/* ============================================================
   AI Lawyer — Design System
   Classic legal: navy + brass, serif headings, clean sans UI
   ============================================================ */

:root {
  /* Navy scale */
  --navy-950: #0b1626;
  --navy-900: #0f1d33;
  --navy-850: #13243f;
  --navy-800: #182c4a;
  --navy-700: #213a5e;
  --navy-600: #2e4a73;
  --navy-500: #3d5d8a;

  /* Brass / gold accent (muted, restrained) */
  --brass-600: #9a7636;
  --brass-500: #b08a47;
  --brass-400: #c6a468;
  --brass-300: #d4bd92;
  --brass-200: #ecdcbd;

  /* Warm neutral paper */
  --paper:     #f6f4ef;
  --paper-2:   #efece4;
  --card:      #ffffff;
  --card-2:    #fbfaf7;

  /* Ink / text */
  --ink-900:   #16202e;
  --ink-700:   #364152;
  --ink-500:   #5a6473;
  --ink-400:   #828b98;

  /* Lines */
  --line:      #e4e0d6;
  --line-2:    #d8d3c6;
  --line-navy: rgba(255,255,255,0.10);

  /* Status hues (muted) */
  --c-claude:  #c08552;
  --c-gpt:     #2f8f7a;
  --c-gemini:  #4471c4;
  --c-grok:    #5b6470;
  --c-deepseek:#7a59b8;
  --c-mistral: #c2603e;

  --ok:        #2f7d5b;
  --warn:      #b07d2a;
  --danger:    #b1442f;

  --radius:    14px;
  --radius-sm: 9px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(15,29,51,.06), 0 1px 3px rgba(15,29,51,.05);
  --shadow-md: 0 4px 14px rgba(15,29,51,.08), 0 2px 6px rgba(15,29,51,.05);
  --shadow-lg: 0 18px 50px rgba(11,22,38,.18), 0 6px 18px rgba(11,22,38,.10);

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink-900);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#root { height: 100%; }

button { font-family: inherit; cursor: pointer; }
::selection { background: var(--brass-200); color: var(--ink-900); }

/* ---- Scrollbars ---- */
.scroll { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.scroll::-webkit-scrollbar { width: 9px; height: 9px; }
.scroll::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 20px; border: 2px solid transparent; background-clip: content-box; }
.scroll::-webkit-scrollbar-thumb:hover { background: var(--ink-400); background-clip: content-box; }
.scroll-navy { scrollbar-color: rgba(255,255,255,.18) transparent; }
.scroll-navy::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); }
.scroll-navy::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.28); }

/* ============================================================
   APP SHELL
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 296px 1fr;
  height: 100%;
  overflow: hidden;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(176,138,71,.10), transparent 60%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: #e9edf4;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(0,0,0,.25);
  min-height: 0;
}

.sb-brand {
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--line-navy);
  display: flex;
  align-items: center;
  gap: 13px;
}
.sb-brand .wordmark { display: flex; flex-direction: column; line-height: 1; }
.sb-brand .wordmark .name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: .2px;
  color: #fff;
}
.sb-brand .wordmark .name em { font-style: italic; color: var(--brass-400); }
.sb-brand .wordmark .sub {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(233,237,244,.55);
  margin-top: 6px;
  font-weight: 500;
}

.sb-new {
  margin: 16px 16px 8px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--navy-600), var(--navy-700));
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.08);
  transition: transform .12s ease, filter .15s ease;
}
.sb-new:hover { filter: brightness(1.1); transform: translateY(-1px); }
.sb-new:active { transform: translateY(0); }
.sb-new .plus { color: var(--brass-400); font-size: 17px; line-height: 1; }

.sb-list { flex: 1; overflow-y: auto; padding: 10px 10px 18px; min-height: 0; }
.sb-group-label {
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(233,237,244,.42);
  font-weight: 600;
  padding: 12px 10px 7px;
}
.sb-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: #d7deea;
  padding: 9px 11px;
  border-radius: 9px;
  margin-bottom: 2px;
  transition: background .12s ease, border-color .12s ease;
}
.sb-item:hover { background: rgba(255,255,255,.05); }
.sb-item.active {
  background: rgba(176,138,71,.13);
  border-color: rgba(176,138,71,.30);
}
.sb-item .t {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  color: #eef2f7;
}
.sb-item.active .t { color: #fff; }
.sb-item .meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 4px;
  font-size: 11px;
  color: rgba(215,222,234,.5);
}
.sb-item .meta .pill {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--brass-400);
  letter-spacing: .03em;
}

.sb-foot {
  border-top: 1px solid var(--line-navy);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px;
  color: rgba(233,237,244,.6);
}
.sb-foot .ava {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(180deg, var(--brass-400), var(--brass-600));
  color: var(--navy-950); font-weight: 700; font-size: 13px;
  display: grid; place-items: center;
  font-family: var(--serif);
}
.sb-foot .who { line-height: 1.2; }
.sb-foot .who b { color: #fff; font-weight: 600; display: block; font-size: 13px; }

/* ============================================================
   MAIN
   ============================================================ */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--paper); }

