/*
 * AgentShorts - design tokens, feed and desktop panels.
 * Mobile first. Light by default, dark via prefers-color-scheme.
 * GPL-2.0-or-later
 */
:root {
	--as-bg: #f6f5f2; --as-card: #ffffff; --as-fg: #16161a; --as-muted: #6b6b76; --as-line: #e7e5df;
	--as-accent: #ff6a3d; --as-accent-fg: #fff; --as-radius: 24px; --as-shadow: 0 10px 30px rgba(20,20,30,.08);
	--as-inbox: #e7f0ff; --as-family: #ffeedd; --as-calendar: #e9f8ef; --as-watch: #fff6d6; --as-business: #f1eaff; --as-limits: #ffe6ea; --as-core: #ececec;
	--as-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
	body.agentshorts-app, body.agentshorts-fullscreen {
		--as-bg: #0f0f12; --as-card: #1a1a20; --as-fg: #f2f2f4; --as-muted: #a2a2ad; --as-line: #2c2c35; --as-shadow: 0 10px 30px rgba(0,0,0,.4);
		--as-inbox: #1d2a40; --as-family: #3a2a1c; --as-calendar: #1b3326; --as-watch: #3a3418; --as-business: #2b2340; --as-limits: #3d1f26; --as-core: #2a2a30;
	}
}
.as-app, .as-feed, .as-saved, .as-join, .as-single, .as-landing, .as-start, .as-extras { font-family: var(--as-font); color: var(--as-fg); -webkit-font-smoothing: antialiased; }
.as-app *, .as-landing *, .as-start *, .as-join *, .as-app *::before, .as-app *::after { box-sizing: border-box; }
:is(.as-app, .as-landing, .as-start) :is(h1, h2, h3, p, li, dt, dd) { color: inherit; }
:is(.as-app, .as-landing, .as-start) button { box-shadow: none; text-transform: none; letter-spacing: normal; }

body.agentshorts-fullscreen { margin: 0; overflow: hidden; background: var(--as-bg); }

/* Buttons (body prefix beats theme button/link rules) */
body .as-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 999px; border: 1px solid var(--as-line); background: transparent; color: var(--as-fg); padding: 10px 16px; font: inherit; font-weight: 700; line-height: 1.2; cursor: pointer; text-decoration: none; text-align: center; }
body .as-btn:hover, body .as-btn:focus-visible { background: var(--as-bg); color: var(--as-fg); border-color: var(--as-fg); }
body .as-btn--primary, body .as-btn--primary:hover, body .as-btn--primary:focus-visible { background: var(--as-fg); color: var(--as-card); border-color: var(--as-fg); }
body .as-btn--primary:hover { opacity: .9; }
body .as-btn--primary[disabled] { opacity: .35; cursor: not-allowed; }
body .as-btn--wide { display: flex; width: 100%; }
body .as-btn--lg { padding: 14px 22px; font-size: 1.05rem; }
.as-actions .as-btn--primary { flex: 1; }

/* Feed: the scroll container */
.as-feed { position: relative; overflow-x: hidden; height: 100vh; height: 100dvh; overflow-y: auto; background: var(--as-bg); scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.as-feed::-webkit-scrollbar { display: none; }

/* Mobile top bar */
.as-bar { position: sticky; top: 0; z-index: 5; height: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: 0 16px; pointer-events: none; }
.as-bar > * { pointer-events: auto; margin-top: 14px; }
.as-brand { font-weight: 800; letter-spacing: -.02em; font-size: 1.05rem; }
.as-bar__right { display: flex; gap: 8px; }
.as-pill { background: var(--as-card); color: var(--as-fg); box-shadow: var(--as-shadow); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: .9rem; text-decoration: none; }

/* Slides & cards */
.as-slide { height: 100vh; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; display: flex; align-items: center; justify-content: center; padding: 60px 14px 18px; }
.as-card { width: min(100%, 440px); max-height: 100%; background: var(--as-card); border-radius: var(--as-radius); box-shadow: var(--as-shadow); padding: 20px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; transition: transform .35s ease, opacity .35s ease; }
.as-slide:not(.is-visible) .as-card { transform: scale(.96); opacity: .6; }
.as-card--hero { padding: 28px 24px; }
.as-card h1 { font-size: clamp(1.6rem, 6vw, 2.1rem); line-height: 1.1; letter-spacing: -.03em; margin: 0; font-weight: 800; }
.as-card h2 { font-size: 1.45rem; line-height: 1.15; letter-spacing: -.02em; margin: 0; font-weight: 800; }
.as-eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 700; color: var(--as-accent); }
.as-lede { margin: 0; color: var(--as-muted); font-size: 1.02rem; line-height: 1.45; }
.as-hint { margin: 6px 0 0; color: var(--as-muted); font-size: .85rem; text-align: center; }
.as-small { margin: 0; font-size: .88rem; color: var(--as-muted); }
.as-small a { color: var(--as-muted); }

