/* The app's stylesheet. Tokens (font, colours, radii) live in theme.css; anything that follows state is bound inline in src/screens/. */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* App shell, not a web page: the viewport itself never scrolls, zooms or bounces. */
html, body { margin: 0; padding: 0; height: 100%; overscroll-behavior: none; }
body { background: var(--bg); color: var(--ink); font-family: var(--font);
  position: fixed; inset: 0; overflow: hidden;
  touch-action: manipulation; -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.rc-shell { height: 100vh; height: 100dvh; --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px); --safe-right: env(safe-area-inset-right, 0px);
  padding: var(--safe-top) var(--safe-right) 0 var(--safe-left);
  /* What sits at the bottom keeps clear of the home indicator's line, not of its whole 34pt, which looks too high. */
  --bottom-room: max(0px, calc(var(--safe-bottom) - 18px)); }
.rc-shell::before { content: ""; position: absolute; inset: 0 0 auto; height: var(--safe-top); background: var(--bg); pointer-events: none; }
.rc-bar { position: relative; box-shadow: none !important; }
.rc-bar::after { content: ""; position: absolute; inset: auto 0 0; border-top: 1px solid var(--line); pointer-events: none; }
.rc-content { min-height: 0; min-width: 0; flex: 1; display: flex; flex-direction: column; position: relative; overflow: hidden; background: var(--bg); }
@supports (height: 100dvh) { body { height: 100dvh; } }
/* Panes scroll on their own and never chain the gesture out to the shell.
   The browser re-serialises an inline style with a space after the colon, so that is the spelling matched. */
[style*="overflow-y: auto"] { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
/* Chrome does not look selectable; recipe text stays copyable. */
button, [role="button"], [role="tab"], nav, header, label { -webkit-user-select: none; user-select: none; }
a { color: var(--accent-text); text-underline-offset: 2px; }
::-webkit-scrollbar { width: 0; height: 0; }
@keyframes rc-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes rc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rc-pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes rc-drop { from { transform: scale(.95); opacity: 0; } }
:root { --ease-out: cubic-bezier(.23, 1, .32, 1); }
/* Small controls keep their look but answer to a 44px touch area. */
.rc-hit { position: relative; }
/* A bottom sheet shows a handle: it can be pulled down to close (sheet-drag.js). */
[data-sheet]::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; }
/* The screen reaches under the home indicator, so a sheet ends with that much room (.rc-plan pads itself). */
[data-sheet]:not(.rc-plan)::after { content: ""; display: block; flex: none; height: var(--bottom-room, 0px); }
.rc-hit::after, .rc-switch::after { content: ""; position: absolute; top: 50%; left: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%); }
/* The tap highlight is off, so a press has to answer on its own. */
button { transition: transform 160ms var(--ease-out); }
button:active:not(:disabled) { transform: scale(.97); }
/* Full-width menu rows and list rows tint instead of shrinking. The tint is an inset shadow so it sits over an inline background. */
.rc-menu-row:active:not(:disabled) { transform: none; box-shadow: inset 0 0 0 100vmax color-mix(in srgb, var(--accent) 12%, transparent); }
.rc-row { transition: box-shadow 200ms ease-out; }
/* The short delay keeps a scroll from flashing every row it starts on; a button inside the row answers for itself. */
.rc-row:active:not(:has(button:active)) { box-shadow: inset 0 0 0 100vmax color-mix(in srgb, var(--accent) 12%, transparent); transition: box-shadow 0s 70ms; }
.rc-switch { transition: background-color .2s ease, transform 160ms var(--ease-out); }
.rc-switch > span { transition: transform .2s var(--ease-out); }
/* Always in the page so it can fade out, and so the live region exists before its text changes. */
.rc-toast { position: absolute; left: 16px; right: 16px; bottom: 86px; z-index: 80; padding: 12px 14px; border: 1px solid transparent; border-radius: 14px;
  background: var(--ink); color: var(--bg); font-size: 14px; text-align: center; box-shadow: 0 4px 14px rgba(0,0,0,.14); pointer-events: none;
  opacity: 0; transform: translateY(8px); transition: opacity 150ms ease-out, transform 150ms ease-out; }
