/*
  depth.css — "less flat": real-world depth where it is logical (2026-10-16).
  ========================================================================
  Loaded after views.css / overlays.css so it overrides them, and before
  responsive.css. Built ONLY from shadows, gradients and borders, so every
  effect has a direct equivalent in the phone apps later (iOS: CALayer shadow +
  CAGradientLayer; Android: elevation + GradientDrawable). No images, no filters.
  Revert: delete this file and its <link> in app_shell.html.

  One recipe, three sizes:
    sheet — a piece of paper lying on the page (boards, cards, panels, menus):
            faint paper gradient, crisp lit top edge, a few millimetres of page
            edge under the bottom, a tight contact shadow where it meets the
            surface, a soft cast shadow down-and-left (light from the top-right).
    note  — a small thing resting ON a sheet (shift cards, chips): a tighter
            shadow; lifts under the pointer, settles when pressed.
    float — something held above everything (panels, windows, menus, toasts):
            the sheet recipe plus a long soft shadow.
  Never changes stacking order (z-index): a raised header once trapped the
  identity menu behind the week's pinned day row. Separation between layers
  is drawn on the LOWER layer's top edge instead.
*/
:root {
  --paper: linear-gradient(165deg, #ffffff 0%, #fbfcfd 60%, #f4f6f9 100%);
  --sheet-top: inset 0 1px 0 var(--lit);
  --sheet-bottom: inset 0 -1px 0 rgba(20, 30, 50, .08);
  --sheet-edges: 0 1px 0 0 #e2e6ec, 0 2px 0 0 #d5dbe3, 0 3px 0 0 #c7cfd9;
  --sheet-contact: 0 2px 4px rgba(20, 30, 50, .20);
  --sheet-cast: -8px 16px 28px -8px rgba(20, 30, 50, .24);
  --sheet: var(--sheet-top), var(--sheet-bottom), var(--sheet-edges), var(--sheet-contact), var(--sheet-cast);
  --float: var(--sheet-top), var(--sheet-bottom), var(--sheet-edges), var(--sheet-contact),
           -10px 24px 40px -8px rgba(20, 30, 50, .32), 0 48px 80px -20px rgba(20, 30, 50, .40);
  --note-rest: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 2px rgba(20, 30, 50, .14), 0 4px 8px -2px rgba(20, 30, 50, .18);
  --note-lift: inset 0 1px 0 rgba(255, 255, 255, .9), 0 2px 4px rgba(20, 30, 50, .12), 0 12px 22px -6px rgba(20, 30, 50, .30);
  --note-press: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 1px rgba(20, 30, 50, .12);
  --under-bar: inset 0 9px 9px -9px rgba(20, 30, 50, .20);
}

/* ---- 1. Boards: each phase band (week), the table (team), each day cell
   (month) is a sheet lying on the page. Week cells keep their phase tints. ---- */
.wk-band, .team-card { box-shadow: var(--sheet); }
.month-cell { background: var(--paper); box-shadow: var(--sheet-top), var(--neutral-edges-2), var(--sheet-contact), var(--cell-cast); }
/* Today, and a day short of workers: the cell's own edges take the colour
   (it used to be a coloured line around a cell with grey edges). */
.month-cell.short { box-shadow: var(--sheet-top), var(--danger-edges-2), var(--sheet-contact), var(--cell-cast); }
.month-cell.today, .month-cell.short.today { box-shadow: var(--sheet-top), var(--accent-edges-2), var(--sheet-contact), var(--cell-cast); }

/* ---- 1b. The day panel: each phase's box is a small sheet in the phase's
   own colour — its hairline already is; the two stacked edges under it take
   deeper shades of the same colour (owner 2026-11-14: "the outline in the
   colored most outer box still use the old design"). --own-shadow is also
   what the "you landed here" pulse keeps under its wash. ---- */
.section {
  --pe: var(--border);
  --own-shadow: inset 0 1px 0 var(--lit), 0 1px 0 0 var(--pe),
                0 2px 0 0 color-mix(in srgb, var(--pe) 80%, #1C2433), 0 4px 7px rgba(20, 30, 50, .08);
  box-shadow: var(--own-shadow);
}
.section.morning { --pe: var(--morning-border); }
.section.noon    { --pe: var(--noon-border); }
.section.evening { --pe: var(--evening-border); }
.section.night   { --pe: var(--night-border); }

/* ---- 2. Notes on the sheets: shift cards and the team view's chips. Status
   rings (mine / in-swap) keep their ring AND get the note shadow; a giveaway
   keeps its amber tint; a "new" board message keeps its blue tint. ---- */
.shift-card, .chip { background: var(--paper); box-shadow: var(--note-rest); }
.shift-card:hover { transform: translateY(-2px); box-shadow: var(--note-lift); }
.shift-card:active { transform: translateY(0); box-shadow: var(--note-press); }
.shift-card.mine, .chip.mine { background: var(--primary-soft); }   /* a blue card, not a line around a white one */
.shift-card.in-swap { box-shadow: 0 0 0 1px var(--swap-dot), var(--note-rest); }
.shift-card.in-swap:hover { box-shadow: 0 0 0 1px var(--swap-dot), var(--note-lift); }
.shift-card.giveaway, .chip.giveaway { background: var(--give-card); }

/* ---- 3. Cards on the other pages: settings, workers roster, stats, board
   (forum) messages and the compose box, owner portal. ---- */
.settings-card, .admin-card, .hero-card, .stats-block, .roster-card, .board-msg, .board-compose {
  background: var(--paper); box-shadow: var(--sheet);
}
.hero-card.accent { background: var(--primary-soft); }
/* A new board message is a blue card: face, hairline and stacked edges. */
.board-msg.new {
  background: var(--primary-soft); border-color: var(--accent-line);
  box-shadow: var(--sheet-top), var(--accent-edges), var(--sheet-contact), var(--sheet-cast);
}
.roster-card:hover { transform: translateY(-2px); box-shadow: var(--sheet-top), var(--sheet-edges), var(--sheet-contact), -10px 22px 34px -8px rgba(20, 30, 50, .30); }

/* ---- 4. Floating things: panels (shift details, day, inbox, my requests,
   notifications), windows (new shift), the identity menu, the toast. ---- */
.drawer, .modal-box, .popover, .confirm-box { background: var(--paper); box-shadow: var(--float); }
.toast { box-shadow: 0 2px 4px rgba(20, 30, 50, .30), 0 14px 36px -6px rgba(20, 30, 50, .50); }

/* ---- 5. Buttons: the primary one is a raised key that presses down; the
   quiet ones sit just above the surface. ---- */
.btn-primary {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 1px 2px rgba(20, 30, 50, .16), 0 4px 10px rgba(47, 91, 215, .35);
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn-primary:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 2px 3px rgba(20, 30, 50, .16), 0 8px 16px rgba(47, 91, 215, .40); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 1px 1px rgba(20, 30, 50, .18), 0 2px 4px rgba(47, 91, 215, .30); }
.btn-ghost { box-shadow: var(--raise, inset 0 1px 0 var(--lit), 0 1px 2px rgba(20, 30, 50, .10)); }
.btn-ghost:active { box-shadow: var(--well, inset 0 1px 2px rgba(20, 30, 50, .12)); }

/* ---- 5b. Every button has a body (owner 2026-11-14: "decline blends with
   the background … gives only one button a priority … more modern and
   isometric"). The quiet button is a raised neutral key, a step off the card;
   the small buttons get the same lit top edge, soft shadow and press-down as
   the big ones. Blue stays the main action; red stays for what deletes. ---- */
.btn-sm.ghost, .btn-block.ghost, .confirm-btn.ghost, .btn-xs, .btn-ghost {
  background: var(--btn); border-color: var(--btn-border); color: var(--text);
}
.btn-sm.ghost:hover, .btn-block.ghost:hover, .confirm-btn.ghost:hover, .btn-xs:hover, .btn-ghost:hover {
  background: var(--btn-hover);
}
.btn-sm, .btn-block, .btn-xs, .btn-ghost { transition: transform .1s ease, box-shadow .1s ease, background-color .1s ease; }
/* The blue one keeps a (transparent) frame, so it is exactly as tall as its neighbour. */
.btn-sm.primary, .btn-block.primary { border: 1px solid transparent; }
.btn-sm.primary, .btn-block.primary {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 1px 2px rgba(20, 30, 50, .16), 0 3px 8px rgba(47, 91, 215, .30);
}
.btn-sm.ghost, .btn-block.ghost, .btn-xs, .btn-ghost, .confirm-btn.ghost, .btn-sm.danger-soft, .btn-block.danger {
  box-shadow: var(--key-shadow);
}
.btn-sm:active, .btn-block:active, .btn-xs:active, .btn-ghost:active {
  transform: translateY(1px); box-shadow: var(--well-deep, inset 0 1px 2px rgba(20, 30, 50, .16));
}
.btn-sm:disabled, .btn-block[disabled], .btn-xs:disabled { transform: none; }
.btn-sm:focus-visible, .btn-block:focus-visible, .btn-xs:focus-visible, .btn-ghost:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}

/* ---- 5c. Dropdowns and the date field are keys too (owner 2026-11-14: "the
   whole section of creating a new shift still follows the old design"): the
   quiet button's face, frame and shadow, and our own arrow instead of the
   browser's. One look for every dropdown on the site (new shift, the time
   picker, Settings' timezone, Managers' promote list). The arrow is a mid
   grey that reads on both palettes; it sits at the end of the field — left
   in a right-to-left page, right inside the left-to-right time picker. ---- */
.form-field select, .time-select select, .tz-select, .mgr-promote-form select, .form-field input[type="date"] {
  -webkit-appearance: none; appearance: none;
  background-color: var(--btn); border: 1px solid var(--btn-border);
  color: var(--text); font-weight: var(--fw-strong, 700);
  box-shadow: var(--key-shadow);
  transition: background-color .1s ease, border-color .1s ease;
}
.form-field select, .time-select select, .tz-select, .mgr-promote-form select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%238590A2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 10px 6px;
  background-position: right 11px center;
  padding-inline-end: 30px;
}
[dir="rtl"] .form-field select, [dir="rtl"] .tz-select, [dir="rtl"] .mgr-promote-form select { background-position: left 11px center; }
/* The time picker is always left-to-right (its wrapper says so). */
.time-select select, .form-field .time-select select, .hours-row .time-select select,
[dir="rtl"] .form-field .time-select select {
  background-position: right 9px center; padding-left: 11px; padding-right: 26px;
}
.form-field select:hover, .time-select select:hover, .tz-select:hover, .mgr-promote-form select:hover,
.form-field input[type="date"]:hover { background-color: var(--btn-hover); }
.form-field select:focus-visible, .time-select select:focus-visible, .tz-select:focus-visible,
.mgr-promote-form select:focus-visible, .form-field input[type="date"]:focus-visible {
  border-color: var(--primary); outline: 2px solid var(--primary); outline-offset: 1px;
}
/* One height for every control in a form column, so rows line up. */
.form-field select, .form-field input[type="date"], .form-field .time-select .time-min-exact { height: 42px; box-sizing: border-box; }
/* The typed minute is a field, not a key: a shallow well. */
.time-min-exact { box-shadow: var(--well, inset 0 1px 2px rgba(20, 30, 50, .10)); }

