:root {
  --ink: #111820;
  --muted: #667085;
  --line: #e5e9ef;
  --line-strong: #d5ddea;
  --paper: #ffffff;
  --white: #ffffff;
  --deep: #101820;
  --navy: #1a2b49;
  --accent: #2f6fbd;
  --accent-dark: #1f4f91;
  --pale: #f6f8fb;
  --danger: #b42318;
  --warn: #a15c07;
  --ok: #2d6a4f;
  --shadow-lg: 0 22px 54px rgba(17, 24, 32, 0.08);
  --shadow-sm: 0 8px 24px rgba(17, 24, 32, 0.06);
  --radius-md: 10px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100vh;
  font-family: "Inter", "Helvetica Neue", "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(246, 248, 251, 0.95), rgba(255, 255, 255, 1) 36%),
    repeating-linear-gradient(90deg, rgba(17, 24, 32, 0.04) 0 1px, transparent 1px 104px),
    var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  line-height: 1.3;
  font-weight: 600;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.35rem);
  letter-spacing: 0;
}

h2 {
  font-size: 1.1rem;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 1px solid var(--deep);
  border-radius: var(--radius-md);
  min-height: 44px;
  padding: 0.7rem 1rem;
  color: var(--white);
  background: var(--deep);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

button:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

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

button.secondary,
button.ghost {
  color: var(--deep);
  background: var(--white);
  border-color: var(--line-strong);
}

button.ghost {
  background: transparent;
}

button.secondary:hover:not(:disabled),
button.ghost:hover:not(:disabled) {
  color: var(--white);
}

button.danger {
  background: var(--danger);
  border-color: var(--danger);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.72rem 0.85rem;
  background: var(--white);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  resize: vertical;
  min-height: 9rem;
}

label,
.stack {
  display: grid;
  gap: 0.5rem;
}

label > span {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline-offset: 0;
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 189, 0.14);
}

.panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-lg);
}

.panel.compact {
  padding: 1rem;
}

.status {
  color: var(--muted);
  font-size: 0.92rem;
}

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

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

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--white);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.app-header,
.section-head,
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.app-header {
  margin-bottom: 1.25rem;
}

.app-header .title-block {
  display: grid;
  gap: 0.3rem;
}

.app-header .actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.hidden {
  display: none !important;
}

.disabled {
  pointer-events: none;
  color: var(--muted);
  font-weight: 500;
}

.question-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.question-meta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.86rem;
}

.clock-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 280px;
}

.clock-wrap.large {
  min-height: 420px;
}

.clock {
  width: min(70vw, 320px);
  transform: rotate(-90deg);
}

.clock-track,
.clock-progress {
  fill: none;
  stroke-width: 10;
}

.clock-track {
  stroke: #edf1f7;
}

.clock-progress {
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke 0.2s ease;
}

.clock-center {
  position: absolute;
  text-align: center;
}

.timer {
  font-size: 4.5rem;
  font-weight: 700;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.single-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  width: min(720px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0;
}

@media (max-width: 800px) {
  body {
    background:
      linear-gradient(180deg, rgba(246, 248, 251, 0.95), rgba(255, 255, 255, 1) 36%),
      var(--paper);
  }

  .app-header .actions,
  .form-actions {
    width: 100%;
  }

  .app-header .actions button,
  .form-actions button {
    flex: 1 1 100%;
  }

  .clock {
    width: min(84vw, 320px);
  }

  .timer {
    font-size: 3rem;
  }
}
