/* Právník AI: vzhled 2026. Jen vizuální vrstva nad původním CSS v index.html.
   Návrat: odstranit <link> na tento soubor, nebo obnovit index.html ze zálohy. */
@font-face {
  font-family: 'Inter Var'; src: url('/ui/InterVariable.woff2') format('woff2');
  font-weight: 100 900; font-display: swap; font-style: normal;
}
:root {
  --bg: #fafaf8; --surface: #fff; --soft: #f5f5f2; --softer: #eeeeea;
  --ink: #14171f; --ink-soft: #565c68; --ink-faint: #666c77;
  --line: #e4e4df; --line-soft: #eeeeea;
  --black: #141a2b; --green: #0f7a50; --red: #d4342c; --amber: #a4570a;
  --brass: #b08a45; --brass-soft: rgba(176,138,69,.16);
  --radius: 16px; --ease: cubic-bezier(.2,.7,.2,1);
  --shadow-xs: 0 1px 2px rgba(20,23,31,.04);
  --shadow: 0 1px 2px rgba(20,23,31,.04), 0 10px 32px -10px rgba(20,23,31,.12);
  --shadow-lg: 0 2px 4px rgba(20,23,31,.05), 0 22px 56px -16px rgba(20,23,31,.26);
  /* ikony */
  --i-scale: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z'/%3E%3Cpath d='m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z'/%3E%3Cpath d='M7 21h10M12 3v18M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2'/%3E%3C/svg%3E");
  --i-history: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8'/%3E%3Cpath d='M3 3v5h5M12 7v5l4 2'/%3E%3C/svg%3E");
  --i-chat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
  --i-swords: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 17.5 3 6V3h3l11.5 11.5M13 19l6-6M16 16l4 4M19 21l2-2M14.5 6.5 18 3h3v3l-3.5 3.5M5 14l4 4M7 17l-3 3M3 19l2 2'/%3E%3C/svg%3E");
  --i-file: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5z'/%3E%3Cpath d='M14 2v6h6M16 13H8M16 17H8'/%3E%3C/svg%3E");
  --i-pen: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E");
  --i-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  --i-shield: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
  --i-cal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='18' x='3' y='4' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
  --i-calok: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='18' x='3' y='4' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18M9 16l2 2 4-4'/%3E%3C/svg%3E");
  --i-globe: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/svg%3E");
  --i-bank: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 22h18M6 18v-7M10 18v-7M14 18v-7M18 18v-7M12 2l8 5H4z'/%3E%3C/svg%3E");
  --i-firm: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='16' height='20' x='4' y='2' rx='2'/%3E%3Cpath d='M9 22v-4h6v4M8 6h.01M16 6h.01M12 6h.01M12 10h.01M12 14h.01M16 10h.01M16 14h.01M8 10h.01M8 14h.01'/%3E%3C/svg%3E");
  --i-spark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3-1.9 5.8a2 2 0 0 1-1.3 1.3L3 12l5.8 1.9a2 2 0 0 1 1.3 1.3L12 21l1.9-5.8a2 2 0 0 1 1.3-1.3L21 12l-5.8-1.9a2 2 0 0 1-1.3-1.3z'/%3E%3C/svg%3E");
  --i-zap: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2 3 14h9l-1 8 10-12h-9z'/%3E%3C/svg%3E");
  --i-layers: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 2 10 5-10 5L2 7zM2 17l10 5 10-5M2 12l10 5 10-5'/%3E%3C/svg%3E");
  --i-sliders: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h10M18 6h2M4 12h2M10 12h10M4 18h8M16 18h4'/%3E%3Ccircle cx='16' cy='6' r='2'/%3E%3Ccircle cx='8' cy='12' r='2'/%3E%3Ccircle cx='14' cy='18' r='2'/%3E%3C/svg%3E");
  --i-lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
  --i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpath d='m9 11 3 3L22 4'/%3E%3C/svg%3E");
  --i-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E");
  --i-copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='14' x='8' y='8' rx='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/svg%3E");
  --i-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3'/%3E%3C/svg%3E");
  --i-print: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9V2h12v7M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2'/%3E%3Crect width='12' height='8' x='6' y='14'/%3E%3C/svg%3E");
  --i-mic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2M12 19v3'/%3E%3C/svg%3E");
  --i-stop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect width='14' height='14' x='5' y='5' rx='2.5'/%3E%3C/svg%3E");
  --i-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M5 12l7-7 7 7'/%3E%3C/svg%3E");
  --i-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E");
  --i-trash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M10 11v6M14 11v6'/%3E%3C/svg%3E");
  --i-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --i-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
}

