/* assets/template.css — the type bar and the quiet page chrome (2026-11-14).
 *
 * Loaded LAST. app.css owns the tokens (the Baltasaar portal's teal + lime CI,
 * values duplicated — the app shares a look with the portal, never code) and
 * the structure; assets/glass.css the Apple-glass material. This sheet adds:
 *
 *   · the ONE type bar (js/core/typebar.js): pill input, attachment button,
 *     round send button, pill suggestions — proportions of the 9cxo.com hero
 *     bar, coloured in the CI. Used on the entry (#/start), on the agent chat
 *     home and, compact, as the command bar in the top bar of every view.
 *   · the optional follow-up cards of the entry (views/start.js)
 *   · calm page chrome: bare toolbars, pill buttons and filters, table tiles.
 *
 * Tokens only, so light and dark stay one system. */

/* ============================================================
   1. THE TYPE BAR
   ============================================================ */
.tbar {
  position: relative; display: flex; align-items: flex-end; gap: 6px; width: 100%; min-height: 60px;
  padding: 7px 7px 7px 22px; border-radius: 30px; background: var(--bar-bg);
  box-shadow: inset 0 0 0 1px var(--bar-line), var(--bar-shadow);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  transition: box-shadow var(--dur) var(--ease);
}
.tbar:focus-within { box-shadow: inset 0 0 0 1.5px var(--focus-line), 0 0 0 4px var(--focus-soft), var(--bar-shadow); }
.tbar.is-invalid { box-shadow: inset 0 0 0 1.5px var(--danger), var(--bar-shadow); }
.tbar-in {
  flex: 1 1 auto; min-width: 0; align-self: center; border: 0; outline: 0; background: none; margin: 0; resize: none;
  padding: 11px 0; max-height: 168px; overflow-y: auto;
  font: 400 16px/1.45 var(--font); color: var(--ink); caret-color: var(--accent-ink);
}
input.tbar-in { height: 46px; padding: 0; }
.tbar-in::placeholder { color: var(--dim); opacity: 1; }
.tbar-in:disabled { cursor: not-allowed; }
.tbar-att, .tbar-send { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; display: grid; place-items: center; }
.tbar-att { position: relative; background: transparent; color: var(--muted); transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.tbar-att:hover { background: var(--soft); color: var(--ink); }
.tbar-att svg { width: 19px; height: 19px; }
.tbar-att input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.tbar-att:focus-within { box-shadow: var(--ring); }
.tbar-att.has-files { color: var(--accent-ink); background: var(--petrol-50); }
.tbar-send { background: var(--petrol); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 14px -8px var(--petrol);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), opacity var(--dur) var(--ease); }
.tbar-send:hover:not(:disabled) { background: var(--petrol-700); transform: scale(1.05); }
.tbar-send:active:not(:disabled) { transform: scale(.96); }
.tbar-send:disabled { opacity: .45; cursor: not-allowed; }
.tbar-send svg { width: 18px; height: 18px; }
.tbar-send:focus-visible, .tbar-cta:focus-visible { outline: none; box-shadow: var(--ring); }
.tbar-spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .8s linear infinite; }
/* a labelled primary inside the bar, where the action needs its words (login) */
.tbar-cta { flex: 0 0 auto; height: 46px; padding: 0 20px; border-radius: 23px; border: 0; cursor: pointer; background: var(--petrol); color: #fff;
  font: 600 14.5px var(--font); white-space: nowrap; transition: background var(--dur) var(--ease), opacity var(--dur) var(--ease); }
.tbar-cta:hover:not(:disabled) { background: var(--petrol-700); }
.tbar-cta:disabled { opacity: .55; cursor: not-allowed; }
/* the rows under the input */
.tbar-wrap { position: relative; }
.tbar-meta { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 6px 12px 0; margin: 0; font-size: var(--fs-cap); color: var(--muted); }
.tbar-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; margin: 0; list-style: none; }
.tbar-files li { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 10px; border-radius: 999px; background: var(--petrol-50); color: var(--accent-ink); font-size: var(--fs-cap); }
.tbar-files li svg { width: 13px; height: 13px; flex: 0 0 auto; }
.tbar-files li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tchips { display: flex; flex-wrap: wrap; gap: 8px; }
.tchip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 14px; border-radius: 17px; cursor: pointer;
  border: 1px solid var(--chip-line); background: var(--chip-bg); color: var(--ink-soft);
  font: 500 13px/1.25 var(--font); text-align: left; text-decoration: none; max-width: 100%;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.tchip:hover { background: var(--chip-bg-hover); border-color: var(--accent-ink); color: var(--accent-ink); }
