/* public/styles.css
   Styles for every Metivo screen (public/index.html + public/app.js).
   Follows the UI standard in AGENTS.md: compact white cards with a subtle
   border, 12px radius, 14px 16px padding, 10px gaps; controls at least 40px
   tall; visible keyboard focus; no horizontal scrolling at 320px. Crew use
   this one-handed on phones, so everything stacks in a single column first
   and only widens on larger screens. */

:root {
  /* Brand: charcoal with hi-vis amber. Amber marks the one main action on a
     screen and always carries dark text (white on amber is unreadable). */
  --bg: #f4f5f5;
  --surface: #ffffff;
  --border: #dde1e3;
  --text: #181c1f;
  --muted: #5a6368;
  --accent: #22272b;
  --accent-text: #ffffff;
  --action: #f5a623;
  --action-text: #181c1f;
  --danger: #a4262c;
  --focus: #0b57d0;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-wrap: anywhere;
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.loading { padding: 48px 16px; text-align: center; color: var(--muted); }

/* Shared header: brand, the active page name, then company and account. */
.header {
  display: flex;
  /* One row even at 320px: the company name gives way (it shortens with an
     ellipsis) so Sign out never drops onto a line of its own. */
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-text);
}
/* The blue focus ring disappears on charcoal, so the header uses amber. */
.header :focus-visible { outline-color: var(--action); }
.brand { font-weight: 700; }
.page-name { font-weight: 600; margin: 0; font-size: 16px; }
.header .spacer { flex: 1 1 0; min-width: 0; }
.header > * { flex: 0 0 auto; }
.header .who {
  color: #c9cfd3;
  font-size: 14px;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header select { flex: 0 1 auto; min-width: 0; width: auto; }

.main { max-width: 720px; margin: 0 auto; padding: 16px; display: grid; gap: 10px; }
.narrow { max-width: 440px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: grid;
  gap: 10px;
}
.card h2 { margin: 0; font-size: 16px; }
.card p { margin: 0; }

.row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.row .name { font-weight: 600; }
.meta { color: var(--muted); font-size: 14px; }
.list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.list > li { border-top: 1px solid var(--border); padding-top: 10px; display: grid; gap: 2px; }
.list > li:first-child { border-top: 0; padding-top: 0; }

.chip {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  background: var(--bg);
}
.chip.you { color: var(--accent); border-color: var(--accent); background: var(--surface); }
.chip.off { color: var(--danger); border-color: var(--danger); background: var(--surface); }

label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
input, select, textarea, button, .button {
  font: inherit;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text);
  max-width: 100%;
}
input, select, textarea { width: 100%; }
textarea { resize: vertical; line-height: 1.4; }
button, .button {
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
button.primary, .button.primary { background: var(--action); border-color: var(--action); color: var(--action-text); font-weight: 700; }
button.quiet { font-weight: 500; }
button:disabled { opacity: 0.6; cursor: default; }

.form { display: grid; gap: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions > * { flex: 1 1 140px; }

.notice { border-left: 4px solid var(--action); padding: 8px 12px; background: var(--bg); border-radius: 4px; font-size: 14px; }
.notice.error { border-left-color: var(--danger); color: var(--danger); }
.link-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

@media (min-width: 560px) {
  .form.inline { grid-template-columns: 1fr 160px auto auto; align-items: end; }
}

/* The hidden attribute must win over the display rules above (buttons are
   inline-flex), or "hidden" buttons would still show. */
[hidden] { display: none !important; }

.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand img { display: block; border-radius: 7px; }

/* Welcome page: one centred card, no header bar. */
.welcome { padding-top: 40px; }
.hero { justify-items: center; text-align: center; padding: 28px 20px; gap: 14px; }
.hero-mark { border-radius: 14px; }
.hero-title { margin: 0; font-size: 26px; line-height: 1.2; }
.hero-lead { font-size: 17px; }
.hero .actions { width: 100%; }
.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; text-align: left; font-size: 15px; }
.points li { padding-left: 26px; position: relative; }
.points li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

/* Set-up steps: "1 Company  2 Team". */
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; font-size: 14px; color: var(--muted); }
.steps li { display: flex; align-items: center; gap: 6px; flex: 1 1 0; padding-bottom: 8px; border-bottom: 3px solid var(--border); }
.steps .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
}
.steps .current, .steps .done { border-bottom-color: var(--accent); }
.steps .current { color: var(--text); font-weight: 600; }
.steps .current .num, .steps .done .num { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

.optional { font-size: 13px; color: var(--muted); opacity: 0.85; }
.center { text-align: center; }
.row h2 { flex: 0 1 auto; }
.row .spacer { flex: 1 1 0; }

/* Small but still a 40px touch target, per the UI standard. */
button.small { padding: 4px 12px; font-size: 14px; }

/* City / State / ZIP share a row once there is room; stacked on narrow phones. */
.grid-3 { display: grid; gap: 10px; }
@media (min-width: 360px) {
  .grid-3 { grid-template-columns: 2fr 1fr 1fr; }
}

/* Tick box with its label beside it. The whole row is the 40px touch target. */
label.check { display: flex; align-items: center; gap: 10px; min-height: 40px; text-align: left; color: var(--text); font-size: 15px; cursor: pointer; }
label.check input { width: 22px; height: 22px; min-height: 0; padding: 0; flex: 0 0 auto; accent-color: var(--accent); }

/* Section tabs under the header (Jobs, Team). Always visible: no menu to open. */
/* Five tabs must stay on one line on a phone: names never break, the strip
   tightens on narrow screens and, as a last resort, slides sideways by itself
   without making the page scroll. */
.tabs { display: flex; gap: 4px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tab { white-space: nowrap; flex: 0 0 auto; }
@media (max-width: 420px) {
  .tabs { gap: 0; padding: 0 2px; }
  .tabs .tab { padding: 0 6px; font-size: 14px; }
}
.tab {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.tab[aria-current="page"] { color: var(--text); border-bottom-color: var(--action); }

/* A long job name in the header shortens instead of pushing Sign out away. */
/* min-width keeps short names (Jobs, Team) whole; only long job names shorten. */
.page-name { flex: 0 1 auto; min-width: 3em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* On a narrow phone the company name gives way before the page name does. */
.header .who { flex-shrink: 1000; }

/* Job board. */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; }
.toolbar input { flex: 1 1 180px; width: auto; }
.groups, .group { display: grid; gap: 10px; }
.group-title { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font-size: 15px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--border); flex: 0 0 auto; }
a.card.job { color: inherit; text-decoration: none; gap: 2px; }
a.card.job:hover { border-color: var(--muted); }
.center-self { justify-self: center; }
a.back { color: var(--muted); font-size: 14px; text-decoration: none; min-height: 40px; display: inline-flex; align-items: center; justify-self: start; }

/* One job. */
.grid-2 { display: grid; gap: 10px; }
@media (min-width: 360px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}
.notes { white-space: pre-wrap; }
.tasks .task { display: flex; align-items: center; gap: 10px; }
.tasks .task .check { flex: 1 1 auto; min-width: 0; }
.task-title.done { text-decoration: line-through; color: var(--muted); }
.due { display: block; }

/* Settings: one phase per row; colour and name on top, actions underneath. */
.phase-main { display: flex; gap: 10px; }
.phase-main input[type="color"] { flex: 0 0 48px; width: 48px; padding: 4px; }
.phase-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.phase-actions .check { font-size: 14px; }
.list > li.phase { gap: 6px; }
.form.inline-2 { grid-template-columns: 1fr auto; align-items: end; }

/* On phones the logo alone stands for the brand, leaving the header's one row
   to the page name and the company. */
@media (max-width: 479px) {
  .brand-name { display: none; }
}

/* A label chip with its colour dot (phase on a job card). */
.chip.with-dot { display: inline-flex; align-items: center; gap: 6px; }
.chip.with-dot .dot { width: 9px; height: 9px; }

/* Board filters: one tap each, always visible. They wrap rather than scroll
   sideways so nothing is hidden on a narrow phone. */
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter { border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 600; gap: 6px; }
.filter .count { color: var(--muted); font-weight: 500; }
.filter[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.filter[aria-pressed="true"] .count { color: #c9cfd3; }
.filter.flagged:not([aria-pressed="true"]) { border-color: var(--danger); color: var(--danger); }
/* One column that may be narrower than its content asks for: without this a
   row that does not wrap (the toolbar) would push the page wider than a phone. */
.main { grid-template-columns: minmax(0, 1fr); }
.toolbar { flex-wrap: nowrap; }
.toolbar input { flex: 1 1 0; min-width: 0; }

/* Icon actions (UI standard): a small drawing in a 40px touch area. Quiet by
   default so a card reads as content, not as a row of buttons. */
.icon-btn {
  width: 40px; height: 40px; min-height: 40px; padding: 0; flex: 0 0 40px;
  border-color: transparent; background: transparent; color: var(--muted); border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover, .icon-btn[aria-pressed="true"] { background: var(--bg); color: var(--text); }
.icon-btn.primary { background: var(--action); border-color: var(--action); color: var(--action-text); }
.icon-btn:disabled { opacity: 0.35; }
/* A card's heading: title and chips wrap on the left, icons hold the corner
   without adding height. */
.head { display: flex; align-items: flex-start; gap: 2px; }
.head > .row { flex: 1 1 0; min-width: 0; min-height: 24px; }
.head .icon-btn { margin: -8px 0; }
.head .icon-btn:last-child { margin-right: -8px; }
.card .head h2 { font-size: 16px; }

/* Something late or waited on too long. Always said in words as well. */
.flag { color: var(--danger); font-weight: 600; }
h2.flag { font-weight: 700; }

/* A chip tinted with a label's own colour (set from script); dark text on a
   light wash stays readable whatever colour the company picked. */
.chip.tint { color: var(--text); font-weight: 600; }

/* Job card: step strip, what is next or late, and for owners the money bar. */
a.card.job { gap: 6px; }
.strip { display: flex; gap: 4px; }
.seg { flex: 1 1 0; height: 6px; border-radius: 3px; background: var(--border); }
.seg.done { background: #17a05a; }
.seg.now { background: var(--action); }
.banner { background: #fff1d6; color: #7a4b00; border-radius: 8px; padding: 6px 10px; font-size: 14px; font-weight: 600; }
.banner.late { background: #fde7e9; color: var(--danger); }
.pay { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.bar { appearance: none; -webkit-appearance: none; flex: 1 1 60px; min-width: 40px; height: 8px; border: 0; border-radius: 999px; background: var(--border); overflow: hidden; }
.bar::-webkit-progress-bar { background: var(--border); border-radius: 999px; }
.bar::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.bar::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.amount { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.amount.total { font-size: 15px; }

/* Job facts: small label over its value, two across. */
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 14px; }
.facts span { display: block; color: var(--muted); font-size: 12px; }
.facts:empty { display: none; }

/* Lines inside a card (schedule steps, payments, costs): tick, what, when. */
.lines { list-style: none; margin: 0; padding: 0; }
.lines > li { border-top: 1px solid #eceff0; }
.lines > li:first-child { border-top: 0; }
.line { display: flex; align-items: center; gap: 8px; padding: 4px 0; min-height: 48px; color: inherit; text-decoration: none; }
.line .what { flex: 1 1 0; min-width: 0; display: grid; }
.line .what b { font-weight: 600; }
.line .what span { color: var(--muted); font-size: 13px; }
.line .what span.flag { color: var(--danger); }
.line .when { font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; }
.line .when.amount { font-size: 14px; color: var(--text); }
.line .when.flag { color: var(--danger); }

/* The round tick. The button is a 40px touch area; the ring is drawn inside it. */
.tick {
  width: 40px; height: 40px; min-height: 40px; padding: 0; flex: 0 0 40px; margin-left: -9px;
  border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.tick::before { content: ""; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #b9c0c4; box-sizing: border-box; position: absolute; }
.tick { position: relative; }
.tick.now::before { border-color: var(--action); background: #fff1d6; }
.tick.done::before { border-color: #17a05a; background: #17a05a; }
.tick svg { position: relative; width: 14px; height: 14px; stroke-width: 3; }

/* A date shown as words; tapping it opens the phone's date picker, which
   belongs to the invisible date box behind it. */
.date-wrap { position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: flex-end; min-width: 56px; min-height: 44px; border-radius: 8px; }
.date-wrap:hover { background: var(--bg); }
.date-wrap:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.date-btn { padding: 4px 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
/* The real date box covers the words and is see-through, so the tap lands on
   it and the phone opens its own picker. */
input.picker { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; min-width: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; -webkit-appearance: none; appearance: none; }

/* An add form opened inside a card. */
.form.add { border-top: 1px solid #eceff0; padding-top: 10px; }
.grid-2 input, .grid-3 input { min-width: 0; }
button.link, a.link { border: 0; background: transparent; color: var(--focus); font-weight: 600; padding: 0 2px; justify-self: start; text-decoration: underline; }

/* Settings: a milestone is a name, its percent, and remove, on one row. */
.milestone-main { display: flex; align-items: center; gap: 8px; }
.milestone-main input:first-child { flex: 1 1 auto; min-width: 0; }
.milestone-main input:nth-child(2) { flex: 0 0 76px; width: 76px; }

/* Documents and signing. */
.banner.ok { background: #e6f4ea; color: #17592f; }
.row.nowrap { flex-wrap: nowrap; }
.row.nowrap input { flex: 1 1 0; min-width: 0; }
.fingerprint { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.signature { width: 100%; max-width: 420px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.signature polyline { fill: none; stroke: var(--text); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
/* The signature pad: a finger draws here, so the page must not scroll under it. */
.pad { width: 100%; aspect-ratio: 10 / 3; border: 1px dashed var(--muted); border-radius: 8px; background: var(--surface); touch-action: none; cursor: crosshair; }
a.button svg { margin-right: 6px; }
input[type="file"] { padding: 6px; }

/* My work: the address box that opens Maps and the site contact row. */
.over { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 4px 2px 0; }
.place { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; color: inherit; text-decoration: none; }
.place span { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.place svg { flex: 0 0 auto; color: var(--muted); }
.contact { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card h2 a { color: inherit; text-decoration: none; }
label.sees { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-top: 4px; }
label.sees select { flex: 0 1 220px; min-width: 0; }
[hidden] { display: none !important; }

/* iPhone date boxes size themselves by their contents and center the text,
   which pushed "End date" off the screen. Make them behave like other boxes. */
input[type="date"], input[type="datetime-local"], input[type="time"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; text-align: left; }
input::-webkit-date-and-time-value { text-align: left; }
.grid-2 > *, .grid-3 > *, .form > * { min-width: 0; }

/* Job page: the back link sits close under the tabs. */
a.back { margin: -10px 0 -8px; }

/* Paper clip beside a line's name: grey with no file, Metivo amber with one
   (drawn a little heavier so the amber reads clearly on white). */
.line { flex-wrap: wrap; }
.line .title { display: flex; align-items: center; gap: 2px; min-width: 0; }
.line .title b, .line .title input { min-width: 0; }
.clip { color: #9aa0a6; border-color: transparent; background: transparent; margin: -8px 0; }
.clip.has { color: var(--action); }
.clip.has svg { stroke-width: 2.6; }
span.clip { display: inline-flex; align-items: center; justify-content: center; width: 28px; }
.clip svg { width: 18px; height: 18px; }
.files { flex: 0 0 100%; list-style: none; margin: 0 0 6px; padding: 0 0 0 40px; display: grid; gap: 2px; }
.files li { display: flex; align-items: center; gap: 4px; min-width: 0; }
.files .link { flex: 1 1 0; min-width: 0; text-align: left; overflow-wrap: anywhere; min-height: 40px; }
a.link { display: inline-flex; align-items: center; min-height: 40px; }
.files .link { justify-content: flex-start; }
.facts > div { min-width: 0; }
.facts a.wrap { overflow-wrap: anywhere; }

/* Pull down to refresh. The page itself must not bounce or trigger the
   browser's own reload, or two refreshes would fight each other. */
html { overscroll-behavior-y: contain; }
.puller { position: fixed; top: 0; left: 50%; z-index: 20; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); display: flex; align-items: center; justify-content: center; color: var(--muted); transform: translate(-50%, -48px); pointer-events: none; }
.puller.ready { color: var(--text); border-color: var(--action); }
.puller.spin svg { animation: puller-spin 0.7s linear infinite; }
@keyframes puller-spin { to { transform: rotate(-360deg); } }
@media (prefers-reduced-motion: reduce) { .puller.spin svg { animation: none; } }

/* Sign out in the dark header: a light icon, no box. */
.header .icon-btn { color: #fff; border-color: transparent; background: transparent; flex: 0 0 auto; }
.header .icon-btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* Check register and the job's Profit card. */
.stack { display: grid; gap: 10px; }
.sum { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14px; }
.sum span { color: var(--muted); min-width: 0; }
.sum b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sum.total { border-top: 1px solid #eceff0; padding-top: 8px; font-size: 16px; }
.sum.total span { color: var(--text); font-weight: 700; }
.sum.total b { color: #17592f; }
.sum.total.over b { color: var(--danger); }
.card.sum.total { border-top: 1px solid var(--border); padding-top: 14px; flex-direction: row; }
.card.sum.total b { color: var(--text); }
.chip.tint { background: #fff1d6; border-color: #fff1d6; color: #7a4b00; }
a.chip { text-decoration: none; color: var(--text); }
.card > .files { padding-left: 0; }
/* Settings: where the check register is kept. */
.opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.opt > div { display: grid; gap: 2px; min-width: 0; }
.opt.on { border-color: var(--action); background: #fffaf0; }
.opt:not(.on) { opacity: 0.6; }
.radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #b9c0c4; flex: 0 0 auto; margin-top: 2px; }
.opt.on .radio { border-color: var(--action); background: radial-gradient(var(--action) 45%, #fff 50%); }

/* Modules card (Settings) and the Metivo admin. */
.switch { width: 52px; min-width: 52px; height: 40px; padding: 0; border: 0; background: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; }
.switch span { width: 44px; height: 26px; border-radius: 999px; background: #c9cfd3; position: relative; transition: background 0.15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left 0.15s; }
.switch[aria-checked="true"] span { background: var(--action); }
.switch[aria-checked="true"] span::after { left: 21px; }
.switch:disabled { opacity: 0.5; cursor: default; }
.chip.plan { background: var(--header, #22272b); border-color: transparent; color: #fff; }
.lines .line.locked .what { opacity: 0.5; }
fieldset.boxes { border: 0; padding: 0; margin: 0; display: grid; }
fieldset.boxes legend { font-size: 14px; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: 2px; }
fieldset.boxes label.check + label.check { border-top: 1px solid #eceff0; }
.row select.plan-pick { width: auto; flex: 0 0 auto; max-width: 50%; }
.row .name { min-width: 0; overflow-wrap: anywhere; }

/* A confirmation that floats for a few seconds (see toast() in app.js). */
.toast { position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top)); transform: translateX(-50%); margin: 0; z-index: 30; background: #22272b; color: #fff; padding: 10px 18px; border-radius: 14px; font-size: 15px; font-weight: 600; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); width: max-content; max-width: calc(100vw - 32px); text-align: center; }
/* Phase and group pickers on the job card. */
.status label { font-size: 12px; color: var(--muted); }

/* Record payment on the job's Payments card. */
button.wide { width: 100%; }
.line .when small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); text-align: right; }
.files li > span { flex: 1 1 auto; min-width: 0; font-size: 14px; }

/* Invoicing: a real choice between two options (Settings), the "Invoice when"
   picker under each milestone, and the client's invoice page. */
.opts { display: grid; gap: 8px; }
.opt.pick { opacity: 1; width: 100%; justify-content: flex-start; min-height: 44px; align-items: center; text-align: left; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.opt.pick.on { background: #fffaf0; }
.opt.pick:disabled { cursor: default; }
.opt.pick .radio { margin-top: 0; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.setting-row > div { display: grid; gap: 2px; min-width: 0; }
.setting-row b { color: var(--text); font-size: 15px; }
.setting-row select { width: auto; flex: 0 0 auto; min-height: 40px; }
.milestone-when { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.milestone-when select { width: auto; max-width: 62%; min-height: 40px; }
.card.invoice { display: grid; gap: 6px; }
.card.invoice > b { margin-top: 8px; }
.inv-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 15px; }
.inv-row:first-of-type { margin-top: 8px; }
.inv-row.total { font-weight: 700; }
.inv-row span:last-child { white-space: nowrap; }
.setting-row input.short { width: 110px; flex: 0 0 auto; text-align: right; }
/* Clients list: the search box and its plus stay on one line. */
.row.search-row { flex-wrap: nowrap; }
.row.search-row input { flex: 1 1 0; min-width: 0; }

/* Files cards: a tinted file mark, and the whole row opens the file. */
.file-icon { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: #eef1f2; color: var(--muted); }
.file-icon.pdf { background: #fdecea; color: #b3261e; }
.file-icon.img { background: #e7f3ec; color: #1f6b43; }
.file-icon.dir { background: #fdf3dc; color: #8a5a00; }
.file-open { flex: 1 1 0; min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; text-align: left; color: inherit; font: inherit; }
.card .filters { margin-bottom: 6px; }
