:root {
  --ink: #173a3a;
  --ink-2: #275252;
  --muted: #6c7d7a;
  --paper: #f7f5ef;
  --panel: #fffdf8;
  --line: #dedfd8;
  --line-strong: #c8ccc4;
  --accent: #ed6a45;
  --accent-dark: #cd5030;
  --mint: #dfeee8;
  --mint-2: #b9d9ce;
  --success: #24745e;
  --warning: #a45b16;
  --danger: #a23b32;
  --shadow: 0 18px 50px rgba(29, 55, 49, .09);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.login-page { min-height: 100vh; background: #e8eee9; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(420px, .8fr); }
.login-story { position: relative; overflow: hidden; min-height: 100vh; padding: 52px clamp(40px, 7vw, 100px); display: flex; flex-direction: column; justify-content: space-between; color: #f8f4e9; background: var(--ink); }
.login-story::before { content: ""; position: absolute; width: 600px; height: 600px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; left: -220px; bottom: -260px; box-shadow: 0 0 0 100px rgba(255,255,255,.025), 0 0 0 200px rgba(255,255,255,.018); }
.login-copy { position: relative; max-width: 760px; margin: auto 0; padding: 80px 0; z-index: 1; }
.login-copy h1 { max-width: 700px; margin: 10px 0 24px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(48px, 6.7vw, 94px); font-weight: 500; line-height: .97; letter-spacing: -.055em; }
.login-copy > p:last-child { max-width: 570px; font-size: 18px; line-height: 1.7; color: #c8d8d2; }
.paper-stack { position: absolute; right: 7%; bottom: 7%; width: 210px; height: 120px; transform: rotate(-4deg); opacity: .8; }
.paper-stack span { position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.23); border-radius: 5px; background: rgba(255,255,255,.055); }
.paper-stack span:nth-child(2) { transform: translate(12px, 12px); }
.paper-stack span:nth-child(3) { transform: translate(24px, 24px); }
.login-panel { display: grid; place-items: center; padding: 50px; background: var(--panel); }
.login-form { width: min(100%, 420px); display: grid; gap: 24px; }
.login-form h2 { margin: 5px 0 8px; font-family: Georgia, serif; font-size: 40px; font-weight: 500; letter-spacing: -.025em; }

.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 13px; color: white; background: var(--accent); font-family: Georgia, serif; font-weight: 700; font-size: 14px; letter-spacing: -.03em; box-shadow: 0 7px 18px rgba(237,106,69,.25); }
.brand span:last-child { min-width: 0; display: grid; gap: 2px; }
.brand strong { font-family: Georgia, serif; font-size: 20px; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: 11px; }
.brand-large .brand-mark { background: #f17b59; }
.brand-large small { color: #9db7ae; }

.eyebrow { margin: 0 0 6px; color: var(--accent-dark); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.login-story .eyebrow { color: #f2a78f; }
.muted { color: var(--muted); }
label { display: grid; gap: 8px; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 46px; border: 1px solid var(--line-strong); border-radius: 11px; padding: 11px 13px; color: var(--ink); background: white; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(39,82,82,.1); }
textarea { resize: vertical; line-height: 1.5; }
.form-error { margin: 0; padding: 11px 13px; color: var(--danger); border-radius: 10px; background: #fae7e2; font-size: 13px; }

.button { min-height: 42px; border: 1px solid transparent; border-radius: 11px; padding: 10px 17px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; font-size: 13px; font-weight: 800; transition: transform .15s, background .15s, border-color .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button.primary { color: white; background: var(--accent); box-shadow: 0 8px 20px rgba(237,106,69,.2); }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { color: var(--ink); border-color: var(--line-strong); background: white; }
.button.ghost { color: var(--muted); background: transparent; }
.button.wide { width: 100%; }
.button.small { min-height: 34px; padding: 7px 11px; font-size: 12px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 27px 18px 18px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #f1f0e9; z-index: 10; }
.sidebar .brand { padding: 0 10px 25px; }
.primary-nav { display: grid; gap: 5px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.nav-item { width: 100%; border: 0; border-radius: 10px; padding: 10px 12px; display: flex; align-items: center; gap: 11px; color: #506663; background: transparent; cursor: pointer; text-align: left; font-size: 13px; font-weight: 700; }
.nav-item:hover, .nav-item.active { color: var(--ink); background: #e3e7df; }
.nav-icon { width: 20px; text-align: center; font-size: 17px; }
.sidebar-section { padding: 22px 5px 10px; overflow: auto; }
.sidebar-heading { padding: 0 8px 9px; display: flex; justify-content: space-between; align-items: center; color: #7b8986; font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.icon-button { width: 28px; height: 28px; border: 0; border-radius: 8px; display: grid; place-items: center; color: var(--muted); background: transparent; cursor: pointer; font-size: 18px; }
.icon-button:hover { background: #dde2da; }
.folder-tree { display: grid; gap: 2px; }
.folder-button { width: 100%; min-height: 34px; border: 0; border-radius: 8px; padding: 7px 9px; display: flex; align-items: center; gap: 8px; color: #5d716d; background: transparent; cursor: pointer; text-align: left; font-size: 12px; font-weight: 650; }
.folder-button:hover, .folder-button.active { color: var(--ink); background: #e2e6df; }
.folder-button .folder-glyph { color: #94a49f; }
.folder-button[data-depth="1"] { padding-left: 24px; }
.folder-button[data-depth="2"] { padding-left: 39px; }
.folder-button[data-depth="3"] { padding-left: 52px; }
.sidebar-spacer { flex: 1; }
.budget-card { margin: 12px 5px; padding: 13px; border: 1px solid #d5dad2; border-radius: 13px; background: rgba(255,255,255,.5); }
.budget-line { display: flex; justify-content: space-between; font-size: 11px; }
.budget-line strong { color: var(--accent-dark); }
.meter, .progress-track { height: 5px; overflow: hidden; border-radius: 99px; background: #dfe2dc; }
.meter { margin: 9px 0 7px; }
.meter span, .progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .35s ease; }
.budget-card small { color: var(--muted); font-size: 10px; }
.account-button { width: 100%; border: 0; border-top: 1px solid var(--line); padding: 16px 8px 4px; display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; background: transparent; cursor: pointer; text-align: left; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--ink-2); font-weight: 800; }
.account-button span:last-child { min-width: 0; display: grid; }
.account-button strong { overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.account-button small { color: var(--muted); font-size: 10px; }

.main-content { min-width: 0; }
.topbar { height: 78px; padding: 16px clamp(20px, 4vw, 52px); display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); background: rgba(247,245,239,.88); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 5; }
.search-box { width: min(420px, 48vw); position: relative; }
.search-box > span { position: absolute; left: 14px; top: 11px; color: var(--muted); font-size: 20px; }
.search-box input { padding-left: 41px; min-height: 43px; border-color: transparent; background: #ecece6; }
.mobile-menu { display: none; border: 0; background: none; font-size: 22px; }
.view { padding: 42px clamp(22px, 4.4vw, 62px) 70px; }
.global-banner { margin: 18px clamp(22px, 4.4vw, 62px) 0; padding: 12px 16px; border: 1px solid #d4ddd7; border-radius: 12px; color: var(--ink-2); background: var(--mint); font-size: 12px; }
.hero-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(310px, .43fr); align-items: stretch; gap: 28px; }
.hero-row h1, .document-heading-row h1 { margin: 8px 0 14px; font-family: Georgia, serif; font-weight: 500; letter-spacing: -.04em; }
.hero-row h1 { max-width: 760px; font-size: clamp(38px, 4.4vw, 64px); line-height: 1.03; }
.hero-copy { max-width: 680px; color: var(--muted); line-height: 1.65; }
.drop-card { min-height: 170px; border: 1px dashed #9fb7ad; border-radius: var(--radius); padding: 24px; display: flex; align-items: center; justify-content: center; gap: 16px; color: var(--ink); background: var(--mint); cursor: pointer; text-align: left; transition: transform .15s, border-color .15s; }
.drop-card:hover { transform: translateY(-2px); border-color: var(--ink-2); }
.drop-card span:last-child { display: grid; gap: 5px; }
.drop-card small { color: var(--muted); }
.drop-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; color: white; background: var(--ink-2); font-size: 25px; }
.stats-grid { margin: 38px 0 50px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.stat-card { min-height: 122px; padding: 19px 21px; display: flex; flex-direction: column; justify-content: center; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.55); }
.stat-card strong { margin: 4px 0; font-family: Georgia, serif; font-size: 34px; font-weight: 500; }
.stat-card small { color: var(--muted); }
.stat-card.accent { border-color: #e7c6b9; background: #f7e7df; }
.stat-label { color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.library-section { margin-top: 10px; }
.section-title-row { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-title-row h2, .versions-layout h2 { margin: 3px 0 0; font-family: Georgia, serif; font-size: 31px; font-weight: 500; letter-spacing: -.025em; }
.view-switch { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.view-switch button { width: 32px; height: 30px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; cursor: pointer; }
.view-switch button.active { color: var(--ink); background: var(--mint); }
.document-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 18px; }
.document-card { min-height: 225px; position: relative; overflow: hidden; padding: 20px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); cursor: pointer; box-shadow: 0 8px 24px rgba(24,54,49,.035); transition: transform .16s, box-shadow .16s, border-color .16s; }
.document-card:hover { transform: translateY(-3px); border-color: var(--mint-2); box-shadow: var(--shadow); }
.document-card::after { content: ""; position: absolute; width: 110px; height: 110px; right: -42px; bottom: -48px; border-radius: 50%; background: var(--mint); }
.document-top { display: flex; align-items: center; justify-content: space-between; }
.document-file-icon { width: 40px; height: 48px; display: grid; place-items: center; border: 1px solid #e4c9bf; border-radius: 5px 12px 5px 5px; color: var(--accent-dark); background: #faeae4; font-family: Georgia, serif; font-size: 11px; font-weight: 800; }
.document-file-icon.course { width: 52px; border-color: #bfd5ca; color: var(--ink-2); background: var(--mint); font-size: 9px; letter-spacing: .06em; }
.status-pill { padding: 5px 8px; border-radius: 99px; color: var(--muted); background: #eceee9; font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.status-pill.complete, .status-pill.plan_ready { color: var(--success); background: #dff0e8; }
.status-pill.generating, .status-pill.analyzing { color: var(--warning); background: #f7e9d5; }
.status-pill.failed { color: var(--danger); background: #f7dfdc; }
.document-card h3 { margin: 21px 0 8px; font-family: Georgia, serif; font-size: 21px; font-weight: 500; line-height: 1.2; }
.document-card p { margin: 0; color: var(--muted); font-size: 12px; }
.document-card footer { position: relative; z-index: 1; margin-top: auto; padding-top: 18px; display: flex; justify-content: space-between; color: #82918e; font-size: 10px; }
.empty-state { margin-top: 20px; min-height: 280px; padding: 38px; display: grid; place-items: center; align-content: center; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: rgba(255,255,255,.35); }
.empty-state h3 { margin: 12px 0 6px; font-family: Georgia, serif; font-size: 24px; font-weight: 500; }
.empty-state p { margin: 0 0 20px; color: var(--muted); }
.empty-glyph { width: 52px; height: 64px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--accent-dark); background: white; font-family: Georgia, serif; }

.document-header { margin-bottom: 26px; }
.back-button { border: 0; padding: 0; color: var(--muted); background: none; cursor: pointer; font-size: 12px; font-weight: 700; }
.document-heading-row { margin-top: 24px; display: flex; justify-content: space-between; align-items: end; gap: 25px; }
.document-heading-row h1 { font-size: clamp(36px, 4vw, 56px); }
.document-heading-row p { margin: 0; }
.job-panel { margin: 28px 0; padding: 17px 20px; border: 1px solid #d8dfd9; border-radius: 14px; background: #eef4ef; }
.job-top, .job-top > div { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.job-top { font-size: 12px; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(237,106,69,.45); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(237,106,69,0); } 100% { box-shadow: 0 0 0 0 rgba(237,106,69,0); } }
.progress-track { margin: 12px 0 8px; height: 7px; }
.job-panel p { margin: 0; font-size: 11px; }
.tabs { display: flex; gap: 25px; border-bottom: 1px solid var(--line); }
.tab { border: 0; border-bottom: 2px solid transparent; padding: 13px 2px; color: var(--muted); background: transparent; cursor: pointer; font-size: 12px; font-weight: 800; }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.tab-panel { padding-top: 28px; }
.plan-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 34px; align-items: start; }
.plan-summary { position: sticky; top: 110px; padding: 22px; border: 1px solid #d5ddd7; border-radius: 15px; background: var(--mint); }
.summary-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--ink-2); font-size: 24px; }
.plan-summary h3 { margin: 18px 0 14px; font-family: Georgia, serif; font-size: 23px; font-weight: 500; }
.plan-summary dl { margin: 0; display: grid; gap: 10px; }
.plan-summary dl div { padding-bottom: 9px; display: grid; gap: 2px; border-bottom: 1px solid rgba(39,82,82,.12); }
.plan-summary dt { color: var(--muted); font-size: 10px; }
.plan-summary dd { margin: 0; font-weight: 800; font-size: 13px; }
.plan-summary p { margin: 16px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.plan-editor { margin-top: 18px; display: grid; gap: 10px; counter-reset: parts; }
.plan-item { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: start; border: 1px solid var(--line); border-radius: 13px; padding: 14px; background: var(--panel); }
.plan-number { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: var(--ink-2); background: var(--mint); font-family: Georgia, serif; font-size: 17px; }
.plan-fields { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 9px; }
.plan-fields .section-title { grid-column: 1; font-weight: 750; }
.plan-fields .section-pages { grid-column: 2; }
.plan-fields .section-instructions { grid-column: 1 / -1; min-height: 38px; font-size: 11px; }
.plan-tools { display: flex; gap: 3px; }
.plan-tools button { width: 28px; height: 28px; border: 0; border-radius: 7px; color: var(--muted); background: #f0f0eb; cursor: pointer; font-size: 12px; }
.plan-tools button:hover { color: var(--ink); background: var(--mint); }
.plan-actions { margin-top: 18px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.plan-actions span { font-size: 11px; }
.plan-loading { min-height: 180px; display: grid; place-items: center; color: var(--muted); }
.compare-toolbar { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.compare-toolbar p { margin: 0; color: var(--muted); font-size: 12px; }
.compare-toolbar div { display: flex; gap: 7px; }
.compare-grid { min-height: 650px; display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.pdf-pane { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #e8e9e4; }
.pdf-pane header { height: 48px; padding: 0 15px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); background: var(--panel); font-size: 12px; }
.pdf-pane header small { margin-left: auto; color: var(--muted); }
.source-picker { min-width: 0; max-width: 72%; min-height: 30px; margin-left: auto; padding: 4px 28px 4px 8px; border-color: var(--line); background: #f7f7f3; font-size: 10px; }
.source-dot, .after-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.after-dot { background: var(--success); }
.pdf-pane iframe { width: 100%; height: 650px; border: 0; background: white; }
.pdf-placeholder { height: 650px; display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); }
.pdf-placeholder span { color: var(--accent); font-size: 34px; }
.pdf-placeholder p { max-width: 250px; line-height: 1.5; }
.versions-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 35px; }
.versions-layout aside { padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.versions-layout aside h3 { margin: 4px 0 8px; font-family: Georgia, serif; font-size: 23px; font-weight: 500; }
.versions-list, .retouch-list { margin-top: 18px; display: grid; gap: 9px; }
.version-row, .retouch-row { padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.version-row strong, .retouch-row strong { display: block; font-size: 12px; }
.version-row small, .retouch-row small { color: var(--muted); font-size: 10px; }
.version-actions { display: flex; gap: 5px; }
.download-link { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 10px; font-weight: 800; }
.retouch-row button { border: 0; border-radius: 8px; padding: 7px 9px; color: var(--ink-2); background: var(--mint); cursor: pointer; font-size: 10px; font-weight: 800; }

.modal { width: min(600px, calc(100vw - 28px)); max-height: calc(100vh - 30px); border: 0; border-radius: 20px; padding: 0; color: var(--ink); background: transparent; box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(19,45,43,.5); backdrop-filter: blur(4px); }
.modal-card { position: relative; padding: 30px; display: grid; gap: 19px; background: var(--panel); }
.modal-card.compact { padding: 28px; }
.modal-card h2 { margin: 0; font-family: Georgia, serif; font-size: 31px; font-weight: 500; letter-spacing: -.025em; }
.modal-card > p { margin: -10px 0 0; line-height: 1.5; }
.modal-close { position: absolute; right: 16px; top: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; color: var(--muted); background: #efefe9; cursor: pointer; font-size: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.upload-zone { min-height: 180px; padding: 24px; display: grid; place-items: center; align-content: center; border: 1px dashed #9fb7ad; border-radius: 14px; background: var(--mint); cursor: pointer; text-align: center; }
.upload-zone input { position: absolute; opacity: 0; pointer-events: none; }
.upload-zone strong { margin-top: 10px; }
.upload-zone small { color: var(--muted); font-weight: 500; }
.upload-zone em { margin-top: 8px; color: var(--accent-dark); font-size: 10px; font-style: normal; }
.profile-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.profile-presets button { min-height: 83px; padding: 12px; display: grid; gap: 5px; place-content: center; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: white; cursor: pointer; font-weight: 800; }
.profile-presets button small { color: var(--muted); font-size: 9px; font-weight: 500; }
.profile-presets button.active { border-color: var(--ink-2); background: var(--mint); box-shadow: inset 0 0 0 1px var(--ink-2); }
.sliders { display: grid; gap: 12px; }
.sliders label { grid-template-columns: 140px minmax(0, 1fr) 20px; align-items: center; }
.sliders output { grid-column: 3; grid-row: 1; text-align: right; }
.sliders input { grid-column: 2; grid-row: 1; min-height: auto; padding: 0; accent-color: var(--accent); box-shadow: none; }
.check-row { grid-template-columns: auto minmax(0, 1fr); align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.check-row input { width: 18px; min-height: 18px; accent-color: var(--ink-2); }
.check-row span { display: grid; gap: 3px; }
.check-row small { color: var(--muted); font-weight: 500; }
.mode-card { padding: 13px; display: flex; align-items: center; gap: 12px; border-radius: 11px; background: #edf4ef; }
.mode-card div { display: grid; gap: 3px; }
.mode-card small { color: var(--muted); font-size: 10px; }
.field-help { margin-top: -5px; color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.45; }
.mode-badge { padding: 5px 7px; border-radius: 6px; color: var(--success); background: #d8ebe3; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 380px; z-index: 100; transform: translateY(20px); opacity: 0; pointer-events: none; padding: 13px 16px; border-radius: 11px; color: white; background: var(--ink); box-shadow: var(--shadow); font-size: 12px; transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }

@media (max-width: 1050px) {
  .document-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .hero-row { grid-template-columns: 1fr; }
  .drop-card { min-height: 120px; }
  .versions-layout { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-story { min-height: 47vh; padding: 30px; }
  .login-copy { padding: 50px 0 25px; }
  .login-copy h1 { font-size: clamp(42px, 12vw, 68px); }
  .paper-stack { display: none; }
  .login-panel { padding: 40px 24px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: 270px; transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: block; }
  .topbar { padding: 14px 20px; }
  .search-box { flex: 1; width: auto; }
  .view { padding: 30px 20px 60px; }
  .global-banner { margin: 14px 20px 0; }
  .stats-grid { grid-template-columns: 1fr; }
  .plan-layout { grid-template-columns: 1fr; }
  .plan-summary { position: static; }
  .compare-grid { grid-template-columns: 1fr; }
  .tabs { overflow-x: auto; }
  .tab { white-space: nowrap; }
}

@media (max-width: 580px) {
  .topbar .button.primary { width: 44px; padding: 8px; font-size: 0; }
  .topbar .button.primary span { font-size: 18px; }
  .document-grid { grid-template-columns: 1fr; }
  .document-heading-row { align-items: stretch; flex-direction: column; }
  .section-title-row { align-items: start; }
  .plan-item { grid-template-columns: 34px minmax(0, 1fr); }
  .plan-tools { grid-column: 2; justify-content: flex-end; }
  .plan-fields { grid-template-columns: 1fr; }
  .plan-fields .section-title, .plan-fields .section-pages, .plan-fields .section-instructions { grid-column: 1; }
  .plan-actions { align-items: stretch; flex-direction: column; }
  .profile-presets { grid-template-columns: 1fr; }
  .sliders label { grid-template-columns: 100px minmax(0,1fr) 20px; }
  .modal-card { padding: 26px 20px; }
  .compare-toolbar { align-items: flex-start; flex-direction: column; }
}
