:root {
  color-scheme: light;
  --bg: #f5f6f3;
  --surface: #ffffff;
  --surface-weak: #eef1ed;
  --surface-warm: #fbf8f1;
  --text: #202522;
  --muted: #66706a;
  --line: #d7ddd6;
  --accent: #2f6b5b;
  --accent-dark: #214e43;
  --amber: #a9792b;
  --soft-blue: #586f83;
  --warn: #8a5a21;
  --danger: #a33b35;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

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

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 650;
  padding: 10px 14px;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: default;
  opacity: 0.65;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.hidden {
  display: none !important;
}

.login-panel {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: center;
  gap: 48px;
}

.login-panel h1,
.topbar h1 {
  margin: 4px 0 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  max-width: 560px;
  line-height: 1.7;
}

.login-form,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
}

textarea {
  resize: vertical;
}

.login-form,
.settings-form,
.notice-form {
  display: grid;
  gap: 14px;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.dashboard {
  display: grid;
  gap: 24px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 650;
}

.ghost:hover {
  background: var(--surface-weak);
}

.principle-band {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.1fr);
  gap: 22px;
  align-items: start;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfcfb 0%, var(--surface-weak) 100%);
  border-radius: 8px;
  padding: 18px 20px;
}

.principle-band strong {
  display: block;
  margin-bottom: 6px;
}

.principle-band p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.principle-band ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.principle-band li,
.guardrail {
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  padding: 8px 10px;
}

.principle-band li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--amber);
  vertical-align: 1px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  min-height: 88px;
  display: grid;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  font-size: 30px;
  line-height: 1;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 18px;
  align-items: start;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
  letter-spacing: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.panel-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
}

.icon-button.is-loading {
  color: transparent;
  position: relative;
}

.icon-button.is-loading::after {
  content: "";
  position: absolute;
  inset: 11px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.event-list,
.notice-list,
.status-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.event,
.notice,
.status-row {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fbfcfb;
}

.event {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 130px;
  gap: 10px;
  align-items: center;
}

.event code {
  color: var(--accent-dark);
  font-weight: 800;
}

.event small,
.notice small,
.status-row dd {
  color: var(--muted);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.guardrail {
  margin: 0;
  color: var(--warn);
  line-height: 1.6;
}

.check {
  display: flex;
  grid-template-columns: none;
  flex-direction: row;
  align-items: center;
}

.check input {
  width: auto;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.status-row dt,
.status-row dd {
  margin: 0;
}

.status-row dt {
  color: var(--muted);
  font-size: 13px;
}

.status-row dd {
  font-weight: 650;
  text-align: right;
}

.button-row,
.notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notice {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.notice-copy {
  display: grid;
  gap: 7px;
}

.notice-copy strong {
  font-size: 16px;
  line-height: 1.35;
}

.notice-copy p {
  margin: 0;
  color: var(--text);
  line-height: 1.65;
}

.notice-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.notice-meta span {
  border-radius: 6px;
  background: var(--surface-weak);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  padding: 5px 8px;
}

.notice-meta .status-active {
  background: #e7f0ea;
  color: var(--accent-dark);
}

.notice-meta .status-scheduled {
  background: #eef2f5;
  color: var(--soft-blue);
}

.notice-meta .status-draft {
  background: var(--surface-warm);
  color: var(--amber);
}

.notice-period {
  color: var(--muted);
  font-size: 12px;
}

.notice-actions {
  justify-content: flex-end;
  padding-top: 2px;
}

.notice-more {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: #fbfcfb;
  color: var(--muted);
  font-size: 13px;
  padding: 12px;
}

.text-button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 650;
  padding: 6px 8px;
}

.text-button:hover {
  background: var(--surface-weak);
}

.text-button.muted-action {
  color: var(--muted);
}

.text-button.danger-action {
  color: var(--danger);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 840px) {
  .login-panel,
  .grid,
  .metrics,
  .principle-band {
    grid-template-columns: 1fr;
  }

  .login-panel {
    align-content: center;
    gap: 24px;
  }

  .form-row,
  .event {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }

  .notice-more {
    align-items: flex-start;
    flex-direction: column;
  }
}
