:root {
  font-family: "Segoe UI", Arial, sans-serif;
  color: #172c3b;
  background: #eef3f6;
  line-height: 1.55;
  color-scheme: light;
  --ink: #09283b;
  --accent: #884811;
  --copper: #f2ad73;
  --border: #d4dfe6;
  --paper: #fff;
  --warm: #fff5e9;
}
* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; }
.shell { max-width: 1240px; margin: auto; padding-inline: clamp(16px, 4vw, 44px); }
.bar { background: linear-gradient(118deg, #0e344b, var(--ink) 66%); color: white; border-bottom: 3px solid var(--copper); }
.top, .row, .actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.top { min-height: 76px; padding-block: 12px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; font-weight: 750; font-size: clamp(18px, 3vw, 23px); }
.brand-mark { flex: none; width: 32px; height: 34px; border: 1px solid var(--copper); border-radius: 5px 5px 10px 5px; background: linear-gradient(145deg, transparent 53%, var(--copper) 54% 59%, transparent 60%), linear-gradient(90deg, transparent 23%, var(--copper) 24% 28%, transparent 29% 47%, var(--copper) 48% 52%, transparent 53%); }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
nav a, nav button { color: white; background: transparent; border: 1px solid transparent; border-radius: 8px; text-decoration: none; padding: 7px 11px; font-weight: 600; }
nav [aria-current="page"] { color: #ffd3af; background: #23465c; }
nav a:hover, nav button:not(:disabled):hover { border-color: #839cac; background: #23465c; }
main { padding-block: clamp(24px, 4vw, 42px) 44px; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 12px; overflow-wrap: anywhere; }
h1 { font-size: clamp(29px, 4.5vw, 48px); letter-spacing: -.035em; }
h2 { font-size: clamp(20px, 3vw, 25px); letter-spacing: -.02em; }
h3 { font-size: 17px; }
a { color: #195876; text-underline-offset: 3px; }
p { margin: 0 0 12px; overflow-wrap: anywhere; }
.muted, time { color: #4c6171; font-size: .92rem; }
.panel { padding: clamp(16px, 3vw, 27px); background: var(--paper); border: 1px solid var(--border); border-radius: 16px; min-width: 0; box-shadow: 0 5px 16px #12304708; }
.stack { display: grid; gap: 16px; min-width: 0; }
.columns { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.login-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 6vw, 80px); min-height: 480px; padding: clamp(24px, 6vw, 76px); border-radius: 22px; background: linear-gradient(129deg, transparent 79%, #e98f52 79.2% 87%, #f4b37c 87.2%), linear-gradient(142deg, #12445b, #09283b 63%); box-shadow: 0 18px 46px #09283b24; }
.login-intro h1 { max-width: 13ch; color: white; font-size: clamp(34px, 5.4vw, 64px); }
.login { width: 100%; max-width: 430px; padding: clamp(20px, 3vw, 32px); border-top: 4px solid var(--copper); }
.login h2 { margin-bottom: 20px; }
.login form button { width: 100%; }
.login > button { margin-top: 12px; }
.entries { list-style: none; padding: 0; margin: 0; }
.entries li { padding-block: 12px; border-bottom: 1px solid var(--border); }
.entries li:last-child { border-bottom: 0; }
.entries a { font-weight: 650; }
form { display: grid; gap: 12px; }
form button { justify-self: start; }
label { display: grid; gap: 4px; font-weight: 600; }
input, select, textarea, button { font: inherit; }
input, select, textarea { width: 100%; min-width: 0; background: #fbfdfe; padding: 10px 12px; border: 1px solid #9aafbd; border-radius: 9px; color: inherit; }
textarea { resize: vertical; min-height: 112px; }
button, .button { background: var(--copper); border: 1px solid #bd7b47; color: #172839; border-radius: 9px; padding: 9px 14px; cursor: pointer; text-decoration: none; font-weight: 650; }
button:not(:disabled):hover, .button:hover { background: #f8bd8d; }
.secondary { background: white; border-color: #aabcc8; color: var(--ink); }
.secondary:not(:disabled):hover { background: #eaf2f7; }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 3px solid #aa671e; outline-offset: 3px; }
.messages { display: grid; gap: 10px; max-height: 55vh; overflow: auto; }
.message { border-inline-start: 3px solid #b78052; padding: 12px 15px; background: #faf4ec; border-radius: 8px; }
.message.staff { border-color: #38799a; background: #edf5fa; }
.message p { white-space: pre-wrap; margin: 6px 0 0; }
.draft-panel { gap: 10px; padding: 14px 16px; border: 1px solid #e5ccb4; border-radius: 11px; background: var(--warm); }
.draft-actions { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; }
.draft-status[data-error="true"] { color: #922c22; }
.draft-result:empty { display: none; }
.draft-text, .draft-sources blockquote { white-space: pre-wrap; overflow-wrap: anywhere; }
.draft-sources { padding-inline-start: 20px; }
.draft-sources li + li { margin-top: 8px; }
.draft-sources details { margin-bottom: 10px; }
.draft-sources blockquote { margin: 0 0 8px; padding-inline-start: 12px; border-inline-start: 2px solid var(--border); }
.notice { padding-top: 12px; color: #334c40; }
.notice:empty { display: none; }
.notice[data-error="true"] { color: #922c22; }
.reply-notice { position: sticky; top: 0; z-index: 2; padding-top: 12px; }
.reply-alert { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 18px; padding: 12px 16px; border: 1px solid #d8cab4; border-inline-start: 4px solid var(--accent); border-radius: 8px; background: #fcf7ed; }
.reply-alert strong { color: var(--ink); }
.reply-alert p { margin: 0; }
.reply-alert-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.reply-alert-actions a { font-weight: 650; }
.badge { color: var(--accent); font-weight: 650; }
.unread-replies { padding: 3px 9px; border: 1px solid #e5d2b6; border-radius: 12px; background: #fcf7ed; font-size: .88rem; }
.entries .appeal-entry { padding: 12px 13px; margin-top: 4px; border-inline-start: 3px solid transparent; border-radius: 9px; }
.entries .appeal-unread { background: var(--warm); border-inline-start-color: var(--accent); }
.unread-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 12px; }
.unread-filter { display: inline-flex; width: fit-content; align-items: center; gap: 8px; }
.unread-filter input { width: auto; margin: 0; accent-color: var(--accent); }
details summary { cursor: pointer; font-weight: 650; }
details form { margin-top: 12px; }
@media (max-width: 760px) {
  .columns, .login-layout { grid-template-columns: minmax(0, 1fr); }
  .login-layout { gap: 24px; min-height: auto; background: linear-gradient(145deg, transparent 85%, #e98f52 85.3% 90%, #f4b37c 90.3%), linear-gradient(142deg, #12445b, #09283b 64%); }
  .login-intro h1 { max-width: 16ch; }
}
