/* Jerusalem Shawarma hours — after the shift-ledger page: a cedar-green
   masthead with a brass rule, then one centred column built for a phone. */
:root {
  --bg: #F3F2ED;
  --surface: #FFFFFF;
  --ink: #1D2420;
  --muted: #69716B;
  --line: #E1DED5;
  --brass: #9C7228;
  --brass-soft: #F1E7D2;
  --cedar: #1F3B33;
  --cedar-ink: #F2EEE4;
  --cedar-muted: #B9C7BF;
  --danger: #A23A2A;
  --ok: #3F7D5A;
  --font-display: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --font-body: "Jost", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111614; --surface: #19201D; --ink: #ECE8DE; --muted: #9AA39C; --line: #2B3430;
    --brass: #D4AA5A; --brass-soft: #2E281B; --cedar: #172C26; --cedar-ink: #F2EEE4; --cedar-muted: #9FB3A8;
    --danger: #E07A66; --ok: #7CC29A; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111614; --surface: #19201D; --ink: #ECE8DE; --muted: #9AA39C; --line: #2B3430;
  --brass: #D4AA5A; --brass-soft: #2E281B; --cedar: #172C26; --cedar-ink: #F2EEE4; --cedar-muted: #9FB3A8;
  --danger: #E07A66; --ok: #7CC29A; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.num { font-variant-numeric: tabular-nums lining-nums; }
a { color: var(--brass); }

/* ------------------------------------------------ masthead */
.mast { background: var(--cedar); color: var(--cedar-ink); border-bottom: 3px solid var(--brass);
        padding-top: env(safe-area-inset-top, 0px); }
.mast-inner, main, .install-inner {
  max-width: 640px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.mast-inner { padding-block: 22px 18px; display: grid; gap: 16px; }
.mast-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.eyebrow { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--cedar-muted); }
h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(34px, 9vw, 46px); line-height: 1.02;
     margin: 4px 0 0; text-wrap: balance; letter-spacing: .005em; }
