/* ============================================================================
   Stock the Block — members.html + admin.html
   Only theme tokens (var(--...)), so light, dark and stock all just work.
   This is a work tool, so it's quieter than the public site: no scroll
   effects, no mascot, dense but readable.
   ============================================================================ */

   .portal-main { padding-top:88px; padding-bottom:96px; max-width:760px; }
   .portal-wide { max-width:1000px; }
   .portal-head { margin:0 0 28px; }
   .portal-head h1 { font-size:clamp(30px,4.4vw,42px); margin:0; color:var(--text); }
   .p-lede { font-size:17px; line-height:1.6; color:var(--text-secondary); margin:10px 0 0; max-width:60ch; }
   .p-h2 { font-family:'Plus Jakarta Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; font-weight:700;
     font-size:21px; letter-spacing:-0.02em; color:var(--text); margin:0 0 16px; }
   .p-muted { color:var(--text-secondary); font-size:14px; line-height:1.55; margin:0; }
   .p-who { font-size:14px; color:var(--text-secondary); margin:0 0 20px; }
   .p-who b { color:var(--text); font-weight:600; }
   
   .p-card { background:var(--surface); border:1px solid var(--brand-line); border-radius:12px; padding:24px; margin:0 0 40px; }
   .p-narrow { max-width:440px; }
   
   /* --- forms --------------------------------------------------------------- */
   /* minmax(0,1fr): without it the grid grows to fit its widest item (the
      file picker) and the fields spill out of the card on narrow phones. */
   .p-form { display:grid; grid-template-columns:minmax(0,1fr); gap:18px; }
   .p-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px 18px; }
   @media (max-width:560px) { .p-grid { grid-template-columns:minmax(0,1fr); } }
   .p-form label, .p-grid label { display:grid; grid-template-columns:minmax(0,1fr); gap:7px; align-content:start; font-size:13px; font-weight:600; color:var(--text); }
   #deliveryFields { display:grid; grid-template-columns:minmax(0,1fr); gap:18px; }
   .p-fieldset { min-width:0; }
   .p-opt { font-weight:400; color:var(--text-secondary); }
   .portal input[type="text"], .portal input[type="email"], .portal input[type="password"],
   .portal input[type="number"], .portal input[type="date"], .portal textarea {
     width:100%; min-width:0; box-sizing:border-box; border:1px solid var(--rule); background:var(--bg); color:var(--text);
     font-family:inherit; font-size:15px; padding:10px 12px; border-radius:8px; transition:border-color 140ms ease, box-shadow 140ms ease; }
   .portal textarea { resize:vertical; line-height:1.5; max-width:100%; }
   /* iPhone Safari draws date inputs at their own natural width and ignores
      width:100%, so the field stuck out past the right edge of the form.
      Dropping the native look lets it size like the other fields. */
   .portal input[type="date"] { -webkit-appearance:none; appearance:none; display:block; max-width:100%;
     min-height:2.6em; }
   .portal input[type="date"]::-webkit-date-and-time-value { text-align:left; margin:0; }
   .portal input[type="file"] { width:100%; max-width:100%; min-width:0; }
   .portal input:focus-visible, .portal textarea:focus-visible { outline:none; border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-line-soft); }
   .portal input[type="file"] { font-size:14px; color:var(--text-secondary); }
   .portal input[type="file"]::file-selector-button { font-family:inherit; font-weight:600; font-size:13px; margin-right:12px; padding:8px 14px;
     border-radius:8px; border:1.5px solid var(--brand-line-mid); background:var(--surface); color:var(--brand); cursor:pointer; }
   
   .p-fieldset { border:1px solid var(--line); border-radius:10px; padding:14px 14px 12px; margin:0; display:grid; gap:10px; }
   .p-fieldset legend { font-size:13px; font-weight:600; padding:0 6px; color:var(--text); }
   .p-items { display:grid; gap:8px; }
   .p-item { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(0,1fr) auto; gap:8px; align-items:center; }
   @media (max-width:480px) { .p-item { grid-template-columns:minmax(0,1fr) minmax(0,0.7fr); } .p-item .p-rm { grid-column:1 / -1; justify-self:end; } }
   .p-rm { background:none; border:1px solid transparent; width:38px; height:38px; display:grid; place-items:center; padding:0; border-radius:8px; font-family:inherit; font-size:13px; color:var(--text-secondary); cursor:pointer; }
   .p-rm:hover { color:var(--accent-text); border-color:var(--line); }
   
   .p-link { background:none; border:none; padding:0; font-family:inherit; font-size:14px; font-weight:600; color:var(--brand); cursor:pointer; justify-self:start; }
   .p-link:hover { color:var(--accent-text); text-decoration:underline; }
   .p-link:disabled { color:var(--text-secondary); cursor:default; text-decoration:none; }
   
   .p-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; }
   .btn-sm.danger { color:var(--accent-text); border-color:var(--accent); }
   .btn-sm.danger:hover:not(:disabled) { background:color-mix(in srgb, var(--accent) 10%, transparent); border-color:var(--accent); }
   .btn-sm.quiet { border-color:transparent; background:none; color:var(--text-secondary); font-weight:600; }
   .btn-sm.quiet:hover:not(:disabled) { color:var(--accent-text); background:none; }
   
   .p-msg { margin:0; font-size:14px; line-height:1.5; color:var(--text-secondary); min-height:1.5em; }
   .p-msg.is-ok { color:var(--brand); font-weight:600; }
   .p-msg.is-err { color:var(--accent-text); font-weight:600; }
   
   .p-preview { display:flex; align-items:center; gap:14px; font-size:13px; color:var(--text-secondary); padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--bg); }
   .p-preview[hidden] { display:none; }
   .p-preview img { width:72px; height:72px; object-fit:cover; border-radius:8px; border:1px solid var(--line); flex:none; }
   .p-preview-text { display:grid; gap:2px; min-width:0; margin-right:auto; }
   .p-preview-text b { color:var(--text); font-size:14px; }
   
   /* --- delivery cards ----------------------------------------------------- */
   .d-list { display:grid; gap:14px; }
   .d-card { background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:18px 20px; display:grid; gap:14px; }
   .d-head { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; }
   .d-head .p-muted { font-size:13px; }
   .d-route { font-family:'Plus Jakarta Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; font-weight:700; font-size:17px;
     letter-spacing:-0.01em; color:var(--text); margin:0 0 10px; }
   .d-arrow { font-weight:500; color:var(--text-secondary); }
   .d-facts { display:flex; flex-wrap:wrap; gap:6px 28px; margin:0 0 12px; }
   .d-facts dt { font-size:12px; color:var(--text-secondary); }
   .d-facts dd { margin:2px 0 0; font-size:15px; font-weight:600; font-variant-numeric:tabular-nums; }
   .d-items { list-style:none; margin:0; padding:0; border-top:1px solid var(--line-soft); }
   .d-items li { display:flex; justify-content:space-between; gap:16px; padding:7px 0; border-bottom:1px solid var(--line-soft); font-size:14px; }
   .d-qty { color:var(--text-secondary); font-variant-numeric:tabular-nums; }
   .d-notes { margin:12px 0 0; font-size:14px; line-height:1.55; color:var(--text); white-space:pre-wrap; }
   .d-review { margin:0; padding:10px 12px; border-radius:8px; background:var(--tint); font-size:14px; line-height:1.5; white-space:pre-wrap; }
   
   /* Status: orange asks for attention, green is done, rejected steps back. */
   .d-status { display:inline-flex; align-items:center; gap:6px; padding:3px 10px 3px 8px; border-radius:999px; border:1.5px solid;
     font-family:'Plus Jakarta Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; font-weight:700; font-size:12px; }
   .d-status::before { content:""; width:7px; height:7px; border-radius:50%; background:currentColor; }
   .d-status.s-pending { color:var(--accent-text); border-color:var(--accent); background:color-mix(in srgb, var(--accent) 10%, transparent); }
   .d-status.s-accepted { color:var(--brand); border-color:var(--brand); }
   .d-status.s-rejected { color:var(--text-secondary); border-color:var(--line); border-style:dashed; }
   
   /* Admin: details and photo side by side. */
   .d-split { display:grid; grid-template-columns:minmax(0,1fr) 220px; gap:20px; align-items:start; }
   @media (max-width:640px) { .d-split { grid-template-columns:minmax(0,1fr); } }
   .d-photo img { width:100%; border-radius:8px; border:1px solid var(--line); display:block; }
   .d-temps { font-size:13px; }
   .d-admin textarea { font-size:14px; }
   .d-card.is-editing { border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-line-soft); }
   
   .p-tabs { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 18px; }
   .p-tab { font-family:'Plus Jakarta Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; font-weight:600; font-size:13px;
     padding:8px 14px; border-radius:8px; border:1px solid var(--line); background:var(--surface); color:var(--text-secondary); cursor:pointer; }
   .p-tab:hover { color:var(--text); }
   .p-tab[aria-pressed="true"] { background:var(--brand); border-color:var(--brand); color:var(--on-brand); }
   .p-count { font-variant-numeric:tabular-nums; opacity:0.8; }
   .p-empty { padding:24px 0; }
   
   /* design.css hides nav links and the theme label on phones, which suits the
      long public nav; here there are only two links and no icon. */
   @media (max-width:800px) {
     .portal nav.bar .links a:not([hidden]) { display:inline; }
     .portal #themeToggle .theme-name { display:inline; }
   }
   .portal #themeToggle { width:auto; padding:0 10px; }

   /* --- portal: greeting, tabs, badges -------------------------------------- */