.topbar {
  height: 66px;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px;
  background: rgba(246,244,239,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.tb-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tb-title { min-width: 0; }
.tb-title .h {
  font-family: var(--serif);
  font-size: 17px; font-weight: 600; color: var(--ink-900);
  line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw;
}
.tb-title .panel-dots { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.tb-title .panel-dots .lbl { font-size: 11px; color: var(--ink-400); margin-right: 2px; font-weight: 500; }
.tb-title .panel-dots .d { width: 8px; height: 8px; border-radius: 50%; }

.tb-right { display: flex; align-items: center; gap: 14px; }

/* language segmented control */
.lang {
  display: inline-flex;
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.lang button {
  border: 0; background: transparent;
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  color: var(--ink-500);
  padding: 5px 11px; border-radius: 6px;
  transition: all .12s ease;
}
.lang button:hover { color: var(--ink-900); }
.lang button.on {
  background: var(--navy-800); color: #fff;
  box-shadow: var(--shadow-sm);
}

.ghost-btn {
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--ink-700);
  font-size: 13px; font-weight: 600;
  padding: 8px 15px; border-radius: 9px;
  transition: all .12s ease;
}
.ghost-btn:hover { border-color: var(--ink-400); color: var(--ink-900); }

/* ---- conversation scroll area ---- */
.thread {
  flex: 1; overflow-y: auto; min-height: 0;
  padding: 34px 26px 30px;
}
.thread-inner { max-width: 880px; margin: 0 auto; }

/* user message */
.msg-user { display: flex; justify-content: flex-end; margin-bottom: 28px; }
.msg-user .bubble {
  max-width: 76%;
  background: var(--navy-800);
  color: #f2f5fa;
  padding: 15px 19px;
  border-radius: 16px 16px 5px 16px;
  box-shadow: var(--shadow-md);
  font-size: 15px; line-height: 1.55;
  display: flex; flex-direction: column; align-items: flex-start;
}
.msg-user .bubble .doc {
  margin-top: 12px;
  display: inline-flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.16);
  padding: 8px 12px; border-radius: 9px;
  font-size: 12.5px; color: #e7ecf4;
}
.msg-user .bubble .doc .ic {
  width: 22px; height: 26px; border-radius: 3px;
  background: linear-gradient(180deg,#fff,#dfe6f0);
  position: relative; flex: 0 0 auto;
}
.msg-user .bubble .doc .ic:after {
  content:""; position:absolute; top:0; right:0; width:8px; height:8px;
  background: var(--navy-700); clip-path: polygon(0 0,100% 100%,0 100%);
}

/* ---- panel of models ---- */
.panel { margin-bottom: 26px; }
.panel-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 13px;
}
.panel-head .lab {
  font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-500);
}
.panel-head .rule { flex: 1; height: 1px; background: var(--line); }
.panel-head .count {
  font-family: var(--mono); font-size: 11.5px; color: var(--brass-600);
  background: rgba(176,138,71,.10); border: 1px solid rgba(176,138,71,.22);
  padding: 2px 8px; border-radius: 20px;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
}
.mcard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px 12px;
  box-shadow: var(--shadow-sm);
  text-align: left; width: 100%;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
  position: relative;
}
.mcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-2); }
.mcard.open { border-color: var(--navy-600); box-shadow: var(--shadow-md); }
.mcard .top { display: flex; align-items: center; gap: 8px; }
.mcard .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 3px rgba(0,0,0,.025); }
.mcard .nm { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--ink-900); letter-spacing: -.01em; }
.mcard .chev { margin-left: auto; color: var(--ink-400); transition: transform .18s ease; font-size: 11px; }
.mcard.open .chev { transform: rotate(180deg); }

