/* App chrome shared by every signed-in page: the sidebar shell, modals,
 * onboarding bands and key rows. Component rules live in ah.css. */
:root { --ah-font-sans: "Public Sans", ui-sans-serif, system-ui, sans-serif; --af-sidebar: 232px; }
body.ah-root { margin:0; background:var(--ah-bg); display:flex; min-height:100vh; }
#nav { flex:none; }
.page { flex:1 1 auto; min-width:0; max-width:1100px; margin:0 auto; padding:32px 32px 80px; display:flex; flex-direction:column; gap:22px; }
h1.serif { font-family:"Source Serif 4",Georgia,serif; font-weight:400; font-size:34px; line-height:1.1; letter-spacing:-0.015em; margin:0; color:var(--ah-fg); }
.lead { color:var(--ah-fg-muted); margin:0; max-width:64ch; line-height:1.6; }
.muted { color:var(--ah-fg-subtle); font-size:13px; }
.hidden { display:none !important; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:16px; } @media (max-width:820px){ .grid2 { grid-template-columns:1fr; } }
table.af { width:100%; border-collapse:collapse; font-size:14px; } table.af th, table.af td { text-align:left; padding:10px 12px; border-top:1px solid var(--ah-border); vertical-align:middle; } table.af th { font-size:11px; letter-spacing:.06em; text-transform:uppercase; color:var(--ah-fg-subtle); border-top:none; }
code.key, .mono { font-family:var(--ah-font-mono); font-size:13px; }
code.key { background:var(--ah-bg-sunken); padding:2px 6px; border-radius:4px; }
pre.cmd { margin:0; background:#1a1f18; color:#e6ece9; padding:12px 14px; border-radius:8px; font-family:var(--ah-font-mono); font-size:13px; overflow-x:auto; }

/* Sidebar */
.af-side { width:var(--af-sidebar); min-height:100vh; position:sticky; top:0; align-self:flex-start; background:var(--ah-bg-raised); border-right:1px solid var(--ah-border); display:flex; flex-direction:column; padding:18px 14px; gap:18px; box-sizing:border-box; }
.af-side .brand { display:flex; align-items:center; gap:10px; color:var(--ah-fg); text-decoration:none; font-weight:600; padding:4px 8px; }
.af-side .brand .ai { color:var(--ah-fg-subtle); font-weight:500; }
.af-side nav { display:flex; flex-direction:column; gap:2px; }
.af-side nav a { display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:8px; color:var(--ah-fg-muted); text-decoration:none; font-size:14px; font-weight:500; }
.af-side nav a:hover { background:var(--ah-bg-sunken); color:var(--ah-fg); }
.af-side nav a[aria-current="page"] { background:var(--ah-accent-weak); color:var(--ah-accent); font-weight:600; }
.af-side nav a .ic { width:18px; height:18px; flex:none; opacity:.85; }
.af-side nav a .ck { margin-left:auto; font-size:11px; color:var(--ah-pass-fg); font-weight:700; }
.af-side .foot { margin-top:auto; display:flex; flex-direction:column; gap:8px; padding:10px 8px; border-top:1px solid var(--ah-border); font-size:13px; }
.af-side .foot .who { color:var(--ah-fg); font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.af-side .foot .org { color:var(--ah-fg-subtle); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
@media (max-width:860px) { body.ah-root { flex-direction:column; } .af-side { width:100%; min-height:0; position:static; flex-direction:row; flex-wrap:wrap; align-items:center; } .af-side nav { flex-direction:row; flex-wrap:wrap; } .af-side .foot { margin-top:0; border-top:none; margin-left:auto; } .page { padding:20px 16px 60px; } }

/* Modal */
.af-overlay { position:fixed; inset:0; background:rgba(26,31,24,.42); display:flex; align-items:center; justify-content:center; padding:24px; z-index:50; animation:af-fade .15s ease; }
.af-modal { background:var(--ah-bg-raised); border-radius:16px; box-shadow:0 20px 60px rgba(26,31,24,.25); width:100%; max-width:720px; max-height:calc(100vh - 48px); display:flex; flex-direction:column; overflow:hidden; animation:af-rise .18s ease; }
.af-modal--wide { max-width:960px; }
.af-modal__head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:18px 22px; border-bottom:1px solid var(--ah-border); }
.af-modal__title { margin:0; font-family:"Source Serif 4",Georgia,serif; font-weight:400; font-size:24px; letter-spacing:-0.01em; }
.af-modal__x { border:none; background:none; font-size:22px; line-height:1; color:var(--ah-fg-subtle); cursor:pointer; padding:4px 8px; border-radius:6px; }
.af-modal__x:hover { background:var(--ah-bg-sunken); color:var(--ah-fg); }
.af-modal__body { padding:22px; overflow:auto; display:flex; flex-direction:column; gap:16px; }
.af-modal__foot { display:flex; align-items:center; gap:10px; padding:14px 22px; border-top:1px solid var(--ah-border); background:var(--ah-bg-sunken); }
.af-modal__foot .sp { flex:1; }
@keyframes af-fade { from { opacity:0; } } @keyframes af-rise { from { transform:translateY(8px); opacity:0; } }

/* Onboarding bands */
.af-bands { display:flex; flex-direction:column; gap:14px; }
.af-band { display:grid; grid-template-columns:56px 1fr auto; gap:20px; align-items:center; padding:22px 26px; border:1px solid var(--ah-border); border-radius:16px; background:linear-gradient(135deg, var(--ah-bg-raised), var(--ah-brand-50)); box-shadow:var(--ah-shadow-sm); transition:transform .15s ease, box-shadow .15s ease; }
.af-band:hover { transform:translateY(-1px); box-shadow:var(--ah-shadow-md); }
.af-band--done { background:var(--ah-bg-raised); }
.af-band__n { width:48px; height:48px; border-radius:50%; display:grid; place-items:center; font-family:"Source Serif 4",Georgia,serif; font-size:22px; color:var(--ah-accent); background:var(--ah-bg-raised); border:1px solid var(--ah-brand-200); }
.af-band--done .af-band__n { background:var(--ah-pass-fg); color:#fff; border-color:var(--ah-pass-fg); }
.af-band__t { display:flex; flex-direction:column; gap:4px; }
.af-band__t b { font-size:17px; color:var(--ah-fg); }
.af-band__t span { color:var(--ah-fg-muted); font-size:14px; line-height:1.5; }
.af-band__a { display:flex; align-items:center; gap:10px; }
@media (max-width:640px) { .af-band { grid-template-columns:44px 1fr; } .af-band__a { grid-column:1 / -1; } }

/* Plan choice cards */
.af-plans { display:grid; grid-template-columns:1fr 1fr; gap:14px; } @media (max-width:640px) { .af-plans { grid-template-columns:1fr; } }
.af-plan { border:1.5px solid var(--ah-border); border-radius:14px; padding:20px; display:flex; flex-direction:column; gap:10px; cursor:pointer; background:var(--ah-bg-raised); text-align:left; font:inherit; color:inherit; transition:border-color .12s ease, box-shadow .12s ease; }
.af-plan:hover { border-color:var(--ah-brand-300); box-shadow:var(--ah-shadow-md); }
.af-plan[aria-pressed="true"] { border-color:var(--ah-accent); box-shadow:0 0 0 3px var(--ah-brand-100); }
.af-plan .nm { font-size:18px; font-weight:600; }
.af-plan .pr { font-family:"Source Serif 4",Georgia,serif; font-size:30px; line-height:1; color:var(--ah-accent); }
.af-plan .pr small { font-family:var(--ah-font-sans); font-size:13px; color:var(--ah-fg-subtle); }
.af-plan ul { margin:0; padding-left:18px; color:var(--ah-fg-muted); font-size:13.5px; line-height:1.6; }

/* Key rows */
.af-keyval { display:inline-flex; align-items:center; gap:6px; }
.af-keyval code { font-family:var(--ah-font-mono); font-size:13px; letter-spacing:.06em; background:var(--ah-bg-sunken); padding:3px 8px; border-radius:6px; min-width:150px; }
.af-ib { border:1px solid var(--ah-border-strong); background:var(--ah-bg-raised); border-radius:6px; padding:4px 7px; cursor:pointer; color:var(--ah-fg-muted); display:inline-flex; align-items:center; font:inherit; font-size:12px; gap:4px; }
.af-ib:hover { background:var(--ah-bg-sunken); color:var(--ah-fg); }
.af-steps { display:flex; flex-direction:column; gap:12px; } .af-step { display:grid; grid-template-columns:34px 1fr; gap:14px; align-items:start; } .af-step::before { counter-increment:s; content:counter(s); width:30px; height:30px; border-radius:50%; background:var(--ah-accent-weak); color:var(--ah-accent); border:1px solid var(--ah-brand-100); display:grid; place-items:center; font-weight:700; font-size:13px; } .af-steps { counter-reset:s; }
.af-media { aspect-ratio:16/9; border-radius:12px; background:repeating-linear-gradient(135deg, var(--ah-bg-sunken) 0 12px, var(--ah-brand-50) 12px 24px); border:1px dashed var(--ah-border-strong); display:grid; place-items:center; color:var(--ah-fg-subtle); font-size:13px; }
.af-chips { display:flex; flex-wrap:wrap; gap:6px; } .af-chip { font-size:12.5px; padding:4px 10px; border-radius:999px; background:var(--ah-bg-sunken); color:var(--ah-fg-muted); }

/* Key status pills stay on one line */
#tbl .ah-pill { white-space:nowrap; } #tbl th { white-space:nowrap; }

/* Onboarding actions read as buttons: one width for all of them */
.af-band__a .ah-btn { min-width: 150px; justify-content: center; }

/* Buttons without an explicit size get the standard size, and links styled as
 * buttons never look like links */
.ah-btn:not(.ah-btn--sm):not(.ah-btn--md) { padding: 10px 18px; font-size: var(--ah-text-md); }
a.ah-btn, a.ah-btn:hover { text-decoration: none; }
.af-band__a .ah-btn { min-width: 160px; }

/* Demo player: a Mac window with an animated chat */
.af-demo { width:100%; }
.af-win { position:relative; border-radius:12px; overflow:hidden; border:1px solid var(--ah-border); box-shadow:0 18px 40px rgba(26,31,24,.14); background:#fff; font-size:13.5px; }
.af-win__bar { display:flex; align-items:center; gap:12px; padding:9px 12px; background:#f1f3f0; border-bottom:1px solid #e3e7e1; }
.af-win__dots { display:flex; gap:6px; } .af-win__dots i { width:11px; height:11px; border-radius:50%; background:#e5e7e4; border:1px solid rgba(0,0,0,.08); }
.af-win__dots i:nth-child(1){ background:#ff5f57; } .af-win__dots i:nth-child(2){ background:#febc2e; } .af-win__dots i:nth-child(3){ background:#28c840; }
.af-win__title { flex:1; text-align:center; font-size:12.5px; color:#6b756a; font-weight:600; }
.af-win__badge { display:flex; align-items:center; gap:6px; font-size:11.5px; font-weight:700; color:#1a1f18; background:#fff; border:1px solid #d8ded6; border-radius:999px; padding:3px 9px; }
.af-win__badge i { width:7px; height:7px; border-radius:50%; background:#4c8b4a; } .af-win__badge b { color:#525d50; font-weight:500; }
.af-win__body { display:flex; flex-direction:column; height:clamp(280px, 48vh, 420px); background:#fff; }
.af-chat { flex:1; overflow-y:auto; padding:18px 22px; display:flex; flex-direction:column; gap:12px; scroll-behavior:smooth; }
.af-msg { max-width:88%; line-height:1.55; }
.af-msg--user { align-self:flex-end; background:#eef1ec; border-radius:16px 16px 4px 16px; padding:10px 14px; color:#1a1f18; }
.af-msg--ai { align-self:flex-start; color:#1a1f18; max-width:100%; }
.af-toast { align-self:center; font-size:11.5px; color:#3b6e39; background:#ecf5eb; border:1px solid #dbedda; border-radius:999px; padding:3px 10px; }
.af-ack { font-weight:700; color:#3b6e39; margin-bottom:8px; }
.af-think { display:flex; gap:4px; padding:4px 0; } .af-think i { width:6px; height:6px; border-radius:50%; background:#b8c0b6; animation:af-blink 1s infinite; } .af-think i:nth-child(2){ animation-delay:.2s } .af-think i:nth-child(3){ animation-delay:.4s }
@keyframes af-blink { 0%,80%,100%{ opacity:.3 } 40%{ opacity:1 } }
.af-a__title { font-weight:700; margin:2px 0 8px; } .af-a__h { font-weight:700; margin-top:10px; } .af-a__p { margin:2px 0 0; line-height:1.55; } .af-a__k { margin-top:4px; color:#525d50; } .af-a__li { margin-top:2px; padding-left:14px; position:relative; } .af-a__li::before { content:"•"; position:absolute; left:2px; color:#8f998d; }
.af-composer { padding:12px 18px 16px; border-top:1px solid #eef0ec; display:flex; gap:10px; align-items:center; }
.af-composer__box { flex:1; position:relative; border:1px solid #d8ded6; border-radius:14px; padding:11px 14px; min-height:44px; box-sizing:border-box; display:flex; align-items:center; flex-wrap:wrap; line-height:1.45; color:#1a1f18; background:#fff; }
.af-composer__ph { position:absolute; left:14px; top:50%; transform:translateY(-50%); color:#8f998d; pointer-events:none; }
.af-caret { display:inline-block; width:1px; height:16px; background:#1a1f18; vertical-align:-3px; margin-left:1px; animation:af-caret 1s steps(1) infinite; }
@keyframes af-caret { 50% { opacity:0 } }
.af-send { width:34px; height:34px; border-radius:50%; border:none; background:#d8ded6; color:#fff; font-size:16px; font-weight:700; transition:background .2s, transform .1s; pointer-events:none; }
.af-send--on { background:#1a1f18; } .af-send--press { transform:scale(.9); }
.af-replay { font:600 11.5px var(--ah-font-sans); background:#fff; border:1px solid #d8ded6; border-radius:999px; padding:3px 10px; cursor:pointer; color:#525d50; margin-left:8px; }
.af-replay:hover { color:#1a1f18; }
@media (prefers-reduced-motion: reduce) { .af-caret, .af-think i { animation:none; } }

/* Demo player: attachments, agent steps, tables, deliverables */
.af-att { display:inline-flex; align-items:center; gap:6px; font-size:12px; color:#3b6e39; background:#fff; border:1px solid #dbedda; border-radius:8px; padding:3px 8px; margin-bottom:6px; }
.af-dstep { display:flex; align-items:center; gap:8px; font-size:12.5px; color:#525d50; margin:2px 0; }
.af-step__spin { width:11px; height:11px; border:2px solid #dbedda; border-top-color:#4c8b4a; border-radius:50%; animation:af-spin .8s linear infinite; flex:none; }
.af-step__ok { width:11px; height:11px; border-radius:50%; background:#4c8b4a; flex:none; position:relative; } .af-step__ok::after { content:""; position:absolute; left:3px; top:1px; width:3px; height:6px; border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg); }
@keyframes af-spin { to { transform:rotate(360deg); } }
.af-tbl { border-collapse:collapse; font-size:12.5px; margin:8px 0; width:100%; } .af-tbl th, .af-tbl td { border:1px solid #e3e7e1; padding:5px 8px; text-align:left; } .af-tbl th { background:#f4f7f3; font-size:11px; letter-spacing:.05em; text-transform:uppercase; color:#525d50; }
.af-deliv { display:flex; align-items:center; gap:12px; margin:10px 0 4px; padding:10px 12px; border:1px solid #dbedda; background:#f0f7ef; border-radius:10px; cursor:pointer; transition:box-shadow .2s; }
.af-deliv--open { box-shadow:0 0 0 3px #dbedda; }
.af-deliv__ic { font-size:20px; } .af-deliv__t { display:flex; flex-direction:column; gap:1px; flex:1; } .af-deliv__t span { font-family:var(--ah-font-mono); font-size:12px; color:#3b6e39; }
.af-deliv__badge { font-size:11px; font-weight:700; color:#a13636; background:#fbeaea; border-radius:6px; padding:2px 8px; }
.af-sheet { margin:6px 0 4px; border:1px solid #d8ded6; border-radius:10px; overflow:hidden; background:#fff; box-shadow:0 8px 24px rgba(26,31,24,.12); animation:af-rise .25s ease; }
.af-sheet__bar { display:flex; align-items:center; gap:10px; padding:6px 10px; background:#1d6f42; color:#fff; font-size:12px; font-weight:600; }
.af-sheet__dots { display:flex; gap:5px; } .af-sheet__dots i { width:9px; height:9px; border-radius:50%; background:rgba(255,255,255,.35); }
.af-sheet table { border-collapse:collapse; width:100%; font-size:12.5px; } .af-sheet td { border:1px solid #e3e7e1; padding:5px 10px; } .af-sheet__k { background:#f4f7f3; font-weight:600; width:150px; color:#525d50; }
.af-sheet table + table { border-top:2px solid #d8ded6; } .af-sheet th { background:#e6f0e5; color:#2c5329; font-size:11px; letter-spacing:.06em; text-transform:uppercase; text-align:left; padding:5px 10px; border:1px solid #e3e7e1; }

.af-side nav hr.sep{border:0;border-top:1px solid var(--ah-line,#e6e3dc);margin:10px 8px}