.p-hello { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:6px 16px; margin:0 0 16px; }
.p-hello h2 { font-family:'Plus Jakarta Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; font-weight:700;
  font-size:24px; letter-spacing:-0.02em; color:var(--brand); margin:0; }
.p-hello .p-who { margin:0; }
/* Scrolls sideways only. The baseline is an inset shadow the active tab's
   underline sits on top of; it used to be a border plus a -1px margin on the
   tabs, which made the bar a pixel too tall, so it scrolled up and down too. */
.p-tabbar { display:flex; gap:4px; box-shadow:inset 0 -1px 0 var(--line); margin:0 0 24px; overflow-x:auto; overflow-y:hidden; overscroll-behavior-x:contain; }
.p-tabbar [role="tab"] { display:inline-flex; align-items:center; gap:8px; white-space:nowrap; cursor:pointer;
  font-family:'Plus Jakarta Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; font-weight:600; font-size:15px;
  padding:12px 14px; background:none; border:none; border-bottom:2px solid transparent; color:var(--text-secondary); }
.p-tabbar [role="tab"]:hover { color:var(--text); }
.p-tabbar [role="tab"][aria-selected="true"] { color:var(--brand); border-bottom-color:var(--accent); }
.p-tabbar [role="tab"][hidden] { display:none; }
.p-badge { font-size:12px; font-weight:700; min-width:20px; padding:1px 7px; border-radius:999px; text-align:center;
  background:var(--line-soft); color:var(--text-secondary); font-variant-numeric:tabular-nums; }