/* ===== základ ===== */
body {
  font-family: 'Inter Var', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-optical-sizing: auto;
  letter-spacing: -.006em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(900px 420px at 28% -160px, rgba(176,138,69,.09), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
::selection { background: var(--brass-soft); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 8px; }
#q:focus-visible { outline: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d6d6d0; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #bcbcb5; background-clip: padding-box; }
button, .dseg, .chip, .mode, .jud, summary { -webkit-tap-highlight-color: transparent; }

/* společná ikona: --ic určí tvar, barva je currentColor */
.mode::before, .dseg::before, .histbtn::before, .hist-new::before, .hist-head b::before,
.panel > summary::before, .msg.ai .card-head .who::before, .msg.ai .card-head .actions button::before,
.hearbtn::before, #protokol .pbtns button::before, .ans-jump::before, #installbtn::before {
  content: ''; display: inline-block; flex: none; width: 15px; height: 15px; vertical-align: -2.5px;
  background: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
}
.mode::before, .dseg::before { width: 14px; height: 14px; margin-right: 6px; }
.dseg::before { width: 13px; height: 13px; vertical-align: -2px; margin-right: 5px; }
.mode[data-mode=chat] { --ic: var(--i-chat); } .mode[data-mode=soud] { --ic: var(--i-swords); }
.mode[data-mode=analyze] { --ic: var(--i-file); } .mode[data-mode=generate] { --ic: var(--i-pen); }
.mode[data-mode=judikatura] { --ic: var(--i-search); } .mode[data-mode=compliance] { --ic: var(--i-shield); }
.mode[data-mode=chronologie] { --ic: var(--i-cal); } .mode[data-mode=preklad] { --ic: var(--i-globe); }
.mode[data-mode=finance] { --ic: var(--i-bank); } .mode[data-mode=ares] { --ic: var(--i-firm); }
.mode[data-mode=freshness] { --ic: var(--i-calok); }
.dseg[data-depth=auto] { --ic: var(--i-spark); } .dseg[data-depth=flash] { --ic: var(--i-zap); } .dseg[data-depth=pro] { --ic: var(--i-layers); }

/* ===== hlavička ===== */
header { position: relative; z-index: 20; background: rgba(255,255,255,.78); -webkit-backdrop-filter: saturate(170%) blur(14px); backdrop-filter: saturate(170%) blur(14px); border-bottom-color: var(--line); }
.brand { gap: 11px; }
.brand .scales {
  width: 36px; height: 36px; border-radius: 11px; font-size: 0; color: #f1dfb8;
  background: linear-gradient(150deg, #27304a 0%, #141a2b 72%);
  box-shadow: 0 1px 2px rgba(20,26,43,.3), inset 0 1px 0 rgba(255,255,255,.14);
}
.brand .scales::before { content: ''; width: 21px; height: 21px; background: currentColor; -webkit-mask: var(--i-scale) center / contain no-repeat; mask: var(--i-scale) center / contain no-repeat; }
.brand h1 { font-size: 16.5px; font-weight: 650; letter-spacing: -.02em; line-height: 1.25; }
.brand h1 em { color: #8a6a2f; font-weight: 650; }
.brand .sub { font-size: 11.5px; color: var(--ink-faint); letter-spacing: -.002em; }
.stats { gap: 2px; }
.stat { background: none; border: none; padding: 4px 11px; font-size: 12.5px; color: var(--ink-faint); position: relative; }
.stat + .stat::before { content: ''; position: absolute; left: 0; top: 7px; bottom: 7px; width: 1px; background: var(--line); }
.stat b { font-weight: 600; }
.stat .dot { width: 6px; height: 6px; box-shadow: 0 0 0 3px rgba(15,122,80,.14); margin-right: 8px; vertical-align: 1.5px; }
.histbtn {
  --ic: var(--i-history); background: #fff; border-color: var(--line); border-radius: 11px; padding: 7px 13px;
  font-size: 13px; font-weight: 550; color: var(--ink); box-shadow: var(--shadow-xs);
  transition: border-color .16s, box-shadow .16s, transform .16s var(--ease);
}
.histbtn:hover { background: #fff; border-color: #cfcfc8; box-shadow: var(--shadow); transform: translateY(-1px); }

/* ===== vlákno a karty odpovědí ===== */
#thread { padding-right: 4px; scrollbar-gutter: stable; }
.msg { animation: rise .38s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.msg.user .bubble {
  background: var(--black); color: #f6f6f3; border-radius: 18px 18px 5px 18px; padding: 11px 17px;
  box-shadow: 0 6px 18px -8px rgba(20,26,43,.5);
}
.msg.ai .card { background: #fff; border-color: var(--line); box-shadow: var(--shadow-xs); }
.msg.ai .card-head { background: none; padding: 11px 18px; border-bottom-color: var(--line-soft); font-size: 12.5px; }
.msg.ai .card-head .who { --ic: var(--i-scale); font-weight: 620; letter-spacing: -.012em; display: inline-flex; align-items: center; gap: 7px; }
.msg.ai .card-head .who::before { width: 16px; height: 16px; color: var(--brass); }
#protokol .card-head .who { --ic: var(--i-mic); }
.msg.ai .card-head .badge { background: var(--soft); border: none; color: var(--ink-soft); padding: 3px 10px; font-size: 11px; }
.msg.ai .card-head .actions { gap: 2px; }
.msg.ai .card-head .actions button {
  background: none; border: none; color: var(--ink-faint); padding: 5px 8px; font-size: 12px; font-weight: 500; border-radius: 8px;
  display: inline-flex; align-items: center; gap: 5px; transition: background .14s, color .14s;
}
.msg.ai .card-head .actions button::before { width: 13px; height: 13px; }
.msg.ai .card-head .actions button:hover { background: var(--soft); color: var(--ink); }
.msg.ai .card-head .actions .cp { --ic: var(--i-copy); } .msg.ai .card-head .actions .dl, .msg.ai .card-head .actions .dlp { --ic: var(--i-down); }
.msg.ai .card-head .actions .docx { --ic: var(--i-file); } .msg.ai .card-head .actions .pdf { --ic: var(--i-print); }
.msg.ai .content { padding: 16px 20px 18px; font-size: 15px; line-height: 1.68; }
.answer-more, .ans-jump {
  background: #fff; border-color: var(--line); border-radius: 10px; font-family: inherit; font-size: 12.5px; font-weight: 550; line-height: 1.3; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.answer-more:hover, .ans-jump:hover { background: #fff; border-color: #cfcfc8; box-shadow: var(--shadow-xs); }
.ans-jump { --ic: var(--i-check); display: inline-flex; align-items: center; gap: 6px; }
.ans-jump[data-target="#judpanel"] { --ic: var(--i-scale); }

/* markdown odpovědi */
.content h1, .content h2, .content h3 { font-weight: 650; letter-spacing: -.016em; }
.content h1 { font-size: 21px; } .content h2 { font-size: 17.5px; } .content h3 { font-size: 15.5px; }
.content h2 { border-bottom: none; padding-bottom: 0; margin-top: 22px; }
.content h1:first-child, .content h2:first-child, .content h3:first-child { margin-top: 2px; }
.content strong { font-weight: 620; }
.content code { background: var(--soft); border-color: var(--line-soft); border-radius: 6px; font-size: 12.5px; font-family: ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, monospace; }
.content blockquote { border-left: 2px solid var(--brass); background: var(--soft); padding: 8px 15px; border-radius: 0 10px 10px 0; }
.content th, .content td { border: none; border-bottom: 1px solid var(--line-soft); padding: 8px 12px; }
.content th { background: var(--soft); font-weight: 600; font-size: 12.5px; }
.content a { color: var(--green); text-decoration-color: rgba(15,122,80,.35); text-underline-offset: 2.5px; transition: text-decoration-color .15s; }
.content a:hover { text-decoration-color: currentColor; }
.content pre { background: var(--soft); border-color: var(--line-soft); border-radius: 10px; }

/* přemýšlení */
.thinking { padding: 16px 20px; }
.thinking .pulse span { width: 6px; height: 6px; background: var(--brass); }
.thinking .tstat {
  background: linear-gradient(90deg, var(--ink-soft) 30%, #6a707c 50%, var(--ink-soft) 70%) 0 0 / 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shim 2.4s linear infinite;
}
@keyframes shim { from { background-position: 120% 0; } to { background-position: -100% 0; } }
.cursor::after { color: var(--brass); }

/* ===== uvítání ===== */
#welcome { padding: 2px 0 20px; }
.hero { border-radius: 20px; border: none; box-shadow: var(--shadow); margin-bottom: 20px; isolation: isolate; }
.hero img { height: 262px; filter: saturate(.8) brightness(.94); animation: heroin 1.4s var(--ease) both; }
@keyframes heroin { from { transform: scale(1.045); } to { transform: none; } }
.hero::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.09); pointer-events: none; }
.hero-cap { padding: 26px 30px; background: linear-gradient(180deg, rgba(12,14,22,0) 30%, rgba(12,14,22,.74) 100%); }
.hero-t { font-size: 31px; font-weight: 620; letter-spacing: -.012em; line-height: 1.12; text-shadow: none; }
.hero-s { font-size: 13.5px; margin-top: 7px; color: rgba(255,255,255,.82); text-shadow: none; letter-spacing: -.004em; }
#welcome p { font-size: 14.5px; line-height: 1.6; margin-bottom: 20px; max-width: 590px; }
.chips { gap: 8px; max-width: 760px; }
.chip {
  border-color: var(--line); border-radius: 12px; font-size: 13.5px; font-weight: 500; padding: 9px 15px; box-shadow: var(--shadow-xs);
  transition: transform .18s var(--ease), box-shadow .18s, border-color .18s;
}
.chip:hover { background: #fff; border-color: #cbcbc4; box-shadow: var(--shadow); transform: translateY(-1px); }
.chip:active { transform: translateY(0); }

/* ===== vstup ===== */
#composer-wrap { background: linear-gradient(180deg, rgba(250,250,248,0), var(--bg) 30%); }
#inputrow {
  border-color: var(--line); border-radius: 18px; padding: 9px 9px 9px 18px; align-items: flex-end;
  box-shadow: var(--shadow); transition: border-color .18s, box-shadow .18s;
}
#inputrow:focus-within { border-color: rgba(176,138,69,.42); box-shadow: 0 0 0 1px rgba(176,138,69,.1), var(--shadow); }
#q { padding: 8px 0; align-self: center; }
#q::placeholder { color: var(--ink-faint); opacity: 1; }
#send { width: 40px; height: 40px; border-radius: 12px; font-size: 0; transition: transform .16s var(--ease), background .16s; }
#send::before { content: ''; width: 19px; height: 19px; background: currentColor; -webkit-mask: var(--i-up) center / contain no-repeat; mask: var(--i-up) center / contain no-repeat; }
#send:hover { opacity: 1; background: #27304a; transform: translateY(-1px); }
#send:active { transform: translateY(0); }
#send.stop { background: var(--red); }
#send.stop::before { -webkit-mask-image: var(--i-stop); mask-image: var(--i-stop); }

/* ===== pravý panel ===== */
aside { gap: 12px; padding-right: 2px; }
.panel { flex: none; border-color: var(--line); box-shadow: var(--shadow-xs); overflow: hidden; }
.panel > summary {
  padding: 12px 16px; font-size: 13.5px; font-weight: 620; letter-spacing: -.012em; border-bottom-color: var(--line-soft);
  transition: background .14s;
}
.panel > summary:hover { background: #fdfdfb; }
.panel:not([open]) > summary { border-bottom-color: transparent; }
.panel > summary::before { color: var(--ink-faint); }
.panel > summary::after { content: ''; order: 9; margin-left: 8px; width: 14px; height: 14px; background: var(--ink-faint); -webkit-mask: var(--i-chev) center / contain no-repeat; mask: var(--i-chev) center / contain no-repeat; transition: transform .22s var(--ease); }
.panel > summary:not(:has(.cnt))::after { margin-left: auto; }
.settings-panel > summary { --ic: var(--i-sliders); } .auth-panel > summary { --ic: var(--i-lock); }
.info-panel > summary { --ic: var(--i-info); }
.panel:has(#judpanel) > summary { --ic: var(--i-scale); } .panel:has(#verpanel) > summary { --ic: var(--i-check); }
.panel > summary .cnt { background: var(--soft); font-variant-numeric: tabular-nums; padding: 1px 9px; }
.panel .pimg { height: 52px; border-bottom: none; filter: saturate(.55); -webkit-mask-image: linear-gradient(#000, transparent); mask-image: linear-gradient(#000, transparent); }
.settings-label { font-size: 11px; font-weight: 600; letter-spacing: -.002em; text-transform: none; color: var(--ink-faint); margin-bottom: 8px; }
.settings-body { padding: 14px 14px 12px; }
.settings-section + .settings-section { margin-top: 15px; padding-top: 14px; }
#modes { gap: 5px; }
.mode {
  display: inline-flex; align-items: center; border-color: var(--line); border-radius: 10px; font-size: 12.5px; font-weight: 520;
  padding: 6px 11px; transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.mode:not(.active) { background: var(--soft); border-color: transparent; color: var(--ink-soft); }
.mode:not(.active):hover { background: var(--softer); border-color: transparent; color: var(--ink); }
.mode.active { box-shadow: 0 4px 12px -5px rgba(20,26,43,.55); }
.mode.active::before { color: #e7cf9d; }
#deepwrap { border: none; background: var(--softer); border-radius: 12px; padding: 3px; gap: 2px; }
.dseg { border-right: none; border-radius: 9px; color: var(--ink-soft); font-size: 12px; font-weight: 520; padding: 6px 6px; transition: background .18s, color .18s, box-shadow .18s; }
.dseg:hover { background: rgba(255,255,255,.6); }
.dseg.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20,23,31,.14); font-weight: 600; }
.dseg.active::before { color: var(--brass); }
.settings-copy { font-size: 12.5px; }
#below { padding: 0; margin-top: 12px; column-gap: 8px; }
#below .note { font-size: 11px; }
#newchat { color: var(--ink-soft); font-size: 11.5px; font-weight: 550; text-decoration: underline; text-underline-offset: 2.5px; margin-left: auto; }
#newchat:hover { color: var(--ink); }
.panel .pbody { padding: 11px 12px; }
.panel .empty { font-size: 13px; line-height: 1.5; }

/* judikatura a citace */
.jud { background: #fff; border-color: var(--line); border-radius: 12px; padding: 10px 13px; transition: border-color .15s, box-shadow .15s, transform .18s var(--ease); }
.jud:hover { background: #fff; border-color: #cbcbc4; box-shadow: var(--shadow-xs); transform: translateY(-1px); }
.jud .court { font-size: 11px; letter-spacing: 0; text-transform: none; font-weight: 550; }
.jud .jdate { font-size: 11px; }
.jud .cn { font-weight: 620; letter-spacing: -.01em; }
.jud .ecli { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; }
.jud .presne { background: rgba(15,122,80,.08); border: none; }
.cit { border-bottom: 1px solid var(--line-soft); padding: 7px 6px; font-size: 13px; }
.kc { background: var(--soft); border-color: var(--line-soft); border-radius: 12px; padding: 12px 13px 7px; }
.kc-h { font-weight: 620; }
.kc-row { background: #fff; border-color: var(--line-soft); border-left-width: 2px; border-radius: 0 9px 9px 0; }

/* panely nástrojů */
#toolpanel { background: var(--soft); border-color: var(--line-soft); border-radius: 12px; padding: 13px; margin-top: 12px; }
#toolpanel label, .auth-form label, #authbody label { font-size: 12px; font-weight: 550; color: var(--ink-soft); letter-spacing: -.002em; text-transform: none; margin-bottom: 4px; display: block; }
#toolpanel select, #toolpanel input:not([type=file]), .auth-form input {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; font-family: inherit; color: var(--ink); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
#toolpanel select { font-size: 13.5px; } #toolpanel input:not([type=file]) { font-size: 13.5px; }
#toolpanel select:focus, #toolpanel input:not([type=file]):focus, .auth-form input:focus { outline: none; border-color: rgba(176,138,69,.6); box-shadow: 0 0 0 3px var(--brass-soft); }
.auth-form input { display: block; width: 100%; font-size: 14px; margin-bottom: 9px; }
#authbody .trow { display: flex; gap: 8px; flex-wrap: wrap; }
#authbody button {
  padding: 8px 15px; background: #fff; border: 1px solid var(--line); border-radius: 10px; font-family: inherit; font-size: 13px; font-weight: 550; line-height: 1.3; color: var(--ink); cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
#authbody button:hover { border-color: #cfcfc8; box-shadow: var(--shadow-xs); }
#toolpanel .hint { line-height: 1.5; }
#authbody .hint { margin-top: 10px; font-size: 12.5px; line-height: 1.5; color: var(--ink-faint); }
#authbody .empty:empty { display: none; }
#toolpanel input[type=file]::file-selector-button {
  border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 6px 12px; font-family: inherit; font-size: 12.5px; font-weight: 550; color: var(--ink); margin-right: 10px; cursor: pointer;
}
.hearbtn { --ic: var(--i-mic); background: var(--black); border-radius: 10px; font-size: 13px; padding: 8px 15px; display: inline-flex; align-items: center; gap: 7px; }
.hearbtn.rec { --ic: var(--i-stop); background: var(--red); }
#protokol .pbtns button { border-radius: 10px; display: inline-flex; align-items: center; gap: 6px; }
#protokol .pbtns button::before { width: 13px; height: 13px; }
#pb-react { --ic: var(--i-zap); } #pb-rozpory { --ic: var(--i-search); } #pb-priprava { --ic: var(--i-file); }
#protokol .pbtns button.primary::before { color: #e7cf9d; }

/* ===== historie ===== */
.hist-back { background: rgba(14,16,24,.36); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.hist-panel { border-right: none; border-radius: 0 20px 20px 0; box-shadow: var(--shadow-lg); animation-duration: .3s; }
.hist-head { border-bottom: none; padding: 16px 16px 6px 20px; }
.hist-head b { --ic: var(--i-history); font-weight: 640; letter-spacing: -.018em; font-size: 16px; display: inline-flex; align-items: center; gap: 9px; }
.hist-head b::before { width: 17px; height: 17px; color: var(--brass); }
.hist-head button { font-size: 0; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; }
.hist-head button::before { content: ''; width: 17px; height: 17px; background: currentColor; -webkit-mask: var(--i-x) center / contain no-repeat; mask: var(--i-x) center / contain no-repeat; }
.hist-new { --ic: var(--i-plus); display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 16px 8px; border-radius: 12px; transition: background .16s; }
.hist-new:hover { opacity: 1; background: #27304a; }
.hist-item { border-radius: 12px; }
.hist-item.active { background: var(--soft); box-shadow: inset 2px 0 0 var(--brass); }
.hist-item .hi-title { font-weight: 550; }
.hist-item .hi-del { font-size: 0; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; }
.hist-item .hi-del::before { content: ''; width: 15px; height: 15px; background: currentColor; -webkit-mask: var(--i-trash) center / contain no-repeat; mask: var(--i-trash) center / contain no-repeat; }

/* instalace aplikace (styl z JS, proto !important) */
#installbtn { --ic: var(--i-down); background: var(--black) !important; border-radius: 11px !important; display: inline-flex; align-items: center; gap: 7px; box-shadow: var(--shadow) !important; }
#installbtn::before { width: 14px; height: 14px; }

/* ===== mobil: navrací rozměry z původních pravidel ===== */
@media (max-width: 640px) {
  .brand h1 { font-size: 15.5px; } .brand .sub { font-size: 11px; }
  .brand .scales { width: 34px; height: 34px; border-radius: 10px; }
  .histbtn { padding: 5px 12px; font-size: 12.5px; }
  .hero { border-radius: 16px; margin-bottom: 14px; }
  .hero img { height: 158px; }
  .hero-cap { padding: 14px 16px; }
  .hero-t { font-size: 22px; }
  .hero-s { font-size: 11.5px; margin-top: 4px; line-height: 1.35; }
  #welcome { padding: 4px 0 14px; }
  #welcome p { font-size: 13.5px; margin-bottom: 14px; }
  .chip { padding: 9px 13px; font-size: 13px; }
  .msg.ai .content { padding: 13px 15px; }
  .msg.ai .card-head { padding: 8px 12px; }
  .msg.ai .card-head .actions button { padding: 3px 8px; }
  #thread { padding-right: 0; scrollbar-gutter: auto; }
  #inputrow { border-radius: 16px; padding: 7px 7px 7px 15px; }
  #q { font-size: 16px; padding: 10px 0; }
  #send { width: 44px; height: 44px; }
  .mode { padding: 6px 11px; }
  #toolpanel select, #toolpanel input:not([type=file]), .auth-form input { font-size: 16px; min-height: 44px; }
  #toolpanel input:not([type=file]) { min-width: 0; width: 100%; }
  .hist-head button { width: 44px; height: 44px; }
  .hist-item .hi-del { width: 44px; height: 44px; }
  .hearbtn { justify-content: center; }
  .hist-head { padding-top: calc(14px + env(safe-area-inset-top)); }
}
/* ===== odpověď přímo na ploše, čitelná šířka řádku ===== */
.msg.ai .card { background: transparent; border-color: transparent; box-shadow: none; }
.msg.ai .card-head { padding-left: 2px; padding-right: 2px; }
.msg.ai .content { padding-left: 2px; padding-right: 2px; }
.msg.ai .content > :not(table, pre) { max-width: 76ch; }
.thinking { padding-left: 2px; padding-right: 2px; }
.ans-foot { padding-left: 2px; padding-right: 2px; }
.answer-more { margin-left: 2px; }
#protokol .card { background: #fff; border-color: var(--line); box-shadow: var(--shadow-xs); }
#protokol .card-head, #protokol .content { padding-left: 16px; padding-right: 16px; }

/* formuláře nástrojů: stejná šířka polí, vlastní šipka */
#toolpanel .trow > div { flex: 1 1 170px; min-width: 0; }
#toolpanel select, #toolpanel input:not([type=file]) { width: 100%; min-width: 0; }
#toolpanel select {
  -webkit-appearance: none; appearance: none; padding-right: 30px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666c77' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 10px center / 14px no-repeat;
}

/* přístupnost a zarovnání textů */
.panel > summary:focus-visible { outline-offset: -2px; }
.panel .empty, .hist-empty { text-wrap: balance; }
[hidden] { display: none !important; }
.content { overflow-wrap: anywhere; }
.content pre { max-width: 100%; overflow-x: auto; padding: 10px 12px; }
.content pre code { background: none; border: none; padding: 0; }

/* mobil: platí i pro starší anglickou verzi, která původní blok nemá */
@media (max-width: 640px) {
  .msg.ai.long-answer.collapsed .content::after { background: linear-gradient(transparent, var(--bg)); }
  .msg.ai .card-head { flex-wrap: wrap; row-gap: 4px; padding-left: 0; padding-right: 0; }
  .msg.ai .card-head .actions { flex-wrap: wrap; gap: 6px; margin-left: 0; }
  .msg.ai .content { padding-left: 0; padding-right: 0; }
  .thinking, .ans-foot { padding-left: 0; padding-right: 0; }
  #protokol .card-head, #protokol .content { padding-left: 12px; padding-right: 12px; }
  .mode, .histbtn, .chip, #newchat, .hearbtn, #protokol .pbtns button, .msg.ai .card-head .actions button,
  .settings-links a, .hist-head button, .hist-item .hi-del, #authbody button {
    min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  }
  .dseg { min-height: 44px; display: flex; align-items: center; justify-content: center; }
  .panel > summary, .answer-more, .ans-jump, .hist-new { min-height: 44px; }
  .msg.ai .card-head .actions button { min-width: 44px; }
  .hist-item { min-height: 52px; }
  #toolpanel input[type=file] { min-height: 44px; width: 100%; }
  #protokol .spk { min-height: 44px; display: inline-flex; align-items: center; }
  .chip { font-size: 12.5px; text-align: center; text-wrap: balance; }
  /* tlačítko instalace nad vstupem, nekryje hlavičku */
  #installbtn {
    top: auto !important; right: 16px !important; bottom: calc(92px + env(safe-area-inset-bottom)) !important;
    min-height: 44px; padding: 0 14px !important; font-size: 12.5px !important;
  }
}
@media (max-width: 360px) {
  #q::placeholder { font-size: 14px; }
}
/* pole nástrojů: inline flex:1 z JS a sloupec na mobilu */
#toolpanel .trow > div[style*="flex:1"] { flex: 1 1 170px !important; }
@media (max-width: 640px) {
  #toolpanel .trow > div, #toolpanel .trow > div[style*="flex:1"] { flex: 0 0 auto !important; }
  /* v toku stránky pod obsahem: pevná pozice by při scrollu přejížděla přes vstup */
  #installbtn { position: static !important; display: flex; margin: 8px auto 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