.tchip:focus-visible { outline: none; box-shadow: var(--ring); }
.tchip:disabled { opacity: .55; cursor: progress; }
.tchip svg { width: 14px; height: 14px; flex: 0 0 auto; }
@media (pointer: coarse) { .tchip { min-height: 44px; } }

/* compact: the command bar in the top bar of every view, and inside cards */
.tbar.compact { min-height: 40px; padding: 2px 3px 2px 14px; border-radius: 20px; gap: 2px; align-items: center;
  background: var(--field-bg); box-shadow: inset 0 0 0 1px var(--line-2); -webkit-backdrop-filter: none; backdrop-filter: none; }
.tbar.compact:focus-within { box-shadow: inset 0 0 0 1.5px var(--focus-line), 0 0 0 3px var(--focus-soft); }
.tbar.compact .tbar-in { height: 36px; font-size: var(--fs-body); }
.tbar.compact .tbar-att, .tbar.compact .tbar-send { width: 34px; height: 34px; }
.tbar.compact .tbar-att svg { width: 16px; height: 16px; }
.tbar.compact .tbar-send svg { width: 15px; height: 15px; }
.tbar.compact .tbar-send { box-shadow: none; }
.tb-cmd { flex: 1 1 260px; min-width: 0; max-width: 440px; margin: 0 4px 0 auto; }
@media (max-width: 1100px) { .tb-cmd { display: none; } }

/* ============================================================
   2. AGENT CHAT HOME — the type bar is the home
   ============================================================ */
.home-main { min-width: 0; }
.ac { max-width: 820px; }
.ac-welcome { padding: clamp(24px, 8vh, 84px) 8px 0; }
.ac-welcome h2 { font-size: clamp(26px, 3.2vw, 36px); font-weight: 600; letter-spacing: -.025em; line-height: 1.12; margin: 18px 0 10px; text-wrap: balance; }
.ac-welcome p { font-size: 15.5px; line-height: 1.55; max-width: 560px; margin-bottom: 0; text-wrap: pretty; }
/* sticky under a long thread: a soft veil of the ground, so nothing reads through the bar or its mode row */
.ac-composer.tbar-wrap { position: sticky; bottom: 0; z-index: var(--z-sticky); padding: 10px 8px 10px; margin: 4px -8px 0; border: 0;
  background: linear-gradient(180deg, transparent 0, var(--base) 30px); box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 0; }
