:root {
  color-scheme: light;
  --bg: #f4efe7;
  --bg-accent: #efe1cf;
  --panel: rgba(255, 252, 247, 0.9);
  --panel-strong: #fffdf9;
  --text: #1f2933;
  --muted: #5e6d78;
  --border: rgba(124, 88, 48, 0.16);
  --accent: #0f766e;
  --accent-strong: #115e59;
  --danger: #b42318;
  --danger-strong: #912018;
  --success-bg: #e4f4ec;
  --warning-bg: #fff1d8;
  --warning-border: #e6b663;
  --shadow: 0 18px 45px rgba(76, 55, 34, 0.12);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17140f;
  --bg-accent: #241c13;
  --panel: rgba(32, 26, 20, 0.92);
  --panel-strong: #211911;
  --text: #f0e9de;
  --muted: #b8a99a;
  --border: rgba(230, 208, 182, 0.14);
  --accent: #75d1c9;
  --accent-strong: #4fb9b0;
  --danger: #f08e86;
  --danger-strong: #e36e65;
  --success-bg: #163327;
  --warning-bg: #3e2f13;
  --warning-border: #ad8441;
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(191, 148, 98, 0.15), transparent 32%),
    linear-gradient(180deg, var(--bg-accent), var(--bg));
  color: var(--text);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input {
  font: inherit;
}

code,
.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.shell {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 253, 249, 0.72);
  backdrop-filter: blur(14px);
}

:root[data-theme="dark"] .topbar {
  background: rgba(23, 20, 15, 0.82);
}

.topbar__inner,
.site-footer__inner {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand:hover {
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.nav__link {
  color: var(--text);
  font-size: 0.96rem;
}

.nav__meta,
.meta,
.page-intro,
.help-text {
  color: var(--muted);
}

.nav__meta {
  font-size: 0.92rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.72rem 1.1rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}

.button:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  color: #fff;
}

.button-primary:hover {
  background: var(--accent-strong);
}

.button-secondary,
.button-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.button-secondary:hover,
.button-ghost:hover {
  background: rgba(255, 255, 255, 0.36);
}

:root[data-theme="dark"] .button-secondary:hover,
:root[data-theme="dark"] .button-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

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

.button-danger:hover {
  background: var(--danger-strong);
}

.button-small {
  padding: 0.55rem 0.9rem;
  font-size: 0.88rem;
}

.button-large {
  padding: 0.95rem 1.5rem;
  font-size: 1rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 4rem 2rem;
  text-align: center;
}

.hero h1,
.page-title {
  margin: 0;
  line-height: 1.1;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.75rem);
}

.hero__lead {
  width: min(700px, 100%);
  margin: 1rem auto 2rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--accent);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header--stacked {
  display: block;
}

.page-title {
  font-size: clamp(2rem, 4vw, 3rem);
}

.section-card,
.form-card,
.list-card {
  padding: 1.25rem;
}

.section-title {
  margin: 0 0 1rem;
  font-size: 1.2rem;
}

.notice {
  margin-bottom: 1.5rem;
  padding: 1.2rem 1.25rem;
  border: 1px solid var(--warning-border);
  border-radius: 20px;
}

.notice h2 {
  margin: 0 0 0.45rem;
  font-size: 1.1rem;
}

.notice-warning {
  background: var(--warning-bg);
}

.token-value {
  display: block;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel-strong);
  overflow-wrap: anywhere;
}

.flash-stack {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.flash {
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
}

.flash--success {
  background: var(--success-bg);
}

.flash--error {
  border-color: var(--danger);
}

.form-stack {
  display: grid;
  gap: 1rem;
}

.form-field label {
  display: block;
  margin-bottom: 0.45rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
}

.text-input {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-strong);
  color: var(--text);
}

.text-input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.25);
  outline-offset: 2px;
}

.field-error {
  margin: 0.45rem 0 0;
  color: var(--danger);
}

.help-text,
.meta,
.back-link,
.pagination,
th,
td,
.empty-state,
.empty-cell {
  font-family: Arial, Helvetica, sans-serif;
}

.button-row,
.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.table-wrap {
  overflow-x: auto;
}

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

thead {
  background: rgba(0, 0, 0, 0.04);
}

:root[data-theme="dark"] thead {
  background: rgba(255, 255, 255, 0.06);
}

th,
td {
  padding: 0.95rem 0.85rem;
  border-top: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

thead th {
  border-top: 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.actions-col {
  text-align: right;
}

.empty-cell,
.empty-state {
  padding: 1.4rem;
  text-align: center;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  background: rgba(0, 0, 0, 0.06);
  font-size: 0.8rem;
  font-weight: 700;
}

:root[data-theme="dark"] .badge {
  background: rgba(255, 255, 255, 0.1);
}

.badge-success {
  background: var(--success-bg);
}

.list-row {
  display: block;
  padding: 1rem 1.1rem;
  border-top: 1px solid var(--border);
}

.list-row:first-child {
  border-top: 0;
}

.list-row:hover {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.28);
}

:root[data-theme="dark"] .list-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.list-row__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.list-row__title {
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 700;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 0.5rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.site-footer__inner {
  padding: 1rem 0 2rem;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.84rem;
  text-align: center;
}

@media (max-width: 760px) {
  .topbar__inner,
  .page-header,
  .list-row__content,
  .pagination {
    display: block;
  }

  .nav {
    justify-content: flex-start;
    margin-top: 0.8rem;
  }

  .page-header > * + * {
    margin-top: 0.8rem;
  }

  .actions-col {
    text-align: left;
  }

  .button-row {
    display: flex;
    flex-wrap: wrap;
  }
}