.mcard .verdict {
  display: inline-flex; align-items: center;
  margin-top: 11px;
  font-size: 11.5px; font-weight: 600;
  padding: 4px 9px; border-radius: 7px;
  letter-spacing: .01em;
  white-space: nowrap;
}
.v-ok   { background: rgba(47,125,91,.10); color: var(--ok); }
.v-warn { background: rgba(176,125,42,.12); color: var(--warn); }
.v-info { background: rgba(46,74,115,.10); color: var(--navy-600); }

.mcard .conf { margin-top: 11px; }
.mcard .conf .barwrap { height: 4px; background: var(--paper-2); border-radius: 20px; overflow: hidden; }
.mcard .conf .bar { height: 100%; border-radius: 20px; }
.mcard .conf .ct { display: flex; justify-content: space-between; margin-top: 6px; font-size: 10.5px; color: var(--ink-400); }
.mcard .conf .ct b { color: var(--ink-700); font-weight: 600; font-family: var(--mono); }

.mcard .body {
  font-size: 13px; line-height: 1.6; color: var(--ink-700);
  overflow: hidden;
  max-height: 0; opacity: 0;
  transition: max-height .26s ease, opacity .2s ease, margin-top .2s ease, padding-top .2s ease;
}
.mcard.open .body {
  max-height: 320px; opacity: 1;
  margin-top: 11px; padding-top: 11px;
  border-top: 1px dashed var(--line-2);
}

/* thinking state */
.mcard.thinking { background: var(--card-2); }
.mcard.thinking .nm { color: var(--ink-400); }
.dots3 { display: inline-flex; gap: 4px; margin-top: 13px; }
.dots3 span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ink-400);
  animation: blink 1.2s infinite ease-in-out;
}
.dots3 span:nth-child(2) { animation-delay: .2s; }
.dots3 span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100%{opacity:.25;transform:translateY(0)} 40%{opacity:1;transform:translateY(-2px)} }

/* ============================================================
   SYNTHESIS HERO
   ============================================================ */
.synth {
  margin-top: 4px;
  background:
    linear-gradient(180deg, rgba(176,138,71,.05), transparent 120px),
    var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
}
.synth:before {
  content:""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--brass-400), var(--brass-600));
}
.synth-head {
  display: flex; align-items: center; gap: 13px;
  padding: 18px 24px;
  background: linear-gradient(180deg, var(--navy-850), var(--navy-900));
  color: #fff;
}
.synth-head .meta { line-height: 1.25; min-width: 0; flex: 1; }
.synth-head .meta .k {
  font-family: var(--serif); font-size: 18px; font-weight: 600; color: #fff;
  white-space: nowrap;
}
.synth-head .meta .k em { color: var(--brass-400); font-style: italic; }
.synth-head .meta .by { font-size: 11.5px; color: rgba(233,237,244,.6); margin-top: 3px; font-family: var(--mono); }
.synth-head .tag {
  margin-left: auto;
  font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--brass-400);
  border: 1px solid rgba(176,138,71,.4);
  padding: 5px 11px; border-radius: 20px;
}