.p-badge:empty { display:none; }
.p-badge.is-alert { background:var(--accent); color:#1D1D1F; }
.p-formcard { max-width:760px; margin-bottom:0; }
.p-tabintro { margin:0 0 16px; max-width:62ch; }.p-card .p-muted + .p-muted { margin-top:10px; }
.p-card .p-muted a { color:var(--brand); font-weight:600; }
.p-card .p-muted + .p-actions { margin-top:16px; }

/* ============================================================================
   Redesign: sign-in screens, dashboard, sectioned delivery form
   ============================================================================ */
.ico { display:inline-grid; place-items:center; flex:none; line-height:0; }
.ico svg { display:block; }

/* --- sign-in and approval screens --------------------------------------- */
.auth { min-height:calc(100svh - 190px); display:grid; align-content:center; justify-items:center; gap:18px; padding:8px 0 24px; }
.auth-card { width:100%; max-width:940px; display:grid; grid-template-columns:minmax(0,1.05fr) minmax(0,1fr); background:var(--surface);
  border:1px solid var(--brand-line); border-radius:20px; overflow:hidden; box-shadow:0 1px 2px var(--line-soft), 0 28px 60px -32px var(--paper-shadow); }
.auth-solo .auth-card { max-width:520px; grid-template-columns:minmax(0,1fr); }
.auth-side { position:relative; isolation:isolate; background:var(--tint); padding:44px 44px 40px; display:flex; flex-direction:column; align-items:flex-start;
  border-right:1px solid var(--brand-line-soft); }
/* Graph paper, fading out toward the bottom: the same texture as the food
   safety band on the home page. */
.auth-side::before { content:""; position:absolute; inset:0; z-index:-1; pointer-events:none;
  background-image:linear-gradient(var(--brand-line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--brand-line-soft) 1px, transparent 1px);
  background-size:26px 26px; -webkit-mask-image:linear-gradient(180deg, #000 0%, transparent 70%); mask-image:linear-gradient(180deg, #000 0%, transparent 70%); }
.auth-mascot { display:block; width:88px; margin:0 0 22px; }
.auth-kicker { font-family:'DM Mono',ui-monospace,Menlo,monospace; font-size:12px; letter-spacing:0.1em; text-transform:uppercase; color:var(--brand); margin:0 0 8px; }
.auth-title { font-family:'Plus Jakarta Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; font-weight:800; font-size:clamp(32px,3.6vw,42px);
  line-height:1.05; letter-spacing:-0.035em; color:var(--text); margin:0 0 12px; }
.auth-lede { font-size:16.5px; line-height:1.55; color:var(--text-secondary); margin:0 0 28px; max-width:40ch; }
.auth-points { list-style:none; margin:auto 0 0; padding:0; display:grid; gap:18px; }
.auth-points li { display:grid; grid-template-columns:38px minmax(0,1fr); gap:14px; align-items:start; }
.auth-ico { width:38px; height:38px; border-radius:10px; background:var(--surface); border:1px solid var(--brand-line); color:var(--brand); }
.auth-points b { display:block; font-family:'Plus Jakarta Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; font-weight:700; font-size:15px; color:var(--text); margin:1px 0 2px; }
.auth-points span { font-size:14px; line-height:1.5; color:var(--text-secondary); }

.auth-main { padding:52px 48px; display:flex; flex-direction:column; justify-content:center; gap:14px; }
.auth-solo .auth-main { padding:36px; }
.auth-h { font-family:'Plus Jakarta Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; font-weight:800; font-size:28px; letter-spacing:-0.03em; color:var(--text); margin:0; }
.auth-p { font-size:16px; line-height:1.55; color:var(--text-secondary); margin:0 0 6px; }
.auth-rule { height:1px; background:var(--line); margin:10px 0 4px; }
.auth-fine { font-size:13.5px; line-height:1.55; color:var(--text-secondary); margin:0; }
.auth-fine b { color:var(--text); font-weight:600; }
.auth-fine a { color:var(--brand); font-weight:600; }
.auth-lock { vertical-align:-2px; margin-right:6px; color:var(--brand); display:inline-grid; }
.auth-back { margin:0; font-size:14px; }
.auth-back a { color:var(--text-secondary); font-weight:600; }
.auth-back a:hover { color:var(--brand); }
.auth-status { max-width:360px !important; display:flex !important; flex-direction:column; align-items:center; gap:14px; padding:40px 28px; text-align:center; }
.auth-status p { margin:0; color:var(--text-secondary); font-size:15px; }
.auth .p-msg:empty { display:none; }

.p-spin { width:28px; height:28px; border-radius:50%; border:3px solid var(--brand-line-soft); border-top-color:var(--brand); animation:pSpin 0.8s linear infinite; }
@keyframes pSpin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .p-spin { animation-duration:2.4s; } }

/* "Sign in with Google": Google's own light and dark button colors. */
.g-btn { display:flex; align-items:center; justify-content:center; gap:12px; width:100%; min-height:50px; padding:0 20px; border-radius:12px;
  background:#FFFFFF; color:#1F1F1F; border:1px solid #747775; cursor:pointer;
  font-family:'Plus Jakarta Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; font-weight:700; font-size:16px; letter-spacing:-0.005em;
  transition:background-color 140ms ease, box-shadow 140ms ease, border-color 140ms ease; }
.g-btn:hover:not(:disabled) { background:#F6F8F6; box-shadow:0 1px 3px rgba(60,64,67,0.25); }
.g-btn:focus-visible { outline:2px solid var(--brand); outline-offset:3px; }
.g-btn:disabled { cursor:progress; opacity:0.75; }
.g-logo { width:20px; height:20px; }
:root[data-theme="dark"] .g-btn { background:#131314; color:#E3E3E3; border-color:#8E918F; }
:root[data-theme="dark"] .g-btn:hover:not(:disabled) { background:#1F2020; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="stock"]) .g-btn { background:#131314; color:#E3E3E3; border-color:#8E918F; }
  :root:not([data-theme="light"]):not([data-theme="stock"]) .g-btn:hover:not(:disabled) { background:#1F2020; }
}

/* Waiting for approval */
.acct { display:flex; align-items:center; gap:12px; padding:0 0 18px; margin:0 0 6px; border-bottom:1px solid var(--line-soft); min-width:0; }
.acct > div { display:grid; min-width:0; }
.acct b { font-size:15px; color:var(--text); }
.acct span:not(.avatar) { font-size:13.5px; color:var(--text-secondary); overflow-wrap:anywhere; }
.steps { list-style:none; margin:6px 0 4px; padding:0; display:grid; gap:0; }
.steps li { position:relative; display:flex; align-items:center; gap:12px; padding:8px 0; font-size:15px; color:var(--text-secondary); }
.steps li:not(:last-child)::after { content:""; position:absolute; left:11px; top:34px; height:14px; width:2px; background:var(--line); }
.step-dot { width:24px; height:24px; border-radius:50%; border:2px solid var(--line); display:grid; place-items:center; flex:none; background:var(--surface); }
.steps .is-done { color:var(--text); }
.steps .is-done .step-dot { background:var(--brand); border-color:var(--brand); color:var(--on-brand); }
.steps .is-done .step-dot svg { width:13px; height:13px; }
.steps .is-now { color:var(--text); font-weight:600; }
.steps .is-now .step-dot { border-color:var(--accent); box-shadow:0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.steps .is-now .step-dot::after { content:""; width:8px; height:8px; border-radius:50%; background:var(--accent); }
.uid { display:flex; align-items:center; gap:12px; padding:12px 12px 12px 16px; border-radius:12px; background:var(--tint); border:1px solid var(--brand-line-soft); margin-top:6px; }
.uid-text { display:grid; gap:2px; min-width:0; flex:1; }
.uid-l { font-size:12px; font-weight:600; color:var(--text-secondary); }
.uid code { font-family:'DM Mono',ui-monospace,Menlo,monospace; font-size:13.5px; color:var(--text); overflow-wrap:anywhere; }

.avatar { width:40px; height:40px; border-radius:50%; background:var(--brand); color:var(--on-brand); display:grid; place-items:center; flex:none;
  font-family:'Plus Jakarta Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; font-weight:800; font-size:15px; letter-spacing:0.02em; }
.avatar-lg { width:60px; height:60px; font-size:21px; box-shadow:0 0 0 4px var(--brand-line-soft); }

.p-copy { padding:8px 12px; font-size:13px; flex:none; }
.p-copy.is-done { border-color:var(--brand); }

@media (max-width:760px) {
  .auth { min-height:0; align-content:start; padding-top:0; }
  .auth-card { grid-template-columns:minmax(0,1fr); border-radius:16px; }
  .auth-side { padding:26px 22px 22px; border-right:none; border-bottom:1px solid var(--brand-line-soft); display:grid; grid-template-columns:64px minmax(0,1fr); column-gap:16px; align-items:center; }
  .auth-mascot { width:64px; margin:0; grid-row:1 / span 2; }
  .auth-kicker { margin:0 0 2px; align-self:end; }
  .auth-title { font-size:28px; margin:0; align-self:start; }
  .auth-lede { grid-column:1 / -1; margin:16px 0 0; font-size:15.5px; }
  .auth-points { display:none; }
  .auth-main, .auth-solo .auth-main { padding:26px 22px 24px; }
  .auth-h { font-size:24px; }
}

/* --- dashboard header and numbers ----------------------------------------- */
.dash-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:16px 20px; margin:0 0 24px; }
.dash-id { display:flex; align-items:center; gap:18px; min-width:0; }
.dash-name { min-width:0; }
.dash-kicker { font-family:'DM Mono',ui-monospace,Menlo,monospace; font-size:12px; letter-spacing:0.1em; text-transform:uppercase; color:var(--brand); margin:0; }
.dash-head h1 { font-size:clamp(28px,3.8vw,38px); line-height:1.1; letter-spacing:-0.035em; color:var(--text); margin:2px 0 4px; }
.dash-who { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; margin:0; font-size:14px; color:var(--text-secondary); overflow-wrap:anywhere; }
.role-badge { font-family:'DM Mono',ui-monospace,Menlo,monospace; font-size:11px; font-weight:500; letter-spacing:0.08em; text-transform:uppercase;
  padding:2px 8px; border-radius:999px; border:1px solid var(--brand-line-mid); color:var(--brand); background:var(--tint); }
.role-badge:empty { display:none; }

.dash-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:0 0 28px; }
.stat { background:var(--surface); border:1px solid var(--brand-line); border-radius:14px; padding:16px 18px 14px; }
.stat-n { font-family:'Plus Jakarta Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; font-weight:800; font-size:clamp(24px,3vw,32px);
  letter-spacing:-0.03em; line-height:1.1; color:var(--brand); margin:0; font-variant-numeric:tabular-nums; }
.stat-l { font-size:13px; line-height:1.4; color:var(--text-secondary); margin:4px 0 0; }
@media (max-width:640px) {
  .dash-head { margin-bottom:18px; }
  .dash-id { gap:14px; }
  .avatar-lg { width:48px; height:48px; font-size:17px; }
  .dash-head h1 { font-size:26px; }
  .dash-head { position:relative; }
  .dash-head > .btn-sm { position:absolute; top:0; right:0; padding:7px 12px; font-size:13px; }
  .dash-stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-bottom:22px; }
  .stat { padding:12px 14px; }
  .stat-n { font-size:24px; }
}

/* --- the delivery form, in numbered sections ------------------------------ */
.p-formcard { padding:28px 32px; }
.d-form { gap:0; }
#deliveryFields { gap:0; }
.f-sec { display:grid; grid-template-columns:minmax(0,1fr); gap:14px; padding:26px 0; border-top:1px solid var(--line-soft); }
#deliveryFields > .f-sec:first-child { padding-top:0; border-top:none; }
.f-sec-head { display:grid; grid-template-columns:30px minmax(0,1fr); gap:14px; align-items:start; }
.f-num { width:30px; height:30px; border-radius:50%; display:grid; place-items:center; background:var(--tint); color:var(--brand); border:1px solid var(--brand-line);
  font-family:'DM Mono',ui-monospace,Menlo,monospace; font-weight:500; font-size:13px; }
.f-sec-head h3 { font-family:'Plus Jakarta Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; font-weight:700; font-size:17px; letter-spacing:-0.015em;
  color:var(--text); margin:4px 0 3px; }
.f-sec-head h3 .p-opt { font-size:13px; font-family:'Inter',sans-serif; letter-spacing:0; }
.f-sec-head p { margin:0; font-size:14px; line-height:1.5; color:var(--text-secondary); max-width:62ch; }
.f-body { display:grid; grid-template-columns:minmax(0,1fr); gap:16px; padding-left:44px; }
.d-admin .f-body { padding-left:0; }

.p-field { display:grid; grid-template-columns:minmax(0,1fr); gap:7px; align-content:start; min-width:0; }
.p-field > label { font-size:13px; font-weight:600; color:var(--text); }
.p-grid-date { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
/* From and to, stacked like a trip: a hollow dot for the school, a solid
   one for the drop-off, and a dashed line between them. */
.route { position:relative; display:grid; grid-template-columns:minmax(0,1fr); gap:18px; padding-left:34px; }
.route .p-field { position:relative; }
.route .p-field::before { content:""; position:absolute; left:-34px; top:30px; width:22px; height:22px; box-sizing:border-box; border-radius:50%;
  border:2px solid var(--brand); background:var(--surface); }
.route .p-field + .p-field::before { background:var(--brand); box-shadow:inset 0 0 0 4px var(--surface); }
.route .p-field:first-child::after { content:""; position:absolute; left:-24px; top:56px; bottom:-44px; border-left:2px dashed var(--brand-line-mid); }

/* Box ID */
.boxid { display:flex; align-items:center; gap:14px; padding:16px 16px 16px 20px; border-radius:12px; background:var(--tint); border:1.5px dashed var(--brand-line-mid); }
.boxid-text { display:grid; gap:2px; min-width:0; flex:1; }
.boxid-l { font-family:'DM Mono',ui-monospace,Menlo,monospace; font-size:11.5px; letter-spacing:0.1em; text-transform:uppercase; color:var(--text-secondary); }
.boxid-v { font-family:'DM Mono',ui-monospace,Menlo,monospace; font-weight:500; font-size:clamp(22px,3vw,28px); letter-spacing:0.05em; color:var(--brand); line-height:1.2; }
.boxid.is-none { border-style:solid; border-color:var(--line); }

/* Pick-from-list fields */
.cb-field { display:grid; gap:6px; min-width:0; }
.cb { position:relative; }
.portal .cb input { padding-right:42px; text-overflow:ellipsis; }
.cb-toggle { position:absolute; top:50%; right:5px; transform:translateY(-50%); width:32px; height:32px; display:grid; place-items:center; padding:0;
  border:none; border-radius:6px; background:none; color:var(--text-secondary); cursor:pointer; }
.cb-toggle:hover { color:var(--brand); background:var(--tint); }
.cb-toggle .ico { transition:transform 160ms ease; }
.cb.is-open .cb-toggle .ico { transform:rotate(180deg); }
.cb.is-invalid input { border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.cb-list { position:absolute; left:0; right:0; top:calc(100% + 6px); z-index:40; max-height:min(320px, 52vh); overflow-y:auto; overscroll-behavior:contain;
  background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:6px; box-shadow:0 18px 40px -12px var(--paper-shadow), 0 2px 6px var(--line-soft); }
.cb-list[hidden] { display:none; }
.cb-group + .cb-group { margin-top:4px; padding-top:4px; border-top:1px solid var(--line-soft); }
.cb-group-l { font-family:'DM Mono',ui-monospace,Menlo,monospace; font-size:11px; letter-spacing:0.1em; text-transform:uppercase; color:var(--text-secondary); padding:8px 10px 4px; }
.cb-opt { position:relative; display:grid; gap:1px; padding:9px 34px 9px 10px; border-radius:8px; cursor:pointer; }
.cb-opt.is-active { background:var(--tint); }
.cb-name { font-size:14.5px; font-weight:600; color:var(--text); line-height:1.35; }
.cb-meta { font-size:12.5px; line-height:1.4; color:var(--text-secondary); }
.cb-opt[aria-selected="true"]::after { content:""; position:absolute; right:12px; top:50%; width:6px; height:11px; margin-top:-7px;
  border:solid var(--brand); border-width:0 2px 2px 0; transform:rotate(45deg); }
.cb-empty { padding:12px 10px; font-size:14px; line-height:1.5; color:var(--text-secondary); }
.cb-detail { display:flex; align-items:flex-start; gap:6px; margin:0; font-size:13px; line-height:1.45; color:var(--text-secondary); }
.cb-detail[hidden] { display:none; }
.cb-detail .ico { margin-top:2px; color:var(--brand); }

/* Foods */
.p-fieldset { padding:14px 16px 14px; }
.p-add { display:inline-flex; align-items:center; gap:6px; }

/* Photo */
.f-body { position:relative; }
.vh-file { position:absolute; left:0; top:0; width:1px; height:1px; opacity:0; overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); }
/* ".p-form label" makes labels a grid of small bold text; the photo area is
   a label too, so it needs the extra class to win. */
.p-form .drop { display:flex; grid-template-columns:none; font-size:inherit; font-weight:400; }
.drop { display:flex; align-items:center; gap:16px; padding:18px 20px; border-radius:12px; border:1.5px dashed var(--brand-line-mid); background:var(--bg);
  cursor:pointer; transition:border-color 140ms ease, background-color 140ms ease; }
.drop:hover, .drop.is-over { border-color:var(--brand); background:var(--tint); }
.vh-file:focus-visible + .drop { outline:2px solid var(--brand); outline-offset:3px; }
.drop[hidden] { display:none; }
.drop-ico { width:44px; height:44px; border-radius:12px; display:grid; place-items:center; background:var(--surface); border:1px solid var(--brand-line); color:var(--brand); flex:none; }
.drop-text { display:grid; gap:2px; }
.drop-text b { font-size:15px; color:var(--brand); }
.drop-text span { font-size:13.5px; color:var(--text-secondary); line-height:1.45; }

/* Save */
.f-submit { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:14px 20px; padding-top:22px; border-top:1px solid var(--line-soft); }
.f-submit .p-muted { max-width:44ch; }
.btn-lg { font-size:15.5px; padding:13px 26px; border-radius:10px; }
.d-form > .p-msg { margin-top:12px; }
.d-form > .p-msg:empty { display:none; }

.saved { display:flex; align-items:center; gap:14px; padding:16px 18px; margin:0 0 16px; border-radius:12px; background:var(--tint); border:1px solid var(--brand-line-mid); }
.saved[hidden] { display:none; }
.saved-ico { width:34px; height:34px; border-radius:50%; background:var(--brand); color:var(--on-brand); }
.saved-text { display:grid; gap:2px; flex:1; min-width:0; }
.saved-text b { font-family:'Plus Jakarta Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; font-size:16px; color:var(--text); }
.saved-text span { font-size:14px; line-height:1.45; color:var(--text-secondary); }

@media (max-width:640px) {
  .p-formcard { padding:20px 16px; border-radius:14px; }
  .f-sec { padding:22px 0; }
  .f-sec-head { grid-template-columns:28px minmax(0,1fr); gap:12px; }
  .f-num { width:28px; height:28px; font-size:12px; }
  .f-sec-head h3 { margin-top:3px; }
  .f-body { padding-left:0; }
  .p-grid-date { grid-template-columns:minmax(0,1fr); }
  .boxid { padding:14px; gap:10px; }
  .route .cb-list { left:-34px; }
  .f-submit .btn-lg { width:100%; justify-content:center; }
  .saved { flex-wrap:wrap; }
  .saved .btn-sm { margin-left:48px; }
}

/* Form on the left, checklist on the right; stacked below 960px. */
#tab-log:not([hidden]) { display:grid; grid-template-columns:minmax(0,1fr) 290px; gap:24px; align-items:start; }
#tab-log > .saved { grid-column:1 / -1; }
#tab-log .p-formcard { max-width:none; }
.log-aside { position:sticky; top:84px; display:grid; gap:14px; }
.aside-card { background:var(--surface); border:1px solid var(--brand-line); border-radius:14px; padding:20px 20px 18px; }
.aside-card h2 { font-family:'Plus Jakarta Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; font-weight:700; font-size:16px; letter-spacing:-0.01em; color:var(--text); margin:0 0 12px; }
.aside-card p { margin:0; font-size:14px; line-height:1.55; color:var(--text-secondary); }
.aside-quiet { background:transparent; border-style:dashed; }
.aside-quiet h2 { margin-bottom:6px; }
.checks { list-style:none; margin:0; padding:0; display:grid; gap:10px; }
.checks li { position:relative; padding-left:28px; font-size:14px; line-height:1.45; color:var(--text); }
.checks li::before { content:""; position:absolute; left:0; top:1px; width:18px; height:18px; border-radius:50%; background:var(--tint); border:1px solid var(--brand-line-mid); }
.checks li::after { content:""; position:absolute; left:6.5px; top:5px; width:4px; height:8px; border:solid var(--brand); border-width:0 2px 2px 0; transform:rotate(45deg); }
@media (max-width:960px) {
  #tab-log:not([hidden]) { grid-template-columns:minmax(0,1fr); }
  .log-aside { position:static; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); }
}

/* --- delivery cards ------------------------------------------------------- */
.d-card { border-radius:14px; }
.d-boxid { display:inline-flex; align-items:center; gap:8px; margin:0 0 8px; padding:3px 10px 3px 4px; border-radius:8px; background:var(--tint); border:1px solid var(--brand-line-soft); }
.d-boxid-l { font-family:'DM Mono',ui-monospace,Menlo,monospace; font-size:10.5px; letter-spacing:0.1em; text-transform:uppercase; color:var(--text-secondary);
  padding:2px 6px; border-radius:5px; background:var(--surface); }
.d-boxid code { font-family:'DM Mono',ui-monospace,Menlo,monospace; font-weight:500; font-size:14px; letter-spacing:0.04em; color:var(--brand); }
.d-route { line-height:1.35; }
.d-route:has(+ .d-addr) { margin-bottom:4px; }
.d-arrow { color:var(--brand); }
.d-addr { display:flex; align-items:center; gap:6px; margin:0 0 12px; font-size:13.5px; color:var(--text-secondary); }
.d-addr .ico { color:var(--brand); }

.p-emptystate { display:grid; justify-items:center; text-align:center; gap:10px; padding:48px 20px; border:1.5px dashed var(--brand-line); border-radius:16px; background:var(--surface); }
.p-empty-mascot { display:block; width:72px; margin-bottom:6px; }
.p-emptystate h3 { font-family:'Plus Jakarta Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; font-weight:700; font-size:20px; letter-spacing:-0.02em; color:var(--text); margin:0; }
.p-emptystate .p-muted { max-width:40ch; margin:0 0 6px; }

/* --- review tools --------------------------------------------------------- */
.p-reviewbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px 16px; margin:0 0 18px; }
.p-reviewbar .p-tabs { margin:0; }
.p-search { flex:1 1 260px; max-width:360px; }
.portal .p-search input { width:100%; box-sizing:border-box; border:1px solid var(--rule); background:var(--bg); color:var(--text); font-family:inherit; font-size:14px;
  padding:9px 12px 9px 36px; border-radius:8px; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236C6C70' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-size:16px; background-position:12px 50%; }
.portal .p-search input:focus-visible { outline:none; border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-line-soft); }
@media (max-width:640px) { .p-search { max-width:none; } }

/* Foods: small column names over the rows, and the remove button stays on
   the same row on phones instead of dropping to its own line. */
.p-item-head { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(0,1fr) 38px; gap:8px; font-size:12px; font-weight:600; color:var(--text-secondary); margin:0 0 -2px; }
@media (max-width:480px) {
  .p-item, .p-item-head { grid-template-columns:minmax(0,1fr) 80px 32px; gap:6px; }
  .p-item .p-rm { grid-column:auto; justify-self:center; width:32px; }
}

/* The portal's bar keeps its theme name on phones (see above), but on the
   narrowest ones the icon alone has to do. */
@media (max-width:420px) { .portal #themeToggle .theme-name { display:none; } .portal #themeToggle { padding:0 8px; } }

/* --- footer --------------------------------------------------------------- */
.p-foot { border-top:1px solid var(--line-soft); }
.p-foot .wrap { display:flex; flex-wrap:wrap; gap:8px 22px; padding-top:22px; padding-bottom:28px; font-size:13px; color:var(--text-secondary); }
.p-foot a { color:var(--text-secondary); }
.p-foot a:hover { color:var(--brand); }