/* ---- 5d. The last flat controls (owner 2026-11-14: "it's still the old
   button design … search for all old designs so we can fix them in one go").
   Every pressable control that still was a white box with a line around it
   becomes the same raised neutral key: the top bar's bell, sun/moon, identity
   and language buttons, a panel's × , "clear all", the date arrows and Today
   (desktop: on a phone they are the bottom bar's chips), the limit chip and
   the × of a week cell, "cancel" in the swap banner. ---- */
.bell-btn, .user-btn, .icon-btn, .lang-btn, .lang-switch .lang-theme, .notif-clear, .pick-cancel, .wk-dayoff, .sec-remove, .cap-chip {
  background-color: var(--btn); border-color: var(--btn-border);
  box-shadow: var(--key-shadow);
  transition: transform .1s ease, box-shadow .1s ease, background-color .1s ease, border-color .1s ease;
}
.bell-btn:hover, .user-btn:hover, .icon-btn:hover, .lang-btn:hover, .lang-switch .lang-theme:hover, .notif-clear:hover { background-color: var(--btn-hover); border-color: var(--btn-border); }
.bell-btn:active, .user-btn:active, .icon-btn:active, .lang-btn:active, .lang-switch .lang-theme:active, .notif-clear:active, .pick-cancel:active,
.wk-dayoff:active, .sec-remove:active, .cap-chip:active {
  transform: translateY(1px); box-shadow: var(--well-deep, inset 0 1px 2px rgba(20, 30, 50, .16));
}
.icon-btn, .lang-btn, .notif-clear { color: var(--text); }
.pick-cancel { border-color: var(--accent-line); }
/* The limit chip keeps its meaning colours (changed for this day / closed). */
.cap-chip.custom { background-color: var(--accentT); border-color: var(--accent); }
.cap-chip.closed { background-color: var(--swap-bg); border-color: var(--swap-border); }
@media (min-width: 681px) {
  .nav-arrow, .nav-today {
    background-color: var(--btn); border-color: var(--btn-border); box-shadow: var(--key-shadow);
    transition: transform .1s ease, box-shadow .1s ease, background-color .1s ease;
  }
  .nav-arrow:hover, .nav-today:hover { background-color: var(--btn-hover); }
  .nav-arrow:active, .nav-today:active { transform: translateY(1px); box-shadow: var(--well-deep, inset 0 1px 2px rgba(20, 30, 50, .16)); }
}
/* Delete my account: the red key (as "Delete shift"). */
.btn-danger { box-shadow: var(--key-shadow); transition: transform .1s ease, box-shadow .1s ease, background-color .1s ease; }
.btn-danger:active { transform: translateY(1px); box-shadow: var(--well-deep, inset 0 1px 2px rgba(20, 30, 50, .16)); }
.btn-danger:focus-visible { outline: 2px solid var(--danger-text); outline-offset: 2px; }
/* The day panel's "end applying" (blue) and "reopen" (quiet), and the small
   blue Save of the limit editor (gone 2026-11-15: the day panel's card has a
   full-width Save). */
