/* Food — phone-first base styles. */
:root {
  color-scheme: light dark;
  --bg: #fbf7f2;
  --surface: #ffffff;
  --text: #1f1a17;
  --muted: #6b625c;
  --brand: #b3401f;
  --brand-contrast: #ffffff;
  --border: #d9cfc6;
  --focus: #1f6feb;
  --error-bg: #fde8e4;
  --error-text: #8a2a12;
  --radius: 0.625rem;
  --tap: 44px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161412;
    --surface: #221e1b;
    --text: #f2ebe4;
    --muted: #a89e96;
    --brand: #e0623b;
    --brand-contrast: #1a0d08;
    --border: #3d3531;
    --focus: #6cb0ff;
    --error-bg: #4a1f14;
    --error-text: #ffb8a3;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  padding-bottom: env(safe-area-inset-bottom);
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}

.nav {
  max-width: 40rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.5rem;
  min-height: var(--tap);
}

.nav-brand {
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  margin-right: auto;
}

.nav-brand,
.nav-link,
.button-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 0.75rem;
}

.nav-link {
  color: var(--text);
  text-decoration: none;
}

.nav-form {
  margin: 0;
}

.button-link {
  background: none;
  border: 0;
  color: var(--brand);
  font: inherit;
  cursor: pointer;
  width: auto;
}

.page {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem;
}

h1 {
  font-size: 1.5rem;
  margin: 0.5rem 0 1rem;
}

.muted {
  color: var(--muted);
}

.stack > * + * {
  margin-top: 0.75rem;
}

label {
  display: block;
  font-weight: 600;
}

input,
select,
textarea,
button {
  font: inherit;
  color: inherit;
  width: 100%;
  min-height: var(--tap);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

button {
  cursor: pointer;
}

.button-primary {
  background: var(--brand);
  color: var(--brand-contrast);
  border-color: var(--brand);
  font-weight: 600;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
}

.alert-error {
  background: var(--error-bg);
  color: var(--error-text);
}

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

@media (min-width: 40rem) {
  button,
  .button-primary {
    width: auto;
    min-width: 8rem;
  }
}

/* Settings: sections, facts, tokens. */
.section + .section {
  margin-top: 2rem;
}

h2 {
  font-size: 1.125rem;
  margin: 0 0 0.5rem;
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1rem;
  margin: 0;
}

.facts dt {
  font-weight: 600;
}

.facts dd {
  margin: 0;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.row > input {
  flex: 1 1 12rem;
}

.token-form {
  margin-bottom: 1rem;
}

.notice {
  background: var(--surface);
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.notice p {
  margin: 0 0 0.5rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9375rem;
}

.token-plaintext {
  flex: 1 1 12rem;
  overflow-wrap: anywhere;
  user-select: all;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.token-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.token-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
}

.token-item.is-revoked .token-name {
  text-decoration: line-through;
  color: var(--muted);
}

.token-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  min-width: 0;
}

.token-name {
  font-weight: 600;
}

.token-revoke {
  margin: 0;
  flex: 1 1 100%;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: var(--error-bg);
  color: var(--error-text);
}

.button-secondary {
  background: var(--surface);
  color: var(--brand);
  border-color: var(--brand);
  font-weight: 600;
}

.button-danger {
  background: var(--surface);
  color: var(--error-text);
  border-color: var(--error-text);
  font-weight: 600;
}

@media (min-width: 40rem) {
  .token-revoke {
    flex: 0 0 auto;
  }
}
