/* Shared theme tokens, type, fields, buttons and layout primitives. */
/* Shared foundations and tokens. Component rules live in their named stylesheets. */
@import url("https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --text: #252622;
  --page: #f8f6f2;
  --muted: #65665f;
  --line: #e4e1d9;
  --card: #efede7;
  --accent: #812e2d;
  --blue: #406dab;
  --success: #303a2c;
  --success-on: #fff;
  --field: #f1efe9;
  --field-border: #85867d;
  --button: #262823;
  --button-hover: #41443d;
  --secondary-border: #cac8bf;
  --step: #dedbd3;
  --warm-surface: #f5e6df;
  --warm-text: #973f29;
  --avatar: #eae7de;
  --avatar-text: #292b26;
  --soft-surface: #e8e4d9;
  --subtle-surface: #eeeae1;
  --divider: #dad5ca;
  --food-symbol: #e4d9cd;
  --drink-symbol: #dfe5ed;
  --empty-border: #d8d5ca;
  --empty-text: #33362e;
  --track: #dfdad0;
  --tabs: #eae7df;
  --error: #a43829;
  --selected-surface: #f3e6df;
  --danger: #ac412e;
  --warning-surface: #f3e3da;
  --warning-text: #a34831;
  --accent-deep: #6c2425;
  --accent-soft: #ead0d0;
  --accent-border: #b57b7d;
  --accent-muted: #7d4546;
  --popover: #fffdf8;
  --accent-on: #fff8f2;
  --accent-secondary: #f1d9d4;
  --accent-white: #fff;
  --ring-track: #ded9ce;
  --focus-soft: #812e2d15;
  --accent-shadow: #812e2d20;
  --accent-outline: #812e2d30;
  --accent-tint: #812e2d0a;
  --nav-surface: #f8f6f2f5;
  --button-text: white;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --text: #f1efe9;
  --page: #191b18;
  --muted: #b1b3a9;
  --line: #42453d;
  --card: #282b25;
  --accent: #e39a95;
  --blue: #96b9e5;
  --success: #b9c9a6;
  --success-on: #20231c;
  --field: #242720;
  --field-border: #93988a;
  --button: #dedfd5;
  --button-hover: #f1f0e9;
  --secondary-border: #686d60;
  --step: #42453d;
  --warm-surface: #3a2925;
  --warm-text: #efb29e;
  --avatar: #35392f;
  --avatar-text: #efeee7;
  --soft-surface: #303429;
  --subtle-surface: #303329;
  --divider: #44483c;
  --food-symbol: #40372c;
  --drink-symbol: #2d3949;
  --empty-border: #4b5041;
  --empty-text: #d7dbcd;
  --track: #42463b;
  --tabs: #30332a;
  --error: #f0a394;
  --selected-surface: #3d2c29;
  --danger: #f0a394;
  --warning-surface: #3b2b22;
  --warning-text: #edb39d;
  --accent-deep: #e8a6a2;
  --accent-soft: #513430;
  --accent-border: #ac7470;
  --accent-muted: #d9aaa6;
  --popover: #30342b;
  --accent-on: #291b1b;
  --accent-secondary: #432a28;
  --accent-white: #291b1b;
  --ring-track: #44483c;
  --focus-soft: #e39a9525;
  --accent-shadow: #e39a9520;
  --accent-outline: #e39a9540;
  --accent-tint: #e39a9510;
  --nav-surface: #191b18f5;
  --button-text: #20231c;
}

:root {
  font-family: "DM Sans", sans-serif;
  color: var(--text);
  background: var(--page);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

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

:where(button, a[href], input, select, textarea, summary, [tabindex], [contenteditable="true"]):focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

input,
select {
  width: 100%;
  padding: 15px 16px;
  background: var(--field);
  border: 1px solid var(--field-border);
  border-radius: 12px;
  color: var(--text);
  outline: none;
  min-height: 53px;
}

input:focus-visible,
select:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-soft);
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

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

h1,
h2,
h3,
.big,
.brand {
  font-family: "Manrope", sans-serif;
}

h1 {
  font-size: 36px;
  line-height: 1.2;
  letter-spacing: -1.4px;
  font-weight: 800;
}

h2 {
  font-size: 22px;
  letter-spacing: -0.6px;
}

h3 {
  font-size: 17px;
}

p {
  line-height: 1.6;
}

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

.small {
  font-size: 14px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
}

.primary,
.secondary {
  border-radius: 12px;
  padding: 15px 22px;
  min-height: 52px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.primary {
  background: var(--button);
  color: var(--button-text);
}

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

.secondary {
  border: 1px solid var(--secondary-border);
  background: transparent;
}

.secondary:hover {
  background: var(--card);
}

.icon {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.between {
  justify-content: space-between;
}

.stack {
  display: grid;
  gap: 20px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.full {
  grid-column: 1/-1;
}

.pill {
  border-radius: 30px;
  padding: 9px 14px;
  background: var(--card);
  font-size: 13px;
  font-weight: 600;
}

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

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

.card {
  background: var(--card);
  border-radius: 21px;
  padding: 26px;
}

.note {
  border-left: 3px solid var(--accent);
  padding-left: 15px;
  font-size: 14px;
  line-height: 1.6;
}

.privacy {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
}

.section-head {
  margin-bottom: 26px;
}

.content-narrow {
  max-width: 860px;
}

.error {
  color: var(--error);
  font-size: 14px;
  line-height: 1.5;
}

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

.plain-link {
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.button-label {
  display: flex;
  gap: 8px;
  align-items: center;
}

.source {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 20px;
}

.chip {
  background: var(--warning-surface);
  color: var(--warning-text);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 13px;
}

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

@media (max-width: 700px) {
  h1 {
    font-size: 30px;
  }

  .field-grid {
    gap: 15px;
  }

  .section-head {
    gap: 10px;
  }

  .card {
    padding: 24px;
  }
}

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

.soft-bagel {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex-shrink: 0;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 10000;
  transform: translateY(-200%);
  padding: 12px 16px;
  background: var(--page,#f8f6f2);
  color: var(--text,#252622);
  border: 2px solid currentColor;
  border-radius: 8px;
  font: 700 16px/1.4 "DM Sans",sans-serif;
}

.skip-link:focus {
  transform: none;
  outline: 3px solid var(--blue,#406dab);
  outline-offset: 2px;
}

.skip-navigation {
  left: auto;
  right: 16px;
}

:where(button,a[href],input,select,textarea,summary,[tabindex],[contenteditable="true"]):focus:not(:focus-visible) {
  outline: none;
}

@media(max-width:700px) {
  :root[data-theme="dark"] .food-swipe-row .food-row-actions button.danger {
    background: #E39A95;
    color: #191c16;
  }
}

.module-label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  line-height: 1.5;
  color: var(--muted);
}

[data-ai-allowance]:not(:empty)::before,.ai-loading-shimmer:not(:empty)::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  vertical-align: -4px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='m12 3 2.5 6.5L21 12l-6.5 2.5L12 21l-2.5-6.5L3 12l6.5-2.5Z'/%3E%3Cpath d='m20 2 .6 1.4L22 4l-1.4.6L20 6l-.6-1.4L18 4l1.4-.6Z'/%3E%3C/svg%3E") center/contain no-repeat;
}