.rc-toast[data-kind="error"] { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--danger-soft)); }
.rc-toast[data-open="yes"] { opacity: 1; transform: none; transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
@media (prefers-reduced-motion: reduce) {
  /* Less motion, not none: sheets and menus fade in place instead of travelling. */
  @keyframes rc-up { from { opacity: 0; } to { opacity: 1; } }
  @keyframes rc-pop { from { opacity: 0; } to { opacity: 1; } }
  @keyframes rc-drop { from { opacity: 0; } }
  button:active:not(:disabled) { transform: none; opacity: .7; }
  .rc-switch > span { transition: none; }
  .rc-toast, .rc-toast[data-open="yes"] { transform: none; }
}
/* The middle tab sits a little above the bar, cut out of it by a ring in the bar's own colour. */
.rc-nav-pick { width: 50px; height: 50px; margin-top: -18px; border-radius: 17px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 4px var(--surface), 0 6px 14px color-mix(in srgb, var(--accent) 30%, transparent); transition: transform 200ms var(--ease-out); }
/* The pill marks the open tab; its icon and label take the accent, the rest stay muted. */
.rc-nav-tab { color: var(--muted); transition: color 160ms ease-out, transform 160ms var(--ease-out); }
.rc-nav-tab:has(> .rc-nav-on), .rc-nav-tab:has([data-active="yes"]) { color: var(--accent-text); }
.rc-nav-pick[data-active="yes"] { transform: rotate(-6deg); }
/* Swipe deck. While a finger is down the top card is moved by script, so nothing here transitions it. */
.rc-deck { position: relative; flex: 1; min-height: 0; margin: 10px 18px 22px; }
.rc-card { position: absolute; inset: 0; border-radius: 22px; overflow: hidden; background: #253024; color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 12px 30px rgba(37,43,36,.2); touch-action: none; user-select: none; -webkit-user-select: none;
  pointer-events: none; transform-origin: 50% 100%; }
.rc-card[data-top="yes"] { pointer-events: auto; cursor: grab; }
.rc-card[data-top="yes"]:active { cursor: grabbing; }
.rc-card[data-top="yes"]:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 3px; }
.rc-card img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; -webkit-user-drag: none; }
.rc-card-plain { background: var(--accent-soft); color: var(--ink); }
.rc-card-mark { position: absolute; inset: 0 0 34%; display: flex; align-items: center; justify-content: center; color: color-mix(in srgb, var(--accent-text) 45%, transparent); }
.rc-card-info { position: absolute; inset: auto 0 0; padding: 70px 20px 20px; background: linear-gradient(to top, rgba(18,24,17,.82), rgba(18,24,17,.45) 50%, transparent); }
.rc-card-plain .rc-card-info { background: none; }
.rc-card-title { font-size: 27px; font-weight: 800; line-height: 1.15; letter-spacing: -.015em; text-wrap: balance;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rc-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rc-card-meta > span { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.18); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.rc-card-plain .rc-card-meta > span { background: var(--surface); }
.rc-stamp { position: absolute; top: 26px; padding: 3px 12px 5px; border: 3px solid currentColor; border-radius: 10px; font-size: 26px; font-weight: 800;
  background: rgba(255,255,255,.88); opacity: 0; pointer-events: none; }
.rc-stamp-yes { left: 22px; color: var(--accent); transform: rotate(-12deg); }
.rc-stamp-no { right: 22px; color: var(--danger); transform: rotate(12deg); }
.rc-deck-actions { flex: none; display: flex; align-items: center; justify-content: center; gap: 26px; padding: 0 0 18px; }
.rc-deck-btn { flex: none; width: 62px; height: 62px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-card); }
.rc-deck-btn:disabled { opacity: .4; cursor: default; }
.rc-deck-yes { width: 70px; height: 70px; border: 0; background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 30%, transparent); }
.rc-deck-no { color: var(--danger); }
.rc-deck-undo { width: 46px; height: 46px; color: var(--muted); box-shadow: none; }
/* Import loader: the chef stirring a bowl with food circling it. Each item sits at its own angle and distance on a ring that turns,
   and turns back by the same amount itself, so the food stays upright. */
.rc-loader { position: absolute; inset: 0; z-index: 60; background: var(--bg); color: var(--ink); display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px 24px calc(24px + var(--safe-bottom, 0px)); }
/* The loader keeps the app's original orange and brown, in both themes. */
.rc-loader { --accent: #b0531f; --on-accent: #fff; --bg: #f6ecdd; --surface: #fffbf4; --ink: #3b2417; --muted: #7d6253;
  --line: color-mix(in srgb, var(--accent) 24%, var(--surface)); }
:root:has(.rc-root[data-theme="dark"]) .rc-loader { --accent: #c0612a; --bg: #1d1612; --surface: #2b211b; --ink: #f2e6d8; --muted: #bfa894; }
.rc-loader-stage { position: relative; width: 250px; height: 250px; flex: none; }
.rc-loader-glow { position: absolute; inset: 46px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 26%, transparent) 0%, transparent 70%); }
.rc-loader-orbit { position: absolute; inset: 0; animation: rc-orbit 16s linear infinite; }
.rc-loader-orbit > span { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px;
  transform: rotate(var(--a)) translateY(calc(var(--r) * -1)) rotate(calc(var(--a) * -1)); }
.rc-loader-orbit > span > i { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; font-style: normal;
  font-size: var(--s, 26px); line-height: 1; animation: rc-orbit 16s linear infinite reverse; }
