/* The Assistant, Files and What it knows (workspace.js). Uses app.css's colors and parts. */

/* Top menu: the less-used pages under More */
.nav-more { position: relative; display: inline-flex; }
.nav-more > button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 8px 12px; border-radius: 10px; font-weight: 500; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
.nav-more > button:hover, .nav-more > button.on { color: var(--ink); background: var(--bg); }
.nav-more > button.on { background: var(--accent-soft); }
.nav-menu { position: absolute; top: calc(100% + 6px); right: 0; min-width: 180px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 30; display: flex; flex-direction: column; }
.nav-menu[hidden] { display: none; }
.nav .nav-menu a { flex-direction: row; font-size: 14.5px; padding: 9px 12px; }

svg.big { width: 34px; height: 34px; color: var(--accent); }
.rich h1 { font-size: 1.6em; margin: .6em 0 .35em; } .rich h2 { font-size: 1.3em; margin: .7em 0 .3em; } .rich h3 { font-size: 1.1em; margin: .7em 0 .3em; }
.rich p { margin: 0 0 .7em; } .rich ul, .rich ol { margin: 0 0 .8em; padding-left: 1.4em; } .rich li { margin: .15em 0; }
.rich blockquote { margin: 0 0 .8em; padding: 2px 14px; border-left: 3px solid var(--accent-line); color: var(--muted); }
.rich table { border-collapse: collapse; margin: 0 0 .9em; width: 100%; font-size: .95em; display: block; overflow-x: auto; }
.rich th, .rich td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; min-width: 60px; }
.rich th { background: var(--bg); font-weight: 600; }
.rich code { background: var(--bg); border-radius: 5px; padding: 1px 5px; font-size: .92em; }
.rich pre { background: var(--bg); border-radius: 10px; padding: 12px; overflow-x: auto; }
.rich hr { border: 0; border-top: 1px solid var(--line); margin: 1em 0; }
.rich > :last-child { margin-bottom: 0; }

/* Assistant */
.as-layout, .ask-assist { --as-glow: color-mix(in srgb, var(--accent) 55%, #22d3ee); --as-warm: color-mix(in srgb, var(--accent) 50%, #f472b6); }
/* The assistant gets the whole width: a roomy conversation and history, with small controls above the history. */
.page:has(> .as-layout) { max-width: 1480px; }
.as-layout { display: grid; grid-template-columns: 290px 1fr; gap: 32px; align-items: start; }
.as-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 110px); }
.as-newbtn { display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: 13.5px; color: var(--accent-ink); padding: 7px 12px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--as-glow)); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 28%, transparent); transition: transform .15s, box-shadow .15s; }
.as-newbtn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 34%, transparent); }
.as-newbtn svg { width: 15px; height: 15px; }
.as-knows { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; transition: border-color .15s; }
.as-knows:hover { border-color: var(--accent-line); }
.as-knows > svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.as-knows span { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-size: 13px; font-weight: 500; white-space: nowrap; }
.as-knows small { color: var(--muted); font-size: 11.5px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-chats { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; margin-top: 4px; }
.as-group { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 12px 10px 4px; }
.as-chat { display: flex; flex-direction: column; gap: 1px; text-decoration: none; color: var(--ink); padding: 10px 12px; border-radius: 10px; font-size: 14.5px; border-left: 2px solid transparent; }
.as-chat span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.as-chat .faint { font-size: 12.5px; }
.as-chat:hover { background: var(--card); }
.as-chat.on { background: var(--accent-soft); border-left-color: var(--accent); }

.as-main { display: flex; flex-direction: column; min-width: 0; min-height: calc(100vh - 170px); max-width: 1060px; width: 100%; margin: 0 auto; }
.as-thread { flex: 1; display: flex; flex-direction: column; gap: 26px; padding: 8px 0 24px; }
.as-msg { display: flex; gap: 14px; max-width: 100%; }
.as-msg.new { animation: as-in .35s ease both; } /* (only what arrives while it's open) */
@keyframes as-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.as-me { justify-content: flex-end; }
.as-bubble { background: var(--card); color: var(--ink); border: 1px solid var(--accent-line); padding: 11px 16px; border-radius: 18px 18px 6px 18px; max-width: min(720px, 85%); white-space: pre-wrap; overflow-wrap: anywhere;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--accent) 10%, transparent), 0 6px 20px color-mix(in srgb, var(--accent) 8%, transparent); }
.as-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.as-bot .as-text { font-size: 15.5px; line-height: 1.65; overflow-wrap: anywhere; padding-top: 4px; }
.as-text.writing { white-space: pre-wrap; }
.as-text.writing::after { content: ''; display: inline-block; width: 8px; height: 1.05em; margin-left: 2px; vertical-align: -2px; border-radius: 2px; background: var(--accent); animation: as-caret 1s steps(2) infinite; }
@keyframes as-caret { 50% { opacity: 0; } }
.as-bot .as-text.rich table { background: var(--card); border-radius: 10px; }