.ac-composer.tbar-wrap:focus-within { border: 0; box-shadow: none; }
.ac-composer.tbar-wrap .tbar { background: var(--card-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
.ac-composer.tbar-wrap .tbar-in { max-height: 220px; }
.ac-thread.ac-empty { min-height: 0; padding-bottom: 0; }
.ac-thread.ac-empty + .ac-composer.tbar-wrap { position: relative; bottom: auto; margin: 28px 0 0; padding: 0; background: transparent; }
.ac-composer + .ac-ideas { margin-top: 14px; justify-content: center; }
.ac-idea { min-height: 34px; padding: 6px 14px; border-radius: 17px; border: 1px solid var(--chip-line); background: var(--chip-bg); color: var(--ink-soft);
  font-size: 13px; font-weight: 500; box-shadow: none; }
.ac-idea:hover { background: var(--chip-bg-hover); }
@media (pointer: coarse) { .ac-idea { min-height: 44px; } }
.ac-mode { margin-left: -8px; max-width: 100%; }

/* follow-up cards of the entry (website, reading, profile draft, first steps) */
.ac-follow { display: grid; gap: 12px; max-width: 820px; width: 100%; margin: 22px auto 0; }
.ac-follow:empty { display: none; }
.fu-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow); padding: 18px 20px; min-width: 0; }
.fu-head { display: flex; align-items: flex-start; gap: 12px; }
.fu-ic { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px; background: var(--petrol-50); color: var(--accent-ink); display: grid; place-items: center; }
.fu-ic svg { width: 17px; height: 17px; }
.fu-tx { flex: 1 1 auto; min-width: 0; }
.fu-tx b { display: block; font-size: var(--fs-head); font-weight: 600; letter-spacing: -.008em; overflow-wrap: anywhere; }
.fu-tx p { margin: 3px 0 0; color: var(--muted); font-size: var(--fs-sub); line-height: 1.5; }
.fu-x { flex: 0 0 auto; width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.fu-x:hover { background: var(--soft); color: var(--ink); }
.fu-x:focus-visible { outline: none; box-shadow: var(--ring); }
.fu-x svg { width: 15px; height: 15px; }
@media (pointer: coarse) { .fu-x { width: 44px; height: 44px; } }
.fu-body { margin-top: 14px; min-width: 0; }
.fu-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 18px; margin: 0; }
.fu-facts dt { font-size: var(--fs-cap); color: var(--muted); margin: 0 0 2px; }
.fu-facts dd { margin: 0; font-size: var(--fs-body); min-width: 0; overflow-wrap: anywhere; }
.fu-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.fu-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: var(--fs-sub); color: var(--muted); }
.fu-steps li { display: flex; align-items: center; gap: 9px; }
.fu-steps li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--track); flex: 0 0 auto; }
.fu-steps li.done, .fu-steps li.now { color: var(--ink); }
.fu-steps li.done::before { background: var(--success); }
.fu-steps li.now::before { background: var(--lime-700); animation: pulse 1.2s ease-in-out infinite; }
.fu-card .st-cards { gap: 12px; }
.fu-card .st-pcard { box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }

/* ============================================================
   3. QUIET PAGE CHROME (calm density, one primary action)
   ============================================================ */
.toolbar, .content .kb-toolbar { background: transparent; border: 0; box-shadow: none; padding: 0; border-radius: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
.page-head h1 { letter-spacing: -.025em; }
.btn, .btn.sm { border-radius: 999px; }
.btn { padding-left: 16px; padding-right: 16px; }
.filter-field .field, .toolbar .field { border-radius: 999px; padding-left: 15px; }
select.field, .form-field select { padding-right: 34px; }
.empty .ic { border-radius: 14px; }
.dt .table-wrap { background: var(--card); border-radius: var(--radius); box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow); }
.dt table.tbl th:first-child { border-top-left-radius: calc(var(--radius) - 1px); }
.dt table.tbl th:last-child { border-top-right-radius: calc(var(--radius) - 1px); }
.nav-sec-head { letter-spacing: .08em; }
/* long German compounds must not widen a tile */
.tile-label, .tile-sub { overflow-wrap: anywhere; min-width: 0; }

@media (max-width: 620px) {
  /* a long label wraps inside its pill instead of pushing the page sideways */
  .btn { padding-left: 13px; padding-right: 13px; white-space: normal; max-width: 100%; text-align: center; }
  .card-head-actions { min-width: 0; max-width: 100%; }
  .tbar { padding-left: 18px; min-height: 56px; border-radius: 28px; }
  .tbar-att, .tbar-send { width: 44px; height: 44px; }
  .tbar.has-cta { flex-wrap: wrap; padding: 7px; }
  .tbar.has-cta .tbar-in { flex: 1 1 100%; padding: 0 12px; }
  .tbar.has-cta .tbar-cta { flex: 1 1 100%; }
  .ac-welcome { padding-top: 18px; }
  .ac-welcome h2 { font-size: 25px; }
  .fu-card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .tbar-send, .tbar-send:hover:not(:disabled) { transition: none; transform: none; }
  .tbar-spin, .fu-steps li.now::before { animation: none; }
}
@media (forced-colors: active) { .tbar, .tchip, .fu-card { border: 1px solid CanvasText; } }