.rc-loader-pot { position: absolute; left: 50%; top: 50%; width: 136px; height: auto; margin: -70px 0 0 -68px; animation: rc-bob 2.6s ease-in-out infinite; }
.rc-loader-title { margin-top: 6px; font-size: 22px; font-weight: 800; letter-spacing: -.015em; text-align: center; }
.rc-loader-note { margin-top: 4px; font-size: 14px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.rc-loader-steps { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 13px; min-width: 232px; }
.rc-loader-steps li { display: flex; align-items: center; gap: 11px; font-size: 15px; color: var(--muted); transition: color 300ms ease-out; }
.rc-loader-steps li[data-state="active"] { color: var(--ink); font-weight: 700; }
.rc-loader-steps li[data-state="done"] { color: var(--ink); }
.rc-loader-mark { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; color: #fff; }
.rc-loader-steps li[data-state="active"] .rc-loader-mark { border-color: color-mix(in srgb, var(--accent) 28%, transparent); border-top-color: var(--accent); animation: rc-spin .8s linear infinite; }
.rc-loader-steps li[data-state="done"] .rc-loader-mark { background: var(--accent); border-color: var(--accent); color: var(--on-accent); animation: rc-tick 260ms var(--ease-out); }
.rc-loader-cancel { margin-top: 36px; padding: 10px 24px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 15px; cursor: pointer; }
@keyframes rc-orbit { to { transform: rotate(360deg); } }
@keyframes rc-bob { 50% { transform: translateY(-6px); } }
@keyframes rc-spin { to { transform: rotate(360deg); } }
@keyframes rc-tick { from { transform: scale(.6); } }
.rc-ing-emoji { flex: none; width: 26px; font-size: 19px; line-height: 1; text-align: center; }
@media (prefers-reduced-motion: reduce) {
  .rc-loader-orbit, .rc-loader-orbit > span > i, .rc-loader-pot, .rc-loader-steps li .rc-loader-mark { animation: none !important; }
  .rc-loader-steps li[data-state="active"] .rc-loader-mark { border-color: var(--accent); }
}
input, textarea, select, button { font-family: var(--font); }
/* Fields that set no colours of their own follow the theme instead of the browser's white. */
:where(input:not([type="file"]), textarea, select) { background-color: var(--surface); color: var(--ink); accent-color: var(--accent); }
/* A placeholder that does not fit ends in an ellipsis instead of a cut letter. */
input { text-overflow: ellipsis; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
/* A search box is the input's frame, so the frame shows the focus. */
.rc-field { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); transition: border-color 150ms ease-out, box-shadow 150ms ease-out; }
.rc-field:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage) 30%, transparent); }
button:focus-visible, [role="button"]:focus-visible, [role="tab"]:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
a:focus-visible, summary:focus-visible, input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
/* Many fields switch the outline off inline; the ones not inside a .rc-field frame (which lights up instead) get it
   back for the keyboard, hence the !important. */
:is(input, textarea, select):focus-visible:not(.rc-field :is(input, textarea, select)) { outline: 2px solid var(--accent-text) !important; outline-offset: 1px; }
div, input, textarea { min-width: 0; }
.rc-url-field { display: flex; align-items: center; gap: 6px; }
.rc-url-field input { flex: 1; width: 100%; direction: ltr; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); }
.rc-url-field button { flex: none; min-width: 44px; min-height: 44px; padding: 8px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-s); cursor: pointer; }
.rc-url-field button:disabled { opacity: .45; cursor: default; }
/* Settings: groups of rows under a short heading. A row is a button, a label for a file input, or plain. */
.rc-set-head { font-family: var(--font-display); font-size: 17px; font-weight: 800; color: var(--ink); margin: 24px 4px 8px; }
.rc-set-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; box-shadow: var(--shadow-card); }
.rc-set-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 12px 14px; border: 0; background: none;
  color: var(--ink); font: inherit; text-align: right; }
.rc-set-row + .rc-set-row, .rc-set-row + .rc-set-file + .rc-set-row { border-top: 1px solid var(--line); }
a.rc-set-row { color: var(--ink); text-decoration: none; }
button.rc-set-row { cursor: pointer; }
button.rc-set-row:disabled { opacity: .5; cursor: default; }
.rc-set-label { flex: 1; min-width: 0; font-size: 16px; line-height: 1.35; }
.rc-set-sub { display: block; margin-top: 2px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.rc-set-chev { flex: none; color: var(--muted); }
.rc-set-mini { flex: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; color: var(--ink); font-size: 13px; cursor: pointer; }
.rc-set-note { font-size: 13px; line-height: 1.6; color: var(--muted); margin: 8px 6px 0; }
.rc-set-note:empty { display: none; }
/* The file inputs are reached through their row's label; the input itself stays in the page for the picker. */
.rc-set-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
details.rc-set-row > summary { list-style-position: inside; }

/* Pinch zoom is allowed, so iOS would also zoom in on focusing any field under 16px. Fields there get 16px; the
   !important is needed because many fields set their size inline. */
@supports (-webkit-touch-callout: none) {
  input, textarea, select { font-size: max(16px, 1em) !important; }
}

/* The screen crash-screen.js puts over a screen that failed to draw. */
.rc-crash { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 24px; background: var(--bg, #faf8f3); color: var(--ink, #252b24); font-family: var(--font); text-align: center; }
.rc-crash h2 { margin: 0; font-size: 22px; }
.rc-crash p { margin: 0 0 8px; max-width: 320px; font-size: 16px; line-height: 1.6; color: var(--muted, #6e746a); }
.rc-crash button { min-height: 48px; padding: 0 28px; border: 0; border-radius: 14px; background: var(--accent, #344e35); color: var(--on-accent, #fff);
  font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