.synth-body { padding: 22px 26px 26px; }
.synth-lede {
  font-family: var(--serif);
  font-size: 18px; line-height: 1.55; color: var(--ink-900);
  margin: 0 0 20px;
}
.synth-lede b { color: var(--navy-700); font-weight: 700; }

.synth-sec { margin-top: 20px; }
.synth-sec .sh {
  display: flex; align-items: center; gap: 9px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: var(--brass-600);
  margin-bottom: 11px;
}
.synth-sec .sh .mk { width: 6px; height: 6px; background: var(--brass-500); transform: rotate(45deg); }

.kpoints { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.kpoints li {
  display: flex; gap: 11px; align-items: flex-start;
  font-size: 14.5px; line-height: 1.55; color: var(--ink-700);
}
.kpoints li .b {
  flex: 0 0 auto; margin-top: 8px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--navy-600);
}

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.steps li {
  display: flex; gap: 13px; align-items: flex-start;
  font-size: 14.5px; line-height: 1.55; color: var(--ink-700);
}
.steps li .n {
  flex: 0 0 auto;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--navy-800); color: #fff;
  font-family: var(--serif); font-weight: 600; font-size: 13px;
  display: grid; place-items: center;
  margin-top: 1px;
}
.steps li b { color: var(--ink-900); font-weight: 600; }

.risk {
  margin-top: 22px;
  display: flex; gap: 13px;
  background: rgba(177,68,47,.05);
  border: 1px solid rgba(177,68,47,.18);
  border-radius: var(--radius);
  padding: 15px 17px;
}
.risk .ic {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px;
  background: rgba(177,68,47,.12); color: var(--danger);
  display: grid; place-items: center; font-weight: 800; font-family: var(--serif);
}
.risk .tx { font-size: 13.5px; line-height: 1.55; color: var(--ink-700); }
.risk .tx b { color: var(--danger); }

.synth-foot {
  margin-top: 22px; padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.synth-foot .agree {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--ink-500);
}
.synth-foot .agree .pips { display: flex; gap: 3px; }
.synth-foot .agree .pips i { width: 7px; height: 14px; border-radius: 2px; background: var(--ok); display: inline-block; }
.synth-foot .agree .pips i.off { background: var(--line-2); }
.synth-foot .acts { margin-left: auto; display: flex; gap: 8px; }
.synth-foot .acts button {
  border: 1px solid var(--line-2); background: var(--card);
  color: var(--ink-600); font-size: 12.5px; font-weight: 600;
  padding: 7px 13px; border-radius: 8px; transition: all .12s ease;
  display: inline-flex; align-items: center; gap: 7px;
}
.synth-foot .acts button:hover { border-color: var(--ink-400); color: var(--ink-900); background: var(--card-2); }

.disclaimer {
  max-width: 880px; margin: 22px auto 0;
  font-size: 11.5px; color: var(--ink-400); line-height: 1.5;
  display: flex; gap: 9px; align-items: flex-start;
}
.disclaimer .s { color: var(--brass-500); font-weight: 700; }

/* ============================================================
   COMPOSER
   ============================================================ */