.day-applying-btn { transition: transform .1s ease, box-shadow .1s ease, background-color .1s ease; }
.day-applying-btn.end {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 1px 2px rgba(20, 30, 50, .16), 0 3px 8px rgba(47, 91, 215, .30);
}
.day-applying-btn.reopen { background: var(--btn); border-color: var(--btn-border); box-shadow: var(--key-shadow); }
.day-applying-btn.reopen:hover { background: var(--btn-hover); }
.day-applying-btn:active { transform: translateY(1px); box-shadow: var(--well-deep, inset 0 1px 2px rgba(20, 30, 50, .16)); }

/* ---- 5e. No browser-drawn tick or dot is left: every checkbox and radio
   that is drawn at all is our round tick (the ones inside a switch, a day
   key, a two-part switch or a row with its own .round-tick are invisible and
   untouched by this). Used as-is by the limit editor's "no limit", the
   call-out's worker picks and the worker panel's application window. ---- */
input[type="checkbox"]:not(.switch), input[type="radio"] {
  -webkit-appearance: none; appearance: none; flex: none; margin: 0;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--btn-border); background: var(--surface) center / 10px 8px no-repeat;
  cursor: pointer; vertical-align: middle;
  transition: background-color .12s ease, border-color .12s ease;
}
input[type="checkbox"]:not(.switch):checked, input[type="radio"]:checked {
  background-color: var(--primary-fill); border-color: var(--primary-fill);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 4.2l2.6 2.6L9 1.2'/%3E%3C/svg%3E");
}
input[type="checkbox"]:not(.switch):focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
input[type="checkbox"]:not(.switch):disabled, input[type="radio"]:disabled { opacity: .45; cursor: default; }

