/* Shared parts used by every screen.  OWNER: Ultron (frozen after the mockup). */

/* ---------------------------------------------------------------- column and card */
.column { width: min(var(--read), 100%); margin: 0 auto; padding: var(--s6) var(--s2) var(--s8); }
.card {
  background: var(--paper); border-radius: var(--r-card); box-shadow: var(--lift);
  padding: var(--s3) var(--s4);
}
@media (max-width: 560px) { .card { padding: var(--s3) 20px; } }
.title { font: 600 var(--t-xl)/1.15 var(--font-title); letter-spacing: -0.01em; }
.title-md { font: 600 var(--t-lg)/1.2 var(--font-title); letter-spacing: -0.005em; }
.heading { font-size: 15px; font-weight: 600; line-height: 1.4; }
.meta { font-size: var(--t-sm); color: var(--evergreen-soft); font-weight: 500; line-height: 1.45; }
.path { font-size: var(--t-sm); color: var(--evergreen-soft); }
.path a { color: inherit; text-decoration: none; }
.path a:hover { color: var(--tide); text-decoration: underline; }

/* ---------------------------------------------------------------- buttons */
.btn-primary, .btn-quiet {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s1);
  min-height: 44px; padding: 0 20px; border: 0; border-radius: var(--r-ctl);
  font-weight: 600; font-size: 15px; text-decoration: none;
  transition: background-color var(--fast) var(--ease), opacity var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.btn-primary { background: var(--evergreen); color: var(--sky-low); }
.btn-primary:hover { background: #163C3C; }
.btn-quiet { background: rgb(28 73 73 / 0.06); color: var(--evergreen); }
.btn-quiet:hover { background: rgb(28 73 73 / 0.1); }
.btn-primary:active, .btn-quiet:active { transform: scale(0.97); }
.btn-primary:disabled, .btn-quiet:disabled { opacity: .4; cursor: default; transform: none; }
.link-btn {
  border: 0; padding: 0; background: none; color: var(--tide); font-weight: 500;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}

/* ---------------------------------------------------------------- fields */
.field {
  width: 100%; min-height: 48px; padding: 12px 16px;
  border: 0; border-radius: var(--r-ctl);
  background: var(--paper-solid); box-shadow: inset 0 0 0 1px var(--hairline-strong);
  transition: box-shadow var(--fast) var(--ease);
}
.field::placeholder { color: var(--evergreen-faint); }
.field:focus { outline: none; box-shadow: inset 0 0 0 1px var(--tide), var(--ring); border-radius: var(--r-ctl); }

/* ---------------------------------------------------------------- the typing box (the reference's green)
   Files row (only with files) · the text · a foot with the plus button left and send right.
   Layout and behavior after Kokonut UI's AI Input Selector, minus its promo bar, model menu
   and effort control (Principal, 2026-11-21). Our tokens only. */
.composer {
  position: relative; width: 100%; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.97), rgb(250 252 251 / 0.94));
  border-radius: var(--r-box); box-shadow: var(--lift-high);
  transition: box-shadow var(--fast) var(--ease);
}
.composer:focus-within { box-shadow: var(--lift-high), 0 0 0 1.5px var(--tide); }
.composer textarea {
  display: block; width: 100%; min-height: 92px; max-height: 40vh; resize: none;
  padding: 20px 22px 4px; border: 0; background: transparent; border-radius: var(--r-box);
  field-sizing: content; line-height: 1.55;
}
.composer textarea:focus { outline: none; box-shadow: none; }
.composer textarea::placeholder { color: var(--evergreen-faint); }
.composer-foot { display: flex; align-items: center; justify-content: space-between; padding: 2px 10px 10px; }
.attach-btn { border-radius: 50%; }
.attach-btn:hover { background: var(--sand-soft); }
.attach-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.send {
  position: relative; flex: none;
  display: grid; place-items: center; width: 40px; height: 40px; margin-right: 2px;
  border: 0; border-radius: 50%; background: var(--evergreen); color: var(--sky-low);
  transition: background-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.send .icon { width: 20px; height: 20px; }
.send:disabled { background: rgb(28 73 73 / 0.14); color: rgb(255 255 255 / 0.95); cursor: default; }
.send:not(:disabled):active { transform: scale(0.94); }
.composer.is-docked textarea { min-height: 48px; padding-block: 16px 2px; }

/* files added to the box: soft sand pills, each with its state and a remove button */
.attach-list { display: flex; flex-wrap: wrap; gap: var(--s1); margin: 0; padding: 14px 14px 0; list-style: none; }
.attach-list:empty { display: none; }
.attach-chip {
  display: inline-flex; align-items: center; gap: var(--s1); max-width: 100%; min-height: 44px;
  padding: 0 2px 0 12px; border-radius: var(--r-ctl);
  background: var(--sand-soft); box-shadow: inset 0 0 0 1px var(--hairline);
  font-size: var(--t-sm); color: var(--evergreen); animation: rise var(--fast) var(--ease);
}
.attach-chip > .icon { width: 16px; height: 16px; flex: none; color: var(--evergreen-soft); }
.attach-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 24ch; font-weight: 500; }
.attach-state { display: inline-flex; align-items: center; gap: 5px; flex: none; color: var(--evergreen-soft); }
.attach-state .icon { width: 14px; height: 14px; color: var(--tide); }
.attach-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--tide); animation: attach-pulse 1.4s var(--ease) infinite; }
@keyframes attach-pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
.attach-chip.is-refused { background: var(--paper-solid); box-shadow: inset 0 0 0 1px var(--hairline-strong); }
.attach-remove { width: 40px; height: 40px; border-radius: 50%; }
.attach-remove .icon { width: 16px; height: 16px; }
.attach-remove:focus-visible { outline: none; box-shadow: var(--ring); }
.attach-notice {
  margin: 10px 14px 0; padding: 8px 12px; border-radius: var(--r-ctl);
  background: var(--sand); font-size: var(--t-sm); color: var(--evergreen);
}
.attach-notice:empty { display: none; }
/* dragging files over the box */
.composer.is-dropping { box-shadow: var(--lift-high), 0 0 0 1.5px var(--tide); }
.composer.is-dropping::after {
  content: "Drop files to add"; position: absolute; inset: 6px; display: grid; place-items: center;
  border: 1.5px dashed var(--tide); border-radius: calc(var(--r-box) - 6px);
  background: rgb(253 244 232 / 0.92); color: var(--tide); font-weight: 500; pointer-events: none;
}
/* the files Kitt sent, under their message */
.you-files { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin: 0; padding: 0; list-style: none; }
.you-files .attach-chip { min-height: 32px; padding-right: 12px; background: rgb(255 255 255 / 0.7); }