/* The conversation's heading: title, Share and Delete */
.as-head { position: sticky; top: 64px; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px 0; background: linear-gradient(var(--bg) 75%, transparent); }
.as-head.empty { display: none; }
.as-head-t { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.as-head h1 { font-size: 17px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.as-shared { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 10px; }
.as-shared svg { width: 13px; height: 13px; }
.as-head-btns { display: flex; align-items: center; gap: 6px; }
.as-menuwrap { position: relative; }
.as-sharebtn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; font-size: 14px; padding: 7px 14px; border-radius: 999px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.as-sharebtn:hover:not(:disabled) { border-color: var(--accent-line); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 12%, transparent); }
.as-sharebtn svg { width: 16px; height: 16px; color: var(--accent); }
.as-iconbtn { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid transparent; background: none; border-radius: 50%; color: var(--muted); cursor: pointer; }
.as-iconbtn:hover:not(:disabled) { background: var(--err-soft); color: var(--err); }
.as-iconbtn svg { width: 17px; height: 17px; }
.as-sharebtn:disabled, .as-iconbtn:disabled { opacity: .5; cursor: default; }
.as-menu { min-width: 250px; }
.as-menu button { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.as-menu button:hover { background: var(--accent-soft); }
.as-menu button > svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.as-menu span { display: flex; flex-direction: column; font-size: 14px; }
.as-menu small { color: var(--muted); font-size: 12px; }

/* Deleting from the list */
.as-chat-row { position: relative; }
.as-chat-row .as-chat { padding-right: 34px; }
.as-chat-del { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--faint); cursor: pointer; opacity: 0; transition: opacity .15s; }
.as-chat-row:hover .as-chat-del, .as-chat-del:focus-visible { opacity: 1; }
@media (hover: none) { .as-chat-del { opacity: .7; } }
.as-chat-del:hover { color: var(--err); background: var(--err-soft); }
.as-chat-del svg { width: 15px; height: 15px; }

/* Picking teammates, and the Team page */
.as-pick { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 4px; max-height: 320px; overflow-y: auto; }
.as-pick-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.as-pick-row:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.as-pick-row span:last-child { display: flex; flex-direction: column; min-width: 0; }
.as-pick-row small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.as-avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #22d3ee)); }
.tm-invite { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.tm-invite-h { display: flex; align-items: center; gap: 12px; }
.tm-invite-h > svg { width: 26px; height: 26px; color: var(--accent); }
.tm-fields { display: flex; gap: 8px; flex-wrap: wrap; }
.tm-fields input { flex: 1; min-width: 180px; }
.tm-list { padding: 6px 18px; }
.tm-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; flex-wrap: wrap; }
.tm-row + .tm-row { border-top: 1px solid var(--line); }
.tm-who { flex: 1; min-width: 180px; }
.tm-btns { display: flex; gap: 6px; }

/* The orb: a moon, as in the logo, that goes through its phases while it works */
.as-orb { display: block; position: relative; flex: none; width: 34px; height: 34px; border-radius: 50%; margin-top: 2px;
  --moon-dark: color-mix(in srgb, var(--accent) 38%, #0d0f2b); --moon-lit: #fffdf6;
  background: linear-gradient(135deg, var(--accent), var(--as-glow));
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent), inset 0 0 0 1px rgba(255, 255, 255, .25); }
.as-orb i { position: absolute; inset: 0; border-radius: 50%; background: inherit; filter: blur(10px); opacity: 0; z-index: -1; }
.as-moon { position: absolute; inset: 20%; border-radius: 50%; overflow: hidden; background: var(--moon-dark);
  box-shadow: 0 0 6px rgba(255, 255, 255, .45); transform: rotate(-18deg); }
/* (Lit half, plus an ellipse over the line between light and dark: dark narrows to a half moon, then lit widens to full.) */
.as-moon b { position: absolute; top: 0; bottom: 0; left: 0; width: 50%; background: var(--moon-lit); }
.as-moon u { position: absolute; inset: 0; border-radius: 50%; background: var(--moon-dark); transform: scaleX(.55); }
.as-orb.busy .as-moon b, .as-orb.hero .as-moon b { animation: moon-half var(--moon-t, 3.2s) linear infinite; }
.as-orb.busy .as-moon u, .as-orb.hero .as-moon u { animation: moon-edge var(--moon-t, 3.2s) linear infinite; }
.as-orb.busy i { opacity: .7; animation: as-pulse 1.6s ease-in-out infinite; }
.as-orb.hero { width: 76px; height: 76px; margin: 0 auto 18px; --moon-t: 16s; }
.as-orb.hero i { opacity: .55; filter: blur(26px); animation: as-pulse 4s ease-in-out infinite; }
@keyframes moon-half { 0%, 49.99% { left: 50%; } 50%, 99.99% { left: 0; } 100% { left: 50%; } }
@keyframes moon-edge {
  0% { transform: scaleX(1); background: var(--moon-dark); } 25% { transform: scaleX(0); background: var(--moon-dark); }
  25.01% { transform: scaleX(0); background: var(--moon-lit); } 50%, 50.01% { transform: scaleX(1); background: var(--moon-lit); }
  75% { transform: scaleX(0); background: var(--moon-lit); } 75.01% { transform: scaleX(0); background: var(--moon-dark); } 100% { transform: scaleX(1); background: var(--moon-dark); } }
@keyframes as-spin { to { transform: rotate(360deg); } }
@keyframes as-pulse { 0%, 100% { transform: scale(.9); opacity: .35; } 50% { transform: scale(1.35); opacity: .75; } }

/* Working: a live trail of what it's doing */
.as-status { padding-top: 7px; }
.as-shimmer { font-weight: 500; background: linear-gradient(90deg, var(--faint) 0%, var(--ink) 45%, var(--faint) 90%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: as-shine 1.6s linear infinite; }
@keyframes as-shine { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.as-trail-live, .as-trail ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.as-trail-live:empty { display: none; }
.as-trail-live li, .as-trail li { position: relative; display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); padding: 4px 0 4px 2px; animation: as-in .25s ease both; }
.as-trail-live li:not(:last-child)::before, .as-trail li:not(:last-child)::before { content: ''; position: absolute; left: 6px; top: 18px; bottom: -8px; width: 1.5px; background: var(--line); }
.as-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--accent-line); background: var(--card); position: relative; z-index: 1; }
li.run .as-dot { border-color: var(--accent); border-right-color: transparent; animation: as-spin .8s linear infinite; }
li.run { color: var(--ink); }
li.ok .as-dot { background: var(--accent); border-color: var(--accent); }
.as-trail { align-self: flex-start; }
.as-trail summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); }
.as-trail summary::-webkit-details-marker { display: none; }
.as-trail summary svg { width: 15px; height: 15px; color: var(--accent); }
.as-trail summary:hover { border-color: var(--accent-line); color: var(--ink); }
.as-trail[open] summary { margin-bottom: 6px; }