/* ---- 5f. Fields you type in are shallow wells: the same fill and hairline
   as before, with a soft shade under the top edge — keys stand out of the
   card, fields sink into it. ---- */
.field input, .search input, .board-compose textarea, .board-reply textarea,
.settings-card input[type="number"], .settings-card input[type="text"], .settings-card input[type="email"],
.settings-card input[type="password"], .wd-window-days input[type="number"] {
  box-shadow: var(--well, inset 0 1px 2px rgba(20, 30, 50, .08));
}

/* ---- 6. Layers: the header and toolbar read as being in front of the page
   because the page's top edge is shaded under them. ---- */
.month-wrap, .team-wrap, .stats-wrap, .settings-wrap, .board-wrap, .roster-wrap { box-shadow: var(--under-bar); }
/* Not on the week's pinned day-header strip (owner 2026-11-12: "there is a
   transparent box around that … remove it"): the strip is narrower than the
   page (it starts after the side gutter), so the shade drew its outline — a
   pale box around the header card. The strip keeps the page colour, which is
   what hides the bands as they scroll under the header. */

/* ---- Phones: shorter, lighter shadows — less to paint, less visual noise on
   a small screen; the page edges and contact shadow stay. No hover on touch. ---- */
@media (max-width: 680px) {
  :root {
    --sheet-cast: -4px 8px 14px -6px rgba(20, 30, 50, .18);
    --float: var(--sheet-top), var(--sheet-bottom), var(--sheet-edges), var(--sheet-contact), 0 20px 44px -10px rgba(20, 30, 50, .36);
    --note-rest: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 2px rgba(20, 30, 50, .14), 0 3px 6px -2px rgba(20, 30, 50, .16);
  }
  .shift-card:hover, .roster-card:hover, .btn-primary:hover { transform: none; }
  .shift-card:hover { box-shadow: var(--note-rest); }
  .roster-card:hover { box-shadow: var(--sheet); }
}

