:root {
  color-scheme: light;
  --bg: #f6f5fa; --surface: #fff; --nav: #fff; --ink: #211c35; --muted: #625a75;
  --line: #ebe7f1; --accent: #5c3bb6; --solid: #5434ad; --white: #fff;
  --lilac: #eee7ff; --mint: #e1f5e9; --peach: #fceadf; --green: #235d46; --orange: #8b4530;
  --shadow: 0 10px 30px #33205308;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171520; --surface: #23202e; --nav: #211e2c; --ink: #f4efff; --muted: #c0b7d0;
  --line: #383244; --accent: #d0baff; --solid: #6845c7;
  --lilac: #3b2d59; --mint: #233f36; --peach: #4a3028; --green: #9cdec0; --orange: #ffc4a8;
  --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #171520; --surface: #23202e; --nav: #211e2c; --ink: #f4efff; --muted: #c0b7d0;
    --line: #383244; --accent: #d0baff; --solid: #6845c7;
    --lilac: #3b2d59; --mint: #233f36; --peach: #4a3028; --green: #9cdec0; --orange: #ffc4a8;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink); }
button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
a, button { touch-action: manipulation; }
a:active, button:active { opacity: .68; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip:focus { position: absolute; z-index: 5; background: var(--surface); padding: 12px; }
.bar { padding-top: env(safe-area-inset-top); background: var(--nav); border-bottom: 1px solid var(--line); }
.bar-inner, .navigation > div, .shell { width: min(100%, 1120px); margin: auto; padding-inline: max(24px, env(safe-area-inset-left)) max(24px, env(safe-area-inset-right)); }
.bar-inner { min-height: 70px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; gap: 10px; align-items: center; min-height: 44px; font-size: 22px; font-weight: 800; letter-spacing: -.045em; margin-right: auto; }
.brand img { border-radius: 12px; }
.brand-hub { color: var(--accent); margin-left: .12em; }
.demo-label { font-size: .75rem; font-weight: 650; color: var(--muted); background: var(--bg); padding: 6px 9px; border-radius: 99px; white-space: nowrap; }
.avatar, .icon-control { border: 0; min-width: 44px; min-height: 44px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--accent); background: var(--lilac); font-weight: 750; flex-shrink: 0; }
.icon-control { font-size: 24px; background: var(--bg); cursor: pointer; }
.avatar.small { min-width: 36px; min-height: 36px; }
.navigation { background: var(--nav); border-bottom: 1px solid var(--line); }
.navigation > div { display: flex; gap: 6px; }
.navigation a { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 49px; padding: 0 13px; font-size: .88rem; color: var(--muted); font-weight: 650; }
.navigation a[aria-current] { color: var(--accent); box-shadow: inset 0 -3px var(--accent); }
.navigation a span { font-size: 1.24rem; line-height: 1; }
.shell { padding-top: 28px; padding-bottom: 34px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -.055em; line-height: 1.04; overflow-wrap: anywhere; }
h2 { font-size: clamp(1.07rem, 2vw, 1.26rem); letter-spacing: -.025em; }
p { line-height: 1.55; }
.hero { position: relative; overflow: hidden; isolation: isolate; padding: clamp(23px, 4.5vw, 51px); border-radius: 28px; background: linear-gradient(112deg,#2e1b57 0%,#422679 61%,#624298 100%); color: #fff; }
.hero-copy { position: relative; z-index: 1; }
.eyebrow { color: var(--accent); font-weight: 750; letter-spacing: .07em; font-size: .76rem; text-transform: uppercase; margin-bottom: 8px; }
.hero .eyebrow { color: #e3ceff; }
.hero h1 span, .demo-panel h1 span { color: #c7a8ff; }
.hero p + .button { margin-top: 20px; }
.hero h1 + p { margin-top: 10px; color: #f0e6fa; max-width: 34ch; }
.hero .primary { background: #f0e6ff; color: #412472; }
.hero-art { position: absolute; inset: 0 0 0 51%; pointer-events: none; overflow: hidden; }
.hero-art i { width: 320px; height: 130px; border-radius: 50%; border: 2px solid #e4c1ff66; position: absolute; top: 46%; right: 7%; transform: translateY(-50%) rotate(-34deg); }
.hero-art i:nth-child(2) { transform: translateY(-50%) rotate(37deg); background: #b787ee1a; }
.hero-art i:nth-child(3) { transform: translateY(-50%) rotate(85deg); }
.hero-art b { position: absolute; color: #e7ccff; font-size: 3.6rem; right: 27%; top: 25%; }
.hero-art b:last-child { top: 13%; right: 12%; font-size: 1.6rem; }
.dashboard { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); padding: 18px; border-radius: 22px; box-shadow: var(--shadow); min-width: 0; overflow-wrap: anywhere; }
.card.wide { grid-column: 1 / -1; }
.card-head { display: flex; align-items: center; gap: 10px; }
.card-head h2 { flex: 1; }
.card-head a, .back { min-height: 44px; display: inline-flex; align-items: center; color: var(--accent); font-size: .86rem; font-weight: 700; }
.tile, .datebox { display: grid; place-content: center; text-align: center; flex-shrink: 0; width: 42px; height: 42px; border-radius: 13px; background: var(--lilac); color: var(--accent); font-size: 1.28rem; }
.datebox { min-height: 46px; font-size: .7rem; line-height: 1.12; }
.datebox b { font-size: 1.13rem; }
.mint { background: var(--mint); color: var(--green); }
.peach { background: var(--peach); color: var(--orange); }
.row { display: flex; align-items: center; min-height: 58px; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border: 0; padding-bottom: 3px; }
.row strong { font-size: .94rem; font-weight: 700; }
.dav-list .row .grow, .dav-name { min-width: 0; overflow-wrap: anywhere; }
.dav-actions { display: flex; flex-wrap: wrap; justify-content: end; column-gap: 10px; }
.dav-tap { display: inline-flex; align-items: center; min-height: 44px; touch-action: manipulation; }
.dav-tap:active { opacity: .65; }
.dav-preview { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .95rem; }
.dav-image { display: block; max-width: 100%; max-height: 70vh; object-fit: contain; margin-inline: auto; }
.grow { min-width: 0; flex: 1; }
small { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; }
.chip { display: inline-block; padding: 5px 8px; border-radius: 20px; font-size: .72rem; font-weight: 700; }
.shared { background: var(--mint); color: var(--green); }
.private { background: var(--lilac); color: var(--accent); }
.quick { justify-content: space-between; }
.quick > span:last-child, .pickup-row > span:last-child { color: var(--accent); font-size: 1.19rem; }
.empty, .card > p, .footnote, .hint { color: var(--muted); font-size: .92rem; margin: 8px 0; }
.post { align-items: flex-start; }
.post p { margin-top: 5px; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; font-weight: 720; font-size: .9rem; padding: 8px 15px; border: 0; border-radius: 12px; cursor: pointer; }
.primary { background: var(--solid); color: var(--white); }
.secondary { background: var(--lilac); color: var(--accent); }
.danger { background: var(--peach); color: var(--orange); }
.card > .button { margin-top: 9px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.page-head h1 + p { margin-top: 8px; color: var(--muted); }
.narrow { max-width: 660px; }
.stacked { margin-top: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.history { margin: 12px 0 0; padding-inline-start: 20px; }
.history li { margin-block: 8px; }
.segmented { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.segmented a { padding: 0 14px; min-height: 44px; display: grid; place-items: center; border-radius: 10px; }
.segmented a[aria-current] { color: var(--accent); background: var(--lilac); font-weight: 700; }
.editor label { font-weight: 650; }
.editor p { margin: 12px 0; }
.editor p > label { display: block; margin-bottom: 4px; }
.editor > .button { margin: 10px 0; }
input:not([type=checkbox],[type=hidden]), textarea, select { width: 100%; min-width: 0; max-width: 100%; min-height: 44px; font-size: max(16px, 1rem); padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
textarea { display: block; resize: vertical; }
.editor input[type=checkbox] { accent-color: var(--accent); width: 19px; height: 19px; vertical-align: middle; }
.editor label:has(input[type=checkbox]) { display: flex; min-height: 44px; gap: 7px; align-items: center; }
.inline-form { display: flex; gap: 8px; margin-bottom: 6px; }
.check { width: 44px; height: 44px; border-radius: 13px; border: 0; background: var(--mint); color: var(--green); cursor: pointer; font-size: 1.2rem; }
.completed { text-decoration: line-through; color: var(--muted); }
.alerts > div { background: var(--mint); color: var(--green); padding: 11px 14px; border-radius: 12px; margin-bottom: 12px; }
.errorlist { color: var(--orange); padding-inline-start: 24px; }
.guest .shell { display: grid; min-height: 100svh; place-items: center; padding-block: max(24px, env(safe-area-inset-top)); }
.demo-panel { max-width: 480px; padding: clamp(20px,5vw,42px); background: var(--surface); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); }
.demo-panel img { border-radius: 20px; margin-bottom: 16px; }
.demo-panel h1 + p { margin-top: 12px; color: var(--muted); }
.demo-panel .login-error { margin-top: 14px; padding: 10px 12px; border-radius: 12px; color: var(--orange); background: var(--peach); }
.personas { display: grid; gap: 7px; margin-top: 20px; }
.personas button { cursor: pointer; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 15px; padding: 7px; display: flex; gap: 10px; align-items: center; text-align: left; }
.end { margin-left: auto; margin-right: 7px; color: var(--accent); }
@media (hover: hover) and (pointer: fine) {
  .quick:hover, .pickup-row:hover, .navigation a:hover { color: var(--accent); }
  .button:hover, .personas button:hover { filter: brightness(.94); }
}
@media (max-width: 680px) {
  .bar-inner, .shell { padding-inline: max(15px, env(safe-area-inset-left)) max(15px, env(safe-area-inset-right)); }
  .bar-inner { min-height: 60px; gap: 7px; }
  .brand { gap: 7px; font-size: 19px; }
  .brand img { width: 34px; height: 34px; }
  .shell { padding-top: 16px; padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
  .dashboard { grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
  .card { padding: 14px; border-radius: 18px; }
  .hero { border-radius: 21px; }
  .hero-art { opacity: .38; inset-inline-start: 62%; }
  .hero-art i { right: -95px; }
  .navigation { position: fixed; z-index: 3; bottom: 0; left: 0; right: 0; border-top: 1px solid var(--line); border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
  .navigation > div { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); padding-inline: env(safe-area-inset-left) env(safe-area-inset-right); gap: 0; }
  .navigation a { flex-direction: column; gap: 3px; min-height: 58px; font-size: clamp(.62rem, 2.7vw, .79rem); padding: 3px 0; }
  .navigation a[aria-current] { box-shadow: inset 0 3px var(--accent); }
  .navigation-sso > div { grid-template-columns: repeat(5,minmax(0,1fr)); }
}

.mail-layout { display: grid; grid-template-columns: 186px minmax(0,1fr); gap: 15px; align-items: start; }
.mail-folders { display: grid; padding: 8px; gap: 4px; }
.mail-folders a { display: flex; align-items: center; min-height: 44px; padding: 8px 13px; font-weight: 680; border-radius: 12px; font-size: .88rem; white-space: nowrap; }
.mail-folders a[aria-current] { background: var(--lilac); color: var(--accent); }
.mail-list { padding: 16px; }
.mail-list .inline-form button { flex: 0 0 auto; }
.mail-row { display: flex; gap: 11px; align-items: center; padding: 12px 9px; border-radius: 12px; border-bottom: 1px solid var(--line); }
.mail-unread { background: var(--bg); }
.mail-row .mail-line { display: grid; gap: 4px; flex: 1; min-width: 0; }
.mail-meta { display: flex; gap: 8px; justify-content: space-between; font-size: .81rem; color: var(--muted); align-items: baseline; }
.mail-meta time { flex: 0 0 auto; font-size: .72rem; }
.mail-dot { display: inline-block; margin: 0 5px 1px 0; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.mail-unread .mail-meta > span { color: var(--accent); font-weight: 750; }
.mail-row strong { font-size: .95rem; }
.mail-pages { align-items: center; justify-content: space-between; }
.mail-message, .mail-editor { max-width: 800px; }
.mail-message h1 { font-size: clamp(1.55rem,4vw,2.45rem); }
.mail-message .mail-body { margin: 20px 0; white-space: pre-wrap; color: var(--ink); font-size: 1rem; line-height: 1.65; }
.mail-sender { padding-top: 15px; }
.mail-files { border: 1px solid var(--line); padding: 12px; border-radius: 12px; }
.mail-actions { margin-top: 22px; }
.mail-addresses { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
.mail-full { grid-column: 1/-1; }
.mail-editor fieldset { border: 1px solid var(--line); border-radius: 12px; }
.mail-editor input[type=file]::file-selector-button { padding: 7px 9px; border: 0; border-radius: 7px; color: var(--accent); background: var(--lilac); }
@media (hover: hover) and (pointer: fine) {
  .mail-row:hover, .mail-folders a:hover { background: var(--lilac); }
}
@media (max-width: 680px) {
  .mail-layout { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .mail-folders { display: flex; overflow-x: auto; overscroll-behavior-inline: contain; }
  .mail-list { padding: 10px; }
  .mail-composing .navigation { display: none; }
  .mail-composing .shell { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .mail-composing .mail-editor { min-height: 60dvh; }
}