/* What it did and where it came from */
.as-error { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--err); background: var(--err-soft); border: 1px solid color-mix(in srgb, var(--err) 25%, var(--card)); border-radius: 14px; padding: 10px 12px 10px 14px; font-size: 14.5px; }
.as-error svg { width: 18px; height: 18px; flex: none; }
.as-error span { flex: 1; min-width: 180px; }
.as-action { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; border: 1px solid var(--accent-line); background: linear-gradient(135deg, var(--accent-soft), var(--card)); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); }
.as-action.pending { border-color: color-mix(in srgb, var(--accent) 45%, var(--card)); }
.as-action-ic { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--as-glow)); }
.as-action-ic svg { width: 19px; height: 19px; }
.as-action.done { border-color: color-mix(in srgb, var(--ok) 35%, var(--card)); background: var(--ok-soft); box-shadow: none; }
.as-action.done .as-action-ic { background: var(--ok); }
.as-action.failed { border-color: color-mix(in srgb, var(--err) 35%, var(--card)); background: var(--err-soft); box-shadow: none; }
.as-action.failed .as-action-ic { background: var(--err); }
.as-action.cancelled { border-color: var(--line); background: var(--bg); color: var(--muted); box-shadow: none; }
.as-action.cancelled .as-action-ic { background: var(--faint); }
.as-action-text { flex: 1; min-width: 220px; }
.as-action.working .as-action-ic { animation: as-pulse-ic 1.6s ease-in-out infinite; }
@keyframes as-pulse-ic { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 18%, transparent); } }
.as-connect { align-items: flex-start; }
.as-connect .as-action-btns { flex-wrap: wrap; }
.as-signup { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px dashed var(--accent-line); font-size: 14px; }
.as-signup ol { margin: 6px 0 4px; padding-left: 20px; display: flex; flex-direction: column; gap: 3px; }
.as-signup .small svg { width: 13px; height: 13px; vertical-align: -2px; }
.as-link { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.as-link svg { width: 14px; height: 14px; }
.as-signup.opened .as-link::after { content: '(opened)'; color: var(--muted); font-weight: 400; text-decoration: none; margin-left: 2px; }
.as-options { display: flex; flex-direction: column; gap: 10px; }
.as-options-h { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--muted); }
.as-options-h svg { width: 16px; height: 16px; color: var(--accent); }
.as-options-h + .as-connect:not(.cancelled) .as-action-kind::after { content: 'Top pick'; font-size: 11.5px; font-weight: 600; color: var(--accent); border: 1px solid var(--accent-line); border-radius: 999px; padding: 1px 8px; }
.as-action-kind { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.as-badge { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.as-action.pending .as-badge { color: var(--accent); border-color: var(--accent-line); }
.as-action-btns { display: flex; gap: 8px; margin-left: auto; }
.as-remember { font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px dashed var(--accent-line); border-radius: 12px; padding: 8px 12px; }
.as-remember svg { width: 17px; height: 17px; color: var(--accent); }
.as-remember span { flex: 1; min-width: 0; }
.as-refs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.as-refs-h { font-size: 12px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; margin-right: 2px; }
.as-ref { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; max-width: 280px; transition: border-color .15s, transform .15s; }
.as-ref span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-ref svg { width: 15px; height: 15px; color: var(--accent); }
.as-ref:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.as-tools { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.as-bot:hover .as-tools, .as-bot.fresh .as-tools, .as-tools:focus-within { opacity: 1; }
@media (hover: none) { .as-tools { opacity: 1; } }
.as-tools button, .as-tools a { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; cursor: pointer; font: inherit; font-size: 13px; color: var(--muted); padding: 5px 9px; border-radius: 8px; text-decoration: none; }
.as-tools button:hover, .as-tools a:hover { background: var(--card); color: var(--ink); }
.as-tools svg { width: 15px; height: 15px; }
.as-chart { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow); }
.as-chart figcaption { font-weight: 600; margin-bottom: 6px; }
.as-chart svg { width: 100%; height: auto; }
.as-chart .grid { stroke: var(--line); stroke-width: 1; }
.as-chart .lbl { fill: var(--muted); font-size: 12px; }
.as-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.as-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }

/* The composer floats at the bottom, with a glow while you type */
.as-dock { position: sticky; bottom: 0; padding: 18px 0 12px; background: linear-gradient(to bottom, transparent, var(--bg) 30%); }
.as-compose { position: relative; display: flex; gap: 8px; align-items: flex-end; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 8px 8px 8px 10px;
  box-shadow: 0 2px 4px rgba(15, 20, 36, .04), 0 16px 40px color-mix(in srgb, var(--accent) 10%, transparent); transition: border-color .2s, box-shadow .2s; }
.as-compose:focus-within { border-color: transparent; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent), 0 16px 44px color-mix(in srgb, var(--accent) 22%, transparent); }
.as-compose textarea, .as-compose textarea:focus { flex: 1; border: 0; outline: 0; box-shadow: none; background: none; resize: none; padding: 9px 8px; min-height: 42px; max-height: 220px; line-height: 1.5; font-size: 15.5px; color: var(--ink); }
.as-send { flex: none; width: 42px; height: 42px; border: 0; border-radius: 50%; cursor: pointer; display: grid; place-items: center; color: var(--accent-ink); background: var(--faint); transition: background .2s, transform .15s, box-shadow .2s; }
.as-send svg { width: 20px; height: 20px; }
.as-send.ready { background: linear-gradient(135deg, var(--accent), var(--as-glow)); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent); }
.as-send.ready:hover { transform: translateY(-1px); }
.as-send:disabled { opacity: .55; cursor: default; transform: none; }
.as-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--faint); margin-top: 8px; padding: 0 8px; }
.as-foot kbd { font: inherit; font-size: 11.5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--card); color: var(--muted); }