/* Tiles, options, path list (shared by /start/) */
.as-tiles { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
body .as-tile { border: 0; border-radius: 18px; width: 100%; line-height: 1.25; padding: 16px 12px; text-align: left; font: inherit; font-weight: 700; color: var(--as-fg); cursor: pointer; display: flex; flex-direction: column; gap: 8px; min-height: 92px; transition: transform .15s ease, outline-color .15s; outline: 2px solid transparent; outline-offset: 0; }
body .as-tile:hover { transform: translateY(-2px); color: var(--as-fg); }
body .as-tile.is-active { outline-color: var(--as-fg); }
.as-tile__icon { font-size: 1.5rem; }
.as-list { display: flex; flex-direction: column; gap: 8px; }
body .as-option { border: 1px solid var(--as-line); background: var(--as-card); color: var(--as-fg); border-radius: 16px; padding: 14px 16px; font: inherit; font-weight: 600; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; width: 100%; }
body .as-option span { font-weight: 500; color: var(--as-muted); font-size: .9rem; }
body .as-option:hover, body .as-option.is-active { border-color: var(--as-fg); background: var(--as-card); color: var(--as-fg); }
body .as-option.is-active { box-shadow: inset 0 0 0 1px var(--as-fg); }
.as-path { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; counter-reset: p; }
.as-path li { counter-increment: p; background: var(--as-bg); border-radius: 12px; padding: 10px 12px; font-weight: 600; opacity: 0; transform: translateY(8px); animation: as-in .35s ease forwards; }
.as-path li::before { content: counter(p); display: inline-block; width: 1.6em; color: var(--as-accent); font-weight: 800; }
@keyframes as-in { to { opacity: 1; transform: none; } }
.as-reminder { color: var(--as-muted); font-size: .9rem; display: flex; gap: 8px; align-items: center; }
.as-reminder input { font: inherit; border: 1px solid var(--as-line); border-radius: 10px; padding: 6px 8px; background: var(--as-card); color: var(--as-fg); }

/* Lesson card */
.as-card--lesson { padding: 14px; }
.as-card__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.as-chip { border-radius: 999px; padding: 4px 10px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.as-chip--inbox { background: var(--as-inbox); } .as-chip--family { background: var(--as-family); } .as-chip--calendar { background: var(--as-calendar); }
.as-chip--watch { background: var(--as-watch); } .as-chip--business { background: var(--as-business); } .as-chip--limits { background: var(--as-limits); } .as-chip--core { background: var(--as-core); }
.as-num { color: var(--as-muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.as-media { width: 100%; aspect-ratio: 9 / 16; max-height: calc(100dvh - 330px); margin: 0 auto; background: #111; border-radius: 18px; overflow: hidden; }
.as-media:has(.as-video) { width: auto; }
.as-video { width: 100%; height: 100%; border: 0; display: block; object-fit: cover; }
.as-video-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #bbb; font-weight: 600; background: linear-gradient(160deg, #26262e, #121216); }
.as-title { margin: 2px 0 0; font-size: 1.2rem; letter-spacing: -.02em; line-height: 1.2; font-weight: 800; }
.as-title a { color: inherit; text-decoration: none; }
.as-hook { margin: 0; color: var(--as-muted); }
.as-do { margin: 0; font-size: .92rem; background: var(--as-bg); border-radius: 12px; padding: 10px 12px; }
.as-do strong { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--as-accent); }
.as-tryon { display: block; margin-top: 4px; font-weight: 700; }
.as-actions { display: flex; gap: 8px; }
body .as-did.is-done { background: var(--as-accent); border-color: var(--as-accent); color: var(--as-accent-fg); }
body .as-save[aria-pressed="true"] { background: var(--as-fg); color: var(--as-card); }
.as-single { margin: 0 0 1.5em; display: flex; flex-direction: column; gap: 12px; }
.as-single .as-media { max-width: 360px; max-height: 640px; }
/* Content tiers (0.6.6): Premium badge, locked placeholder (tap opens the Premium sheet), guest sign-up nudge. */
.as-badge { border-radius: 999px; padding: 4px 10px; font-size: .74rem; font-weight: 800; white-space: nowrap; letter-spacing: .02em; }
.as-badge--premium { background: linear-gradient(135deg, #ffcf5a, #ff8a3d); color: #2a1600; }
.as-card__top .as-badge--premium { margin-right: auto; }
.as-card__top .as-chip + .as-badge--premium { margin-left: -2px; }
.as-locked { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 0; padding: 24px; cursor: pointer; color: #f2f2f4; font: inherit; text-align: center; background: radial-gradient(120% 80% at 50% 20%, #3a2a18, #121216 70%); }
.as-locked__icon { font-size: 2.4rem; line-height: 1; }
.as-locked strong { font-size: 1.15rem; }
.as-locked span:last-child { color: #d8d2c8; font-size: .92rem; text-decoration: underline; text-underline-offset: 3px; }
.as-locked:focus-visible { outline: 3px solid var(--as-accent); outline-offset: -3px; }
.as-pathlist li[data-tier="premium"] .as-pathlist__lock::after { content: " Premium"; font-size: .7rem; font-weight: 800; color: #b35a00; }
.as-sheet { width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 0; border-radius: var(--as-radius); padding: 22px; background: var(--as-card); color: var(--as-fg); box-shadow: 0 20px 60px rgba(0,0,0,.35); font-family: var(--as-font); overflow-y: auto; }
.as-sheet::backdrop { background: rgba(10,10,14,.55); }
.as-sheet .as-pitch__title { color: var(--as-fg); font-family: var(--as-font); font-size: 1.45rem; line-height: 1.2; margin: 0; }
.as-sheet .as-pitch__kicker { margin: 0; font-weight: 700; color: var(--as-muted); }
.as-sheet .as-pitch__sub, .as-sheet .as-pitch__free { margin: 0; }
.as-sheet a:not(.as-btn) { color: var(--as-fg); }
.as-pitch__close { min-height: 48px; width: 100%; border-radius: 999px; border: 2px solid var(--as-line); background: transparent; color: var(--as-fg); font: inherit; font-weight: 700; cursor: pointer; padding: 12px 18px; }
.as-pitch__close:focus-visible { outline: 3px solid var(--as-accent); outline-offset: 2px; }
.as-nudge { position: absolute; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 20; width: min(420px, calc(100% - 24px)); background: var(--as-card); color: var(--as-fg); border: 1px solid var(--as-line); border-radius: 18px; box-shadow: var(--as-shadow); padding: 14px 16px; font-family: var(--as-font); }
.as-feed .as-nudge { position: fixed; }
.as-nudge[hidden] { display: none; }
.as-nudge__text { margin: 0 0 10px; font-weight: 600; font-size: .95rem; }
.as-nudge__row { display: flex; gap: 8px; flex-wrap: wrap; }
.as-nudge__row .as-btn { min-height: 44px; }
.as-slide.is-offpath { display: none; }

/* Paywall */
.as-perks { margin: 4px 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.as-perks li::before { content: "✓"; color: var(--as-accent); font-weight: 800; margin-right: 8px; }

/* Progress dots (mobile, right edge) */
.as-dots { position: fixed; right: 6px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 4; }
.as-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--as-muted); opacity: .35; }
.as-dots i.is-on { opacity: 1; background: var(--as-accent); height: 14px; border-radius: 4px; }

/* Saved page */
.as-saved { max-width: 560px; margin: 24px auto; }
.as-saved__list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.as-saved__list a { display: block; padding: 14px 16px; border-radius: 16px; background: var(--as-card); box-shadow: var(--as-shadow); color: var(--as-fg); text-decoration: none; font-weight: 700; }

/* ---------- Desktop: path panel | feed | progress panel ---------- */
.as-panel { display: none; }
.as-logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--as-accent); color: #fff; font-size: .7rem; margin-right: 8px; }
.as-top__brand { display: inline-flex; align-items: center; font-weight: 800; letter-spacing: -.02em; font-size: 1.1rem; color: var(--as-fg); text-decoration: none; }
.as-pcard { background: var(--as-card); border-radius: 20px; box-shadow: var(--as-shadow); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.as-pathlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
body .as-pathlist__btn { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--as-fg); }
body .as-pathlist__btn:hover { background: var(--as-bg); }
.as-pathlist__n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 800; background: var(--as-bg); color: var(--as-muted); }
.as-pathlist__t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-pathlist li.is-current .as-pathlist__btn { background: var(--as-bg); }
.as-pathlist li.is-current .as-pathlist__n { background: var(--as-fg); color: var(--as-card); }
.as-pathlist li.is-done .as-pathlist__n { background: var(--as-accent); color: #fff; }
.as-pathlist li.is-locked .as-pathlist__t { color: var(--as-muted); }
.as-meter { height: 6px; border-radius: 99px; background: var(--as-bg); overflow: hidden; }
.as-meter__bar { display: block; height: 100%; width: 0; background: var(--as-accent); transition: width .4s ease; }
.as-bignum { margin: 0; font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }
.as-bignum small { font-size: .9rem; color: var(--as-muted); font-weight: 600; letter-spacing: 0; }
.as-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.as-week i { font-style: normal; display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; background: var(--as-bg); font-size: .72rem; font-weight: 700; color: var(--as-muted); }
.as-week i.is-on { background: var(--as-accent); color: #fff; }
.as-savedmini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
body .as-savedmini button { all: unset; cursor: pointer; display: block; width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 10px; background: var(--as-bg); font-weight: 600; font-size: .9rem; color: var(--as-fg); }
.as-panel__nav { display: flex; gap: 16px; justify-content: flex-end; padding: 6px 4px; }
.as-panel__nav a { color: var(--as-fg); text-decoration: none; font-weight: 600; }

@media (min-width: 1024px) {
	.as-app { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(260px, 320px); height: 100vh; height: 100dvh; max-width: 1600px; margin: 0 auto; background: var(--as-bg); }
	.as-panel { display: flex; flex-direction: column; gap: 14px; padding: 22px 20px; height: 100vh; height: 100dvh; overflow-y: auto; scrollbar-width: thin; }
	.as-app .as-bar, .as-app .as-dots { display: none; }
	.as-app .as-slide { padding: 28px 16px; }
	.as-app .as-card { width: min(100%, 460px); }
	.as-app .as-media { max-height: calc(100dvh - 300px); }
}

/* 0.5.0: disclaimer at the end of the feed (last snap point). */
.as-feedfoot { scroll-snap-align: end; padding: 18px 16px 28px; text-align: center; }
.as-feedfoot .as-disclaimer { margin: 0 auto; max-width: 440px; font-size: .78rem; line-height: 1.45; color: var(--as-muted); }

/* Next-modules card (0.6.9) */
.as-next__list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.as-next__item { margin: 0; }
body .as-next__pick { min-height: 96px; height: 100%; gap: 4px; }
body .as-next__pick:focus-visible { outline-color: var(--as-fg); outline-offset: 2px; }
.as-next__emoji { font-size: 1.4rem; line-height: 1; }
.as-next__label { font-weight: 800; }
.as-next__meta { font-weight: 500; font-size: .82rem; color: var(--as-muted); }
body .as-next__dismiss { align-self: center; min-height: 44px; border-color: transparent; color: var(--as-muted); font-weight: 600; }
.as-next__title:focus { outline: none; }
@media (max-width: 380px) { .as-next__list { grid-template-columns: 1fr; } body .as-next__pick { min-height: 0; flex-direction: row; align-items: center; } }
@media (prefers-reduced-motion: reduce) { body .as-next__pick { transition: none; } }

/* 0.7.1: footer legal links + cookie banner (fullscreen feed). */
.as-feedfoot .as-legal { margin: 8px auto 0; max-width: 440px; font-size: .78rem; line-height: 1.7; color: var(--as-muted); text-align: center; }
.as-feedfoot .as-legal a { color: inherit; }

.as-cookie { position: fixed; z-index: 99999; left: 12px; right: 12px; bottom: 12px; max-width: 560px; margin: 0 auto; background: #1b1b20; color: #f2f2f4; border: 1px solid rgba(255,255,255,.14); border-radius: 18px; box-shadow: 0 12px 40px rgba(0,0,0,.35); padding: 14px 16px; font: 14px/1.45 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
.as-cookie__text { margin: 0 0 10px; color: #f2f2f4; }
.as-cookie__row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.as-cookie__btn { flex: 1 1 0; min-width: 88px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; border: 1px solid #f2f2f4; background: #f2f2f4; color: #16161a; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.as-cookie__choose { background: transparent; color: #f2f2f4; }
.as-cookie__details { flex-basis: 100%; text-align: center; color: #c9c9d1; font-size: .85rem; }
.as-cookie :focus-visible { outline: 3px solid #fb923c; outline-offset: 2px; }
