/*
 * Soft UI: depth from soft, layered shadows instead of hard lines. Corners of 10–16px,
 * calm 200ms hover states, clear focus rings. Loaded last on every page, so it only
 * restyles: layout stays in the other stylesheets. Colours are the brand's own.
 */
:root {
  --radius: 10px;
  --radius-large: 16px;
  /* a hairline drawn as a shadow, so cards keep an edge without a hard border */
  --edge: 0 0 0 1px rgb(18 19 15 / 0.06);
  --shadow-sm: var(--edge), 0 1px 2px rgb(18 19 15 / 0.05), 0 2px 6px rgb(18 19 15 / 0.04);
  --shadow: var(--edge), 0 1px 2px rgb(18 19 15 / 0.04), 0 8px 24px -8px rgb(18 19 15 / 0.12);
  --shadow-lift: var(--edge), 0 2px 4px rgb(18 19 15 / 0.05), 0 16px 36px -12px rgb(18 19 15 / 0.18);
  --field: #fbfcfa;
  --soft-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- surfaces: cards and panels float on a shadow, not a border ---------- */
.panel, .client-box, .side, .intake, .assistant, .history[open], .share-panel, .narrow .form, .table-scroll,
.today__panel, .plan, .plan + .plan, .notice, .share__card, .portal-link, .glance__card, .foodpick, .window, .card {
  border-color: transparent;
  border-radius: var(--radius-large);
  box-shadow: var(--shadow);
}
.panel, .client-box, .side, .intake, .assistant { background: var(--white); }
.plans { border: 0; gap: 20px; }
.home .plan { border-radius: 20px; box-shadow: var(--shadow); transition: box-shadow 0.2s var(--soft-ease), transform 0.2s var(--soft-ease); }
.home .plan:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.plan.is-recommended { box-shadow: 0 0 0 2px var(--accent), 0 12px 30px -12px rgb(71 118 97 / 0.35); }
.home .plan.is-recommended:hover { box-shadow: 0 0 0 2px var(--accent), 0 18px 40px -14px rgb(71 118 97 / 0.45); }
.window .wb.panel { box-shadow: none; }
.reasonbox { border-color: rgb(180 35 24 / 0.35); box-shadow: var(--shadow-sm); }

/* the app's page sits on stone; the header lifts off it with a shadow, not a rule */
.portal-header { border-bottom: 0; box-shadow: 0 1px 0 rgb(18 19 15 / 0.05), 0 4px 16px -10px rgb(18 19 15 / 0.12); position: relative; z-index: 5; }
.menu__body { border-color: transparent; border-radius: 14px; box-shadow: var(--shadow-lift); }

/* ---------- buttons: a soft lift on hover, pressed on click ---------- */
.button {
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: background-color 0.2s var(--soft-ease), border-color 0.2s var(--soft-ease), box-shadow 0.2s var(--soft-ease), transform 0.2s var(--soft-ease), color 0.2s var(--soft-ease);
}
.button:not(.button--solid) { border-color: transparent; }
.button:hover:not(:disabled) { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.button:active:not(:disabled) { box-shadow: var(--shadow-sm); transform: translateY(0); }
.button--solid { box-shadow: 0 1px 2px rgb(53 90 73 / 0.3), 0 6px 16px -6px rgb(53 90 73 / 0.5); }
.button--solid:hover:not(:disabled) { box-shadow: 0 2px 4px rgb(53 90 73 / 0.3), 0 12px 24px -8px rgb(53 90 73 / 0.55); }
.button:disabled { box-shadow: none; }
.button:focus-visible, .link:focus-visible, .filtertab:focus-visible, .chip input:focus-visible + span { outline: 3px solid rgb(71 118 97 / 0.35); outline-offset: 2px; }

/* ---------- fields: a soft, slightly sunken well ---------- */
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea, .toolbar input, .assistant input, .intake textarea,
.client__copy select, .target input, .wb__select, .wb__template input, .detail__actions select, .lib > input, .foodsearch__row input,
.foodsearch__row select, .ingredients input, .ingredients select, .ownfood input, .sharelink input, .share__other input, .calc__form input,
.share-panel input, .portal-link input, .portal-link textarea, .reasonbox textarea, .foodpick__row input, .foodpick__row select,
.detail__rename input, .share__code {
  border-color: rgb(18 19 15 / 0.1);
  border-radius: var(--radius);
  background-color: var(--field);
  box-shadow: inset 0 1px 2px rgb(18 19 15 / 0.05);
  transition: border-color 0.2s var(--soft-ease), box-shadow 0.2s var(--soft-ease), background-color 0.2s var(--soft-ease);
}
/* placeholders in these light fields: the browser default grey misses 4.5:1 on --field */
:is(.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea, .toolbar input, .assistant input, .intake textarea, .client__copy select, .target input, .wb__select, .wb__template input, .detail__actions select, .lib > input, .foodsearch__row input, .foodsearch__row select, .ingredients input, .ingredients select, .ownfood input, .sharelink input, .share__other input, .calc__form input, .share-panel input, .portal-link input, .portal-link textarea, .reasonbox textarea, .foodpick__row input, .foodpick__row select, .detail__rename input, .share__code)::placeholder { color: var(--ink-3); opacity: 1; }
.field input:not([type="checkbox"]):not([type="radio"]):hover, .field select:hover, .field textarea:hover, .toolbar input:hover, .lib > input:hover { border-color: rgb(18 19 15 / 0.2); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--accent);
  background-color: var(--white);
  outline: 0;
  /* strong enough to find on a page of small number fields */
  box-shadow: 0 0 0 3px rgb(71 118 97 / 0.5);
}
.lang select { border-color: transparent; box-shadow: var(--shadow-sm); }

/* ---------- small controls ---------- */
.chip span { border-color: transparent; border-radius: 999px; background: var(--white); box-shadow: var(--shadow-sm); transition: background-color 0.2s var(--soft-ease), box-shadow 0.2s var(--soft-ease); }
.chip:hover span { box-shadow: var(--shadow); }
.chip input:checked + span { box-shadow: 0 1px 2px rgb(53 90 73 / 0.3), 0 4px 10px -4px rgb(53 90 73 / 0.45); }
.filtertab { border-color: transparent; border-radius: 14px; box-shadow: var(--shadow-sm); transition: box-shadow 0.2s var(--soft-ease), background-color 0.2s var(--soft-ease); }
.filtertab:hover { box-shadow: var(--shadow); }
.filtertab[aria-pressed="true"] { border-color: transparent; box-shadow: 0 0 0 2px var(--accent), var(--shadow-sm); }
.lib__tabs { border-color: transparent; border-radius: 12px; padding: 3px; gap: 2px; background: var(--stone-2); }
.lib__tabs button { border: 0; border-radius: 9px; }
.lib__tabs button[aria-pressed="true"] { box-shadow: var(--shadow-sm); }
.foodpick__hit, .stepper b { border-color: transparent; box-shadow: var(--shadow-sm); }

/* ---------- the week builder: meals sit in soft wells ---------- */
.cell__main { border-radius: 10px; transition: background-color 0.2s var(--soft-ease), box-shadow 0.2s var(--soft-ease); }
.cell:hover .cell__main { box-shadow: var(--shadow-sm); }
.cell.is-selected .cell__main { box-shadow: 0 0 0 2px var(--accent), 0 6px 16px -8px rgb(71 118 97 / 0.45); }
.dish { border-radius: 10px; transition: background-color 0.2s var(--soft-ease); }

/* ---------- the home page ---------- */
.home .site-header.is-scrolled { border-bottom-color: transparent; box-shadow: 0 1px 0 rgb(18 19 15 / 0.04), 0 8px 24px -16px rgb(18 19 15 / 0.2); }
.howto li { border-color: transparent; background: rgb(255 255 255 / 0.06); box-shadow: 0 1px 0 rgb(255 255 255 / 0.08) inset, 0 12px 28px -14px rgb(0 0 0 / 0.6); }

/* ---------- touch: every header control is at least 44px tall on a phone or tablet ---------- */
@media (max-width: 760px), (pointer: coarse) {
  .nav a, .portal-header nav a, .account-links .link, .account-links a, .account-links button { display: inline-flex; align-items: center; min-height: 44px; }
  .lang select, .home .site-header .account-links .button { min-height: 44px; }
  .mark { display: inline-flex; align-items: center; min-height: 44px; }
  .portal-header button, .button, .lib__tabs button, .detail__tabs button, .tabs button { min-height: 44px; }
  .button--small { min-height: 40px; }
  .foot nav { gap: 0; }
  .foot nav a { display: inline-flex; align-items: center; min-height: 40px; }
}

/* ---------- type: balanced headings, no lone last words in paragraphs ---------- */
h1, h2, h3 { text-wrap: balance; }
p, li, figcaption, summary { text-wrap: pretty; }

@media (prefers-reduced-motion: reduce) {
  .button, .home .plan { transition: none; }
  .button:hover:not(:disabled), .button:active:not(:disabled), .home .plan:hover { transform: none; }
}
@media print {
  .panel, .card, .plan, .button, .table-scroll { box-shadow: none !important; }
}