.composer-wrap {
  flex: 0 0 auto;
  padding: 14px 26px 18px;
  background: linear-gradient(180deg, rgba(246,244,239,0), var(--paper) 36%);
  border-top: 1px solid var(--line);
}
.composer {
  max-width: 880px; margin: 0 auto;
  display: flex; align-items: flex-end; gap: 10px;
  background: var(--card);
  border: 1.5px solid var(--line-2);
  border-radius: 16px;
  padding: 9px 9px 9px 12px;
  box-shadow: var(--shadow-md);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.composer.focus { border-color: var(--navy-600); box-shadow: 0 0 0 4px rgba(46,74,115,.10), var(--shadow-md); }
.composer .attach {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card-2);
  color: var(--ink-500); display: grid; place-items: center;
  transition: all .12s ease;
}
.composer .attach:hover { color: var(--navy-700); border-color: var(--line-2); }
.composer textarea {
  flex: 1; border: 0; outline: 0; resize: none; background: transparent;
  font-family: var(--sans); font-size: 15px; line-height: 1.5; color: var(--ink-900);
  padding: 9px 4px; max-height: 160px; min-height: 24px;
}
.composer textarea::placeholder { color: var(--ink-400); }
.composer .send {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(180deg, var(--navy-700), var(--navy-850));
  color: #fff; border: 1px solid rgba(255,255,255,.12);
  display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(15,29,51,.25);
  transition: filter .12s ease, transform .12s ease;
}
.composer .send:hover { filter: brightness(1.12); transform: translateY(-1px); }
.composer .send:disabled { opacity: .4; cursor: default; transform: none; filter: none; }
.composer-hint {
  max-width: 880px; margin: 9px auto 0;
  text-align: center; font-size: 11.5px; color: var(--ink-400);
}
.composer-hint b { color: var(--ink-500); font-weight: 600; }

/* attached chips in composer */
.attached-row { max-width: 880px; margin: 0 auto 9px; display: flex; gap: 8px; flex-wrap: wrap; }
.attached-row .chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line-2);
  padding: 6px 10px; border-radius: 9px; font-size: 12px; color: var(--ink-700);
  box-shadow: var(--shadow-sm);
}
.attached-row .chip .x { color: var(--ink-400); cursor: pointer; font-weight: 700; }
.attached-row .chip .x:hover { color: var(--danger); }

/* ---- disclosure for individual answers ---- */
.disclose {
  margin: 16px 0 4px;
  display: inline-flex; align-items: center; gap: 9px;
  background: transparent; border: 1px solid var(--line-2);
  color: var(--ink-600); font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 20px; transition: all .12s ease;
}
.disclose:hover { border-color: var(--navy-600); color: var(--navy-700); background: var(--card); }
.disclose .chev { transition: transform .2s ease; font-size: 10px; }
.disclose.open .chev { transform: rotate(180deg); }

