/* PortoPro Tracker: calm, square-cornered, Google Sans. Brand colors are tokens; nothing else is hard-coded. */
@font-face {
  font-family: 'Google Sans';
  src: url('/fonts/google-sans-hebrew.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: 'Google Sans';
  src: url('/fonts/google-sans-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --navy: #00496E;
  --navy-deep: #032940;
  --gold: #BEA175;
  --gold-hover: #A88F62;
  --paper: #F4EDE7;
  --surface: #FFFFFF;
  --ink: #00496E;
  --muted: #5C6F7A;
  --hair: rgba(0, 73, 110, 0.14);
  --ok: #4F998B;
  --alert: #D97B62;
  --space: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #032940; --surface: #07354F; --ink: #F4EDE7; --muted: #A9B8C0; --hair: rgba(244, 237, 231, 0.16); color-scheme: dark;
  }
}
:root[data-theme='dark'] { --paper: #032940; --surface: #07354F; --ink: #F4EDE7; --muted: #A9B8C0; --hair: rgba(244, 237, 231, 0.16); color-scheme: dark; }

* { box-sizing: border-box; border-radius: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Google Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---- type scale: tracking tightens as size grows ---- */
h1 { font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.06; letter-spacing: -0.025em; font-weight: 600; margin: 0 0 12px; }
h2 { font-size: 1.375rem; line-height: 1.25; letter-spacing: -0.012em; font-weight: 600; margin: 0; }
h3 { font-size: 1.0625rem; line-height: 1.35; font-weight: 600; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.lede { font-size: 1.0625rem; color: var(--muted); max-width: 60ch; }
.num { font-variant-numeric: tabular-nums; }
[dir='ltr'], .ltr { direction: ltr; unicode-bidi: plaintext; }

/* ---- layout ---- */
.wrap { max-width: 880px; margin: 0 auto; padding: 40px 20px 96px; }
.wrap.wide { max-width: 1040px; }
.stack > * + * { margin-top: 16px; }
.stack-lg > * + * { margin-top: 40px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.rule { border: 0; border-top: 1px solid var(--hair); margin: 0; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 20px; }
.brand-logo { height: 40px; width: auto; }
.logo-on-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .logo-on-light { display: none; }
  :root:not([data-theme='light']) .logo-on-dark { display: block; }
}
:root[data-theme='dark'] .logo-on-light { display: none; }
:root[data-theme='dark'] .logo-on-dark { display: block; }

/* ---- the one primary action per screen ---- */
.next {
  display: grid; grid-template-columns: 1fr auto; gap: 12px 24px; align-items: center;
  padding: 24px 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
}
.next strong { display: block; font-size: 1.25rem; letter-spacing: -0.01em; font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px; border: 1px solid var(--gold); background: var(--gold); color: #fff;
  font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background-color 160ms ease-out, border-color 160ms ease-out, transform 100ms ease-out, opacity 160ms;
}
.btn:hover { background: var(--gold-hover); border-color: var(--gold-hover); }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.5; cursor: default; transform: none; }
.btn.outline { background: transparent; color: var(--ink); border-color: var(--gold); }
.btn.outline:hover { background: color-mix(in srgb, var(--gold) 14%, transparent); }
.btn.quiet { background: transparent; border-color: var(--hair); color: var(--ink); }
.btn.quiet:hover { border-color: var(--ink); }
.btn.danger { background: transparent; border-color: var(--alert); color: var(--alert); }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 0.875rem; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
:root[data-theme='dark'] :focus-visible { outline-color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) :focus-visible { outline-color: var(--gold); } }

/* ---- tabs: underline, no boxes ---- */
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--hair); overflow-x: auto; scrollbar-width: none; }
.tab { padding: 10px 0; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); cursor: pointer; font-weight: 500; white-space: nowrap; }
.tab[aria-selected='true'] { color: var(--ink); border-bottom-color: var(--gold); }
.badge-count { display: inline-block; min-width: 1.5em; padding: 0 6px; margin-inline-start: 6px; background: var(--alert); color: #fff; font-size: 0.75rem; text-align: center; font-weight: 600; }

/* ---- lists: hairlines, not cards ---- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 18px 0; border-bottom: 1px solid var(--hair); }
.item { display: grid; grid-template-columns: 12px 1fr auto; gap: 16px; align-items: start; }
.dot { width: 8px; height: 8px; background: var(--gold); margin-top: 9px; }
.dot.done { background: var(--ok); }
.dot.late { background: var(--alert); }
.dot.idle { background: var(--hair); }
.meta { font-size: 0.875rem; color: var(--muted); }

.progress { height: 3px; background: var(--hair); position: relative; overflow: hidden; }
.progress > i { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--gold); transition: width 420ms cubic-bezier(.2,.7,.2,1); }
.bigpct { font-size: clamp(2.5rem, 8vw, 4rem); line-height: 1; letter-spacing: -0.03em; font-weight: 600; }

/* ---- photos ---- */
.photo { background: color-mix(in srgb, var(--ink) 8%, transparent); aspect-ratio: 4 / 3; width: 100%; object-fit: cover; }
.photo-wrap { position: relative; }
.photo-wrap .stamp { position: absolute; inset-block-end: 10px; inset-inline-start: 10px; height: 22px; opacity: 0.92; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---- forms ---- */
.field { display: grid; gap: 6px; }
.field > label { font-size: 0.875rem; font-weight: 500; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--hair); color: var(--ink);
  transition: border-color 160ms;
}
.input:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 1px var(--gold); }
textarea.input { min-height: 96px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grid2, .pair { grid-template-columns: 1fr; } .next { grid-template-columns: 1fr; } .next .btn { width: 100%; } }

/* ---- dialogs ---- */
dialog { border: 1px solid var(--hair); background: var(--surface); color: var(--ink); padding: 28px; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
dialog::backdrop { background: rgba(3, 41, 64, 0.5); backdrop-filter: blur(6px); }

.notice { padding: 14px 0; border-top: 1px solid var(--alert); color: var(--ink); }
.toast { position: fixed; inset-inline: 16px; inset-block-end: 20px; max-width: 420px; margin-inline: auto; background: var(--navy-deep); color: #fff; padding: 14px 18px; z-index: 50; animation: rise 280ms cubic-bezier(.2,.7,.2,1); }
.toast.error { background: var(--alert); }
.code { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 0.9rem; word-break: break-all; }

/* ---- the single entrance moment ---- */
@media (prefers-reduced-motion: no-preference) {
  .enter { opacity: 0; transform: translateY(8px); animation: rise 520ms cubic-bezier(.2,.7,.2,1) forwards; }
  .enter.d1 { animation-delay: 70ms; }
  .enter.d2 { animation-delay: 140ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* photos inside lists stay a sensible size */
.list .photo-wrap { max-width: 420px; }
