:root {
  color-scheme: light;
  --ink: #111525;
  --muted: #536079;
  --line: #dfe5ef;
  --paper: #fff;
  --ground: #f2f5fa;
  --blue: #2b50dc;
  --blue-dark: #1536b6;
  --wash: #eef2ff;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--ground);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #527aff; outline-offset: 3px; }
.shell { width: min(100% - 64px, 1390px); margin: 0 auto; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-size: 23px; font-weight: 760; letter-spacing: -.06em; }
.brand > span:last-child { color: var(--blue); margin-left: -4px; }
.mark { position: relative; width: 32px; height: 32px; border-radius: 10px; background: var(--blue); display: inline-grid; place-items: center; flex: none; }
.mark::before { content: ""; width: 16px; height: 11px; border: 1.5px solid #fff; border-radius: 3px; }
.mark::after { content: ""; width: 8px; height: 8px; border: solid #fff; border-width: 0 1.5px 1.5px 0; position: absolute; top: 8px; transform: rotate(45deg); }
.landing { display: grid; grid-template-columns: 1.2fr 1fr; min-height: min(630px, calc(100vh - 105px)); background: var(--paper); border: 1px solid var(--line); border-radius: 25px; overflow: hidden; margin-bottom: 28px; }
.hero { min-width: 0; position: relative; isolation: isolate; overflow: hidden; background: #101d57; color: #fff; padding: clamp(32px, 5vw, 80px); }
.hero h1 { font-size: clamp(48px, 6.4vw, 105px); letter-spacing: -.085em; line-height: .96; margin: 0; }
.hero p { max-width: 27rem; font-size: clamp(16px, 1.55vw, 21px); color: #d4defc; line-height: 1.55; margin: 26px 0 0; }
.art { position: absolute; inset: auto 0 0 0; height: min(46%, 285px); z-index: -1; pointer-events: none; }
.orbit { position: absolute; width: 85%; aspect-ratio: 1; border: 1px solid #6a8bff75; border-radius: 50%; right: -18%; top: 0; box-shadow: 0 0 0 44px #5880fd0e, 0 0 0 90px #5880fd09; }
.outgoing { position: absolute; height: 1px; background: #a5b7f6; width: 44%; left: 8%; top: 60%; transform: rotate(-16deg); opacity: .5; }
.envelope { width: 32%; max-width: 222px; aspect-ratio: 1.48; border-radius: 16px; background: linear-gradient(145deg, #7c9cff, #4f69f5); position: absolute; right: 20%; top: 21%; transform: rotate(-16deg); overflow: hidden; box-shadow: 0 20px 42px #09113875, inset 0 1px #d2dbffad; }
.envelope div { position: absolute; width: 74%; aspect-ratio: 1; top: -78%; left: 13%; border-radius: 18px; background: #9cb4ff; transform: rotate(45deg); box-shadow: 6px 6px 18px #203b9c66; }
.access { width: min(100%, 520px); padding: clamp(30px, 5.1vw, 72px); margin: auto; }
h2 { margin: 0; font-size: clamp(26px, 3vw, 38px); line-height: 1.12; letter-spacing: -.055em; }
.access p, dialog p { margin: 11px 0 23px; color: var(--muted); line-height: 1.5; }
.toggle { background: var(--ground); padding: 4px; display: flex; align-items: stretch; gap: 3px; margin-bottom: 34px; border-radius: 12px; }
.toggle button { width: 50%; border: 0; background: transparent; color: var(--muted); padding: 9px 7px; border-radius: 9px; font-weight: 650; font-size: 14px; }
.toggle button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 5px #0e2b6022; }
label { display: block; color: var(--ink); font-size: 14px; font-weight: 680; margin: 0 0 7px; }
input, textarea { width: 100%; min-width: 0; min-height: 46px; border: 1px solid #cbd5e6; border-radius: 10px; padding: 10px 13px; background: var(--paper); color: var(--ink); margin: 0 0 16px; }
input::placeholder { color: #68748a; opacity: 1; }
textarea { resize: vertical; }
.address-field { display: flex; align-items: center; border: 1px solid #cbd5e6; border-radius: 10px; margin-bottom: 16px; padding-right: 13px; }
.address-field input { border: 0; margin: 0; }
.address-field:focus-within { outline: 2px solid #527aff; }
.address-field input:focus-visible { outline: none; }
.address-field span { font-size: 14px; color: var(--muted); flex: none; }
.primary { min-height: 44px; border: 0; border-radius: 10px; background: var(--blue); color: #fff; padding: 11px 16px; font-weight: 660; }
.primary:hover { background: var(--blue-dark); }
.wide { width: 100%; }
.quiet, .text-button, .copy { min-height: 38px; padding: 6px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--blue-dark); font-weight: 620; }
.quiet:hover, .text-button:hover, .copy:hover { background: var(--wash); }
.text-button { display: block; margin: 8px auto 0; }
#challenge:not(:empty) { margin: 2px 0 12px; }
.error, dialog .error, .access .error { color: #972329; margin: 2px 0 12px; font-size: 14px; }
.mailbox { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; min-height: calc(100vh - 105px); padding-bottom: 24px; }
.sidebar, .mail-content { border: 1px solid var(--line); background: var(--paper); border-radius: 18px; }
.sidebar { padding: 15px; }
.identity { display: flex; align-items: center; gap: 8px; margin: 5px 0 20px; min-width: 0; }
.identity div { min-width: 0; }
.identity p { margin: 0; color: var(--muted); font-size: 13px; }
.initial { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--wash); color: var(--blue-dark); font-weight: 700; flex: none; }
.copy { padding: 1px 2px; text-align: left; min-height: 24px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
#compose { width: 100%; text-align: left; }
.folders { display: grid; gap: 3px; margin-top: 18px; }
.folders button { width: 100%; min-height: 41px; padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; gap: 4px; border: 0; border-radius: 8px; text-align: left; color: var(--muted); background: transparent; }
.folders button:hover, .folders [aria-current="page"] { background: var(--wash); color: var(--blue-dark); }
.folders [aria-current="page"] { font-weight: 680; }
#unread { background: #d7e2ff; border-radius: 6px; padding: 1px 6px; font-size: 13px; }
.mail-content { display: grid; grid-template-columns: minmax(235px, .85fr) minmax(0, 1.15fr); overflow: hidden; }
.mail-list { min-width: 0; border-right: 1px solid var(--line); }
.folder-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 17px 16px 6px; }
.folder-head h1 { font-size: clamp(20px, 2vw, 28px); margin: 0; letter-spacing: -.05em; }
.search { padding: 0 16px; }
.search input { background: var(--ground); min-height: 37px; border: 0; margin: 8px 0; }
#list-status { padding: 0 16px; color: var(--muted); }
#list-status:empty { display: none; }
#messages { list-style: none; padding: 0; margin: 6px 0 0; max-height: calc(100dvh - 235px); overflow: auto; }
.message { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 12px; text-align: left; padding: 12px 16px; border: 0; border-top: 1px solid var(--line); width: 100%; background: transparent; color: var(--ink); }
.message span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.message time, .message .subject { color: var(--muted); font-size: 14px; }
.message .subject { grid-column: 1 / -1; }
.message:hover, .message[aria-pressed="true"] { background: var(--wash); }
.message.unread .from, .message.unread .subject { font-weight: 730; }
.reader { min-width: 0; padding: 22px; }
.empty-reader { min-height: 40vh; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); }
.empty-mark { opacity: .78; }
.actions, .dialog-head { display: flex; align-items: center; gap: 7px; margin-bottom: 16px; flex-wrap: wrap; }
.dialog-head { justify-content: space-between; }
#back { display: none; }
#letter h2 { margin: 12px 0; overflow-wrap: anywhere; }
#letter-sender, #letter-date { font-size: 14px; color: var(--muted); margin: 4px 0; overflow-wrap: anywhere; }
#letter-body { margin: 20px 0; overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.55; }
.notice { color: var(--muted); background: var(--ground); border-radius: 8px; padding: 9px; font-size: 14px; }
.danger { color: #972329; }
dialog { border: 1px solid var(--line); border-radius: 17px; padding: clamp(18px, 5vw, 28px); max-width: min(520px, 94vw); width: 100%; color: var(--ink); }
dialog::backdrop { background: #0a14388f; }
dialog h2 { font-size: 26px; }
.announcement { position: fixed; bottom: 12px; max-width: calc(100vw - 22px); left: 50%; transform: translateX(-50%); background: #141e40; color: #fff; border-radius: 12px; padding: 10px 15px; box-shadow: 0 8px 24px #17204547; z-index: 2; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 900px) {
  .mailbox { grid-template-columns: 180px minmax(0,1fr); }
  .mail-content { grid-template-columns: 1fr; }
  .mail-list { border: 0; }
  .reader { display: none; }
  .message-open .mail-list { display: none; }
  .message-open .reader, #back { display: block; }
}
@media (max-width: 660px) {
  .shell { width: calc(100% - 24px); }
  .topbar { height: 62px; }
  .landing, .mailbox { grid-template-columns: 1fr; }
  .hero { padding: 27px 23px; min-height: 287px; }
  .hero h1 { font-size: clamp(43px, 11vw, 64px); }
  .hero p { font-size: 16px; width: min(21rem, 78%); margin-top: 17px; }
  .art { height: 35%; opacity: .65; }
  .access { padding: 24px 18px; }
  .toggle { margin-bottom: 25px; }
  .sidebar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 11px; }
  .identity { margin: 0; }
  .folders { grid-column: 1 / -1; display: flex; margin: 0; }
  .folders button { flex: 1; font-size: 13px; padding: 6px; }
  #messages { max-height: none; }
  .reader { padding: 14px; }
}
