/* Dos Croquetas admin — iOS Settings-style grouped lists. Light + dark. */
:root {
  --brand: #2B5637; --accent: #2B5637; --danger: #d70015;
  --bg: #f2f2f7; --card: #fff; --text: #1d1d1f; --text-2: #6e6e73; --text-3: #8e8e93;
  --sep: rgba(60,60,67,.18); --fill: rgba(118,118,128,.12); --glass: rgba(242,242,247,.8);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.32,.72,0,1);
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --accent: #6cc48a; --danger: #ff453a; --bg: #000; --card: #1c1c1e; --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #8e8e93;
          --sep: rgba(84,84,88,.6); --fill: rgba(118,118,128,.24); --glass: rgba(22,22,24,.8); }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 17px; line-height: 1.4; -webkit-font-smoothing: antialiased; letter-spacing: -0.01em; }
a { color: var(--accent); text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }
img { display: block; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.boot { padding: 40vh 20px; text-align: center; color: var(--text-2); }

/* nav */
.nav { position: sticky; top: 0; z-index: 30; padding-top: var(--sat); background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: .5px solid var(--sep); }
.nav-inner { max-width: 760px; margin: 0 auto; height: 52px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 0 12px; }
.nav-back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.nav-back svg { flex: 0 0 auto; }
.nav-title { font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.nav-right { justify-self: end; display: flex; align-items: center; gap: 6px; }
.lang-seg { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--fill); }
.lang-seg button { min-width: 40px; min-height: 32px; border-radius: 7px; font-size: 14px; font-weight: 700; color: var(--text-2); }
.lang-seg button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
@media (prefers-color-scheme: dark) { .lang-seg button[aria-pressed="true"] { background: #636366; color: #fff; } }

.page { max-width: 760px; margin: 0 auto; padding: 8px 16px calc(120px + var(--sab)); }
.large-title { font-size: 34px; font-weight: 700; letter-spacing: -0.025em; margin: 10px 4px 4px; line-height: 1.1; }
.lead { margin: 0 4px 10px; color: var(--text-2); font-size: 15px; }
.editing-hint { margin: 0 4px 6px; font-size: 13px; color: var(--text-2); }
.editing-hint b { color: var(--accent); }

/* grouped lists */
.group { margin-top: 26px; }
.group-head { display: flex; align-items: flex-end; justify-content: space-between; margin: 0 16px 7px; gap: 8px; }
.group-head h3 { margin: 0; font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; color: var(--text-2); }
.group-head .link { font-size: 15px; font-weight: 500; min-height: 32px; display: inline-flex; align-items: center; color: var(--accent); }
.card { background: var(--card); border-radius: 12px; overflow: hidden; }
.foot { margin: 7px 16px 0; font-size: 13px; color: var(--text-2); }
.row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 14px 8px 16px; color: var(--text); position: relative; width: 100%; text-align: left; }
.row + .row::before, .row + .field::before, .field + .row::before, .field + .field::before, .row + .toggle-row::before, .toggle-row + .row::before, .toggle-row + .field::before, .field + .toggle-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
.row:active { background: var(--fill); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .value { color: var(--text-2); font-size: 16px; white-space: nowrap; }
.chev { width: 9px; height: 15px; flex: 0 0 auto; opacity: .35; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 15'%3E%3Cpath d='M1.5 1.5 7.5 7.5l-6 6' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 15'%3E%3Cpath d='M1.5 1.5 7.5 7.5l-6 6' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; }
.thumb { width: 52px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--fill); flex: 0 0 auto; }
.row.add { color: var(--accent); font-weight: 500; }
.row.add .plus { width: 26px; height: 26px; border-radius: 13px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 20px; line-height: 1; flex: 0 0 auto; }
@media (prefers-color-scheme: dark) { .row.add .plus { color: #04140a; } }
.row.danger { color: var(--danger); justify-content: center; font-weight: 500; }
.pills { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.pill { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--fill); color: var(--text-2); }
.pill.on { background: rgba(43,86,55,.12); color: var(--accent); }
@media (prefers-color-scheme: dark) { .pill.on { background: rgba(108,196,138,.16); } }
.pill.warn { background: #fff1c2; color: #7a4b00; }
@media (prefers-color-scheme: dark) { .pill.warn { background: #4a3500; color: #ffd27a; } }

/* reorder controls */
.ctrls { display: flex; gap: 4px; flex: 0 0 auto; }
.ic { width: 36px; height: 36px; border-radius: 18px; display: grid; place-items: center; background: var(--fill); color: var(--text); }
.ic:disabled { opacity: .3; }
.ic.del { color: var(--danger); }
.ic:active { transform: scale(.92); }

/* fields */
.field { display: block; padding: 10px 16px 12px; position: relative; }
.field-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.lang-tag { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .05em; padding: 1px 5px; border-radius: 4px; background: var(--fill); color: var(--text-2); }
.lang-tag.es { background: #fde7c7; color: #8a4b00; }
@media (prefers-color-scheme: dark) { .lang-tag.es { background: #4a3000; color: #ffcf8a; } }
.field input:not([type=checkbox]):not([type=color]):not([type=range]), .field textarea, .field select, .search {
  width: 100%; border: 0; outline: none; background: transparent; font-size: 17px; padding: 4px 0; min-height: 32px; resize: vertical; color: var(--text);
}
.field textarea { line-height: 1.45; min-height: 70px; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); opacity: .8; }
.miss { display: block; font-size: 12px; color: #a05a00; margin-top: 2px; }
@media (prefers-color-scheme: dark) { .miss { color: #ffb44a; } }
.search { background: var(--fill) !important; border-radius: 10px; padding: 8px 12px !important; margin: 10px 0 0; min-height: 40px; }
.inline { display: flex; gap: 10px; align-items: center; }
.inline input[type=color] { width: 44px; height: 36px; border: 0; padding: 0; background: none; border-radius: 8px; }

/* toggle */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; padding: 6px 16px; position: relative; }
.switch { position: relative; width: 51px; height: 31px; flex: 0 0 auto; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: rgba(120,120,128,.32); transition: background .25s ease; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 14px; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform .25s var(--ease); }
.switch input:checked + span { background: #34c759; }
.switch input:checked + span::after { transform: translateX(20px); }
input[type=range] { width: 100%; accent-color: var(--accent); }

/* chips (category picker) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 14px; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--fill); font-size: 15px; font-weight: 600; color: var(--text); }
.chip[aria-pressed="true"] { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .chip[aria-pressed="true"] { color: #04140a; } }

/* media */
.media { padding: 12px 16px 14px; }
.media-preview { width: 100%; aspect-ratio: 4/3; border-radius: 10px; background: var(--fill) center/contain no-repeat; overflow: hidden; display: grid; place-items: center; color: var(--text-3); font-size: 15px; }
.media-preview img { width: 100%; height: 100%; object-fit: contain; }
.media-preview.video { aspect-ratio: 16/9; background: #000; }
.media-preview iframe, .media-preview video { width: 100%; height: 100%; border: 0; display: block; }
.media-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btn { min-height: 40px; padding: 0 16px; border-radius: 999px; font-weight: 600; font-size: 15px; background: var(--fill); color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.primary { background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { background: var(--accent); color: #04140a; } }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; }
.btn:active { transform: scale(.96); }

/* steps */
.step-card { padding: 12px 0 4px; position: relative; }
.step-card + .step-card { border-top: .5px solid var(--sep); }
.step-top { display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; }
.step-no { width: 30px; height: 30px; border-radius: 15px; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; font-size: 15px; flex: 0 0 auto; }
@media (prefers-color-scheme: dark) { .step-no { background: var(--accent); color: #04140a; } }
.step-top .grow { flex: 1; font-weight: 600; color: var(--text-2); font-size: 14px; }
.step-img { display: flex; align-items: center; gap: 10px; padding: 0 16px 10px; }
.step-img img { width: 96px; height: 72px; border-radius: 8px; object-fit: contain; background: #fff; box-shadow: inset 0 0 0 .5px var(--sep); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; text-align: center; }
.login-card img { width: 84px; height: 84px; border-radius: 20px; margin: 0 auto 16px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.login-card h1 { font-size: 28px; margin: 0 0 4px; letter-spacing: -0.02em; }
.login-card p { color: var(--text-2); margin: 0 0 22px; }
.login-card .card { text-align: left; }
.login-card .btn { width: 100%; min-height: 50px; margin-top: 16px; font-size: 17px; border-radius: 14px; }
.err { color: var(--danger); font-size: 15px; min-height: 22px; margin-top: 10px; }

/* save bar + toast + sheet */
.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px 12px calc(10px + var(--sab)); background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--sep);
  animation: up .35s var(--ease); }
.savebar[hidden] { display: none; }
.savebar-inner { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 8px; }
.savebar-msg { flex: 1; font-size: 15px; font-weight: 600; color: var(--text-2); }
.savebar .btn.primary { min-width: 110px; min-height: 44px; font-size: 17px; }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
.toast { position: fixed; left: 50%; top: calc(var(--sat) + 64px); z-index: 60; transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  background: rgba(30,30,32,.92); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 15px; font-weight: 600; max-width: 92vw; text-align: center;
  transition: opacity .25s ease, transform .35s var(--ease); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--danger); }
.sheet-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.35); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 71; max-height: 86vh; overflow: auto; background: var(--bg); border-radius: 16px 16px 0 0;
  padding: 8px 16px calc(24px + var(--sab)); max-width: 760px; margin: 0 auto; animation: up .4s var(--ease); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: -8px; background: var(--bg); padding: 10px 0; z-index: 1; }
.sheet-head b { font-size: 17px; }
.empty-note { padding: 16px; color: var(--text-2); font-size: 15px; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }

/* ticker preview (matches the public ticker / cook-time sheet) */
.tk-preview { padding: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.tkp-label { color: var(--text-2); font-size: 13px; font-weight: 600; margin-right: 4px; }
.tkp-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 10px; border-radius: 999px; white-space: nowrap;
  background: color-mix(in srgb, var(--c) 13%, transparent); box-shadow: inset 0 0 0 .5px color-mix(in srgb, var(--c) 28%, transparent); }
.tkp-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.tkp-chip b { font-weight: 600; }
.tkp-chip span { color: var(--text-2); font-variant-numeric: tabular-nums; }
.tkp-chip.small { height: 26px; font-size: 13px; }
.tkp-sep { width: 4px; height: 4px; border-radius: 50%; background: var(--text-3); opacity: .45; margin: 0 4px; }

/* EN + ES side by side (cook time) */
.bi-row { display: grid; grid-template-columns: 1fr 1fr; position: relative; }
.bi-row .field + .field::before { top: 10px; bottom: 12px; left: 0; right: auto; border-top: 0; border-left: .5px solid var(--sep); }
.bi-row + .bi-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
@media (max-width: 360px) { .bi-row { grid-template-columns: 1fr; } .bi-row .field + .field::before { top: 0; bottom: auto; left: 16px; right: 0; border-left: 0; border-top: .5px solid var(--sep); } }
.bi-row.stack { grid-template-columns: 1fr; }
.bi-row.stack .field + .field::before { top: 0; bottom: auto; left: 16px; right: 0; border-left: 0; border-top: .5px solid var(--sep); }
.bi-row.stack textarea { min-height: 52px; }

/* opened inside the installed app (white status text, content runs up behind it): no separate strip;
   in light mode the nav bar itself is brand green so the status text stays readable */
@media (prefers-color-scheme: light) {
  html.standalone .nav { --text: #fff; --text-2: rgba(255,255,255,.8); --accent: #fff; --fill: rgba(255,255,255,.17); --sep: rgba(0,0,0,.2); color: #fff; background: #2B5637; }
  html.standalone .nav .lang-seg button[aria-pressed="true"] { background: #fff; color: #2B5637; box-shadow: none; }
}
html.standalone .nav { -webkit-backdrop-filter: none; backdrop-filter: none; }
@media (prefers-color-scheme: dark) { html.standalone .nav { background: #161618; } }
html.standalone, html.standalone body { overscroll-behavior: none; }
/* installed app: iOS 26 takes the status-bar colour from body/html background-color, so both = the nav colour;
   the page grey is painted as a background-image layer (not sampled) */
html.standalone body { background-color: #2B5637; background-image: linear-gradient(var(--bg), var(--bg)); min-height: 100vh; }
@media (prefers-color-scheme: dark) { html.standalone body { background-color: #161618; } }

/* KDS screen: POS name -> training item mapping */
.kds-map-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 16px; position: relative; flex-wrap: wrap; }
.kds-map-row + .kds-map-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
.kds-map-row .row-main { min-width: 180px; }
.kds-select { font: inherit; font-size: 15px; color: var(--text); background: var(--fill); border: 0; border-radius: 10px; padding: 8px 10px; max-width: 100%; min-height: 40px; }
.kds-map-row .kds-select { flex: 0 1 300px; }
.kds-how { font-weight: 700; }
.kds-how.ok { color: #248a3d; } .kds-how.warn { color: #b25000; } .kds-how.bad { color: var(--danger); } .kds-how.muted { color: var(--text-2); }
@media (prefers-color-scheme: dark) { .kds-how.ok { color: #30d158; } .kds-how.warn { color: #ffb340; } }
.kds-add { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 16px; border-top: .5px solid var(--sep); }
.kds-add .field { padding: 0; }
.kds-add .btn { align-self: flex-start; }

/* ---------- Import steps from a PDF or photo (inside the Step-by-step card) ---------- */
.row.add.imp-row .plus svg { display: block; }
.row.add.imp-row .row-title { font-size: 17px; }
.row.add.imp-row .row-sub { font-weight: 400; white-space: normal; }
.row.add.imp-row.busy { cursor: progress; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2.2px solid rgba(255,255,255,.45); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.imp { position: relative; margin: 2px 10px 12px; padding: 4px 0 12px; border-radius: 14px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--sep); }
.row + .imp::before { content: none; }
.imp-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 6px 12px; }
.imp-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto; color: var(--accent); background: rgba(43,86,55,.12); }
.imp-ic.bad { color: #a05a00; background: #fff1c2; }
.imp-title { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.imp-note { margin: 6px 12px 4px; padding: 9px 11px; border-radius: 10px; font-size: 13.5px; line-height: 1.4; background: #fff7dd; color: #6b4a00; }
.imp-note.ok { background: rgba(43,86,55,.1); color: var(--accent); }
.imp-note.warn, .imp-note.es-miss { display: flex; gap: 6px; align-items: flex-start; }
.imp-note svg, .imp-flag svg { flex: 0 0 auto; margin-top: 2px; }
.imp-pick { padding: 10px 12px 6px; }
.imp-steps { margin: 8px 10px 0; border-radius: 12px; background: var(--card); overflow: hidden; }
.imp-step { padding: 12px 0 2px; position: relative; }
.imp-step + .imp-step { border-top: .5px solid var(--sep); }
.imp-step .field { padding: 6px 12px 6px 16px; }
.imp-step textarea { min-height: 52px !important; }
.imp-photo { display: flex; align-items: center; gap: 12px; margin: 2px 12px 10px 16px; }
.imp-thumb { flex: 0 0 auto; display: block; width: 132px; height: 100px; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 .5px var(--sep); }
.imp-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.imp-photo-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.imp-photo-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.imp-photo-btns .btn { min-height: 36px; padding: 0 14px; }
@media (min-width: 700px) { .imp-thumb { width: 168px; height: 126px; } }
.imp-flag { display: flex; gap: 6px; margin: 0 12px 10px 16px; font-size: 12.5px; color: #a05a00; }
.imp-sugs { margin: 10px 12px 0; padding: 10px 12px; border-radius: 12px; background: var(--card); }
.imp-sug { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; font-size: 14.5px; line-height: 1.4; }
.imp-sug + .imp-sug { border-top: .5px solid var(--sep); }
.imp-sug input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--accent); flex: 0 0 auto; }
.imp-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 12px 0; }
.imp-foot { margin: 8px 14px 0; font-size: 12.5px; color: var(--text-2); }
@media (prefers-color-scheme: dark) {
  .imp-ic { background: rgba(108,196,138,.16); }
  .imp-ic.bad { background: #4a3500; color: #ffd27a; }
  .imp-note { background: #3a2c00; color: #ffd98a; }
  .imp-note.ok { background: rgba(108,196,138,.14); }
  .imp-flag { color: #ffb44a; }
  .spin { border-color: rgba(4,20,10,.35); border-top-color: #04140a; }
}
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } }
.imp-actions, .imp { scroll-margin-bottom: 96px; scroll-margin-top: 60px; }

.imp-note.es-miss { background: #fde8e4; color: #8a2b14; }
@media (prefers-color-scheme: dark) { .imp-note.es-miss { background: #3d1a12; color: #ffb4a2; } }

/* paired-sauce pills (same look as on the public site) */
.sauce-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: -0.005em; white-space: nowrap; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.12); }
.pills .sauce-pill { min-height: 20px; font-size: 12px; padding: 0 8px; }
.sauce-pick { gap: 10px; align-items: center; }
.sauce-pick select { flex: 1 1 auto; min-width: 0; }
