:root {
  color-scheme: light;
  --paper: #f8f8f6;
  --surface: #fff;
  --ink: #28262d;
  --muted: #87858e;
  --line: #ecebf0;
  --purple: #7662c8;
  --purple-dark: #5e4caf;
  --lavender: #f2efff;
  --green: #638a6e;
  --shadow: 0 8px 28px rgba(47, 39, 74, .045), 0 1px 3px rgba(47, 39, 74, .035);
  font-family: "DM Sans", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 14px; }
button, input, textarea { font: inherit; }
button { color: inherit; }
.app-shell[hidden], .auth-screen[hidden], .google-button-wrap[hidden] { display: none; }
.skip-link, .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link:focus { width: auto; height: auto; clip: auto; margin: 8px; padding: 10px 14px; z-index: 10; background: #fff; border-radius: 8px; }
.app-shell { min-height: 100vh; }

/* Google sign-in */
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 12px; background: radial-gradient(ellipse at 50% 38%, #fff 0, #fbfafc 48%, #f5f3f8 100%); }
.auth-card { width: min(100%, 430px); padding: 38px 18px 30px; border: 1px solid #ebe8f0; border-radius: 16px; background: #fff; box-shadow: 0 16px 48px rgba(47, 39, 74, .08); text-align: center; }
.auth-brand { margin: 0 auto 34px; }
.auth-eyebrow { display: flex; align-items: center; justify-content: center; gap: 7px; margin-bottom: 12px; color: #9b96a4; font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.auth-card h1 { font-size: clamp(28px, 7vw, 36px); letter-spacing: -1.2px; }
.auth-copy { margin: 12px auto 25px; max-width: 320px; color: #88858e; font-size: 12px; line-height: 1.7; }
.google-button-wrap { min-height: 42px; display: flex; justify-content: center; }
.auth-message { min-height: 17px; margin: 13px 0 0; color: #8e4c4e; font-size: 10px; line-height: 1.5; }
.auth-privacy { margin: 16px 0 0; color: #aaa6b0; font-size: 9px; }

/* Sidebar */
.sidebar { width: 247px; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; padding: 26px 16px 18px; background: #fff; border-right: 1px solid #efedf2; z-index: 3; }
.brand { display: inline-flex; width: fit-content; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; margin: 1px 0 29px 7px; }
.brand-mark { width: 31px; height: 31px; display: grid; place-items: center; color: #fff; border-radius: 10px; background: #8673d1; box-shadow: 0 4px 9px #8673d144; }
.brand-mark svg { width: 21px; height: 21px; }
.brand-name { font: 800 19px/1 "Manrope", sans-serif; letter-spacing: -.9px; }
.brand-period { color: #927ee0; }
.nav-group-label { font-size: 9px; letter-spacing: 1.15px; font-weight: 700; color: #a5a3ad; padding: 0 11px; margin: 0 0 10px; }
.primary-nav { display: grid; gap: 4px; }
.nav-link { border: 0; width: 100%; height: 40px; display: flex; align-items: center; gap: 11px; padding: 0 11px; color: #77747f; background: transparent; border-radius: 8px; text-align: left; cursor: pointer; font-size: 12px; font-weight: 500; transition: background .18s, color .18s; }
.nav-link:hover { color: #4f4b5a; background: #faf9fc; }
.nav-link:disabled, .composer-mode:disabled { opacity: .6; cursor: wait; }
.nav-link.active { color: #6552b6; background: #f2effb; font-weight: 700; }
.nav-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linejoin: round; stroke-linecap: round; }
.nav-link.active svg { stroke-width: 1.8; }
.nav-link:nth-child(2) svg { fill: transparent; }
.nav-count { margin-left: auto; color: #aaa7b0; font-size: 10px; font-weight: 600; }
.active .nav-count { color: #8c7bc6; }

/* Main canvas */
.main-area { margin-left: 247px; min-height: 100vh; }
.topbar { height: 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(28px, 5vw, 72px); background: rgba(255,255,255,.7); border-bottom: 1px solid #efedf0; }
.breadcrumb { display: flex; align-items: center; gap: 10px; font-size: 10px; color: #aaa7af; letter-spacing: .4px; }
.breadcrumb span:first-child { font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.breadcrumb-slash { color: #d4d1d7; }
.breadcrumb strong { font-size: 11px; color: #605d67; letter-spacing: 0; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.account-control { display: flex; align-items: center; gap: 10px; }
.account-name { max-width: 170px; overflow: hidden; color: #77737f; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.signout-button { padding: 6px 9px; border: 1px solid #eae8ed; border-radius: 6px; color: #77737f; background: #fff; font-size: 9px; cursor: pointer; }
.signout-button:hover { border-color: #d9d4e6; color: #6552b6; }
.signout-button:disabled { opacity: .6; cursor: wait; }
.global-search { width: 220px; height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 9px; border: 1px solid #ecebf0; border-radius: 7px; background: #fff; }
.global-search svg { width: 15px; height: 15px; fill: none; stroke: #aaa6b2; stroke-width: 1.6; stroke-linecap: round; }
.global-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: #46434c; font-size: 10px; background: transparent; }
.global-search input::placeholder { color: #a6a3ad; }
.global-search kbd { border: 1px solid #e8e6eb; border-radius: 3px; padding: 1px 4px; color: #aaa7b0; font-size: 9px; background: #fbfafc; }
.theme-toggle { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; padding: 0; border: 1px solid #ecebf0; border-radius: 7px; color: #7662c8; background: #fff; cursor: pointer; }
.theme-toggle:hover { border-color: #d8d1f0; background: #faf9ff; }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.theme-picker-wrap { position: relative; }
.theme-menu { width: 178px; position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; padding: 8px; border: 1px solid #ecebf0; border-radius: 10px; background: #fff; box-shadow: 0 10px 30px rgba(47,39,74,.14); }
.theme-menu[hidden] { display: none; }
.theme-menu-title { display: block; padding: 5px 8px 8px; color: #87858e; font-size: 11px; font-weight: 700; }
.theme-option { width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px; border: 0; border-radius: 6px; color: #39363f; background: transparent; text-align: left; font-size: 12px; cursor: pointer; }
.theme-option:hover, .theme-option.selected { background: #f5f3fb; }
.theme-option i { width: 15px; height: 15px; border-radius: 50%; background: #8977d0; box-shadow: inset -4px 0 rgba(255,255,255,.45); }
.theme-option[data-theme-choice="ocean"] i { background: #37878b; }
.theme-option[data-theme-choice="forest"] i { background: #548568; }
.theme-option[data-theme-choice="sunset"] i { background: #d57b59; }
.theme-option[data-theme-choice="midnight"] i { background: #495a85; }
.avatar-button { width: 29px; height: 29px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #f0e8dc; color: #967044; font-size: 11px; font-weight: 700; cursor: pointer; }
.page-content { max-width: 1340px; margin: 0 auto; padding: 22px clamp(28px, 5vw, 72px) 25px; }
.top-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, .42fr); align-items: stretch; gap: 22px; margin-bottom: 22px; }
.welcome-row { min-height: 0; display: flex; align-items: center; position: relative; padding: 22px 8px; }
.eyebrow, .section-kicker { color: #9b96a4; font-size: 9px; font-weight: 700; letter-spacing: 1.3px; }
.eyebrow { display: flex; align-items: center; gap: 7px; margin-bottom: 13px; }
.eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: #9a88dc; }
h1 { margin: 0; color: #2b2831; font: 800 clamp(30px, 3.25vw, 43px)/1.18 "Manrope", sans-serif; letter-spacing: -1.8px; }
.heading-period { color: #8977d0; }
.heading-soft { color: #9b96a5; font-weight: 500; }
.welcome-copy { margin: 11px 0 0; color: #88858e; font-size: 12px; }
.welcome-art { width: 215px; height: 158px; position: relative; margin: -5px 24px 0 0; }
.art-orbit { position: absolute; border: 1px solid #f0edf7; border-radius: 50%; transform: rotate(-19deg); }
.orbit-one { width: 182px; height: 97px; top: 32px; left: 11px; }
.orbit-two { width: 142px; height: 131px; top: 17px; left: 31px; transform: rotate(32deg); }
.art-note { position: absolute; box-shadow: 0 6px 15px #4f3f7212; border-radius: 5px; display: flex; flex-direction: column; }
.art-note span { font: 700 10px "Manrope", sans-serif; }
.art-note i { width: 48px; height: 2px; border-radius: 5px; background: #594e3e1a; margin-top: 5px; }
.art-note-yellow { width: 69px; height: 72px; padding: 11px 9px; top: 48px; left: 44px; background: #ffefbb; transform: rotate(-9deg); }
.art-note-yellow i:last-child { width: 34px; }
.art-note-lilac { width: 76px; height: 86px; padding: 13px 10px; top: 28px; left: 110px; color: #675a8b; background: #eeebff; transform: rotate(7deg); }
.art-note-lilac i { background: #675a8b20; }
.art-note-lilac i:last-child { width: 38px; }
.art-star { position: absolute; color: #c2a867; }
.star-a { top: 24px; left: 87px; font-size: 17px; }
.star-b { top: 101px; right: 4px; color: #aaa0d8; font-size: 12px; }
.art-dot { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #c9bee8; }
.dot-a { top: 39px; left: 25px; }
.dot-b { bottom: 20px; right: 34px; width: 4px; height: 4px; background: #e5c97b; }

/* Ask composer */
.ask-panel { width: 100%; max-width: none; margin: 0; position: relative; padding: 21px 23px 17px; border: 1px solid #ebe8f0; border-radius: 12px; background: #fff; box-shadow: 0 7px 24px rgba(48, 38, 80, .055), 0 1px 3px rgba(48, 38, 80, .035); }
.composer-heading { display: flex; align-items: flex-start; flex-direction: column; gap: 12px; padding-bottom: 8px; }
.ask-panel-top { display: flex; align-items: center; gap: 10px; padding-bottom: 11px; }
.composer-heading .ask-panel-top { padding-bottom: 0; }
.composer-modes { display: flex; align-items: center; align-self: flex-start; gap: 3px; padding: 3px; border: 1px solid #eeecf2; border-radius: 8px; background: #faf9fc; }
.composer-mode { height: 34px; padding: 0 15px; border: 0; border-radius: 6px; color: #817d89; background: transparent; font-size: 12px; font-weight: 600; cursor: pointer; }
.composer-mode.active { color: #5f4dac; background: #fff; box-shadow: 0 1px 4px #30284414; }
.ask-orb { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; background: #f0edfd; color: #8773d0; }
.ask-orb svg { width: 16px; height: 16px; fill: currentColor; }
.ask-panel-top > div { display: grid; gap: 3px; }
.ask-panel-top strong { font-size: 12px; }
.ask-panel-top span:not(.ask-orb) { color: #a09da5; font-size: 10px; }
#question-input { width: 100%; min-height: 59px; resize: vertical; border: 0; outline: 0; padding: 5px 3px 8px; color: #38353e; font-size: 13px; line-height: 1.55; background: transparent; }
#question-input::placeholder { color: #b0adb6; }
.note-title-input { width: 100%; height: 32px; margin: 6px 0 2px; border: 0; outline: 0; color: #38353e; font: 700 13px "Manrope", sans-serif; background: transparent; }
.note-title-input:focus { box-shadow: inset 0 -1px #c9bee8; }
.note-title-input::placeholder { color: #b0adb6; font-weight: 500; }
.note-title-input[hidden], .suggestions[hidden] { display: none; }
.ask-form-bottom { display: flex; align-items: center; justify-content: flex-start; gap: 18px; border-top: 1px solid #f1eff3; padding-top: 13px; }
.ask-hints { display: flex; align-items: center; gap: 10px; color: #aaa7b0; font-size: 9px; }
.web-search-badge { display: flex; align-items: center; gap: 5px; color: #777183; }
.web-search-badge svg { width: 13px; height: 13px; fill: none; stroke: #8e81c2; stroke-width: 1.5; stroke-linecap: round; }
.hint-divider { height: 11px; width: 1px; background: #eae8ed; }
.ask-button { min-width: 112px; height: 36px; display: flex; align-items: center; justify-content: center; padding: 0 10px; color: #fff; border: 0; border-radius: 7px; background: #7966c5; box-shadow: 0 3px 7px #7966c530; font-size: 10px; font-weight: 700; cursor: pointer; transition: background .18s, transform .18s, box-shadow .18s; }
.ask-button:hover { background: #6854b6; transform: translateY(-1px); box-shadow: 0 5px 12px #7966c544; }
.ask-button:disabled { opacity: .74; cursor: wait; transform: none; }
.suggestions { max-width: 820px; display: flex; align-items: center; gap: 7px; margin: 13px auto 33px; flex-wrap: wrap; }
.suggestions-label { color: #aaa6b0; font-size: 8px; font-weight: 700; letter-spacing: 1px; margin-right: 3px; }
.suggestion-chip { padding: 6px 10px; border: 1px solid #eae8ed; border-radius: 20px; background: rgba(255,255,255,.5); color: #7c7884; font-size: 9px; cursor: pointer; transition: all .16s; }
.suggestion-chip:hover { color: #6552b6; border-color: #d6cff0; background: #fff; }

/* Saved board */
.board-section { min-height: 240px; }
.board-heading-row { min-height: 50px; display: flex; justify-content: space-between; align-items: end; padding-bottom: 14px; border-bottom: 1px solid #eae8ed; }
.section-kicker { font-size: 8px; margin-bottom: 7px; }
.board-heading-row h2 { display: flex; align-items: center; gap: 7px; margin: 0; color: #39363f; font: 700 17px "Manrope", sans-serif; letter-spacing: -.3px; }
.board-heading-row h2 span { display: grid; place-items: center; min-width: 20px; height: 18px; padding: 0 5px; border-radius: 6px; background: #f0eef3; color: #928d9c; font: 600 9px "DM Sans", sans-serif; }
.board-controls { display: flex; align-items: center; gap: 15px; padding-bottom: 1px; }
.board-search-row { display: flex; justify-content: flex-start; margin: 13px 0 0; }
.board-search-row .global-search { width: min(100%, 360px); height: 40px; }
.saved-label { display: flex; align-items: center; gap: 5px; color: #9996a0; font-size: 9px; }
.saved-check { width: 13px; height: 13px; display: grid; place-items: center; border: 1px solid #d9e9dc; border-radius: 50%; color: #72a27d; font-size: 8px; }
.sort-button { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border: 1px solid #eae8ed; border-radius: 6px; background: #fff; color: #6f6b76; font-size: 9px; cursor: pointer; }
.sort-button svg { width: 13px; height: 13px; fill: none; stroke: #9c98a2; stroke-width: 1.5; stroke-linecap: round; }
.sort-button .sort-chevron { width: 11px; margin-left: 3px; }
.sort-button:hover { border-color: #d9d4e6; }
.board-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; padding-top: 16px; }
.question-card { --tone: #9280ce; display: flex; flex-direction: column; min-height: 252px; position: relative; overflow: hidden; padding: 15px 15px 12px; border: 1px solid #eceaf0; border-radius: 10px; background: #fff; box-shadow: 0 2px 8px rgba(49, 40, 73, .025); transition: transform .18s, box-shadow .18s, border-color .18s; }
.question-card:hover { transform: translateY(-2px); box-shadow: 0 9px 22px rgba(49, 40, 73, .07); border-color: #e3deee; }
.card-accent { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--tone); opacity: .65; }
.card-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; color: #aaa6b1; font-size: 8px; font-weight: 700; letter-spacing: .55px; }
.card-meta-left { display: flex; align-items: center; gap: 6px; }
.card-meta-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--tone); }
.card-tools { display: flex; align-items: center; gap: 3px; margin: -5px -5px -5px 0; }
.icon-button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 6px; color: #b0acb6; background: transparent; cursor: pointer; transition: all .15s; }
.icon-button:hover { background: #f6f4fa; color: #6855b4; }
.icon-button:disabled { opacity: .45; cursor: not-allowed; }
.icon-button:disabled:hover { color: #b0acb6; background: transparent; }
.icon-button.danger:hover { color: #b85e63; background: #fcf0f0; }
.icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linejoin: round; stroke-linecap: round; }
.icon-button.favorite.is-favorite { color: #d1a94f; }
.icon-button.favorite.is-favorite svg { fill: #f7e9c2; stroke: #c59c43; }
.question-label { display: flex; align-items: center; gap: 5px; color: #a09ba7; font-size: 8px; font-weight: 700; letter-spacing: .75px; text-transform: uppercase; margin-bottom: 5px; }
.question-card h3 { margin: 0; color: #36323d; font: 700 14px/1.4 "Manrope", sans-serif; letter-spacing: -.25px; }
.question-original { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin: 5px 0 0; color: #9995a0; font-size: 9px; line-height: 1.45; }
.note-body { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 8; -webkit-box-orient: vertical; margin: 9px 0 12px; color: #716d78; font-size: 11px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.answer-copy { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 4; -webkit-box-orient: vertical; margin: 10px 0 11px; color: #716d78; font-size: 10px; line-height: 1.6; }
.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 11px; }
.card-category { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 5px; color: #7b748a; background: #f5f3fa; font-size: 8px; }
.category-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--tone); }
.card-reading-time { color: #b0acb5; font-size: 8px; }
.empty-state { min-height: 290px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 35px 20px; text-align: center; }
.empty-illustration { position: relative; width: 96px; height: 84px; margin-bottom: 13px; }
.empty-card { position: absolute; display: block; width: 58px; height: 68px; border: 1px solid #e9e5f1; border-radius: 7px; box-shadow: 0 5px 13px #5145720e; }
.empty-card-back { top: 10px; left: 14px; background: #f2eeff; transform: rotate(-12deg); }
.empty-card-front { top: 7px; left: 32px; display: flex; flex-direction: column; gap: 5px; padding: 16px 9px; background: #fff; transform: rotate(7deg); }
.empty-card-front i { width: 36px; height: 3px; border-radius: 4px; background: #eeebf4; }
.empty-card-front i:first-child { width: 25px; background: #dcd5f1; }
.empty-card-front i:last-child { width: 27px; }
.empty-sun { position: absolute; z-index: 1; right: 2px; top: -2px; color: #c7a85f; font-size: 19px; }
.empty-state h3 { margin: 0; font: 700 15px "Manrope", sans-serif; letter-spacing: -.3px; }
.empty-state p { max-width: 350px; margin: 7px 0 14px; color: #918d98; font-size: 10px; line-height: 1.65; }
.empty-ask { border: 0; color: #7160bc; background: transparent; font-size: 10px; font-weight: 700; cursor: pointer; }
.empty-ask span { display: inline-grid; place-items: center; margin-left: 4px; width: 17px; height: 17px; border-radius: 50%; background: #f0edfa; }
.no-results { grid-column: 1/-1; display: grid; place-items: center; min-height: 190px; color: #96919c; font-size: 11px; }
.page-footer { display: flex; justify-content: space-between; color: #aaa6b0; font-size: 9px; padding: 30px 0 6px; }
.page-footer span:last-child span { color: #a394d9; padding-left: 4px; }
.note-editor { width: min(560px, calc(100vw - 28px)); max-height: min(88vh, 720px); padding: 0; overflow: auto; border: 1px solid #ebe8f0; border-radius: 14px; color: var(--ink); background: #fff; box-shadow: 0 22px 80px #3028442a; }
.note-editor::backdrop { background: #27233270; backdrop-filter: blur(2px); }
.note-editor form { display: grid; gap: 12px; padding: 21px; }
.note-editor-heading { display: flex; align-items: start; justify-content: space-between; }
.note-editor-heading h2 { margin: 5px 0 2px; font: 700 20px "Manrope", sans-serif; }
.note-editor-heading .section-kicker { margin: 0; }
.editor-field { display: grid; gap: 6px; }
.editor-field[hidden] { display: none; }
.editor-field > label { color: #77737f; font-size: 10px; font-weight: 600; }
.note-editor input, .note-editor textarea { width: 100%; border: 1px solid #ebe8f0; border-radius: 8px; outline: 0; padding: 11px 12px; color: #38353e; background: #fff; font-size: 12px; }
.note-editor input:focus, .note-editor textarea:focus { border-color: #bcb0e6; box-shadow: 0 0 0 3px #f3f0fc; }
.note-editor textarea { resize: vertical; line-height: 1.65; }
.note-editor-actions { display: flex; justify-content: end; align-items: center; gap: 8px; }
.editor-cancel { height: 36px; padding: 0 13px; border: 1px solid #eae8ed; border-radius: 7px; color: #77737f; background: #fff; font-size: 10px; font-weight: 600; cursor: pointer; }
.note-editor .ask-button { min-width: auto; }
.note-editor button:disabled { opacity: .6; cursor: wait; }
.toast { position: fixed; z-index: 5; right: 24px; bottom: 22px; max-width: min(390px, calc(100vw - 32px)); padding: 11px 15px; border: 1px solid #e7e2ee; border-radius: 8px; color: #554d65; background: #fff; box-shadow: 0 8px 24px #30284418; font-size: 11px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { color: #8e4c4e; border-color: #f1dedd; }
.skeleton { animation: breathe 1.5s ease-in-out infinite; }
.skeleton .skeleton-line { height: 9px; border-radius: 5px; background: #f0eef3; margin: 10px 0; }
.skeleton .skeleton-line.short { width: 60%; }
.skeleton .skeleton-line.medium { width: 82%; }
.skeleton .skeleton-answer { height: 52px; border-radius: 5px; background: #f7f6f8; margin: 14px 0; }
.loading-label { color: #8674ce; font-size: 9px; font-weight: 700; }

@keyframes breathe { 50% { opacity: .52; } }

@media (max-width: 1150px) {
  .board-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .welcome-art { margin-right: 0; }
}
@media (max-width: 820px) {
  .sidebar { width: 204px; padding-inline: 12px; }
  .main-area { margin-left: 204px; }
  .topbar { padding-inline: 25px; }
  .page-content { padding-inline: 25px; }
  .welcome-art { width: 160px; transform: scale(.85); transform-origin: right center; margin-left: -20px; }
  .board-controls .saved-label { display: none; }
}
@media (max-width: 760px) {
  .welcome-art { display: none; }
}
@media (max-width: 660px) {
  .page-content { padding-top: 18px; }
  .top-layout { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 18px; }
  .welcome-row { padding: 10px 3px 2px; }
  .welcome-row h1 { font-size: clamp(25px, 7vw, 32px); }
  .welcome-row .eyebrow { margin-bottom: 7px; }
  .welcome-copy { margin-top: 6px; }
  .sidebar { position: relative; width: 100%; height: auto; inset: auto; display: grid; grid-template-columns: 1fr auto; gap: 0; padding: 14px 18px 10px; border-right: 0; border-bottom: 1px solid #efedf2; }
  .brand { margin: 0; }
  .nav-group-label { display: none; }
  .sidebar-library-nav { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 4px; overflow-x: auto; padding-top: 10px; scrollbar-width: none; }
  .sidebar-library-nav::-webkit-scrollbar { display: none; }
  .nav-link { width: auto; height: 32px; gap: 6px; padding: 0 9px; font-size: 10px; }
  .sidebar-library-nav .nav-link { flex: 0 0 auto; }
  .nav-link svg { width: 14px; height: 14px; }
  .nav-count { display: none; }
  .main-area { margin-left: 0; }
  .topbar { height: 52px; padding-inline: 18px; }
  .topbar-right { gap: 9px; }
  .account-control { gap: 6px; }
  .account-name { display: none; }
  .global-search { width: min(43vw, 190px); height: 31px; }
  .global-search kbd { display: none; }
  .board-search-row { justify-content: stretch; margin-top: 10px; }
  .board-search-row .global-search { width: 100%; height: 40px; }
  .page-content { padding: 18px 18px 20px; }
  .welcome-row { min-height: auto; padding: 10px 3px 2px; }
  h1 { font-size: clamp(29px, 8vw, 39px); }
  .welcome-copy { font-size: 11px; }
  .welcome-art { width: 106px; height: 118px; margin: 0 -9px 0 -12px; transform: scale(.69); transform-origin: right center; flex: 0 0 106px; }
  .eyebrow { font-size: 7px; letter-spacing: .9px; }
  .ask-panel { padding: 15px 14px 12px; }
  .composer-heading { align-items: start; flex-direction: column; gap: 10px; }
  .composer-modes { width: fit-content; }
  .composer-mode { flex: 0 0 auto; }
  #question-input { min-height: 66px; }
  .ask-button { min-width: 110px; height: 34px; }
  .suggestions { margin-bottom: 27px; gap: 6px; }
  .suggestions-label { width: 100%; margin-bottom: 1px; }
  .suggestion-chip { font-size: 8px; padding: 6px 8px; }
  .board-heading-row h2 { font-size: 15px; }
  .board-heading-row { align-items: end; }
  .section-kicker { font-size: 7px; }
  .board-grid { grid-template-columns: 1fr; gap: 10px; }
  .question-card { min-height: 0; }
  .question-original { -webkit-line-clamp: 3; }
  .answer-copy { -webkit-line-clamp: 5; }
  .page-footer { font-size: 8px; gap: 14px; }
}
@media (max-width: 390px) {
  .welcome-art { display: none; }
  .topbar .breadcrumb { font-size: 9px; }
  .global-search { width: 155px; }
  .page-footer span:last-child { display: none; }
  .ask-hints { gap: 6px; }
  .ask-button { min-width: 100px; gap: 5px; }
}

/* Readable type scale */
.auth-eyebrow, .eyebrow, .section-kicker, .nav-group-label,
.card-meta, .question-label, .suggestions-label { font-size: 10px; }
.auth-copy, .welcome-copy, .ask-panel-top span:not(.ask-orb), .ask-hints,
.saved-label, .sort-button, .question-original, .answer-copy,
.empty-state p, .page-footer, .toast { font-size: 12px; }
.auth-message, .signout-button, .suggestion-chip, .empty-ask,
.card-category, .card-reading-time, .editor-field > label { font-size: 11px; }
.auth-privacy { font-size: 11px; }
.nav-link { font-size: 13px; }
.nav-count, .breadcrumb { font-size: 11px; }
.breadcrumb span:first-child { font-size: 10px; }
.breadcrumb strong, .account-name { font-size: 12px; }
.global-search input { font-size: 12px; }
.ask-panel-top strong { font-size: 14px; }
#question-input { font-size: 15px; }
.note-title-input { font-size: 15px; }
.ask-button { font-size: 12px; }

/* Alternate ocean palette */
:root[data-theme="ocean"] {
  --paper: #f1f7f6;
  --surface: #ffffff;
  --ink: #26373a;
  --muted: #77898b;
  --line: #dce8e7;
  --purple: #37878b;
  --purple-dark: #286d72;
  --lavender: #e4f2f0;
  --green: #4e8a78;
}
:root[data-theme="ocean"] body { background: var(--paper); color: var(--ink); }
:root[data-theme="ocean"] .sidebar,
:root[data-theme="ocean"] .auth-card,
:root[data-theme="ocean"] .ask-panel,
:root[data-theme="ocean"] .question-card,
:root[data-theme="ocean"] .note-editor { border-color: var(--line); background-color: var(--surface); }
:root[data-theme="ocean"] .topbar { border-color: var(--line); background: rgba(255,255,255,.82); }
:root[data-theme="ocean"] .nav-link.active { color: var(--purple-dark); background: var(--lavender); }
:root[data-theme="ocean"] .active .nav-count { color: var(--purple); }
:root[data-theme="ocean"] .brand-mark,
:root[data-theme="ocean"] .ask-button { background: #37878b; }
:root[data-theme="ocean"] .brand-period,
:root[data-theme="ocean"] .heading-period { color: #37878b; }
:root[data-theme="ocean"] .ask-orb { color: #37878b; background: #e4f2f0; }
:root[data-theme="ocean"] .composer-mode.active { color: #286d72; }
:root[data-theme="ocean"] .theme-toggle { color: #37878b; border-color: #dce8e7; }
:root[data-theme="ocean"] .theme-toggle:hover { border-color: #b9d7d4; background: #f3faf9; }
:root[data-theme="ocean"] .signout-button:hover,
:root[data-theme="ocean"] .suggestion-chip:hover { color: #286d72; }
:root[data-theme="forest"] { --paper:#f2f7f1; --surface:#fff; --ink:#29372c; --muted:#788779; --line:#dfe8dc; --purple:#548568; --purple-dark:#3b684d; --lavender:#e8f1e5; --green:#548568; }
:root[data-theme="forest"] body { background:var(--paper); color:var(--ink); }
:root[data-theme="forest"] .sidebar, :root[data-theme="forest"] .auth-card, :root[data-theme="forest"] .ask-panel, :root[data-theme="forest"] .question-card, :root[data-theme="forest"] .note-editor { border-color:var(--line); background-color:var(--surface); }
:root[data-theme="forest"] .topbar { border-color:var(--line); background:rgba(255,255,255,.82); }
:root[data-theme="forest"] .nav-link.active { color:var(--purple-dark); background:var(--lavender); }
:root[data-theme="forest"] .brand-mark, :root[data-theme="forest"] .ask-button { background:#548568; }
:root[data-theme="forest"] .brand-period, :root[data-theme="forest"] .heading-period { color:#548568; }
:root[data-theme="forest"] .ask-orb { color:#548568; background:#e8f1e5; }
:root[data-theme="sunset"] { --paper:#fbf4ef; --surface:#fff; --ink:#3c302d; --muted:#927e77; --line:#f0dfd7; --purple:#d57b59; --purple-dark:#a95339; --lavender:#fbe9df; --green:#638a6e; }
:root[data-theme="sunset"] body { background:var(--paper); color:var(--ink); }
:root[data-theme="sunset"] .sidebar, :root[data-theme="sunset"] .auth-card, :root[data-theme="sunset"] .ask-panel, :root[data-theme="sunset"] .question-card, :root[data-theme="sunset"] .note-editor { border-color:var(--line); background-color:var(--surface); }
:root[data-theme="sunset"] .topbar { border-color:var(--line); background:rgba(255,255,255,.82); }
:root[data-theme="sunset"] .nav-link.active { color:var(--purple-dark); background:var(--lavender); }
:root[data-theme="sunset"] .brand-mark, :root[data-theme="sunset"] .ask-button { background:#d57b59; }
:root[data-theme="sunset"] .brand-period, :root[data-theme="sunset"] .heading-period { color:#d57b59; }
:root[data-theme="sunset"] .ask-orb { color:#d57b59; background:#fbe9df; }
:root[data-theme="midnight"] { --paper:#20283a; --surface:#293349; --ink:#eff2fa; --muted:#aab5cb; --line:#3b4760; --purple:#a9a2f2; --purple-dark:#d4d0ff; --lavender:#39435e; --green:#80b59a; color-scheme:dark; }
:root[data-theme="midnight"] body { background:var(--paper); color:var(--ink); }
:root[data-theme="midnight"] .sidebar, :root[data-theme="midnight"] .auth-card, :root[data-theme="midnight"] .ask-panel, :root[data-theme="midnight"] .question-card, :root[data-theme="midnight"] .note-editor { border-color:var(--line); background-color:var(--surface); }
:root[data-theme="midnight"] .topbar { border-color:var(--line); background:rgba(41,51,73,.94); }
:root[data-theme="midnight"] .nav-link.active { color:#dedbff; background:#39435e; }
:root[data-theme="midnight"] .brand-mark, :root[data-theme="midnight"] .ask-button { background:#756dd0; }
:root[data-theme="midnight"] .brand-period, :root[data-theme="midnight"] .heading-period { color:#b7b2ff; }
:root[data-theme="midnight"] .ask-orb { color:#c0bcff; background:#39435e; }
:root[data-theme="midnight"] .theme-menu { border-color:var(--line); background:var(--surface); }
:root[data-theme="midnight"] .theme-option { color:var(--ink); }
:root[data-theme="midnight"] .theme-option:hover, :root[data-theme="midnight"] .theme-option.selected { background:#39435e; }
:root[data-theme="midnight"] .global-search, :root[data-theme="midnight"] .signout-button, :root[data-theme="midnight"] .theme-toggle { border-color:var(--line); color:var(--ink); background:var(--surface); }
:root[data-theme="midnight"] .global-search input, :root[data-theme="midnight"] #question-input, :root[data-theme="midnight"] .note-title-input { color:var(--ink); }
.board-heading-row h2 { font-size: 19px; }
.board-heading-row h2 span { font-size: 11px; }
.question-card h3 { font-size: 16px; }
.note-body { font-size: 12px; }
.empty-state h3 { font-size: 17px; }
.note-editor input, .note-editor textarea { font-size: 13px; }

@media (max-width: 660px) {
  .nav-link { font-size: 12px; }
  .ask-form-bottom { flex-direction: column; align-items: stretch; gap: 10px; }
  .ask-hints { flex-wrap: wrap; }
  .ask-form-bottom .ask-button { align-self: flex-start; }
  .eyebrow { font-size: 9px; }
  .suggestion-chip { font-size: 10px; }
  .board-heading-row h2 { font-size: 17px; }
  .section-kicker { font-size: 9px; }
  .page-footer { font-size: 10px; }
}

/* Slightly larger type across the interface */
body { font-size: 16px; }
.auth-eyebrow, .eyebrow, .section-kicker, .nav-group-label,
.card-meta, .question-label, .suggestions-label { font-size: 12px; }
.auth-copy, .welcome-copy, .ask-panel-top span:not(.ask-orb), .ask-hints,
.saved-label, .sort-button, .question-original, .answer-copy,
.empty-state p, .page-footer, .toast { font-size: 14px; }
.auth-message, .signout-button, .suggestion-chip, .empty-ask,
.card-category, .card-reading-time, .editor-field > label { font-size: 13px; }
.auth-privacy { font-size: 13px; }
.nav-link { font-size: 15px; }
.nav-count, .breadcrumb { font-size: 13px; }
.breadcrumb span:first-child { font-size: 12px; }
.breadcrumb strong, .account-name { font-size: 14px; }
.global-search input { font-size: 14px; }
.ask-panel-top strong { font-size: 17px; }
#question-input, .note-title-input { font-size: 18px; }
.ask-button { font-size: 14px; }
h1 { font-size: clamp(36px, 3.9vw, 52px); }
.board-heading-row h2 { font-size: 23px; }
.question-card h3 { font-size: 19px; }
.note-body { font-size: 14px; }
.empty-state h3 { font-size: 20px; }
.note-editor input, .note-editor textarea { font-size: 16px; }
