/* Jarvis App v2.0 — extracted from index.html */

html, body { margin: 0; padding: 0; height: 100%; background: #05080c; }

:root {
    --bg: #05080c;
    --bg-panel: #0b131a;
    --bg-panel-2: #0f1a22;
    --cyan: #3ecfff;
    --cyan-dim: #1a4a5c;
    --cyan-glow: rgba(62, 207, 255, 0.35);
    --gold: #ffb648;
    --text: #dff4fb;
    --text-muted: #5f8194;
    --line: #16232c;
    --danger: #ff5f6d;
  }

  * { box-sizing: border-box; }

  #jarvis-root {
    background: radial-gradient(ellipse at 50% 0%, #0a141c 0%, var(--bg) 60%);
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
    min-height: 640px;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
  }

  /* ---------- header ---------- */
  .jv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--line);
    font-family: 'Space Mono', monospace;
  }
  .jv-brand {
    letter-spacing: 0.35em;
    font-size: 13px;
    color: var(--cyan);
    font-weight: 700;
  }
  .jv-brand span { color: var(--text-muted); letter-spacing: 0.2em; }
  .jv-clock {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.05em;
  }
  .jv-header-right { display: flex; align-items: center; gap: 14px; }
  .jv-settings-btn {
    background: none;
    border: 1px solid var(--line);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
  }
  .jv-settings-btn:hover { color: var(--cyan); border-color: var(--cyan-dim); }
  .jv-settings-btn.needs-key {
    color: var(--gold);
    border-color: var(--gold);
    animation: jv-pulse 1.5s ease-in-out infinite;
  }

  .jv-settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 5, 8, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
  }
  .jv-settings-overlay.open { display: flex; }
  .jv-settings-box {
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 20px;
    max-width: 440px;
    width: 100%;
    max-height: 88vh;
    overflow: hidden;
  }
  .jv-settings-title {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.15em;
    color: var(--cyan);
    margin-bottom: 10px;
  }
  .jv-settings-text {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 14px;
  }
  #jv-api-key-input {
    width: 100%;
    background: var(--bg-panel-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    outline: none;
    margin-bottom: 12px;
  }
  #jv-api-key-input:focus { border-color: var(--cyan-dim); }
  #jv-voice-select {
    width: 100%;
    background: var(--bg-panel-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    outline: none;
  }
  #jv-voice-select:focus { border-color: var(--cyan-dim); }
  .jv-settings-btns { display: flex; gap: 8px; margin-bottom: 12px; }
  .jv-settings-btns button {
    flex: 1;
    background: var(--cyan-dim);
    border: 1px solid var(--cyan-dim);
    color: var(--cyan);
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    border-radius: 8px;
    padding: 9px 0;
    cursor: pointer;
  }
  .jv-settings-btns button.jv-secondary {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--line);
  }
  .jv-settings-link {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    text-decoration: underline;
  }
  .jv-settings-link:hover { color: var(--cyan); }

  /* ---------- core / orb ---------- */
  .jv-core-wrap {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px 16px 10px;
    gap: 10px;
    z-index: 1;
    opacity: 0.28;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  /* the orb itself stays clickable even though the wrap ignores pointer events */
  .jv-core-wrap .jv-orb-btn { pointer-events: auto; }
  .jv-core-wrap.jv-draggable { pointer-events: auto; cursor: move; }
  .jv-orb-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 148px;
    height: 148px;
    position: relative;
  }
  .jv-orb-btn:disabled { cursor: not-allowed; opacity: 0.5; }

  .jv-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid var(--cyan-dim);
  }
  .jv-ring.r2 { inset: 14px; border-color: var(--cyan-dim); animation: jv-spin 14s linear infinite; }
  .jv-ring.r3 { inset: 28px; border-style: dashed; opacity: 0.5; animation: jv-spin 22s linear infinite reverse; }

  .jv-core {
    position: absolute;
    inset: 44px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #8fe8ff 0%, var(--cyan) 45%, #0c3a48 100%);
    box-shadow: 0 0 30px 4px var(--cyan-glow);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
  }

  .jv-orb-btn[data-state="listening"] .jv-core {
    animation: jv-pulse 1.1s ease-in-out infinite;
    box-shadow: 0 0 50px 10px var(--cyan-glow);
  }
  .jv-orb-btn[data-state="thinking"] .jv-core {
    background: radial-gradient(circle at 35% 30%, #ffe1a8 0%, var(--gold) 45%, #4a2f0c 100%);
    box-shadow: 0 0 40px 8px rgba(255,182,72,0.35);
    animation: jv-spin 1.4s linear infinite;
  }
  .jv-orb-btn[data-state="speaking"] .jv-core {
    animation: jv-pulse 0.5s ease-in-out infinite;
  }

  @keyframes jv-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
  }
  @keyframes jv-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }

  .jv-status {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.25em;
    color: var(--text-muted);
    text-transform: uppercase;
    min-height: 16px;
  }
  .jv-status.active { color: var(--cyan); }

  /* ---------- transcript ---------- */
  .jv-transcript {
    flex: 1;
    overflow-y: auto;
    padding: 8px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    position: relative;
    z-index: 2;
  }
  .jv-empty {
    margin: auto;
    text-align: center;
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.1em;
    max-width: 320px;
    line-height: 1.7;
  }
  .jv-msg {
    max-width: 96%;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .jv-msg.user {
    align-self: flex-end;
    background: var(--bg-panel-2);
    border: 1px solid var(--line);
    color: var(--text);
  }
  .jv-msg.assistant {
    align-self: flex-start;
    background: transparent;
    border-left: 2px solid var(--cyan);
    padding-left: 12px;
    color: var(--text);
  }
  .jv-msg.error {
    align-self: center;
    color: var(--danger);
    border-left: 2px solid var(--danger);
    font-size: 12px;
    font-family: 'Space Mono', monospace;
  }
  .jv-msg-label {
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 4px;
  }

  /* ---------- input row ---------- */
  .jv-input-row {
    display: flex;
    gap: 8px;
    padding: 14px 20px 20px;
    border-top: 1px solid var(--line);
  }
  .jv-input-row input {
    flex: 1;
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 14px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    outline: none;
  }
  .jv-input-row input:focus { border-color: var(--cyan-dim); }
  .jv-input-row button {
    background: var(--cyan-dim);
    border: 1px solid var(--cyan-dim);
    color: var(--cyan);
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    border-radius: 8px;
    padding: 0 18px;
    cursor: pointer;
  }
  .jv-input-row button:hover { background: #12586d; }
  .jv-input-row button:disabled { opacity: 0.4; cursor: not-allowed; }
  #jv-attach-btn, #jv-image-gen-btn {
    background: var(--bg-panel);
    color: var(--text-muted);
    border: 1px solid var(--line);
    padding: 0 13px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #jv-attach-btn:hover, #jv-image-gen-btn:hover {
    color: var(--cyan);
    border-color: var(--cyan-dim);
    box-shadow: 0 0 12px -4px var(--cyan-glow);
  }
  .jv-attachment {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 20px 10px;
    padding: 8px 12px;
    background: var(--bg-panel);
    border: 1px solid var(--cyan-dim);
    border-radius: 8px;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: var(--cyan);
  }
  .jv-attachment span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .jv-attachment button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
  }
  .jv-attachment button:hover { color: var(--danger); }

  .jv-msg img.jv-chat-image {
    max-width: 100%;
    border-radius: 8px;
    display: block;
    margin-top: 6px;
  }
  .jv-msg-actions {
    margin-top: 8px;
  }
  .jv-msg-actions button {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.05em;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
  }
  .jv-msg-actions button:hover { color: var(--cyan); border-color: var(--cyan-dim); }

  .jv-transcript::-webkit-scrollbar { width: 6px; }
  .jv-transcript::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

