/* SEER System の画面（設計書 6 章）。色は src/screen/theme.ts と合わせる */
:root {
  color-scheme: dark;
  --bg: #070b16;
  --grid: #0e1628;
  --line: #22314f;
  --panel: #0b1222;
  --accent: #e8892b;
  --accent-bright: #ffb45e;
  --text: #e6eaf2;
  --dim: #8a97b5;
  --approve: #1fb8a6;
  --approve-text: #03201c;
  --reject: #e0352b;
  --reject-text: #1f0302;
  --error: #ff8a80;
  --sans: "SEER Sans", system-ui, sans-serif;
  --serif: "SEER Serif", serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
}

a {
  color: var(--accent-bright);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent-bright);
  outline-offset: 2px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 2px solid var(--line);
  background: rgb(7 11 22 / 92%);
}

.brand {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.12em;
  color: var(--text);
  text-decoration: none;
}

.site-header nav {
  display: flex;
  gap: 16px;
  font-size: 15px;
}

.page {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  flex: 1;
}

.page.wide {
  max-width: 1000px;
}

.title {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(28px, 6vw, 40px);
  letter-spacing: 0.08em;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

.section-title {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.intro p {
  color: var(--dim);
}

.panel {
  margin-top: 24px;
  padding: 20px;
  border: 2px solid var(--line);
  background: var(--panel);
  clip-path: polygon(
    14px 0,
    calc(100% - 14px) 0,
    100% 14px,
    100% calc(100% - 14px),
    calc(100% - 14px) 100%,
    14px 100%,
    0 calc(100% - 14px),
    0 14px
  );
}

/* ---------------------------------------------------------------- フォーム */

.field {
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.field > label,
.field > legend {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

.sub-label {
  display: block;
  margin: 10px 0 6px;
  font-size: 14px;
  color: var(--dim);
}

.optional {
  margin-left: 6px;
  padding: 0 6px;
  font-size: 12px;
  color: var(--dim);
  border: 1px solid var(--line);
}

.required {
  margin-left: 6px;
  padding: 0 6px;
  font-size: 12px;
  color: var(--bg);
  background: var(--accent);
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 0;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
}

textarea {
  resize: vertical;
}

.choice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

.hint {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--dim);
}

.privacy {
  margin-bottom: 16px;
}

.quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

button {
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.quick button,
.secondary {
  padding: 6px 14px;
  font-size: 15px;
  color: var(--text);
  background: transparent;
  border: 2px solid var(--line);
}

.quick button:hover,
.secondary:hover {
  border-color: var(--accent);
}

.primary {
  width: 100%;
  padding: 14px;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 0.2em;
  color: var(--bg);
  background: var(--accent);
  border: 0;
}

.primary:not(:disabled):hover {
  background: var(--accent-bright);
}

.turnstile:not(:empty) {
  margin: 12px 0;
}

.status {
  min-height: 1.7em;
  margin: 12px 0 0;
}

.status[data-kind="error"] {
  color: var(--error);
}

/* ---------------------------------------------------------------- 審議ページ */

.screen-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.screen {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  background: var(--bg);
}

.remaining {
  margin: 0;
  min-height: 1.7em;
  font-weight: 700;
  font-size: 18px;
  color: var(--accent-bright);
}

.vote-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.vote-buttons button {
  padding: 14px;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 0.3em;
  border: 3px solid transparent;
}

.vote-approve {
  color: var(--approve-text);
  background: var(--approve);
}

.vote-reject {
  color: var(--reject-text);
  background: var(--reject);
}

.vote-buttons button[aria-pressed="true"] {
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--bg) inset;
}

.topic-full {
  margin: 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 20px;
  overflow-wrap: anywhere;
}

.context-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--dim);
}

details {
  margin-top: 12px;
}

summary {
  cursor: pointer;
  color: var(--accent-bright);
}

.notes {
  margin-top: 16px;
}

.resolution {
  font-size: 20px;
}

.judges {
  padding-left: 1.2em;
  overflow-wrap: anywhere;
}

.warning {
  color: var(--accent);
  font-weight: 700;
}

.note {
  font-size: 14px;
  color: var(--dim);
}

.message {
  padding: 16px;
  border: 2px solid var(--accent);
  background: var(--panel);
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

a.secondary {
  display: inline-block;
  text-decoration: none;
}

/* ---------------------------------------------------------------- 自分の審議 */

.mine-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.mine-item {
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-left: 6px solid var(--accent);
  background: var(--panel);
}

.mine-item.status-closed {
  border-left-color: var(--approve);
}

.mine-item.status-withdrawn {
  border-left-color: var(--dim);
}

.mine-topic {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.mine-status,
.mine-date,
.badges {
  margin: 4px 0 0;
  font-size: 14px;
}

.mine-date {
  color: var(--dim);
}

.badges {
  display: flex;
  gap: 8px;
}

.badge {
  padding: 0 8px;
  font-size: 12px;
  border: 1px solid var(--accent);
  color: var(--accent-bright);
}

/* ---------------------------------------------------------------- 使い方 */

.prose h2 {
  margin-top: 32px;
  font-size: 20px;
  color: var(--accent);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
}

.prose th,
.prose td {
  padding: 8px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.prose th:first-child,
.prose td:first-child {
  white-space: nowrap;
}

.license-text {
  max-height: 24em;
  overflow: auto;
  padding: 12px;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  color: var(--dim);
  background: var(--bg);
  border: 1px solid var(--line);
}

/* ---------------------------------------------------------------- 共通 */

.site-footer {
  padding: 16px;
  font-size: 13px;
  color: var(--dim);
  text-align: center;
  border-top: 2px solid var(--line);
}

.site-footer p {
  margin: 0;
}

.noscript {
  margin: 16px;
  padding: 16px;
  border: 2px solid var(--accent);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

/* プレビュー画像の撮影用のページ：canvas だけを、余白なしで 1200 × 630 に出す */
body.og-render {
  display: block;
  min-height: 0;
  margin: 0;
  background: var(--bg);
}

body.og-render canvas {
  display: block;
  width: 1200px;
  height: 630px;
}
