:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #687382;
  --line: #dce1e7;
  --surface: #ffffff;
  --page: #f7f8fa;
  --blue: #125dcc;
  --blue-dark: #0b4da9;
  --danger: #b42318;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; }
.page-shell { width: min(100% - 32px, 860px); margin: 0 auto; padding: 28px 0 56px; }
.app-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 5px; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(30px, 6vw, 44px); line-height: 1.05; letter-spacing: 0; }
.subtitle { margin-bottom: 0; color: var(--muted); font-size: 16px; }
.secure-label { border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; color: var(--muted); font-size: 13px; font-weight: 700; }
.control-panel { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 20px; box-shadow: 0 5px 18px rgba(23, 32, 42, .05); }
.section-heading { display: flex; justify-content: space-between; gap: 16px; }
h2 { margin-bottom: 5px; font-size: 21px; line-height: 1.2; }
.section-heading p { margin-bottom: 16px; color: var(--muted); font-size: 14px; }
.username-form { display: flex; gap: 10px; }
.username-form input { min-width: 0; flex: 1; border: 1px solid #aeb7c2; border-radius: 7px; background: #fff; padding: 12px 13px; color: var(--ink); outline: none; }
.username-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(18, 93, 204, .14); }
button { border: 0; border-radius: 7px; padding: 11px 15px; font-weight: 700; }
.primary-button { width: 100%; margin-top: 14px; background: var(--blue); color: #fff; }
.primary-button:hover { background: var(--blue-dark); }
.primary-button:disabled { cursor: wait; opacity: .65; }
.secondary-button { background: #edf2f8; color: #1f4f8e; }
.text-button { padding: 6px 0; background: transparent; color: var(--blue); font-size: 13px; }
.inline-status, .request-status { min-height: 20px; margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.request-status.error, .inline-status.error { color: var(--danger); }
.history-section { margin-top: 26px; }
.history-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.history-heading h2 { margin-bottom: 0; }
.history-list { display: grid; gap: 12px; }
.empty-state { border: 1px dashed #b8c0ca; border-radius: 9px; padding: 28px 18px; color: var(--muted); text-align: center; }
.post-card { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 18px; box-shadow: 0 4px 15px rgba(23, 32, 42, .045); }
.post-title { margin-bottom: 10px; font-size: 20px; line-height: 1.25; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 11px; color: var(--muted); font-size: 13px; }
.post-user { color: var(--blue); font-weight: 700; }
.post-link { display: block; overflow-wrap: anywhere; margin-bottom: 12px; color: var(--blue); font-size: 14px; }
.post-preview { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 7; margin-bottom: 14px; color: #3d4652; font-size: 15px; line-height: 1.45; white-space: pre-line; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card-actions button { flex: 1 1 200px; background: #edf2f8; color: #1d385a; }
.card-actions button:hover { background: #dfe9f5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 520px) {
  .page-shell { width: min(100% - 22px, 860px); padding-top: 20px; }
  .control-panel, .post-card { padding: 15px; }
  .username-form { align-items: stretch; }
  .username-form .secondary-button { min-width: 72px; }
  .app-header { margin-bottom: 18px; }
  h1 { font-size: 34px; }
}