/* ============ JARVIS HUD DESIGN v2 ============ */
  :root {
    --bg: #04070c;
    --bg-panel: #0a1219;
    --bg-panel-2: #0e1922;
    --cyan: #45d6ff;
    --cyan-dim: #164a5e;
    --cyan-glow: rgba(69, 214, 255, 0.4);
    --gold: #ffb648;
    --text: #dcf2fb;
    --text-muted: #587b8e;
    --line: #12222d;
    --danger: #ff5f6d;
  }

  /* HUD grid background with vignette */
  #jarvis-root {
    background:
      radial-gradient(ellipse at 50% -10%, rgba(69,214,255,0.07) 0%, transparent 55%),
      repeating-linear-gradient(0deg, transparent 0 39px, rgba(69,214,255,0.03) 39px 40px),
      repeating-linear-gradient(90deg, transparent 0 39px, rgba(69,214,255,0.03) 39px 40px),
      radial-gradient(ellipse at 50% 120%, #081019 0%, var(--bg) 60%);
  }

  /* corner brackets — HUD frame */
  #jarvis-root::before,
  #jarvis-root::after {
    content: '';
    position: absolute;
    width: 26px;
    height: 26px;
    pointer-events: none;
    z-index: 5;
    opacity: 0.7;
  }
  #jarvis-root::before {
    top: 10px; left: 10px;
    border-top: 2px solid var(--cyan);
    border-left: 2px solid var(--cyan);
  }
  #jarvis-root::after {
    bottom: 10px; right: 10px;
    border-bottom: 2px solid var(--cyan);
    border-right: 2px solid var(--cyan);
  }

  /* header — chamfered plate with glowing hairline */
  .jv-header {
    border-bottom: none;
    position: relative;
    background: linear-gradient(180deg, rgba(14,25,34,0.9), rgba(10,18,25,0.4));
  }
  .jv-header::after {
    content: '';
    position: absolute;
    left: 24px; right: 24px; bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan) 30%, var(--cyan) 70%, transparent);
    opacity: 0.55;
  }
  .jv-brand {
    font-family: 'Rajdhani', 'Space Mono', monospace;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.45em;
    text-shadow: 0 0 12px var(--cyan-glow);
  }
  .jv-brand span {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3em;
    vertical-align: 2px;
  }
  .jv-clock {
    font-family: 'Rajdhani', monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--cyan);
    opacity: 0.75;
  }

  /* arc reactor — segmented tick ring as the signature element */
  .jv-ring.r1 {
    border: none;
    background:
      repeating-conic-gradient(
        var(--cyan) 0deg 3deg,
        transparent 3deg 12deg
      );
    -webkit-mask: radial-gradient(circle, transparent 66%, #000 67%, #000 74%, transparent 75%);
    mask: radial-gradient(circle, transparent 66%, #000 67%, #000 74%, transparent 75%);
    opacity: 0.5;
    animation: jv-spin 30s linear infinite;
  }
  .jv-ring.r2 { border-color: rgba(69,214,255,0.35); }
  .jv-ring.r3 { border-color: rgba(69,214,255,0.25); }
  .jv-core {
    background: radial-gradient(circle at 38% 32%, #ffffff 0%, #9beaff 18%, var(--cyan) 48%, #0a3644 100%);
    box-shadow:
      0 0 34px 6px var(--cyan-glow),
      inset 0 0 18px rgba(255,255,255,0.35);
  }
  .jv-orb-btn[data-state="listening"] .jv-core {
    box-shadow:
      0 0 60px 14px var(--cyan-glow),
      inset 0 0 22px rgba(255,255,255,0.5);
  }

  .jv-status {
    font-family: 'Rajdhani', monospace;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.4em;
  }
  .jv-status.active { text-shadow: 0 0 10px var(--cyan-glow); }

  /* messages — chamfered user plates, glowing assistant hairline */
  .jv-msg.user {
    background: linear-gradient(135deg, var(--bg-panel-2), var(--bg-panel));
    border: 1px solid rgba(69,214,255,0.18);
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    border-radius: 0;
  }
  .jv-msg.assistant {
    border-left: 2px solid var(--cyan);
    box-shadow: -6px 0 18px -12px var(--cyan-glow);
  }
  .jv-msg-label {
    font-family: 'Rajdhani', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3em;
  }
  .jv-msg.assistant .jv-msg-label { color: var(--cyan); opacity: 0.8; }

  /* inputs & buttons — chamfered HUD controls */
  .jv-input-row { border-top: none; position: relative; }
  .jv-input-row::before {
    content: '';
    position: absolute;
    left: 24px; right: 24px; top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(69,214,255,0.4), transparent);
  }
  .jv-input-row input {
    border-radius: 0;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
    background: rgba(10,18,25,0.85);
  }
  .jv-input-row input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 14px -4px var(--cyan-glow);
  }
  .jv-input-row button,
  .jv-settings-btns button,
  #jv-voice-test, #jv-el-load-voices {
    font-family: 'Rajdhani', monospace;
    font-weight: 700;
    letter-spacing: 0.2em;
    border-radius: 0;
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  }
  #jv-send-btn {
    background: linear-gradient(135deg, #17586f, var(--cyan-dim));
    text-shadow: 0 0 8px var(--cyan-glow);
  }
  #jv-send-btn:hover { background: linear-gradient(135deg, #1a688a, #17586f); }

  /* settings — HUD panel */
  .jv-settings-box {
    border: 1px solid rgba(69,214,255,0.25);
    border-radius: 0;
    clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
    box-shadow: 0 0 40px -10px var(--cyan-glow);
    max-height: 82%;
    overflow-y: auto;
  }
  .jv-settings-title {
    font-family: 'Rajdhani', monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.25em;
  }
  #jv-api-key-input, #jv-el-key-input, #jv-voice-select, #jv-el-voice-select {
    border-radius: 0;
  }

  .jv-attachment {
    border-radius: 0;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  }

  @media (prefers-reduced-motion: reduce) {
    .jv-ring.r1, .jv-ring.r2, .jv-ring.r3,
    .jv-core, .jv-settings-btn.needs-key { animation: none !important; }
  }

  /* matrix rain canvas — sits behind everything */
  #jv-matrix {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.45;
  }
  .jv-header, .jv-core-wrap, .jv-transcript, .jv-input-row, .jv-attachment, .jv-settings-overlay {
    position: relative;
    z-index: 1;
  }
  .jv-settings-overlay { z-index: 20; }

  /* long-press context menu */
  #jv-ctx-menu {
    position: absolute;
    z-index: 30;
    display: none;
    flex-direction: column;
    min-width: 220px;
    background: var(--bg-panel);
    border: 1px solid rgba(69,214,255,0.35);
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    box-shadow: 0 0 30px -8px var(--cyan-glow);
  }
  #jv-ctx-menu.open { display: flex; }
  #jv-ctx-menu button {
    background: none;
    border: none;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-family: 'Rajdhani', monospace;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-align: left;
    padding: 12px 16px;
    cursor: pointer;
  }
  #jv-ctx-menu button:last-child { border-bottom: none; }
  #jv-ctx-menu button:hover { background: var(--bg-panel-2); color: var(--cyan); }

  /* source list inside chat */
  .jv-source-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
  .jv-source-list a {
    color: var(--cyan);
    font-size: 12px;
    text-decoration: none;
    border-bottom: 1px dotted var(--cyan-dim);
    word-break: break-all;
  }
  .jv-source-list a:hover { text-decoration: underline; }

  /* date + calendar */
  .jv-datetime { text-align: right; line-height: 1.25; }
  .jv-date {
    font-family: 'Rajdhani', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.1em;
  }
  #jv-ev-date, #jv-ev-time, #jv-ev-title {
    width: 100%;
    background: var(--bg-panel-2);
    border: 1px solid var(--line);
    padding: 10px 12px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    outline: none;
    border-radius: 0;
    color-scheme: dark;
  }
  #jv-ev-date:focus, #jv-ev-time:focus, #jv-ev-title:focus { border-color: var(--cyan-dim); }
  .jv-event-list { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; }
  .jv-event-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-panel-2);
    border-left: 2px solid var(--cyan);
    font-size: 12px;
  }
  .jv-event-item .when {
    font-family: 'Rajdhani', monospace;
    font-weight: 700;
    color: var(--cyan);
    white-space: nowrap;
  }
  .jv-event-item .title { flex: 1; }
  .jv-event-item button {
    background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 12px;
  }
  .jv-event-item button:hover { color: var(--danger); }
  .jv-event-empty { color: var(--text-muted); font-size: 12px; }

  /* timer bar */
  .jv-timer-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 16px;
    border: 1px solid var(--cyan-dim);
    background: var(--bg-panel);
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
    font-family: 'Rajdhani', monospace;
    font-weight: 700;
    letter-spacing: 0.15em;
    font-size: 13px;
    color: var(--text-muted);
  }
  #jv-timer-display {
    color: var(--cyan);
    font-size: 16px;
    text-shadow: 0 0 10px var(--cyan-glow);
  }
  #jv-timer-cancel {
    background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 13px;
  }
  #jv-timer-cancel:hover { color: var(--danger); }

  /* continuous listening banner — highly visible, one click to stop */
  .jv-listen-banner {
    position: relative;
    z-index: 2;
    margin: 8px 20px 0;
    padding: 9px 14px;
    background: rgba(255, 95, 109, 0.12);
    border: 1px solid var(--danger);
    color: var(--danger);
    font-family: 'Rajdhani', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
    animation: jv-listen-pulse 1.6s ease-in-out infinite;
  }
  .jv-listen-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger);
  }
  @keyframes jv-listen-pulse {
    0%, 100% { box-shadow: 0 0 0 rgba(255,95,109,0); }
    50% { box-shadow: 0 0 18px rgba(255,95,109,0.35); }
  }

  /* permission checkboxes */
  .jv-perm {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text);
    padding: 6px 0;
    cursor: pointer;
  }
  .jv-perm input { accent-color: #45d6ff; width: 15px; height: 15px; cursor: pointer; }

  /* file download chip in chat */
  .jv-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 14px;
    background: var(--bg-panel-2);
    border: 1px solid var(--cyan-dim);
    color: var(--cyan);
    font-family: 'Rajdhani', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-decoration: none;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  }
  .jv-file-chip:hover { border-color: var(--cyan); box-shadow: 0 0 12px -4px var(--cyan-glow); }

  /* particle avatar */
  #jv-avatar {
    cursor: pointer;
    filter: drop-shadow(0 0 18px rgba(69, 214, 255, 0.25));
  }

  /* settings tabs */
  .jv-tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
  }
  .jv-tab {
    flex: 1;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: 'Rajdhani', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 9px 6px;
    cursor: pointer;
    white-space: nowrap;
  }
  .jv-tab.active {
    color: var(--cyan);
    border-bottom-color: var(--cyan);
    text-shadow: 0 0 8px var(--cyan-glow);
  }
  #jv-keys-code {
    width: 100%;
    background: var(--bg-panel-2);
    border: 1px solid var(--line);
    padding: 10px 12px;
    color: var(--text);
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    letter-spacing: 0.3em;
    text-align: center;
    outline: none;
  }
  #jv-keys-code:focus { border-color: var(--cyan-dim); }
  #jv-keys-unlock {
    background: var(--cyan-dim);
    border: 1px solid var(--cyan-dim);
    color: var(--cyan);
    font-family: 'Rajdhani', monospace;
    font-weight: 700;
    letter-spacing: 0.2em;
    font-size: 12px;
    padding: 10px 0;
    cursor: pointer;
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  }

  /* ============ MOBILE / IPHONE LAYOUT ============ */
  @media (max-width: 520px) {
    /* respect the Dynamic Island and rounded corners */
    #jarvis-root {
      border-radius: 0;
      min-height: 100dvh;
      padding-top: env(safe-area-inset-top);
      padding-bottom: env(safe-area-inset-bottom);
    }
    #jarvis-root::before { top: calc(env(safe-area-inset-top) + 6px); left: 8px; width: 18px; height: 18px; }
    #jarvis-root::after { bottom: calc(env(safe-area-inset-bottom) + 6px); right: 8px; width: 18px; height: 18px; }

    /* compact header: brand on top, controls wrap below */
    .jv-header {
      flex-direction: column;
      align-items: stretch;
      gap: 10px;
      padding: 12px 14px;
    }
    .jv-brand { font-size: 15px; letter-spacing: 0.32em; text-align: center; }
    .jv-brand span { display: none; }
    .jv-header-right {
      justify-content: flex-end;
      gap: 5px;
      flex-wrap: nowrap;
    }
    .jv-datetime { text-align: left; margin-right: auto; }
    .jv-date { font-size: 10px; }
    .jv-clock { font-size: 12px; }
    .jv-weather { font-size: 9px; }
    .jv-settings-btn {
      width: 33px;
      height: 33px;
      flex-shrink: 0;
    }
    .jv-settings-btn svg { width: 14px; height: 14px; }

    /* orb & avatar sized for phone */
    .jv-core-wrap { padding: 14px 10px 10px; gap: 10px; }
    .jv-orb-btn { width: 118px; height: 118px; }
    .jv-orb-btn .jv-core { inset: 35px; }
    #jv-avatar { width: 240px; height: 208px; }
    .jv-status { font-size: 11px; letter-spacing: 0.3em; }

    /* messages use more width, easier long-press */
    .jv-transcript { padding: 6px 12px; }
    .jv-msg {
      max-width: 98%;
      font-size: 15px;
      -webkit-touch-callout: none;
      -webkit-user-select: none;
      user-select: none;
    }

    /* input row: 16px font stops iOS auto-zoom, bigger touch targets */
    .jv-input-row { padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); gap: 6px; }
    .jv-input-row input { font-size: 16px; padding: 12px 12px; }
    .jv-input-row button { padding: 0 14px; min-height: 46px; }
    #jv-attach-btn, #jv-image-gen-btn { padding: 0 12px; }

    /* overlays fill the phone screen nicely */
    .jv-settings-overlay { padding: calc(10px + env(safe-area-inset-top)) 8px calc(10px + env(safe-area-inset-bottom)); align-items: flex-start; }
    .jv-settings-box {
      max-width: 100%;
      max-height: 92vh;
      padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    }
    #jv-api-key-input, #jv-el-key-input, #jv-keys-code,
    #jv-ev-date, #jv-ev-time, #jv-ev-title,
    #jv-voice-select, #jv-el-voice-select {
      font-size: 16px;
    }
    .jv-perm { font-size: 14px; padding: 9px 0; }
    .jv-perm input { width: 19px; height: 19px; }
    .jv-tab { font-size: 12px; padding: 10px 10px; }

    /* context menu: bigger touch targets */
    #jv-ctx-menu { min-width: 240px; }
    #jv-ctx-menu button { padding: 15px 18px; font-size: 14px; }

    .jv-listen-banner { margin: 6px 12px 0; font-size: 10px; letter-spacing: 0.12em; }
    .jv-timer-bar { font-size: 12px; }
  }