/* A fresh conversation */
.as-empty { text-align: center; padding: 48px 10px 10px; max-width: 700px; margin: 0 auto; animation: as-in .4s ease both; }
.as-empty h1 { margin: 0 0 8px; font-size: clamp(26px, 4vw, 34px); letter-spacing: -.02em; background: linear-gradient(120deg, var(--ink) 30%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.as-empty > p { margin: 0 auto; max-width: 560px; font-size: 15.5px; line-height: 1.55; }
.as-knowpill { display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; font-size: 13px; color: var(--muted); text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; }
.as-knowpill svg { width: 16px; height: 16px; color: var(--accent); }
.as-knowpill:hover { border-color: var(--accent-line); color: var(--ink); }
.as-ideas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 28px; text-align: left; }
.as-idea { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px; align-items: center; border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 14px 16px; cursor: pointer; font: inherit; color: var(--ink); text-align: left; transition: border-color .15s, transform .15s, box-shadow .15s; }
.as-idea:hover { border-color: var(--accent-line); transform: translateY(-2px); box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 12%, transparent); }
.as-idea-ic { grid-row: span 2; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); }
.as-idea-ic svg { width: 19px; height: 19px; }
.as-idea b { font-size: 13px; color: var(--accent); }
.as-idea > span:last-child { font-size: 14.5px; line-height: 1.4; }

@media (prefers-reduced-motion: reduce) {
  .as-msg.new, .as-empty, .as-trail-live li, .as-orb, .as-orb i, .as-moon b, .as-moon u, li.run .as-dot, .as-shimmer, .as-text.writing::after { animation: none !important; }
}

/* What it knows */
.kn-grid { display: grid; gap: 16px; }
.kn-grid h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.kn-grid p.muted { margin: 0 0 10px; font-size: 14.5px; }
.kn-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.kn-list { display: flex; flex-direction: column; }
.kn-list .kn-row { padding: 10px 0; border-top: 1px solid var(--line); }
.kn-fact { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.kn-fact > span:first-child { flex: 1; min-width: 200px; }
.kn-grid input[type=text] { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: var(--card); }

/* Files */
.fl-layout { display: grid; grid-template-columns: 210px 1fr; gap: 20px; align-items: start; }
.fl-side { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 84px; }
.fl-folder { display: flex; align-items: center; gap: 8px; border: 0; background: none; text-align: left; padding: 8px 12px; border-radius: 10px; cursor: pointer; color: var(--muted); font-weight: 500; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-folder:hover { background: var(--card); color: var(--ink); }
.fl-folder.on { background: var(--accent-soft); color: var(--ink); }
.fl-usage { margin-top: 14px; padding: 0 12px; }
.fl-usage .bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-bottom: 6px; }
.fl-usage .bar i { display: block; height: 100%; background: var(--accent); }
.fl-main { min-width: 0; border-radius: var(--radius); }
.fl-main.over { outline: 2px dashed var(--accent); outline-offset: 6px; }
.fl-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 0 12px; margin-bottom: 12px; color: var(--faint); }
.fl-search input { flex: 1; border: 0; outline: 0; background: none; padding: 10px 0; color: var(--ink); }
.fl-row { cursor: pointer; }
.fl-row:hover { background: var(--bg); }
.fl-ic svg { width: 22px; height: 22px; color: var(--accent); }
.fl-ai .track { transform: scale(.85); }
.fl-ai svg { width: 16px; height: 16px; color: var(--muted); }
.fl-title { display: flex; align-items: center; gap: 10px; min-width: 0; overflow-wrap: anywhere; }
.fl-title svg { width: 26px; height: 26px; color: var(--accent); }
.fl-detail { display: grid; gap: 16px; }
.fl-preview { max-width: 100%; max-height: 420px; border-radius: 10px; display: block; margin: 0 auto 16px; }
.fl-ver { display: flex; align-items: center; gap: 12px; padding: 9px 0; border: 0; border-top: 1px solid var(--line); background: none; width: 100%; text-align: left; font: inherit; color: inherit; }
.fl-ver > span:first-child { flex: 1; font-weight: 500; }
button.fl-ver { cursor: pointer; padding: 9px 8px; border-radius: 8px; }
button.fl-ver:hover, button.fl-ver.on { background: var(--accent-soft); }

