:root {
    color-scheme: light;
    --ink: #183337;
    --muted: #5c7074;
    --line: #dce4e2;
    --canvas: #f3f5f2;
    --paper: #ffffff;
    --accent: #126453;
    --accent-hover: #0b4c3e;
    --soft: #e7f1ec;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { color: var(--accent-hover); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #ad6900; outline-offset: 4px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .55rem; font-size: clamp(1.9rem, 4vw, 2.75rem); line-height: 1.2; letter-spacing: -.035em; font-weight: 650; overflow-wrap: anywhere; }
h2 { margin: 0; font-size: 1rem; font-weight: 650; }
h3 { margin-bottom: .55rem; font-size: 1.25rem; }
.skip-link { position: fixed; top: .75rem; left: 1rem; transform: translateY(-200%); z-index: 3; padding: .7rem 1rem; background: var(--paper); border: 2px solid var(--accent); border-radius: .4rem; }
.skip-link:focus { transform: translateY(0); }
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1240px; min-height: 92px; margin: 0 auto; padding: 1rem 2.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { color: var(--ink); display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; font-size: 1.3rem; font-weight: 700; line-height: 1.25; }
.brand-mark { display: grid; place-items: center; width: 43px; height: 43px; flex: 0 0 auto; border-radius: 12px; background: var(--accent); color: white; font-size: 1.5rem; font-weight: 650; }
.brand-description { display: block; margin-top: .15rem; color: var(--muted); font-size: .72rem; font-weight: 500; letter-spacing: .02em; }
.header-nav { display: flex; align-items: center; gap: 1.5rem; font-size: .88rem; font-weight: 600; }
.header-nav > a { color: var(--ink); text-decoration: none; }
.header-nav > a:hover { text-decoration: underline; }
.header-nav form { margin: 0; }
.page-shell { max-width: 1240px; min-height: calc(100vh - 185px); margin: 0 auto; padding: 3.25rem 2.5rem 4rem; }
.page-shell:focus { outline: none; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-bottom: 2rem; }
.eyebrow { margin-bottom: .65rem; color: var(--accent); font-size: .72rem; line-height: 1.4; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.page-intro { color: var(--muted); margin-bottom: 0; font-size: .98rem; }
.page-indicator { flex: 0 0 auto; color: var(--muted); font-size: .8rem; border: 1px solid var(--line); border-radius: 30px; padding: .3rem .75rem; }
.inbox-panel, .message-panel, .metadata-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: 0 3px 10px #18333704; }
.panel-heading { padding: 1.25rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }
.panel-heading > span { color: var(--muted); font-size: .78rem; }
.inbox-table { width: 100%; border-collapse: collapse; text-align: left; table-layout: fixed; }
.inbox-table thead { background: #fafbf9; }
.inbox-table th { padding: .8rem 1.5rem; color: var(--muted); font-size: .72rem; font-weight: 600; }
.inbox-table th:first-child { width: 33%; }
.inbox-table th:nth-child(2) { width: 21%; }
.inbox-table th:nth-child(3) { width: 22%; }
.inbox-table th:nth-child(4) { width: 18%; }
.inbox-table th:last-child { width: 6%; padding-left: 0; padding-right: 1.25rem; }
.inbox-table td { padding: 1.25rem 1.5rem; border-top: 1px solid var(--line); font-size: .85rem; vertical-align: middle; overflow-wrap: anywhere; }
.inbox-table tbody tr:first-child td { border-top: 0; }
.inbox-table tbody tr:hover { background: #fbfcfa; }
.submission-link { color: var(--ink); font-weight: 650; text-decoration: none; }
.submission-link:hover { text-decoration: underline; }
.sender-email { display: block; margin-top: .15rem; color: var(--muted); font-size: .8rem; }
.time-detail { display: block; color: var(--muted); font-size: .76rem; }
.status-badge { display: inline-flex; align-items: center; gap: .4rem; border-radius: 30px; padding: .25rem .7rem; color: #205f4c; background: var(--soft); font-size: .72rem; font-weight: 650; white-space: normal; overflow-wrap: anywhere; }
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #408a6e; flex: 0 0 auto; }
.inbox-table .open-cell { padding-left: 0; padding-right: 1.25rem; text-align: right; }
.open-cell a { display: inline-flex; justify-content: center; align-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-size: 1rem; }
.open-cell a:hover { background: var(--soft); }
.pagination { border-top: 1px solid var(--line); padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .8rem; }
.pagination-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .8rem; min-height: 42px; padding: .6rem 1rem; border: 1px solid transparent; border-radius: 7px; text-decoration: none; font-size: .85rem; font-weight: 650; cursor: pointer; transition: background-color .15s; }
.button-primary { background: var(--accent); color: white; }
.button-primary:hover { background: var(--accent-hover); color: white; }
.button-secondary { background: var(--paper); border-color: var(--line); color: var(--ink); }
.button-secondary:hover { color: var(--ink); background: var(--soft); }
.button-quiet { background: #f3f5f2; border-color: var(--line); color: var(--muted); min-height: 38px; padding: .4rem .85rem; }
.button-quiet:hover { background: var(--soft); color: var(--ink); }
.button-wide { width: 100%; justify-content: space-between; padding: .85rem 1rem; }
.empty-state { padding: 4.5rem 1.5rem; text-align: center; }
.empty-state p { max-width: 420px; margin: 0 auto; color: var(--muted); font-size: .9rem; }
.empty-symbol { display: grid; place-items: center; height: 58px; width: 58px; margin: 0 auto 1.25rem; background: var(--soft); color: var(--accent); border-radius: 16px; font-size: 2rem; }
.back-link { display: inline-block; margin-bottom: 1.75rem; font-size: .85rem; text-decoration: none; font-weight: 600; }
.back-link:hover { text-decoration: underline; }
.detail-heading { align-items: flex-start; }
.detail-heading > .status-badge { margin-top: 1.85rem; flex: 0 0 auto; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.5rem; align-items: start; }
.message-content { padding: 1.75rem; min-height: 250px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .98rem; line-height: 1.85; }
.metadata-panel { padding: 1.5rem; }
.metadata-panel h2 { margin-bottom: 1.4rem; }
.metadata-list { margin: 0; }
.metadata-list > div { margin-bottom: 1.25rem; }
.metadata-list dt { color: var(--muted); font-size: .72rem; margin-bottom: .25rem; }
.metadata-list dd { margin: 0; font-size: .85rem; overflow-wrap: anywhere; }
.metadata-list .reference { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .73rem; line-height: 1.7; }
.metadata-note { border-top: 1px solid var(--line); padding-top: 1rem; margin-bottom: 0; color: var(--muted); font-size: .73rem; line-height: 1.6; }
.auth-card { max-width: 475px; margin: 3rem auto 5rem; background: var(--paper); padding: 2.5rem; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px #18333706; }
.auth-card h1 { font-size: 2rem; }
.auth-intro { color: var(--muted); font-size: .95rem; margin: 1.15rem 0 1.75rem; }
.auth-note { color: var(--muted); margin: 1.4rem 0 0; font-size: .78rem; }
.notice { padding: 3rem 2rem; text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.notice-symbol { display: grid; place-items: center; height: 42px; width: 42px; border-radius: 50%; margin: 0 auto 1rem; background: #fff1d9; color: #825111; font-size: 1.2rem; font-weight: 700; }
.notice h1, .notice h2 { font-size: 1.4rem; line-height: 1.35; }
.notice p { max-width: 500px; margin: .8rem auto 1.5rem; color: var(--muted); font-size: .9rem; }
.site-footer { max-width: 1240px; padding: 1.25rem 2.5rem; margin: 0 auto; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .7rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; border: 0; padding: 0; white-space: nowrap; clip-path: inset(50%); overflow: hidden; }

@media (max-width: 900px) {
    .header-inner, .page-shell, .site-footer { padding-left: 1.5rem; padding-right: 1.5rem; }
    .inbox-table th, .inbox-table td { padding-left: 1rem; padding-right: 1rem; }
    .inbox-table th:first-child { width: 30%; }
    .inbox-table th:nth-child(2) { width: 22%; }
    .inbox-table th:nth-child(3) { width: 23%; }
    .inbox-table th:nth-child(4) { width: 19%; }
    .detail-grid { grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (max-width: 680px) {
    .header-inner { padding: 1rem; min-height: 80px; gap: 1rem; }
    .brand-description { font-size: .65rem; }
    .brand { font-size: 1.1rem; gap: .55rem; }
    .brand-mark { width: 36px; height: 36px; font-size: 1.25rem; border-radius: 10px; }
    .header-nav { gap: .8rem; font-size: .76rem; }
    .header-nav .button { font-size: .76rem; padding: .4rem .65rem; }
    .page-shell { padding: 2rem 1rem 3rem; }
    .page-heading { align-items: flex-start; margin-bottom: 1.5rem; gap: 1rem; }
    .page-intro { font-size: .88rem; }
    .page-indicator { display: none; }
    .panel-heading { padding: 1rem; }
    .inbox-table, .inbox-table tbody, .inbox-table tr, .inbox-table td { display: block; width: 100%; }
    .inbox-table thead { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; clip-path: inset(50%); overflow: hidden; }
    .inbox-table tr { position: relative; padding: 1rem; border-top: 1px solid var(--line); }
    .inbox-table tbody tr:first-child { border-top: 0; }
    .inbox-table td, .inbox-table tbody tr:first-child td { padding: .25rem 0; border: 0; }
    .inbox-table td[data-label] { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 1rem; align-items: center; font-size: .78rem; }
    .inbox-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .73rem; }
    .inbox-table .sender-cell { padding: 0 2.5rem .65rem 0; }
    .time-detail { display: inline; margin-left: .5rem; }
    .status-badge { width: fit-content; }
    .inbox-table .open-cell { position: absolute; right: 1rem; top: 1rem; padding: 0; width: auto; }
    .pagination { padding: 1rem; }
    .pagination .button { min-height: 40px; font-size: .75rem; padding: .45rem .65rem; }
    .detail-grid { grid-template-columns: minmax(0, 1fr); }
    .detail-heading { display: block; }
    .detail-heading > .status-badge { margin-top: 1rem; }
    .message-content { padding: 1.25rem; min-height: 180px; font-size: .9rem; }
    .metadata-panel { padding: 1.25rem; }
    .metadata-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; }
    .metadata-list > div { min-width: 0; }
    .auth-card { padding: 1.75rem 1.25rem; margin-top: 1.5rem; margin-bottom: 2rem; }
    .auth-card h1 { font-size: 1.75rem; }
    .site-footer { padding: 1rem; flex-direction: column; gap: .2rem; }
    .notice { padding: 2.5rem 1rem; }
}
@media (prefers-reduced-motion: reduce) {
    .button { transition: none; }
}