/* v2.1 multi-provider controls */
#jv-ai-provider, #jv-ai-model, #jv-openai-key-input, #jv-gemini-key-input {
  width: 100%; box-sizing: border-box; background: #07131b; color: var(--text);
  border: 1px solid var(--cyan-dim); padding: 10px 12px; font-family: inherit;
  outline: none; border-radius: 0;
}
#jv-ai-provider:focus, #jv-ai-model:focus, #jv-openai-key-input:focus, #jv-gemini-key-input:focus { border-color: var(--cyan); }

/* v3.1 full calendar */
.jv-calendar-box { max-width: 600px; width: min(600px, 94vw); max-height: 88vh; padding: 16px; overflow: hidden; }
.jv-calendar-topbar, .jv-calendar-toolbar, .jv-calendar-section-head { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.jv-calendar-subtitle { color:var(--text-muted); font-size:11px; letter-spacing:.12em; }
.jv-calendar-toolbar { margin:14px 0 12px; padding:10px; border:1px solid var(--line); background:rgba(5,14,20,.72); }
.jv-calendar-nav, .jv-calendar-view-switch { display:flex; align-items:center; gap:6px; }
.jv-calendar-icon-btn, .jv-calendar-text-btn, .jv-calendar-view-switch button, .jv-mini-month { background:var(--bg-panel-2); border:1px solid var(--line); color:var(--text-muted); font-family:'Rajdhani',monospace; font-weight:700; cursor:pointer; }
.jv-calendar-icon-btn { width:36px; height:34px; font-size:21px; }
.jv-calendar-text-btn, .jv-calendar-view-switch button { height:34px; padding:0 12px; letter-spacing:.12em; font-size:11px; }
.jv-calendar-icon-btn:hover, .jv-calendar-text-btn:hover, .jv-calendar-view-switch button:hover, .jv-calendar-view-switch button.active { color:var(--cyan); border-color:var(--cyan-dim); box-shadow:0 0 12px -6px var(--cyan-glow); }
.jv-calendar-period { flex:1; text-align:center; color:var(--cyan); font-family:'Rajdhani',monospace; font-size:20px; font-weight:700; letter-spacing:.12em; }
.jv-calendar-weekdays, .jv-calendar-grid { display:grid; grid-template-columns:38px repeat(7,1fr); }
.jv-calendar-weekdays span { text-align:center; padding:8px 2px; color:var(--text-muted); font:700 10px 'Rajdhani',monospace; letter-spacing:.12em; }
.jv-calendar-weekdays .jv-kw-head { color:var(--cyan); opacity:.7; }
.jv-calendar-grid { border-top:1px solid var(--line); border-left:1px solid var(--line); }
.jv-calendar-kw { display:grid; place-items:center; background:rgba(69,214,255,.06); border-right:1px solid var(--cyan-dim); border-bottom:1px solid var(--line); color:var(--cyan); font:700 12px 'Space Mono',monospace; opacity:.8; }
.jv-calendar-day { position:relative; min-height:56px; padding:5px; text-align:left; background:rgba(6,14,20,.78); border:0; border-right:1px solid var(--line); border-bottom:1px solid var(--line); color:var(--text); cursor:pointer; overflow:hidden; }
.jv-calendar-day:hover { background:rgba(12,37,49,.9); box-shadow:inset 0 0 16px rgba(69,214,255,.06); }
.jv-calendar-day.outside { color:rgba(148,164,174,.35); background:rgba(4,9,13,.55); }
.jv-calendar-day.selected { outline:2px solid var(--cyan); outline-offset:-2px; background:rgba(10,44,57,.72); }
.jv-calendar-day.today .jv-calendar-day-number { display:inline-grid; place-items:center; width:26px; height:26px; border-radius:50%; background:var(--cyan); color:#031017; box-shadow:0 0 12px var(--cyan-glow); }
.jv-calendar-day-number { font:700 14px 'Space Mono',monospace; }
.jv-calendar-dots { position:absolute; right:7px; top:10px; display:flex; align-items:center; gap:3px; color:var(--cyan); font-size:9px; }
.jv-calendar-dots i { width:5px; height:5px; border-radius:50%; background:var(--cyan); box-shadow:0 0 6px var(--cyan-glow); }
.jv-calendar-preview { display:block; margin-top:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--cyan); font-size:10px; }
.jv-calendar-lower { display:grid; grid-template-columns:1.45fr .8fr; gap:14px; margin-top:14px; }
.jv-calendar-agenda, .jv-calendar-editor { min-width:0; padding:13px; border:1px solid var(--line); background:rgba(5,14,20,.65); }
.jv-calendar-count { display:inline-grid; place-items:center; min-width:24px; height:24px; padding:0 6px; border:1px solid var(--cyan-dim); color:var(--cyan); font:700 11px 'Space Mono',monospace; }
.jv-calendar-agenda .jv-event-list { max-height:96px; }
.jv-calendar-year-view { grid-template-columns:repeat(4,1fr); gap:10px; }
.jv-mini-month { padding:10px; text-align:left; min-height:175px; }
.jv-mini-month:hover { border-color:var(--cyan-dim); transform:translateY(-1px); }
.jv-mini-month strong { display:block; color:var(--cyan); font-size:12px; letter-spacing:.1em; margin-bottom:7px; }
.jv-mini-weekdays, .jv-mini-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; }
.jv-mini-weekdays span { color:var(--text-muted); text-align:center; font-size:8px; }
.jv-mini-grid span { height:17px; display:grid; place-items:center; font-size:8px; color:var(--text-muted); }
.jv-mini-grid span.today { border:1px solid var(--cyan); color:var(--cyan); }
.jv-mini-grid span.has-event { color:#fff; background:rgba(69,214,255,.2); box-shadow:inset 0 -2px 0 var(--cyan); }
#jv-avatar { width:360px; height:311px; }
@media (max-width: 780px) {
  .jv-calendar-box { width:100%; max-height:92vh; padding:12px; overflow-y:auto; }
  .jv-calendar-toolbar { flex-wrap:wrap; }
  .jv-calendar-period { order:-1; flex-basis:100%; }
  .jv-calendar-day { min-height:42px; padding:4px; }
  .jv-calendar-weekdays, .jv-calendar-grid { grid-template-columns:22px repeat(7,1fr); }
  .jv-calendar-kw { font-size:9px; }
  .jv-calendar-preview { display:none; }
  .jv-calendar-lower { grid-template-columns:1fr; }
  .jv-calendar-year-view { grid-template-columns:repeat(2,1fr); }
  .jv-mini-month { min-height:140px; }
}
@media (max-width: 520px) {
  #jv-avatar { width:300px; height:259px; }
  .jv-calendar-overlay { padding:6px; }
  .jv-calendar-box { max-height:96vh; }
  .jv-calendar-view-switch button, .jv-calendar-text-btn { padding:0 8px; }
  .jv-calendar-day { min-height:38px; }
  .jv-calendar-day-number { font-size:11px; }
  .jv-calendar-dots { right:4px; top:6px; }
  .jv-calendar-year-view { grid-template-columns:1fr; }
}

/* Version 3.2: Projektverwaltung */
.jv-project-panel { min-height: 260px; }
.jv-project-toolbar { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.jv-project-toolbar button, .jv-project-actions button {
  border:1px solid rgba(71,220,255,.35); background:rgba(5,18,26,.82); color:var(--cyan,#67e8f9);
  font:600 11px 'Rajdhani',sans-serif; letter-spacing:.08em; padding:8px 10px; cursor:pointer;
}
.jv-project-toolbar button:hover, .jv-project-actions button:hover { border-color:rgba(71,220,255,.8); background:rgba(17,50,64,.9); }
.jv-project-layout { display:grid; grid-template-columns:minmax(190px,.75fr) minmax(280px,1.6fr); gap:12px; }
.jv-project-list { max-height:310px; overflow:auto; border:1px solid rgba(116,226,255,.16); background:rgba(0,0,0,.18); }
.jv-project-empty { padding:20px 12px; color:rgba(220,246,255,.52); text-align:center; font-size:12px; }
.jv-project-item { width:100%; text-align:left; border:0; border-bottom:1px solid rgba(116,226,255,.1); background:transparent; color:#dff8ff; padding:11px; cursor:pointer; display:block; }
.jv-project-item:hover, .jv-project-item.active { background:rgba(39,188,225,.12); }
.jv-project-item strong { display:block; font:600 14px 'Rajdhani',sans-serif; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.jv-project-item span { display:block; margin-top:4px; font-size:10px; color:rgba(220,246,255,.52); }
.jv-project-editor { display:grid; gap:8px; }
.jv-project-editor input, .jv-project-editor select, .jv-project-editor textarea {
  width:100%; box-sizing:border-box; border:1px solid rgba(111,221,255,.22); background:rgba(0,5,9,.62); color:#e8fbff;
  padding:9px 10px; font:400 13px 'Inter',sans-serif; outline:none;
}
.jv-project-editor input:focus, .jv-project-editor select:focus, .jv-project-editor textarea:focus { border-color:rgba(75,225,255,.65); }
.jv-project-editor textarea { min-height:145px; resize:vertical; line-height:1.45; }
.jv-project-meta { display:flex; justify-content:space-between; gap:8px; color:rgba(220,246,255,.46); font-size:10px; }
.jv-project-actions { display:flex; gap:7px; flex-wrap:wrap; }
.jv-project-actions .danger { color:#ff9e9e; border-color:rgba(255,90,90,.35); }
.jv-project-save-state { margin-left:auto; align-self:center; color:rgba(142,255,200,.7); font-size:10px; letter-spacing:.08em; }
@media (max-width:760px) { .jv-project-layout { grid-template-columns:1fr; } .jv-project-list { max-height:190px; } }

/* ============ v4: weather, calculator, layout polish ============ */
.jv-weather {
  font-family: 'Rajdhani', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--cyan);
  opacity: 0.85;
  cursor: pointer;
  white-space: nowrap;
  margin-top: 1px;
}
.jv-weather:hover { opacity: 1; }

/* header buttons a touch smaller so all fit in one row */
.jv-header-right { gap: 8px; }
.jv-settings-btn { width: 30px; height: 30px; flex-shrink: 0; }

/* calculator */
.jv-calc-box { max-width: 320px; max-height: 96vh; overflow: visible; padding: 14px; }
.jv-calc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.jv-calc-switch { display: flex; align-items: center; gap: 7px; font-family: 'Rajdhani', monospace; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; color: var(--text-muted); cursor: pointer; }
.jv-calc-switch input { accent-color: var(--cyan); width: 16px; height: 16px; cursor: pointer; }
.jv-calc-display {
  background: var(--bg-panel-2);
  border: 1px solid var(--cyan-dim);
  padding: clamp(10px, 2.2vh, 16px) 14px;
  text-align: right;
  font-family: 'Space Mono', monospace;
  font-size: clamp(20px, 3.4vh, 26px);
  color: var(--cyan);
  min-height: 26px;
  word-break: break-all;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.jv-calc-steps {
  background: rgba(69,214,255,0.05);
  border-left: 2px solid var(--cyan);
  padding: 8px 12px;
  margin-top: 8px;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--text);
  line-height: 1.6;
  max-height: 14vh;
  overflow-y: auto;
}
.jv-calc-pad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.jv-calc-key {
  padding: clamp(8px, 1.7vh, 15px) 0;
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: 'Rajdhani', monospace;
  font-size: clamp(15px, 2.4vh, 18px);
  font-weight: 700;
  cursor: pointer;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.jv-calc-key:hover { border-color: var(--cyan-dim); color: var(--cyan); }
.jv-calc-key:active { background: var(--cyan-dim); }
.jv-calc-op { color: var(--cyan); }
.jv-calc-fn { color: var(--text-muted); font-size: 15px; }
.jv-calc-eq { background: var(--cyan-dim); color: var(--cyan); border-color: var(--cyan); }

/* calendar: fit fully on screen without scrolling */
.jv-calendar-box { max-width: 600px; width: min(600px, 94vw); max-height: 88vh; padding: 16px; overflow: hidden; }
.jv-calendar-day { min-height: 0; aspect-ratio: 1 / 0.82; }

@media (max-width: 560px) {
  .jv-weather { font-size: 10px; }
  .jv-calc-box { max-width: 100%; }
  .jv-calc-key { padding: 16px 0; font-size: 19px; }
  .jv-calc-display { font-size: 24px; }
  .jv-calendar-box { width: 100%; max-height: 92vh; padding: 12px; }
  .jv-calendar-day { min-height: 0; aspect-ratio: 1 / 0.9; }
}

/* ============ v5: system dashboard ============ */
.jv-dash-box { max-width: 560px; width: min(560px, 94vw); max-height: 92vh; overflow: visible; padding: 18px; }
.jv-dash-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.jv-dash-title { font-family: 'Rajdhani', monospace; font-weight: 700; font-size: 13px; letter-spacing: 0.22em; color: var(--cyan); text-shadow: 0 0 10px var(--cyan-glow); }
.jv-dash-close { background: none; border: 1px solid var(--cyan-dim); color: var(--text-muted); width: 28px; height: 28px; cursor: pointer; font-size: 13px; clip-path: polygon(5px 0,100% 0,100% calc(100% - 5px),calc(100% - 5px) 100%,0 100%,0 5px); }
.jv-dash-close:hover { color: var(--cyan); border-color: var(--cyan); }
.jv-dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.jv-dash-tile {
  background: linear-gradient(150deg, rgba(69,214,255,0.06), rgba(69,214,255,0.01));
  border: 1px solid var(--line);
  border-left: 2px solid var(--cyan-dim);
  padding: 12px 12px 13px;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  animation: jv-dash-in 0.35s ease both;
}
.jv-dash-wide { grid-column: span 2; }
.jv-dash-label { font-family: 'Rajdhani', monospace; font-size: 9px; font-weight: 700; letter-spacing: 0.18em; color: var(--text-muted); }
.jv-dash-value { font-family: 'Space Mono', monospace; font-size: 14px; color: var(--text); display: flex; align-items: center; gap: 7px; }
.jv-dash-clock { font-family: 'Space Mono', monospace; font-size: 30px; font-weight: 700; color: var(--cyan); line-height: 1; text-shadow: 0 0 14px var(--cyan-glow); }
.jv-dash-sub { font-family: 'Rajdhani', monospace; font-size: 12px; color: var(--text-muted); letter-spacing: 0.05em; }
.jv-dash-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan-glow); flex-shrink: 0; }
.jv-dash-dot.off { background: var(--danger); box-shadow: none; }
.jv-dash-notif { font-size: 12px; color: var(--text-muted); }
@keyframes jv-dash-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 560px) {
  .jv-dash-grid { grid-template-columns: repeat(2, 1fr); }
  .jv-dash-clock { font-size: 26px; }
  .jv-dash-box { padding: 14px; }
}

/* ============ v5: calendar week view ============ */
.jv-calendar-week-view { flex-direction: column; gap: 5px; }
.jv-week-row {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: center;
  background: rgba(6,14,20,0.7);
  border: 1px solid var(--line);
  border-left: 2px solid var(--cyan-dim);
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  min-height: 40px;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.jv-week-row:hover { background: rgba(12,37,49,0.85); }
.jv-week-row.today { border-left-color: var(--cyan); box-shadow: inset 0 0 12px rgba(69,214,255,0.08); }
.jv-week-row.selected { outline: 1px solid var(--cyan); outline-offset: -1px; }
.jv-week-day { display: flex; flex-direction: column; align-items: center; }
.jv-week-dow { font-family: 'Rajdhani', monospace; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; color: var(--text-muted); }
.jv-week-num { font-family: 'Space Mono', monospace; font-size: 18px; font-weight: 700; color: var(--cyan); }
.jv-week-row.today .jv-week-num { color: var(--cyan); text-shadow: 0 0 10px var(--cyan-glow); }
.jv-week-events { display: flex; flex-wrap: wrap; gap: 5px; }
.jv-week-ev { font-family: 'Inter', sans-serif; font-size: 11px; color: var(--text); background: rgba(69,214,255,0.08); border: 1px solid var(--cyan-dim); padding: 2px 7px; border-radius: 3px; }
.jv-week-empty { color: var(--text-muted); opacity: 0.4; font-size: 12px; }
.jv-calendar-view-switch button { flex: 1; }

/* ============ v5: swipeable menus with design arrows ============ */
.jv-swipe-box { position: relative; }
.jv-swipe-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 46px;
  background: linear-gradient(180deg, rgba(69,214,255,0.12), rgba(69,214,255,0.03));
  border: 1px solid var(--cyan-dim);
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s, border-color 0.15s;
}
.jv-swipe-arrow:hover { background: rgba(69,214,255,0.2); border-color: var(--cyan); }
.jv-swipe-arrow::before {
  content: '';
  width: 9px; height: 9px;
  border-top: 2px solid var(--cyan);
  border-right: 2px solid var(--cyan);
}
.jv-swipe-prev { left: -6px; clip-path: polygon(8px 0,100% 0,100% 100%,8px 100%,0 50%); }
.jv-swipe-prev::before { transform: rotate(-135deg); margin-left: 5px; }
.jv-swipe-next { right: -6px; clip-path: polygon(0 0,calc(100% - 8px) 0,100% 50%,calc(100% - 8px) 100%,0 100%); }
.jv-swipe-next::before { transform: rotate(45deg); margin-right: 5px; }
.jv-swipe-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.jv-swipe-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cyan-dim);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}
.jv-swipe-dot.active { background: var(--cyan); box-shadow: 0 0 8px var(--cyan-glow); transform: scale(1.25); }
.jv-tab-panel { animation: jv-swipe-in 0.28s ease both; }
@keyframes jv-swipe-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

@media (max-width: 560px) {
  .jv-swipe-arrow { width: 26px; height: 40px; }
}

/* ============ v5: projects ============ */
.jv-projects-box { max-width: 480px; width: min(480px, 94vw); max-height: 92vh; overflow: visible; padding: 18px; }
.jv-projects-list { display: flex; flex-direction: column; gap: 8px; max-height: 38vh; overflow-y: auto; margin-bottom: 14px; }
.jv-project-item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  background: rgba(6,14,20,0.7);
  border: 1px solid var(--line);
  border-left: 2px solid var(--cyan-dim);
  padding: 11px 12px;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.jv-project-info { flex: 1; min-width: 0; }
.jv-project-name { font-family: 'Rajdhani', monospace; font-weight: 700; font-size: 14px; letter-spacing: 0.05em; color: var(--text); }
.jv-project-descr { font-family: 'Inter', sans-serif; font-size: 12px; color: var(--text-muted); margin-top: 3px; word-break: break-word; }
.jv-project-meta { font-family: 'Space Mono', monospace; font-size: 10px; color: var(--text-muted); opacity: 0.6; margin-top: 4px; }
.jv-project-actions { display: flex; gap: 5px; flex-shrink: 0; }
.jv-project-actions button { background: none; border: 1px solid var(--line); color: var(--text-muted); cursor: pointer; width: 26px; height: 26px; font-size: 12px; }
.jv-project-actions button:hover { color: var(--cyan); border-color: var(--cyan-dim); }
.jv-projects-empty { text-align: center; color: var(--text-muted); opacity: 0.6; font-size: 13px; padding: 20px 0; }
.jv-projects-new { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.jv-projects-new input, .jv-projects-new textarea {
  width: 100%; background: var(--bg-panel-2); border: 1px solid var(--line); color: var(--text);
  font-family: 'Inter', sans-serif; font-size: 14px; padding: 10px; resize: none;
}
.jv-projects-new input:focus, .jv-projects-new textarea:focus { outline: none; border-color: var(--cyan-dim); }
.jv-project-add-btn {
  width: 100%; background: var(--cyan-dim); border: 1px solid var(--cyan); color: var(--cyan);
  font-family: 'Rajdhani', monospace; font-weight: 700; letter-spacing: 0.12em; font-size: 12px; padding: 11px; cursor: pointer;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.jv-project-add-btn:hover { background: rgba(69,214,255,0.2); }
.jv-projects-io { display: flex; gap: 8px; }
.jv-projects-io button { flex: 1; }

@media (max-width: 560px) {
  .jv-projects-box { max-width: 100%; padding: 14px; }
  .jv-projects-list { max-height: 34vh; }
}

/* ============ v6: dashboard action tiles ============ */
.jv-dash-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.jv-dash-action {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: linear-gradient(150deg, rgba(69,214,255,0.1), rgba(69,214,255,0.02));
  border: 1px solid var(--cyan-dim);
  color: var(--cyan);
  font-family: 'Rajdhani', monospace; font-weight: 700; font-size: 10px; letter-spacing: 0.1em;
  padding: 14px 8px; cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: background 0.15s, box-shadow 0.15s;
}
.jv-dash-action:hover { background: rgba(69,214,255,0.2); box-shadow: 0 0 14px -4px var(--cyan-glow); }
.jv-dash-action:active { transform: translateY(1px); }

@media (max-width: 560px) {
  .jv-dash-actions { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .jv-dash-action { padding: 12px 4px; font-size: 9px; }
}

/* ============ v15: clickable KI tile, keyfile, mobile polish ============ */
.jv-dash-clickable { cursor: pointer; transition: background 0.15s, box-shadow 0.15s; }
.jv-dash-clickable:hover { background: rgba(69,214,255,0.14); box-shadow: 0 0 14px -4px var(--cyan-glow); }
.jv-dash-clickable:active { transform: translateY(1px); }

.jv-keyfile-box { border: 1px solid var(--cyan-dim); background: rgba(69,214,255,0.04); padding: 12px; margin-top: 14px; clip-path: polygon(8px 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%,0 8px); }
.jv-keyfile-btns { display: flex; gap: 8px; margin-top: 8px; }
.jv-keyfile-btns button { flex: 1; }

/* deeper mobile compaction */
@media (max-width: 520px) {
  .jv-settings-box { padding: 14px; max-height: 90vh; }
  .jv-dash-box { padding: 12px; }
  .jv-dash-grid { gap: 6px; }
  .jv-dash-tile { padding: 9px 9px 10px; min-height: 52px; }
  .jv-dash-clock { font-size: 22px; }
  .jv-dash-label { font-size: 8px; }
  .jv-dash-value { font-size: 12px; }
  .jv-dash-actions { gap: 6px; }
  .jv-dash-action { padding: 10px 3px; font-size: 8px; }
  .jv-dash-action svg { width: 17px; height: 17px; }
  .jv-tab { font-size: 11px; padding: 8px 4px; letter-spacing: 0.06em; }
  .jv-projects-box { padding: 12px; }
  .jv-project-name { font-size: 13px; }
  .jv-keyfile-btns { flex-direction: column; }
}

/* ============ v18: weather window ============ */
.jv-weather-box { max-width: 560px; width: min(560px, 94vw); max-height: 90vh; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; }
.jv-weather-search { display: flex; gap: 7px; margin-bottom: 8px; }
.jv-weather-search input { flex: 1; background: var(--bg-panel-2); border: 1px solid var(--line); color: var(--text); font-family: 'Inter', sans-serif; font-size: 14px; padding: 9px 11px; }
.jv-weather-search input:focus { outline: none; border-color: var(--cyan-dim); }
.jv-weather-search button { background: rgba(69,214,255,0.1); border: 1px solid var(--cyan-dim); color: var(--cyan); cursor: pointer; width: 40px; font-size: 15px; flex-shrink: 0; }
.jv-weather-search button:hover { background: rgba(69,214,255,0.2); }
.jv-weather-results { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.jv-weather-result { text-align: left; background: rgba(6,14,20,0.7); border: 1px solid var(--line); color: var(--text); padding: 8px 11px; cursor: pointer; font-size: 13px; font-family: 'Inter', sans-serif; }
.jv-weather-result:hover { border-color: var(--cyan-dim); background: rgba(12,37,49,0.85); }
.jv-weather-content { display: flex; flex-direction: column; gap: 12px; }
.jv-weather-loading { text-align: center; color: var(--text-muted); padding: 30px 0; font-family: 'Space Mono', monospace; }

.jv-weather-now { text-align: center; padding: 6px 0 2px; }
.jv-weather-now-place { font-family: 'Rajdhani', monospace; font-size: 14px; letter-spacing: 0.14em; color: var(--cyan); font-weight: 700; }
.jv-weather-now-temp { font-family: 'Space Mono', monospace; font-size: 54px; font-weight: 700; color: var(--text); line-height: 1; margin: 4px 0; }
.jv-weather-now-desc { font-family: 'Inter', sans-serif; font-size: 14px; color: var(--text-muted); }
.jv-weather-now-feels { font-family: 'Inter', sans-serif; font-size: 12px; color: var(--text-muted); opacity: 0.8; margin-top: 2px; }

.jv-weather-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.jv-weather-stat {
  background: linear-gradient(150deg, rgba(69,214,255,0.06), rgba(69,214,255,0.01));
  border: 1px solid var(--line); border-left: 2px solid var(--cyan-dim);
  padding: 9px 10px; clip-path: polygon(7px 0,100% 0,100% calc(100% - 7px),calc(100% - 7px) 100%,0 100%,0 7px);
}
.jv-weather-stat-label { font-family: 'Rajdhani', monospace; font-size: 8px; font-weight: 700; letter-spacing: 0.14em; color: var(--text-muted); }
.jv-weather-stat-value { font-family: 'Space Mono', monospace; font-size: 15px; color: var(--text); margin-top: 3px; }
.jv-weather-stat-sub { font-family: 'Inter', sans-serif; font-size: 10px; color: var(--text-muted); opacity: 0.7; }

.jv-weather-section-title { font-family: 'Rajdhani', monospace; font-size: 10px; font-weight: 700; letter-spacing: 0.18em; color: var(--cyan); margin: 4px 0 2px; }
.jv-weather-hourly { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.jv-weather-hour { flex-shrink: 0; text-align: center; background: rgba(6,14,20,0.6); border: 1px solid var(--line); padding: 8px 10px; min-width: 56px; }
.jv-weather-hour-time { font-family: 'Space Mono', monospace; font-size: 11px; color: var(--text-muted); }
.jv-weather-hour-icon { font-size: 18px; margin: 4px 0; }
.jv-weather-hour-temp { font-family: 'Space Mono', monospace; font-size: 13px; color: var(--text); font-weight: 700; }
.jv-weather-hour-rain { font-family: 'Inter', sans-serif; font-size: 9px; color: var(--cyan); }

.jv-weather-days { display: flex; flex-direction: column; gap: 5px; }
.jv-weather-day { display: grid; grid-template-columns: 46px 30px 1fr 84px; gap: 10px; align-items: center; background: rgba(6,14,20,0.6); border: 1px solid var(--line); padding: 7px 11px; }
.jv-weather-day-name { font-family: 'Rajdhani', monospace; font-size: 12px; font-weight: 700; color: var(--text); }
.jv-weather-day-icon { font-size: 17px; text-align: center; }
.jv-weather-day-rain { font-family: 'Inter', sans-serif; font-size: 10px; color: var(--cyan); }
.jv-weather-day-temps { font-family: 'Space Mono', monospace; font-size: 12px; color: var(--text); text-align: right; }
.jv-weather-day-temps .lo { color: var(--text-muted); }

.jv-weather-aqi-badge { display: inline-block; padding: 1px 7px; border-radius: 3px; font-size: 11px; font-weight: 700; }
.jv-aqi-good { background: rgba(52,211,153,0.2); color: #34d399; }
.jv-aqi-mod { background: rgba(251,191,36,0.2); color: #fbbf24; }
.jv-aqi-bad { background: rgba(248,113,113,0.2); color: #f87171; }

@media (max-width: 560px) {
  .jv-weather-box { padding: 12px; max-height: 92vh; }
  .jv-weather-now-temp { font-size: 44px; }
  .jv-weather-grid { grid-template-columns: repeat(2, 1fr); }
  .jv-weather-day { grid-template-columns: 42px 26px 1fr 74px; gap: 6px; }
}

/* ============ v18: calendar iphone calibration ============ */
@media (max-width: 560px) {
  .jv-calendar-overlay { align-items: flex-start; padding: calc(6px + env(safe-area-inset-top)) 6px calc(6px + env(safe-area-inset-bottom)); }
  .jv-calendar-box { max-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 12px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .jv-calendar-day { min-height: 34px; padding: 3px; }
  .jv-calendar-day-number { font-size: 10px; }
  .jv-calendar-toolbar { gap: 4px; margin-bottom: 6px; }
  .jv-calendar-view-switch { display: flex; gap: 3px; }
  .jv-calendar-view-switch button { font-size: 10px; padding: 4px 6px; }
  .jv-calendar-editor input { padding: 9px; font-size: 15px; }
  .jv-calendar-editor { margin-top: 8px; }
  /* make sure the "new appointment" area is always reachable */
  .jv-calendar-lower { gap: 10px; padding-bottom: 6px; }
}

/* dashboard & weather: fit iphone with safe areas, allow inner scroll */
@media (max-width: 560px) {
  .jv-dash-overlay, #jv-weather-overlay, #jv-projects-overlay {
    align-items: flex-start;
    padding: calc(8px + env(safe-area-inset-top)) 6px calc(8px + env(safe-area-inset-bottom));
  }
  .jv-dash-box, .jv-weather-box, .jv-projects-box {
    max-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ============ v20: iOS viewport height fix (dvh) ============
   Safari counts the URL bar into vh, so boxes grew taller than the visible
   screen and their bottom part could never be scrolled to. dvh follows the
   actual visible area. vh stays first as a fallback for old browsers. */
.jv-settings-overlay { height: 100vh; height: 100dvh; }

.jv-weather-box,
.jv-dash-box,
.jv-projects-box,
.jv-calendar-box,
.jv-settings-box {
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
/* the weather column must be allowed to grow so every day row is reachable */
.jv-weather-box { display: block; }
.jv-weather-content { display: flex; flex-direction: column; gap: 12px; padding-bottom: 6px; }
.jv-weather-days { padding-bottom: 4px; }

@media (max-width: 560px) {
  .jv-settings-overlay {
    align-items: flex-start;
    padding: calc(8px + env(safe-area-inset-top)) 6px calc(8px + env(safe-area-inset-bottom));
  }
  .jv-weather-box,
  .jv-dash-box,
  .jv-projects-box,
  .jv-calendar-box,
  .jv-settings-box {
    max-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px);
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px);
  }
  /* extra breathing room at the bottom so the last row is never glued to the edge */
  .jv-weather-content { padding-bottom: 14px; }
}

/* ============ v20: tappable weather explanations ============ */
.jv-wx-tap { cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.jv-wx-tap:hover { border-left-color: var(--cyan); }
.jv-wx-tap.jv-wx-open { grid-column: 1 / -1; border-left-color: var(--cyan); background: rgba(69,214,255,0.07); }
.jv-wx-info { margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--cyan-dim); animation: jv-swipe-in 0.22s ease both; }
.jv-wx-info-t { font-family: 'Rajdhani', monospace; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: var(--cyan); }
.jv-wx-info-d { font-family: 'Inter', sans-serif; font-size: 12px; color: var(--text); margin-top: 4px; line-height: 1.5; }
.jv-wx-info-r { font-family: 'Inter', sans-serif; font-size: 12px; color: var(--cyan); margin-top: 6px; line-height: 1.45; }

/* ============ v20: currency converter ============ */
.jv-calc-head-right { display: flex; align-items: center; gap: 10px; }
.jv-calc-cur-btn {
  background: linear-gradient(180deg, rgba(69,214,255,0.14), rgba(69,214,255,0.03));
  border: 1px solid var(--cyan-dim); color: var(--cyan);
  width: 32px; height: 28px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  clip-path: polygon(6px 0,100% 0,100% calc(100% - 6px),calc(100% - 6px) 100%,0 100%,0 6px);
  transition: background 0.15s;
}
.jv-calc-cur-btn:hover { background: rgba(69,214,255,0.24); }
.jv-calc-cur-btn.active { background: var(--cyan); color: #04121a; border-color: var(--cyan); }

.jv-cur-panel { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.jv-cur-row { display: grid; grid-template-columns: 1fr 116px; gap: 8px; align-items: stretch; }
.jv-cur-row input, .jv-cur-row select {
  background: var(--bg-panel-2); border: 1px solid var(--line); color: var(--text);
  font-family: 'Space Mono', monospace; font-size: 17px; padding: 11px 12px; width: 100%;
}
.jv-cur-row input:focus, .jv-cur-row select:focus { outline: none; border-color: var(--cyan-dim); }
.jv-cur-result {
  background: rgba(69,214,255,0.07); border: 1px solid var(--cyan-dim); color: var(--cyan);
  font-family: 'Space Mono', monospace; font-size: 19px; font-weight: 700;
  padding: 11px 12px; display: flex; align-items: center; overflow-x: auto; white-space: nowrap;
}
.jv-cur-swap {
  align-self: center; background: none; border: 1px solid var(--cyan-dim); color: var(--cyan);
  width: 34px; height: 26px; cursor: pointer; font-size: 13px;
  clip-path: polygon(5px 0,100% 0,100% calc(100% - 5px),calc(100% - 5px) 100%,0 100%,0 5px);
}
.jv-cur-swap:hover { background: rgba(69,214,255,0.16); }
.jv-cur-rate { font-family: 'Inter', sans-serif; font-size: 11px; color: var(--text-muted); text-align: center; }
.jv-cur-metals { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.jv-cur-metal { font-family: 'Space Mono', monospace; font-size: 11px; color: var(--text-muted); border: 1px solid var(--line); padding: 4px 8px; }

/* ============ v20: sport window ============ */
.jv-sport-box { max-width: 520px; width: min(520px, 94vw); padding: 16px; }
.jv-sport-search { display: grid; grid-template-columns: 1fr 1fr 42px; gap: 7px; margin-bottom: 8px; }
.jv-sport-search select { background: var(--bg-panel-2); border: 1px solid var(--line); color: var(--text); font-family: 'Inter', sans-serif; font-size: 13px; padding: 9px 8px; width: 100%; }
.jv-sport-search select:focus { outline: none; border-color: var(--cyan-dim); }
.jv-sport-search button { background: rgba(69,214,255,0.1); border: 1px solid var(--cyan-dim); color: var(--cyan); cursor: pointer; font-size: 15px; }
.jv-sport-search button:hover { background: rgba(69,214,255,0.2); }
.jv-sport-leagues { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; max-height: 28vh; overflow-y: auto; }
.jv-sport-league { text-align: left; background: rgba(6,14,20,0.7); border: 1px solid var(--line); color: var(--text); padding: 8px 11px; cursor: pointer; font-size: 13px; font-family: 'Inter', sans-serif; }
.jv-sport-league:hover { border-color: var(--cyan-dim); background: rgba(12,37,49,0.85); }
.jv-sport-favs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.jv-sport-fav { display: flex; align-items: center; gap: 6px; background: rgba(69,214,255,0.1); border: 1px solid var(--cyan-dim); color: var(--cyan); font-family: 'Rajdhani', monospace; font-weight: 700; font-size: 11px; letter-spacing: 0.06em; padding: 5px 9px; }
.jv-sport-fav button { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 12px; padding: 0; line-height: 1; }
.jv-sport-fav button:hover { color: var(--danger); }
.jv-sport-content { display: flex; flex-direction: column; gap: 10px; }
.jv-sport-group-title { font-family: 'Rajdhani', monospace; font-size: 10px; font-weight: 700; letter-spacing: 0.16em; color: var(--cyan); }
.jv-sport-match {
  background: rgba(6,14,20,0.65); border: 1px solid var(--line); border-left: 2px solid var(--cyan-dim);
  padding: 9px 11px; cursor: pointer;
  clip-path: polygon(6px 0,100% 0,100% calc(100% - 6px),calc(100% - 6px) 100%,0 100%,0 6px);
}
.jv-sport-match:hover { background: rgba(12,37,49,0.85); }
.jv-sport-match-teams { font-family: 'Inter', sans-serif; font-size: 13px; color: var(--text); }
.jv-sport-match-meta { font-family: 'Space Mono', monospace; font-size: 10px; color: var(--text-muted); margin-top: 3px; }
.jv-sport-score { font-family: 'Space Mono', monospace; font-size: 14px; font-weight: 700; color: var(--cyan); }
.jv-sport-tv { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--cyan-dim); animation: jv-swipe-in 0.22s ease both; }
.jv-sport-tv-t { font-family: 'Rajdhani', monospace; font-size: 9px; font-weight: 700; letter-spacing: 0.14em; color: var(--cyan); }
.jv-sport-tv-list { font-family: 'Inter', sans-serif; font-size: 12px; color: var(--text); margin-top: 4px; line-height: 1.5; }
.jv-sport-key { margin-top: 12px; }
.jv-sport-key summary { font-family: 'Rajdhani', monospace; font-size: 11px; letter-spacing: 0.1em; color: var(--text-muted); cursor: pointer; }
.jv-sport-key input { width: 100%; margin-top: 8px; background: var(--bg-panel-2); border: 1px solid var(--line); color: var(--text); font-family: 'Inter', sans-serif; font-size: 14px; padding: 9px; }

@media (max-width: 560px) {
  .jv-sport-box { padding: 12px; }
  .jv-sport-search { grid-template-columns: 1fr 1fr 38px; gap: 5px; }
  .jv-sport-search select { font-size: 12px; padding: 8px 5px; }
  .jv-dash-actions { grid-template-columns: repeat(4, 1fr); }
}

/* ============ v21: two-pane workspace ============ */
.jv-workspace {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
}
.jv-workspace-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  position: relative;
}
.jv-side-panel {
  width: 0;
  flex-shrink: 0;
  border-left: 1px solid var(--line);
  background: rgba(4, 10, 15, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.28s ease;
}
.jv-workspace.panel-open .jv-side-panel { width: 380px; }
.jv-side-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.jv-side-tab {
  background: rgba(69,214,255,0.06);
  border: 1px solid var(--line);
  color: var(--text-muted);
  width: 36px; height: 32px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  clip-path: polygon(6px 0,100% 0,100% calc(100% - 6px),calc(100% - 6px) 100%,0 100%,0 6px);
}
.jv-side-tab.active { color: var(--cyan); border-color: var(--cyan-dim); background: rgba(69,214,255,0.16); }
.jv-side-tab:hover { color: var(--cyan); }
.jv-side-close {
  margin-left: auto;
  background: none; border: 1px solid var(--line); color: var(--text-muted);
  width: 30px; height: 30px; cursor: pointer; font-size: 13px;
}
.jv-side-close:hover { color: var(--cyan); border-color: var(--cyan-dim); }
.jv-side-body { flex: 1; overflow-y: auto; padding: 12px; min-height: 0; }
.jv-side-view { display: flex; flex-direction: column; gap: 10px; }

/* mobile: panel overlays full width, switch by button */
@media (max-width: 780px) {
  .jv-workspace.panel-open .jv-side-panel {
    position: absolute;
    inset: 0;
    width: 100%;
    z-index: 40;
    background: var(--bg);
  }
  .jv-workspace.panel-open .jv-workspace-main { visibility: hidden; }
}

/* ============ v21: side panel inner elements ============ */
.jv-side-head-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.jv-side-openfull {
  background: rgba(69,214,255,0.1); border: 1px solid var(--cyan-dim); color: var(--cyan);
  font-family: 'Rajdhani', monospace; font-weight: 700; font-size: 10px; letter-spacing: 0.08em;
  padding: 6px 9px; cursor: pointer;
  clip-path: polygon(6px 0,100% 0,100% calc(100% - 6px),calc(100% - 6px) 100%,0 100%,0 6px);
}
.jv-side-openfull:hover { background: rgba(69,214,255,0.2); }