/* The document editor */
.ed-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ed-top .back { margin: 0; }
.ed-title { flex: 1; min-width: 180px; font-size: 22px; font-weight: 700; border: 1px solid transparent; background: none; border-radius: 10px; padding: 6px 10px; letter-spacing: -.01em; }
.ed-title:hover, .ed-title:focus { border-color: var(--line); background: var(--card); outline: 0; }
.ed-status { min-width: 60px; }
.ed-conflict { background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ed-conflict[hidden] { display: none; }
.ed-bar { position: sticky; top: 64px; z-index: 5; display: flex; flex-wrap: wrap; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 5px; margin-bottom: 12px; }
.ed-bar button { border: 0; background: none; border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 14px; color: var(--ink); min-width: 34px; }
.ed-bar button:hover { background: var(--bg); }
.ed-paper { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.ed-body { min-height: 60vh; padding: 40px 56px; outline: 0; font-size: 16px; line-height: 1.65; max-width: 860px; margin: 0 auto; overflow-wrap: anywhere; }
.ed-body:empty::before { content: 'Start writing…'; color: var(--faint); }
.ed-vers { max-height: 220px; overflow-y: auto; margin: 6px 0 12px; }
.ed-vprev { border: 1px solid var(--line); border-radius: 12px; padding: 14px; max-height: 280px; overflow-y: auto; font-size: 14.5px; background: var(--bg); }
.modal:has(.ed-vers) { width: min(720px, 100%); }

/* Home: ask the assistant */
.ask-assist { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ask-assist > .grow { min-width: 200px; }
.ask-assist input { flex: 2; min-width: 220px; border: 1px solid var(--line); border-radius: 999px; padding: 11px 16px; background: var(--bg); transition: border-color .2s, box-shadow .2s; }
.ask-assist input:focus { outline: 0; border-color: transparent; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }
.ask-assist .as-orb { width: 42px; height: 42px; }
.ask-assist .as-send { background: linear-gradient(135deg, var(--accent), var(--as-glow)); }

@media (max-width: 860px) {
  .as-layout, .fl-layout { grid-template-columns: 1fr; }
  .as-side { position: static; max-height: none; flex-direction: row; flex-wrap: wrap; }
  .as-side > * { flex: 1; }
  .as-chats { display: none; }
  .fl-side { position: static; flex-direction: row; overflow-x: auto; }
  .fl-usage { display: none; }
  .ed-body { padding: 22px 18px; }
}
@media (max-width: 720px) {
  .as-dock { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .as-head { top: 56px; }
  .as-sharebtn span { display: none; }
  .as-sharebtn { padding: 8px 10px; }
  .nav-menu.as-menu { right: 0; left: auto; top: calc(100% + 6px); bottom: auto; }
  .as-keys { display: none; }
  .as-ideas { grid-template-columns: 1fr; }
  .as-msg { gap: 10px; }
  .as-orb { width: 28px; height: 28px; }
  .as-empty { padding-top: 24px; }
  .nav-more > button { flex-direction: column; gap: 2px; font-size: 11.5px; padding: 6px 8px; }
  .nav-more > button svg { width: 20px; height: 20px; }
  .nav-menu { top: auto; bottom: calc(100% + 8px); }
  .ed-bar { top: 56px; }
  .as-main { min-height: calc(100vh - 230px); }
}

/* Meetings: it listens for "Hey assistant", answers out loud, in a pop-up and on a display for a TV */
.as-meetbtn > svg { color: var(--accent); }
.mt { --as-glow: color-mix(in srgb, var(--accent) 55%, #22d3ee); --as-warm: color-mix(in srgb, var(--accent) 50%, #f472b6); margin: 0 auto; }
.page:has(> .mt) { max-width: 1400px; }
.mt-stage { text-align: center; padding: 26px 16px 22px; margin: 6px 0 22px; border-radius: 22px; border: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--accent) 12%, var(--card)), var(--card) 70%); }
.mt-stage h1 { margin: 6px 0 6px; font-size: 26px; }
.mt-stage > p { max-width: 620px; margin: 0 auto; }
.mt-orb { width: 96px; height: 96px; margin: 0 auto 14px; }
.mt-orb i, .dp-orb i { filter: blur(24px); }
.mt-orb.listening .as-moon b, .mt-orb.wake .as-moon b, .dp-orb.listening .as-moon b, .dp-orb.wake .as-moon b { animation: moon-half 16s linear infinite; }
.mt-orb.listening .as-moon u, .mt-orb.wake .as-moon u, .dp-orb.listening .as-moon u, .dp-orb.wake .as-moon u { animation: moon-edge 16s linear infinite; }
.mt-orb.thinking .as-moon b, .dp-orb.thinking .as-moon b { animation: moon-half 2.4s linear infinite; }
.mt-orb.thinking .as-moon u, .dp-orb.thinking .as-moon u { animation: moon-edge 2.4s linear infinite; }
.mt-orb.listening i, .dp-orb.listening i { opacity: .35; animation: as-pulse 4s ease-in-out infinite; }
.mt-orb.wake i, .dp-orb.wake i, .mt-orb.thinking i, .dp-orb.thinking i { opacity: .8; animation: as-pulse 1.4s ease-in-out infinite; }
.mt-orb.speaking i, .dp-orb.speaking i { opacity: .9; animation: as-pulse .9s ease-in-out infinite; }
.mt-btns { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.mt-btns .btn svg { width: 17px; height: 17px; }
.mt-go { padding: 11px 20px; font-size: 15.5px; }
.mt-go.on { background: var(--err, #C2392D); border-color: var(--err, #C2392D); }
.mt-warn { margin: 16px auto 0; max-width: 560px; padding: 10px 14px; border-radius: 12px; background: var(--err-soft); color: var(--ink); font-size: 14px; }
.mt-cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.mt-col { border: 1px solid var(--line); border-radius: 16px; background: var(--card); padding: 14px 16px; min-width: 0; }
.mt-col h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }
.mt-chat { display: flex; flex-direction: column; background: var(--bg); }
.mt-asked.as-thread { max-height: 58vh; min-height: 220px; overflow-y: auto; gap: 22px; padding: 6px 4px 14px; }
.mt-empty { margin: auto; text-align: center; max-width: 360px; padding: 24px 0; }
.mt-empty .as-orb { width: 46px; height: 46px; margin: 0 auto 10px; }
.mt-heardq { display: inline-flex; vertical-align: -2px; margin-right: 6px; opacity: .6; }
.mt-heardq svg { width: 14px; height: 14px; }
.mt-chat .as-ref { cursor: default; }
.mt-chat .as-tools button svg { width: 15px; height: 15px; }
.mt-dock { padding-top: 6px; }
.mt-dock .as-foot { padding: 8px 6px 0; }
.mt-a table, .mt-pop-body table, .dp-a table { border-collapse: collapse; margin: 6px 0; }
.mt-pop-body td, .mt-pop-body th { border: 1px solid var(--line); padding: 4px 8px; text-align: left; font-size: 14px; }
.mt-heard { max-height: 64vh; overflow-y: auto; font-size: 14px; line-height: 1.5; }
.mt-heard p { margin: 0 0 6px; }
.mt-heard mark { background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 0 2px; font-weight: 600; }
/* Choosing a voice */
.vc-h { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); margin: 12px 0 6px; }
.vc-list { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.vc-row { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 9px; cursor: pointer; }
.vc-row:hover { background: var(--bg); }
.vc-row > input { width: auto; margin: 0; }
.vc-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vc-name small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-tag { font-size: 11.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; }
.vc-play { border: 1px solid var(--line); background: var(--card); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--accent); flex: none; }
.vc-play:hover { border-color: var(--accent-line); }
.vc-play svg { width: 13px; height: 13px; }
.vc-rate { display: flex; align-items: center; gap: 12px; margin-top: 14px; font-size: 14px; font-weight: 600; }
.vc-rate input { flex: 1; }
.vc-rate span:last-child { font-weight: 400; color: var(--muted); min-width: 44px; }
.vc-tip { display: flex; gap: 10px; margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: var(--bg); font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.vc-tip svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 2px; }
.vc-tip b { color: var(--ink); }
.mt-end { display: flex; justify-content: flex-end; margin-top: 12px; }
.mt-end .btn svg { width: 16px; height: 16px; }
.mt-how { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; line-height: 1.5; }
.mt-pop { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, #0b0d1f 35%, transparent); animation: mt-in .2s ease both; }
.mt-pop.out { animation: mt-out .2s ease both; }
@keyframes mt-in { from { opacity: 0; } } @keyframes mt-out { to { opacity: 0; } }
.mt-pop-card { --as-glow: color-mix(in srgb, var(--accent) 55%, #22d3ee); width: min(720px, 100%); max-height: 80vh; overflow-y: auto; background: var(--card); border-radius: 22px; padding: 18px 22px 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); border: 1px solid var(--accent-line); }
.mt-pop-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.mt-pop-head > div { flex: 1; min-width: 0; }
.mt-pop-x { border: 0; background: none; cursor: pointer; color: var(--muted); width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.mt-pop-x:hover { background: var(--bg); }
.mt-pop-x svg { width: 18px; height: 18px; }
.mt-pop-body { font-size: 18px; line-height: 1.55; overflow-wrap: anywhere; }
.mt-pop-body > :first-child { margin-top: 0; } .mt-pop-body > :last-child { margin-bottom: 0; }

/* The display (for a TV) */
.dp { --as-glow: color-mix(in srgb, var(--accent) 55%, #22d3ee); min-height: 100vh; display: flex; flex-direction: column; color: #f4f5ff;
  background: radial-gradient(ellipse at 20% 0%, color-mix(in srgb, var(--accent) 45%, #0b0d1f), #0b0d1f 65%); }
.dp-top { display: flex; align-items: center; justify-content: space-between; padding: 2.2vh 3vw; font-size: clamp(14px, 1.4vw, 24px); }
.dp-biz { display: flex; align-items: center; gap: 12px; }
.dp-biz img { max-height: 5vh; max-width: 18vw; object-fit: contain; }
.dp-me { display: flex; align-items: center; gap: 12px; opacity: .9; }
.dp-orb { width: clamp(36px, 4vw, 64px); height: clamp(36px, 4vw, 64px); margin: 0; }
.dp-full { border: 0; background: rgba(255, 255, 255, .1); color: inherit; width: 40px; height: 40px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.dp-full svg { width: 20px; height: 20px; }
:fullscreen .dp-full { opacity: 0; } :fullscreen .dp-full:hover { opacity: 1; }
.dp-main { flex: 1; display: grid; place-items: center; padding: 2vh 7vw 7vh; }
.dp-idle { text-align: center; opacity: .8; }
.dp-idle h1 { font-size: clamp(28px, 4.4vw, 76px); margin: 0 0 1vh; }
.dp-idle p { font-size: clamp(16px, 1.8vw, 30px); margin: 0; opacity: .8; }
.dp-answer { width: 100%; max-width: 1500px; animation: mt-in .4s ease both; }
.dp-q { font-size: clamp(16px, 1.6vw, 28px); opacity: .7; margin-bottom: 2.5vh; }
.dp-a { font-size: clamp(22px, 2.7vw, 50px); line-height: 1.4; overflow-wrap: anywhere; }
.dp-a > :first-child { margin-top: 0; }
.dp-a td, .dp-a th { border: 1px solid rgba(255, 255, 255, .25); padding: .3em .7em; text-align: left; font-size: .75em; }
.dp-a svg { max-width: 100%; height: auto; }
.dp-a svg text { fill: #f4f5ff; }
@media (max-width: 860px) { .mt-cols { grid-template-columns: 1fr; } .mt-stage h1 { font-size: 21px; } .mt-orb { width: 76px; height: 76px; } }
@media (prefers-reduced-motion: reduce) { .mt-orb .as-moon b, .mt-orb .as-moon u, .dp-orb .as-moon b, .dp-orb .as-moon u, .mt-orb i, .dp-orb i, .mt-pop, .dp-answer { animation: none !important; } }

/* The meeting remote (a small window that stays on top) */
.rm-body { margin: 0; background: var(--bg); color: var(--ink); --as-glow: color-mix(in srgb, var(--accent) 55%, #22d3ee); }
.rm { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.rm-head { display: flex; align-items: center; gap: 10px; }
.rm-head > div { display: flex; flex-direction: column; min-width: 0; }
.rm-head b { font-size: 15px; }
.rm-head small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-orb { width: 40px; height: 40px; margin: 0; flex: none; }
.rm-orb.listening .as-moon b, .rm-orb.wake .as-moon b { animation: moon-half 16s linear infinite; } .rm-orb.listening .as-moon u, .rm-orb.wake .as-moon u { animation: moon-edge 16s linear infinite; }
.rm-orb.thinking .as-moon b { animation: moon-half 2.4s linear infinite; } .rm-orb.thinking .as-moon u { animation: moon-edge 2.4s linear infinite; }
.rm-orb.speaking i, .rm-orb.thinking i, .rm-orb.wake i { opacity: .8; animation: as-pulse 1.2s ease-in-out infinite; }
.rm-listen { justify-content: center; padding: 11px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.rm-listen svg, .rm-row svg, .rm-link svg, .rm-voice svg { width: 16px; height: 16px; }
.rm-listen.on { background: var(--err, #C2392D); border-color: var(--err, #C2392D); }
.rm-ask { border-radius: 18px; padding: 5px 5px 5px 8px; }
.rm-ask textarea, .rm-ask textarea:focus { min-height: 36px; padding: 7px 6px; font-size: 14.5px; }
.rm-ask .as-send { width: 36px; height: 36px; }
.rm-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.rm-card-h { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.rm-now { display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; line-height: 1.45; min-height: 52px; }
.rm-now span { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rm-nav { display: flex; gap: 6px; margin-top: 8px; }
.rm-nav button, .rm-row button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; padding: 7px 10px; cursor: pointer; font: inherit; font-size: 13px; }
.rm-nav button svg { width: 15px; height: 15px; }
.rm-nav button:hover:not(:disabled), .rm-row button:hover { border-color: var(--accent-line); }
.rm-nav button:disabled { opacity: .4; cursor: default; }
.rm-nav button:last-child { margin-left: auto; }
.rm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rm-voice { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.rm-voice span { display: inline-flex; align-items: center; gap: 5px; flex: none; }
.rm-voice select { flex: 1; min-width: 0; font-size: 13px; padding: 6px 8px; }
.rm-link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; font-size: 13px; padding: 2px 0; align-self: flex-start; }

/* Documents, together (docedit.js): who's here, suggestions, comments, and the side panel. */
.ed-body .ProseMirror { outline: 0; min-height: 56vh; }
.ed-body .ProseMirror p.is-editor-empty:first-child::before { content: attr(data-placeholder); color: var(--faint); float: left; height: 0; pointer-events: none; }
.ed-body .ProseMirror table { border-collapse: collapse; width: 100%; margin: 10px 0; }
.ed-body .ProseMirror td, .ed-body .ProseMirror th { border: 1px solid var(--line); padding: 6px 9px; vertical-align: top; min-width: 60px; }
.ed-body .ProseMirror th { background: var(--bg); font-weight: 600; }
.ed-body .ProseMirror .selectedCell { background: var(--accent-soft); }
.ed-body.suggesting .ProseMirror { caret-color: #15803d; }
.sg-ins { color: #166534; background: color-mix(in srgb, #22c55e 16%, transparent); text-decoration: underline; text-decoration-color: #22c55e; text-underline-offset: 3px; }
.sg-del { color: #b91c1c; background: color-mix(in srgb, #ef4444 10%, transparent); text-decoration: line-through; }
.cm-mark { background: color-mix(in srgb, #f5b301 26%, transparent); border-bottom: 2px solid #f5b301; }
.collaboration-carets__caret { position: relative; margin-left: -1px; margin-right: -1px; border-left: 2px solid; border-right: 0; word-break: normal; pointer-events: none; }
.collaboration-carets__label { position: absolute; top: -1.35em; left: -2px; font-size: 11px; font-weight: 600; line-height: 1; color: #fff; padding: 3px 6px; border-radius: 6px 6px 6px 0; white-space: nowrap; user-select: none; }
.de-people { display: inline-flex; margin-left: 2px; }
.de-av { width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; border: 2px solid var(--card); margin-left: -6px; }
.de-av.sm { width: 22px; height: 22px; font-size: 10px; margin: 0; border: 0; flex: none; }
.de-av.ai { background: var(--accent-soft); color: var(--accent); }
.de-av.ai svg { width: 13px; height: 13px; }
.de-mode button { display: inline-flex; align-items: center; gap: 5px; }
.de-mode button svg { width: 14px; height: 14px; }
.de-ai-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; margin-bottom: 10px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; line-height: 1.5; }
.de-ai-note svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 2px; }
.de-bar-grow { flex: 1; }
.ed-bar .de-cbtn { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent); }
.ed-bar .de-cbtn svg { width: 15px; height: 15px; }
.de-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; align-items: start; }
.de-side { position: sticky; top: 118px; max-height: calc(100vh - 140px); display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.de-tabs { display: flex; border-bottom: 1px solid var(--line); }
.de-tabs button { flex: 1; border: 0; background: none; padding: 10px 6px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border-bottom: 2px solid transparent; }
.de-tabs button svg { width: 14px; height: 14px; }
.de-tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.de-tabs .dot { min-width: 17px; height: 17px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10.5px; display: inline-grid; place-items: center; padding: 0 4px; }
.de-pane { overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.de-pane textarea, .de-pane input[type=text] { width: 100%; }
.de-th, .de-sg, .de-round { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; }
.de-th.draft { border-color: #f5b301; cursor: default; }
.de-th.resolved { opacity: .7; }
.de-quote { font-size: 12.5px; color: var(--muted); border-left: 3px solid #f5b301; padding-left: 8px; }
.de-who { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.de-cbody { white-space: pre-wrap; line-height: 1.45; }
.de-at { color: var(--accent); }
.de-row { display: flex; gap: 6px; flex-wrap: wrap; }
.de-sgtext { line-height: 1.5; }
.de-sgtext ins { color: #166534; background: color-mix(in srgb, #22c55e 16%, transparent); text-decoration: none; }
.de-sgtext del { color: #b91c1c; }
.de-ainote { font-size: 13px; color: var(--muted); display: flex; gap: 6px; }
.de-ainote svg { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--accent); }
.de-h { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.de-scope { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.de-done summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 4px 0; }
.de-done[open] { display: flex; flex-direction: column; gap: 8px; }
.de-link { display: flex; gap: 6px; }
.de-link input { flex: 1; }
.de-people-pick { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; }
#sh-note { width: 100%; margin-bottom: 8px; }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; display: inline-block; vertical-align: -2px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sg-ins { color: #86efac; } :root:not([data-theme="light"]) .sg-del { color: #fca5a5; } }
@media (max-width: 1000px) { .de-wrap { grid-template-columns: 1fr; } .de-side { position: static; max-height: none; } }
.de-tabs .dot[hidden] { display: none; }
.ed-body .ProseMirror td p, .ed-body .ProseMirror th p { margin: 0; }
.ed-top .ed-title { flex: 1 1 220px; min-width: 160px; }
.ed-top .btn { padding-left: 10px; padding-right: 10px; }

/* Memory → Contacts */
.mem-tabs { margin: 0 0 12px; }
.ct-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.ct-bar .fl-search { flex: 1; margin: 0; }
.ct-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; }
.ct-pill { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 5px 11px; font-size: 13px; cursor: pointer; }
.ct-pill span { color: var(--muted); font-size: 12px; margin-left: 2px; }
.ct-pill.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); font-weight: 600; }
.ct-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.ct-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.ct-layout:has(.ct-detail:not([hidden])) { grid-template-columns: minmax(0, 1fr) 380px; }
.ct-table { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ct-tr { display: grid; grid-template-columns: 1.4fr .9fr 1.3fr 1.2fr .7fr; gap: 10px; align-items: center; width: 100%; padding: 10px 14px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.ct-tr:hover, .ct-tr.on { background: var(--bg); }
.ct-th { border-top: 0; cursor: default; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.ct-th:hover { background: none; }
.ct-tr small, .ct-card small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-kind { font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.ct-kind.lead { background: color-mix(in srgb, #7A5AF8 14%, transparent); color: #6440E0; }
.ct-kind.customer { background: color-mix(in srgb, #22c55e 16%, transparent); color: #166534; }
.ct-kind.partner { background: color-mix(in srgb, #0B84D9 14%, transparent); color: #0B6FB8; }
.ct-due { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.ct-due svg { width: 12px; height: 12px; }
.ct-due.late { color: #b45309; font-weight: 600; }
.ct-tag { display: inline-block; font-size: 12px; color: var(--accent); margin-left: 6px; }
.ct-board { display: grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.ct-col { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-height: 240px; display: flex; flex-direction: column; gap: 8px; }
.ct-col.over { border-color: var(--accent); background: var(--accent-soft); }
.ct-colhead { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px; }
.ct-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: grab; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.ct-card.drag { opacity: .5; }
.ct-card.on { border-color: var(--accent); }
.ct-detail { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.ct-dhead { display: flex; justify-content: space-between; gap: 10px; }
.ct-dhead h2 { margin: 0; font-size: 20px; }
.ct-actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.ct-kv { display: grid; grid-template-columns: 90px 1fr; gap: 8px; padding: 5px 0; font-size: 13.5px; border-top: 1px solid var(--line); }
.ct-kv span { color: var(--muted); }
.ct-kv b { font-weight: 500; overflow-wrap: anywhere; }
.ct-notes { margin-top: 10px; padding: 10px; background: var(--bg); border-radius: 10px; white-space: pre-wrap; font-size: 13.5px; }
.ct-detail h3 { margin: 18px 0 8px; font-size: 14px; }
.ct-log { display: flex; gap: 6px; margin-bottom: 10px; }
.ct-log select { width: auto; }
.ct-log input { flex: 1; }
.ct-timeline { display: flex; flex-direction: column; gap: 10px; }
.ct-ev { display: grid; grid-template-columns: 26px 1fr; gap: 8px; font-size: 13.5px; }
.ct-evic { width: 26px; height: 26px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; color: var(--muted); }
.ct-evic svg { width: 14px; height: 14px; }
.ct-ev.text .ct-evic { color: #166534; }
.ct-ev.stage .ct-evic { color: var(--accent); }
.ct-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.ct-form input, .ct-form select, .ct-form textarea { width: 100%; }
.ct-imp { overflow: auto; max-height: 300px; border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; }
.ct-imp table { border-collapse: collapse; font-size: 12.5px; }
.ct-imp th, .ct-imp td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; vertical-align: top; }
.ct-imp th select { min-width: 130px; font-size: 12.5px; padding: 4px 6px; }
@media (max-width: 1000px) { .ct-layout:has(.ct-detail:not([hidden])) { grid-template-columns: 1fr; } .ct-detail { position: static; max-height: none; } .ct-tr { grid-template-columns: 1.3fr 1fr; } .ct-tr > :nth-child(n+3) { display: none; } .ct-grid2 { grid-template-columns: 1fr; } }
.modal:has(.ct-imp), .modal:has(.ct-form) { max-width: 820px; width: calc(100vw - 32px); }