/* entrance */
.enter { animation: rise .4s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 1080px) {
  .model-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* ============================================================
   LIVE dodatki — login, intake, markdown, empty
   ============================================================ */
.boot { display:flex; align-items:center; justify-content:center; height:100%; color:var(--ink-400); font-size:24px; }

.login-screen { display:flex; align-items:center; justify-content:center; height:100%;
  background:radial-gradient(1200px 600px at 50% -10%, var(--navy-800), var(--navy-950)); }
.login-card { background:var(--card); border:1px solid var(--line); border-radius:var(--radius-lg);
  padding:38px 34px; width:340px; text-align:center; box-shadow:var(--shadow-lg);
  display:flex; flex-direction:column; align-items:center; gap:10px; }
.login-brand { font-family:var(--serif); font-size:26px; color:var(--ink-900); margin-top:6px; }
.login-brand em { color:var(--brass-600); font-style:italic; }
.login-sub { font-size:12.5px; color:var(--ink-400); text-transform:uppercase; letter-spacing:.12em; margin-bottom:8px; }
.login-input { width:100%; padding:12px 14px; border:1px solid var(--line-2); border-radius:var(--radius-sm);
  font-family:var(--sans); font-size:15px; outline:none; transition:border .15s; }
.login-input:focus { border-color:var(--navy-500); }
.login-input.err { border-color:var(--danger); }
.login-err { color:var(--danger); font-size:13px; }
.login-btn { width:100%; padding:12px; border:none; border-radius:var(--radius-sm); cursor:pointer;
  background:var(--navy-800); color:#fff; font-size:15px; font-weight:600; transition:filter .15s; }
.login-btn:hover:not(:disabled) { filter:brightness(1.12); }
.login-btn:disabled { opacity:.5; cursor:default; }

.empty-hint { display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:14px; padding:60px 20px; color:var(--ink-400); text-align:center; }
.empty-hint p { font-family:var(--serif); font-size:17px; color:var(--ink-500); max-width:380px; }

.thinking-row { display:flex; align-items:center; gap:10px; padding:14px 4px; color:var(--ink-400); font-size:14px; }

/* intake */
.intake { margin:6px 0 14px; border:1px solid var(--line-2); border-left:3px solid var(--brass-500);
  border-radius:var(--radius-sm); background:var(--card-2); overflow:hidden; }
.intake-head { width:100%; display:flex; align-items:center; gap:9px; padding:11px 14px; cursor:pointer;
  background:transparent; border:none; font-family:var(--sans); font-size:13.5px; font-weight:600;
  color:var(--navy-800); text-align:left; }
.intake-head .ico { font-size:14px; }
.intake-head .lab { flex:1; }
.intake-head .chev { color:var(--ink-400); transition:transform .2s; }
.intake.open .intake-head .chev { transform:rotate(180deg); }
.intake-body { padding:4px 16px 16px; font-size:14px; color:var(--ink-700); line-height:1.6; }
.intake-body p { margin:6px 0; }
.intake-body b { color:var(--navy-800); }

/* model card body markdown clamp */
.mcard .body.clamp { display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical;
  overflow:hidden; }
.mcard .body { font-size:13px; line-height:1.55; color:var(--ink-700); text-align:left; }
.mcard .body p { margin:5px 0; }
.mcard .body h1,.mcard .body h2,.mcard .body h3 { font-size:13.5px; margin:6px 0 3px; }

/* synthesis markdown */
.synth-md { font-size:15px; line-height:1.7; color:var(--ink-900); }
.synth-md h1 { font-family:var(--serif); font-size:22px; margin:4px 0 12px; color:var(--navy-900); }
.synth-md h2 { font-family:var(--serif); font-size:19px; margin:18px 0 8px; color:var(--navy-800);
  border-bottom:1px solid var(--line); padding-bottom:4px; }
.synth-md h3 { font-size:16px; margin:14px 0 6px; color:var(--navy-700); }
.synth-md p { margin:9px 0; }
.synth-md ul,.synth-md ol { margin:9px 0; padding-left:22px; }
.synth-md li { margin:5px 0; }
.synth-md b { color:var(--navy-800); }
.synth-md a { color:var(--brass-600); text-decoration:underline; word-break:break-all; }
.synth-md code { font-family:var(--mono); font-size:13px; background:var(--paper-2); padding:1px 5px; border-radius:4px; }
.synth-md pre { background:var(--navy-950); color:#e8eef7; padding:14px; border-radius:var(--radius-sm); overflow-x:auto; }
.synth-md pre code { background:none; color:inherit; }
.synth-md table { border-collapse:collapse; width:100%; margin:12px 0; font-size:13.5px; }
.synth-md th,.synth-md td { border:1px solid var(--line-2); padding:7px 10px; text-align:left; }
.synth-md th { background:var(--paper-2); font-weight:600; }
.sb-empty { padding:16px 14px; color:var(--ink-400); font-size:13px; }

/* ============================================================
   FIX: model kartice — poln prikaz odgovora (povozi staro demo logiko)
   ============================================================ */
.mcard .body {
  max-height: none !important;
  opacity: 1 !important;
  overflow: visible !important;
  margin-top: 10px;
  font-size: 13px; line-height: 1.6; color: var(--ink-700);
}
/* zaprta kartica: predogled nekaj vrstic */
.mcard:not(.open) .body.clamp {
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  max-height: none !important;
}
/* odprta kartica: cel tekst, brez rezanja */
.mcard.open .body {
  display: block !important;
  -webkit-line-clamp: unset !important;
  max-height: none !important;
  overflow: visible !important;
}
.mcard.open .body * { max-height: none !important; }
/* da gumb-kartica lahko raste */
.mcard { height: auto !important; overflow: visible !important; }
.mcard .body a { color: var(--brass-600); text-decoration: underline; word-break: break-word; }
.mcard .body ul, .mcard .body ol { padding-left: 18px; margin: 6px 0; }
.mcard .body table { width:100%; border-collapse:collapse; font-size:12px; margin:8px 0; }
.mcard .body th, .mcard .body td { border:1px solid var(--line-2); padding:4px 6px; }

/* ============================================================
   MOBILE — responsive (telefon)
   ============================================================ */
.tb-menu { display: none; background: none; border: none; color: var(--ink-700);
  padding: 6px; margin-right: 6px; cursor: pointer; align-items: center; }
.sb-close { display: none; margin-left: auto; background: none; border: none;
  color: var(--ink-400); cursor: pointer; padding: 4px; }
.sidebar-overlay { display: none; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }

  /* sidebar postane drsni predal */
  .sidebar {
    display: flex !important;
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 82%; max-width: 320px; z-index: 1000;
    transform: translateX(-100%);
    transition: transform .26s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.35);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .sb-close { display: inline-flex; }

  .sidebar-overlay {
    display: block; position: fixed; inset: 0;
    background: rgba(8,14,24,.5); z-index: 999;
  }

  .tb-menu { display: inline-flex; }

  /* topbar bolj kompakten */
  .topbar { padding: 10px 12px; gap: 8px; }
  .tb-title .h { font-size: 15px; max-width: 50vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .panel-dots { display: none; }
  .ghost-btn span, .ghost-btn { font-size: 0; }
  .ghost-btn svg { width: 18px; height: 18px; }
  .lang button { padding: 5px 8px; font-size: 12px; }

  /* vsebina */
  .thread { padding: 12px 12px 0; }
  .thread-inner { max-width: 100%; }
  .model-grid { grid-template-columns: 1fr !important; gap: 8px; }
  .synth { border-radius: 12px; }
  .synth-body { padding: 16px 14px; }
  .synth-md { font-size: 14.5px; }
  .synth-md h1 { font-size: 19px; }
  .synth-md h2 { font-size: 17px; }
  .synth-md table { font-size: 12px; display: block; overflow-x: auto; }
  .msg-user .bubble { max-width: 88%; }
  .composer-wrap { padding: 10px 12px; }
  .composer textarea { font-size: 16px; } /* prepreci zoom na iOS */
  .intake-body { font-size: 13.5px; }
  .mcard .body { font-size: 13.5px; }

  /* disclaimer manjsi */
  .disclaimer { font-size: 11px; padding: 10px 12px; }
}

@media (max-width: 480px) {
  .tb-title .h { max-width: 40vw; }
  .sidebar { width: 88%; }
  .login-card { width: 90%; max-width: 340px; }
}

/* intake meta vrstica */
.intake-body .intake-meta { font-size: 12px; color: var(--ink-400); margin-top: 10px;
  padding-top: 8px; border-top: 1px solid var(--line); font-family: var(--mono); }
.intake-body p { margin: 7px 0; }
.intake-body p b { color: var(--navy-800); }

/* ===== Iskalnik po projektih ===== */
.sb-search { position: relative; padding: 0 14px 10px; }
.sb-search input {
  width: 100%; box-sizing: border-box; padding: 9px 30px 9px 12px;
  border: 1px solid var(--line); border-radius: 9px; font-size: 13px;
  background: rgba(255,255,255,.06); color: inherit; font-family: var(--sans);
}
.sb-search input::placeholder { color: var(--ink-400); }
.sb-search input:focus { outline: none; border-color: var(--brass, #c6a468); }
.sb-search-x {
  position: absolute; right: 22px; top: 8px; background: none; border: none;
  color: var(--ink-400); cursor: pointer; padding: 2px; display: inline-flex;
}
.sb-result { display: block; }
.sb-snip { font-size: 11.5px; color: var(--ink-400); margin-top: 3px; line-height: 1.4; }
.sb-snip-tag { display: inline-block; color: var(--brass, #c6a468); margin-right: 4px; font-weight: 600; }
.sb-snip-txt { display: block; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