/* ---- 7. Clear separation inside long panels (owner's request 2026-10-16:
   "the lines are too white"). Dividers are one notch darker app-wide (tokens),
   and each section in a long list is its own framed inner card. ---- */
/* Settings: each phase is a framed white card with a stripe in its colour,
   on the settings card's faintly tinted body. */
.phase-row {
  background: var(--surface); border: 1px solid var(--border);
  border-inline-start: 4px solid var(--border);
  border-radius: var(--rad-l, 12px); padding: 14px 16px; margin: 0 0 12px;
  box-shadow: var(--raise, inset 0 1px 0 var(--lit), 0 1px 2px rgba(20, 30, 50, .08));
}
.phase-row:last-child { border-bottom: 1px solid var(--border); margin-bottom: 0; }
.phase-row.morning { border-inline-start-color: var(--morning-dot); }
.phase-row.noon    { border-inline-start-color: var(--noon-dot); }
.phase-row.evening { border-inline-start-color: var(--evening-dot); }
.phase-row.night   { border-inline-start-color: var(--night-dot); }
/* Requests inbox / My requests: darker frames so each item stands apart. */
.inbox-item { border-color: var(--border); box-shadow: var(--raise, inset 0 1px 0 var(--lit), 0 1px 2px rgba(20, 30, 50, .08)); }
.inbox-item.req { border-color: #A9B3C2; }
/* Notifications: each one a framed row with breathing room. */
.notif-body { padding: 6px 0; }
.notif-item {
  margin: 6px 12px 8px; padding: 14px; border: 1px solid var(--border); border-radius: var(--rad-xl, 14px);
  background: var(--surface);
  box-shadow: inset 0 1px 0 var(--lit), var(--neutral-edges-2), 0 3px 5px rgba(20, 30, 50, .08);
}
/* Unread: the same card in blue — hairline and stacked edges included. */
.notif-item.unread {
  border-color: var(--accent-line);
  box-shadow: inset 0 1px 0 var(--lit), var(--accent-edges-2), 0 3px 5px rgba(20, 30, 50, .08);
}
.notif-item:last-child { border-bottom: 1px solid var(--border); }
.notif-item.unread:last-child { border-bottom-color: var(--accent-line); }