h1 em { font-style: italic; font-weight: 500; color: var(--brass); }
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.month-label { font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.month-label small { font-family: var(--font-body); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
                     color: var(--cedar-muted); margin-left: 6px; }
.icon-btn {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; border: 1px solid rgba(242,238,228,.28);
  background: transparent; color: var(--cedar-ink); font-size: 20px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; font-family: var(--font-display); padding: 0;
}
.icon-btn:hover { border-color: var(--brass); color: var(--brass); }
.icon-btn.dark { color: var(--ink); border-color: var(--line); font-size: 24px; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* ------------------------------------------------ install bar */
.install-bar { background: var(--brass-soft); border-bottom: 1px solid var(--line); }
.install-inner { padding-block: 10px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
                 gap: 8px 14px; font-size: 13.5px; }
.install-actions { display: flex; align-items: center; gap: 12px; }
.link-btn { font: inherit; font-size: 13.5px; background: none; border: 0; color: var(--muted); padding: 6px 2px;
            cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------ layout */
main { padding-block: 22px 48px; display: grid; gap: 28px; }
main.narrow { max-width: 460px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
h2 { font-family: var(--font-display); font-weight: 600; font-size: 24px; margin: 0; line-height: 1.15; }
h3 { font-family: var(--font-display); font-weight: 600; font-size: 19px; margin: 22px 0 8px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; }
.hint.ok { color: var(--ok); }
.center { text-align: center; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card.center p { margin: 14px 0 0; }

form { display: grid; gap: 14px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: grid; gap: 5px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); min-width: 0; }
label.check { display: flex; align-items: center; gap: 10px; text-transform: none; letter-spacing: normal; font-size: 14px; color: var(--ink); }
label.check input { width: 20px; height: 20px; accent-color: var(--cedar); }
input:not([type="checkbox"]), select {
  font: inherit; font-size: 16px; letter-spacing: normal; text-transform: none; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; min-width: 0;
  min-height: 44px; -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
         background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
input[type="date"], input[type="time"] { display: block; }
input::-webkit-date-and-time-value { text-align: left; }
input:focus, select:focus { border-color: var(--brass); outline: none; }
.err { color: var(--danger); font-size: 13.5px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions.spaced { margin-top: 26px; }

.btn { font: inherit; font-weight: 500; font-size: 15px; letter-spacing: .03em; border-radius: 999px; padding: 11px 22px;
       cursor: pointer; border: 1px solid transparent; min-height: 44px; text-align: center; text-decoration: none;
       display: inline-flex; align-items: center; justify-content: center; color: var(--ink); background: transparent; }
.btn.small { padding: 7px 14px; min-height: 36px; font-size: 13.5px; }
.btn.wide { width: 100%; }
.btn.primary { background: var(--cedar); color: var(--cedar-ink); border-color: var(--cedar); flex: 1; }
.btn.light { background: var(--cedar); color: var(--cedar-ink); }
:root[data-theme="dark"] .btn.primary, :root[data-theme="dark"] .btn.light { background: var(--brass); color: #16130C; border-color: var(--brass); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn.primary, :root:not([data-theme="light"]) .btn.light { background: var(--brass); color: #16130C; border-color: var(--brass); }
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: var(--line); }
.btn.danger { color: var(--danger); border-color: var(--line); }
.btn.danger.armed { background: var(--danger); color: var(--surface); border-color: var(--danger); }
.btn:disabled { opacity: .55; cursor: default; }

/* ------------------------------------------------ the clock card */
.clock { border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); padding: 20px 18px; display: grid; gap: 16px; }
.clock .state { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.clock .big { font-family: var(--font-display); font-size: 34px; font-weight: 600; line-height: 1.05; }
.clock .since { font-size: 14px; color: var(--muted); }
.clock .btn.go { font-size: 17px; min-height: 54px; }
.clock.on { background: var(--cedar); color: var(--cedar-ink); border-color: var(--cedar); }
.clock.on .big { color: var(--brass); font-size: clamp(44px, 13vw, 60px); }
.clock.on .since, .clock.on label, .clock.on .hint { color: var(--cedar-muted); }
.clock.on input, .clock.on select { background: rgba(255,255,255,.08); border-color: rgba(242,238,228,.22); color: var(--cedar-ink); }
.clock.on .btn.go { background: var(--brass); color: #16130C; border-color: var(--brass); }
.clock.on .warn { background: rgba(212,170,90,.16); color: var(--cedar-ink); }
.clock.on .link-btn { color: var(--cedar-muted); }
.clock .warn { border-radius: 10px; padding: 10px 12px; font-size: 13.5px; background: var(--brass-soft); }
.clock .err { color: #F0A090; }
.clock:not(.on) .err { color: var(--danger); }
.clock .live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--brass); margin-right: 8px; vertical-align: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .clock .live-dot { animation: breathe 2.4s ease-in-out infinite; }
  @keyframes breathe { 50% { opacity: .35; } }
}

/* ------------------------------------------------ summary */
.summary { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line);
           border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--surface); padding: 14px 14px 12px; min-width: 0; }
.stat .k { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.stat .v { font-family: var(--font-display); font-size: 30px; font-weight: 600; line-height: 1.1; margin-top: 4px; }
.stat.lead .v { font-size: 40px; color: var(--brass); }
.stat .s { font-size: 12px; color: var(--muted); }
.stat.pay { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.stat.pay .v { font-size: 24px; margin: 0; }
.stat.pay .v.quiet { font-family: var(--font-body); font-size: 14px; font-weight: 400; color: var(--muted); }
.ytd { font-size: 13px; color: var(--muted); margin-top: 8px; text-align: right; }

/* ------------------------------------------------ ledger */
.week { margin-top: 18px; }
.week:first-child { margin-top: 0; }
.week-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 0 2px 8px; border-bottom: 1px solid var(--line); }
.week-head .t { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.week-head .h { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.shift {
  width: 100%; text-align: left; font: inherit; color: inherit; background: transparent; border: 0; border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; padding: 12px 2px; cursor: pointer;
}
.shift:hover { background: var(--brass-soft); }
.shift.open .hrs .v { color: var(--brass); }
.day { text-align: center; line-height: 1; }
.day .dn { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.day .dd { font-family: var(--font-display); font-size: 28px; font-weight: 600; margin-top: 2px; }
.mid { min-width: 0; }
.mid .times { font-size: 15px; }
.mid .meta { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.hrs { text-align: right; }
.hrs .v { font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.hrs .u { font-size: 11px; color: var(--muted); letter-spacing: .08em; }
.empty { text-align: center; padding: 34px 18px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.empty .big { font-family: var(--font-display); font-size: 24px; color: var(--ink); margin-bottom: 4px; }
#ledgerHint { margin-top: 12px; }

/* ------------------------------------------------ statement and rate */
.rate-note { border-radius: 10px; padding: 11px 13px; background: var(--brass-soft); font-size: 13.5px; }
.rate-note strong { font-weight: 600; }
.rate-list { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--line); }
.rate-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.rate-list .r { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.rate-list .when { color: var(--muted); font-size: 12.5px; }
.rate-list li.current .r { color: var(--brass); }

/* ------------------------------------------------ sheets */
dialog.sheet {
  width: min(560px, 100vw); max-width: 100vw; max-height: 92dvh; margin: auto auto 0; border: 0; padding: 18px 18px calc(22px + env(safe-area-inset-bottom, 0px));
  border-radius: 20px 20px 0 0; background: var(--surface); color: var(--ink); overflow-y: auto; overscroll-behavior: contain;
}
@media (min-width: 640px) { dialog.sheet { margin: auto; border-radius: 20px; } }
dialog.sheet::backdrop { background: rgba(15, 24, 20, .55); }
dialog.sheet[open] { display: block; }
@media (prefers-reduced-motion: no-preference) {
  dialog.sheet[open] { animation: rise .22s ease-out; }
  @keyframes rise { from { transform: translateY(24px); opacity: 0; } }
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.preview { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--brass-soft); }
.preview .lbl { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.preview .val { font-family: var(--font-display); font-size: 21px; font-weight: 600; color: var(--brass); text-align: right; line-height: 1.15; }
.steps { margin: 0 0 18px; padding-left: 22px; display: grid; gap: 12px; font-size: 15px; }
.share-glyph { vertical-align: -5px; margin: 0 2px; color: #2F7BF5; }
.activity { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; border-top: 1px solid var(--line); }
.activity li { padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.activity .when { color: var(--muted); font-size: 12px; display: block; }

/* ------------------------------------------------ foot */
.foot { font-size: 12px; color: var(--muted); text-align: center; margin: 0; }
.foot .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); margin-right: 6px; vertical-align: 1px; }
.foot .dot.on { background: var(--ok); }

body.plain main { padding-top: 48px; }

@media (max-width: 420px) {
  .summary { grid-template-columns: 1fr 1fr; }
  .stat.lead { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: no-preference) {
  .shift, .btn, .icon-btn { transition: background .15s, border-color .15s, color .15s; }
}