/* ---------------------------------------------------------------- chips, tags, notices */
.chips { display: flex; flex-wrap: wrap; gap: var(--s1); }
.chip {
  display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px;
  border-radius: var(--r-ctl); background: rgb(28 73 73 / 0.06);
  font-size: var(--t-sm); font-weight: 500; color: var(--evergreen);
}
button.chip { border: 0; min-height: 36px; transition: background-color var(--fast) var(--ease); }
button.chip:hover { background: rgb(28 73 73 / 0.11); }
button.chip[aria-pressed="true"] { background: var(--evergreen); color: var(--sky-low); }
button.chip:disabled { opacity: .38; cursor: default; }
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 6px;
  background: var(--sand); color: var(--evergreen); font-size: 12px; font-weight: 600;
}
.tag-new { background: var(--sand); }
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 16px; border-radius: var(--r-ctl);
  background: var(--sand-soft); box-shadow: inset 0 0 0 1px rgb(127 124 83 / 0.18);
  font-size: 15px; line-height: 1.5;
}
.notice .icon { width: 18px; height: 18px; margin-top: 3px; flex: none; color: var(--moss); }
.banner-retracted { background: #F6E4DF; box-shadow: inset 0 0 0 1px rgb(154 74 60 / 0.25); color: var(--brick); }
.banner-retracted .icon { color: var(--brick); }
.banner-review { background: rgb(28 73 73 / 0.05); box-shadow: none; color: var(--evergreen-soft); }
.banner-review .icon { color: var(--evergreen-soft); }

/* ---------------------------------------------------------------- reading text (render.js) */
.prose { display: grid; gap: 14px; }
.prose ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.prose li::marker { color: var(--mist); }
.prose strong { font-weight: 600; }
.cite {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  margin: 0 1px; vertical-align: 2px; position: relative;
  border: 0; border-radius: 6px; background: rgb(72 120 120 / 0.12); color: var(--evergreen);   /* tide failed 4.5:1 at 12 px */
  font-size: 12px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.cite::after { content: ""; position: absolute; inset: -12px -6px; }   /* 44 px hit area */
.cite:hover, .cite.is-on { background: var(--tide); color: #fff; }

/* ---------------------------------------------------------------- sources list */
.sources { display: grid; gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.source {
  display: grid; grid-template-columns: 28px 1fr; gap: 0 12px;
  padding: 12px; margin: 0 -12px; border-radius: 12px;
  transition: background-color var(--slow) var(--ease);
}
.source.is-on { background: rgb(72 120 120 / 0.08); }
.source-n {
  display: grid; place-items: center; width: 24px; height: 24px; margin-top: 1px;
  border-radius: 7px; background: rgb(72 120 120 / 0.12); color: var(--tide);
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.source-body { display: grid; gap: 3px; min-width: 0; }
.source-title { font-weight: 500; color: var(--evergreen); text-decoration: none; overflow-wrap: anywhere; }
.source-title:hover { color: var(--tide); text-decoration: underline; }
.source-title .icon { display: inline; width: 13px; height: 13px; margin-left: 4px; vertical-align: -1px; color: var(--evergreen-soft); }
.saved-in { font-size: var(--t-sm); line-height: 1.45; }
.saved-in .link-btn { font-size: inherit; text-align: left; min-height: 44px; }

/* ---------------------------------------------------------------- note panel (right on a computer, full screen on a phone) */
.panel-scrim {
  position: fixed; inset: 0; z-index: 30; background: rgb(28 73 73 / 0.16);
  animation: fade var(--slow) var(--ease);
}
.note-panel {
  position: fixed; inset: 0 0 0 auto; z-index: 31; width: min(600px, 100%);
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper-solid); box-shadow: var(--lift-high);
  animation: slide-in var(--slow) var(--ease);
}
.note-panel-bar {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between;
  padding: var(--s1) var(--s1) var(--s1) var(--s2);
  background: rgb(255 254 251 / 0.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.note-panel-body { padding: var(--s1) var(--s4) var(--s6); display: grid; gap: var(--s3); }
@media (max-width: 560px) { .note-panel-body { padding-inline: 20px; } }
@keyframes slide-in { from { transform: translateX(32px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ---------------------------------------------------------------- suggestion box (bottom left, every screen) */
.suggest-btn {
  position: fixed; left: var(--s2); bottom: var(--s2); z-index: 25;
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 16px 0 12px; border: 0; border-radius: 999px;
  background: var(--paper); color: var(--evergreen); box-shadow: var(--lift);
  font-size: 15px; font-weight: 500;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.suggest-btn:hover { box-shadow: var(--lift-high); }
.suggest-btn:focus-visible { box-shadow: var(--lift), var(--ring); }
.suggest-btn:active { transform: scale(0.97); }
.suggest-btn .icon { width: 22px; height: 22px; color: var(--tide); }
.shell.is-collapsed .suggest-btn { width: 44px; padding: 0; justify-content: center; left: 10px; }
.shell.is-collapsed .suggest-btn span { display: none; }
@media (max-width: 860px) {
  .suggest-btn, .shell.is-collapsed .suggest-btn {
    left: var(--s2); bottom: calc(76px + env(safe-area-inset-bottom));
    width: 48px; height: 48px; padding: 0; justify-content: center;
  }
  .suggest-btn span { display: none; }
}

.suggest-card {
  position: fixed; inset: auto auto 72px var(--s2); margin: 0;
  width: min(360px, calc(100vw - 32px)); padding: var(--s2);
  border: 0; border-radius: var(--r-card); background: var(--paper-solid); color: var(--evergreen);
  box-shadow: var(--lift-high);
  transform-origin: bottom left;
}
.suggest-card:popover-open { animation: pop var(--fast) var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(0.95) translateY(6px); } }
@media (max-width: 860px) { .suggest-card { bottom: calc(132px + env(safe-area-inset-bottom)); } }
.suggest-card form { display: grid; gap: 12px; }
.suggest-head { display: flex; align-items: center; justify-content: space-between; margin: -4px -6px -4px 0; }
.suggest-card textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.suggest-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s1); }
.suggest-thanks { display: grid; justify-items: center; gap: 12px; padding: var(--s2) var(--s1); text-align: center; }

/* ---------------------------------------------------------------- empty and waiting states */
.quiet-state { display: grid; justify-items: center; gap: 12px; padding: var(--s6) var(--s2); text-align: center; color: var(--evergreen-soft); }
.waiting { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) 0; color: var(--evergreen-soft); animation: rise var(--slow) var(--ease); }
.waiting .sun { width: 56px; }

/* an open tab after the app was updated (app.js, 'app-updated') */
.update-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px;
  margin: 12px auto 0; padding: 8px 16px; max-width: 560px; border-radius: var(--r-card);
  background: var(--paper); box-shadow: var(--lift); font-size: var(--t-sm); color: var(--evergreen);
}
.update-bar[hidden] { display: none; }
