/* Cekot palette (blueprint §12): canvas, surface, ink, muted, CTA. Light mode only. */
:root {
  --canvas: #DEDFE9;
  --surface: #FFFFFF;
  --ink: #2E2657;
  --muted: #625B7F;
  --line: #E3E1EE;
  --cta: #5B46C8;
  --cta-hover: #4936A8;
  --focus: #7D6BFC;
  color-scheme: light;
  font: 16px/1.5 system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

body { margin: 0; }

.inbox {
  max-width: 40rem;
  margin: 1.5rem auto;
  padding: 1.25rem;
  background: var(--surface);
  border-radius: 16px;
}

header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding-bottom: 1rem;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.75rem; line-height: 1.2; }
h2 { font-size: 1.25rem; line-height: 1.3; }
h3 { font-size: 1rem; }
#mailbox, #sender, .help, #loading, #status, #detail-status, .notice p { color: var(--muted); overflow-wrap: anywhere; }

button, a.primary {
  min-height: 44px;
  font: inherit;
  border-radius: 12px;
  cursor: pointer;
}

.primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  margin-top: .75rem;
  padding: .6rem 1rem;
  color: #fff;
  background: var(--cta);
  border: 0;
  font-weight: 600;
  text-decoration: none;
}
.primary:hover { background: var(--cta-hover); }
.primary:disabled { background: var(--muted); cursor: default; }

.text {
  padding: .5rem 0;
  color: var(--cta);
  background: none;
  border: 0;
  font-weight: 600;
}
#more { display: block; margin: .5rem auto 0; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
a { color: var(--cta); overflow-wrap: anywhere; }

.notice { margin-top: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 16px; }
.notice p { margin-top: .35rem; }
#loading, #status, #detail-status { margin-top: .75rem; }

#messages { list-style: none; margin: .75rem 0 0; padding: 0; }
#messages li { border-top: 1px solid var(--line); }
#messages li:last-child { border-bottom: 1px solid var(--line); }
#messages button {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .15rem .75rem;
  width: 100%;
  padding: .75rem .25rem;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 0;
  text-align: left;
}
#messages button:hover { background: #F5F4FA; }
#messages .from { font-weight: 700; overflow-wrap: anywhere; }
#messages .time { color: var(--muted); font-size: .875rem; white-space: nowrap; }
#messages .subject { grid-column: 1 / -1; color: var(--ink); overflow-wrap: anywhere; }

.help { margin-top: 1.25rem; font-size: .875rem; }

#detail { margin-top: .25rem; }
#subject { margin-top: .75rem; font-size: 1.5rem; overflow-wrap: anywhere; }
#sender { margin-top: .25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
#body { margin-top: 1rem; white-space: pre-wrap; overflow-wrap: anywhere; }
#links { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
#link-list { list-style: none; margin: .5rem 0 0; padding: 0; }
#link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-height: 44px;
  margin-top: .5rem;
  padding: .5rem .9rem;
  color: var(--cta);
  border: 1px solid var(--cta);
  border-radius: 12px;
  text-decoration: none;
}
#link-list a::after { content: '↗'; }

[hidden] { display: none !important; }

@media (max-width: 42rem) {
  .inbox { margin: 0; min-height: 100vh; border-radius: 0; }
}
