:root {
  /* Norozay palette (from norozay.com) */
  --bg: #050505;
  --surface: #111111;
  --surface-2: #181818;
  --text: #fdf1ea;
  --muted: rgba(253, 241, 234, .6);
  --line: rgba(184, 126, 73, .18);
  --input-line: rgba(253, 241, 234, .16);
  --brand: #b87e49;
  --brand-hover: #c98f5a;
  --brand-ink: #050505;
  --brand-soft: rgba(184, 126, 73, .14);
  --ok: #7fc596;
  --ok-soft: rgba(127, 197, 150, .12);
  --warn: #e3a857;
  --warn-soft: rgba(227, 168, 87, .12);
  --danger: #f08a7e;
  --danger-soft: rgba(240, 138, 126, .12);
  --violet: #c4a8f0;
  --violet-soft: rgba(196, 168, 240, .12);
  --radius: 6px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .02), 0 8px 24px rgba(0, 0, 0, .35);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.45; }
body.modal-open { overflow: hidden; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 22px; margin-bottom: 12px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
a { color: var(--brand); }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; justify-content: center; }
.nowrap { white-space: nowrap; }
.warn { color: var(--warn); }
.spacer { flex: 1; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.upper { text-transform: uppercase; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.big { padding: 14px 22px; font-size: 17px; border-radius: 10px; }
.btn.block { width: 100%; padding: 11px; margin-top: 6px; }
.link { background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer; padding: 6px; }
.link.danger { color: var(--danger); }
.link.center { display: block; margin: 10px auto 0; }
.icon-btn { background: none; border: 0; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 4px; }

/* ── Auth ── */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-brand { font-weight: 800; font-size: 20px; margin-bottom: 16px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card.wide { max-width: 640px; }
.auth-card .field { margin-bottom: 12px; }

/* ── Shell ── */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 20px;
  padding: 0 20px; height: 58px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; white-space: nowrap; }
#nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
#nav::-webkit-scrollbar { display: none; }
#nav a { padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap; }
#nav a:hover { background: var(--bg); color: var(--text); }
#nav a.active { background: var(--brand-soft); color: var(--brand); }
.me { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.me-name { font-weight: 600; }
.role { font-size: 12px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: 2px 8px; }
main { max-width: 1200px; margin: 0 auto; padding: 24px 20px 64px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 10px; }
.back { display: inline-block; margin-bottom: 10px; text-decoration: none; font-weight: 600; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select, .search { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--surface); }
.search { width: 100%; max-width: 360px; margin-bottom: 12px; }
.count { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: 2px 9px; vertical-align: middle; }
.count.hot { color: var(--brand); background: var(--brand-soft); border-color: transparent; }

/* ── Cards ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card + .card { margin-top: 16px; }
.error-card { border-color: var(--danger); }
.banner { background: var(--brand-soft); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td, tr[data-req]:hover td, tr[data-proj]:hover td, tr[data-user]:hover td { background: rgba(184, 126, 73, .06); cursor: pointer; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .btn + .btn { margin-left: 4px; }
.note { margin-top: 4px; font-size: 13px; color: var(--muted); font-style: italic; }

/* ── Badges ── */
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.b-new, .b-submitted, .b-in_review { background: var(--brand-soft); color: var(--brand); }
.b-scheduled, .b-sent, .b-in_progress, .b-active { background: var(--violet-soft); color: var(--violet); }
.b-completed, .b-approved, .b-accepted { background: var(--ok-soft); color: var(--ok); }
.b-rejected, .b-on_hold { background: var(--warn-soft); color: var(--warn); }
.b-cancelled, .b-declined, .b-inactive { background: var(--danger-soft); color: var(--danger); }
.prio { font-size: 12px; font-weight: 700; }
.p-emergency { color: var(--danger); }
.p-high { color: var(--warn); }
.p-low { color: var(--muted); }

/* ── Forms ── */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
fieldset.grid { margin-top: 6px; }
legend { font-weight: 700; font-size: 14px; padding: 0; margin-bottom: 8px; grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > span { font-size: 13px; font-weight: 600; color: rgba(253, 241, 234, .8); }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--input-line); border-radius: var(--radius); font: inherit; background: #0a0a0a; color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.field input:disabled { background: var(--bg); color: var(--muted); }
.field textarea { resize: vertical; }
.field-pair { display: grid; grid-template-columns: 1fr 1.3fr; gap: 12px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; margin: 4px 0 8px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label { border: 1px solid var(--input-line); border-radius: 8px; padding: 8px 12px; cursor: pointer; display: flex; gap: 6px; align-items: center; font-weight: 600; }
.seg label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.subform { background: var(--bg); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.form-error { background: var(--danger-soft); color: var(--danger); border-radius: 8px; padding: 10px 12px; margin: 8px 0; font-weight: 600; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }

/* ── Key/value ── */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.kv dt { color: var(--muted); font-weight: 600; font-size: 13px; padding-top: 1px; }
.kv dd { margin: 0; white-space: pre-wrap; }

/* ── Stats ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.stat b { font-size: 22px; }
.week-nav { display: flex; align-items: center; gap: 10px; font-weight: 600; }

/* ── Timeclock ── */
.clock-card { max-width: 640px; margin: 0 auto; }
.clock-card.is-active { border-top: 4px solid var(--ok); }
.clock-card .kv { margin: 18px 0; }
.clock-status { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; color: var(--ok); text-transform: uppercase; letter-spacing: .05em; font-size: 13px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(127, 197, 150, .5); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(127, 197, 150, 0); } 100% { box-shadow: 0 0 0 0 rgba(127, 197, 150, 0); } }
.elapsed { font-size: 48px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; margin: 6px 0 2px; }
.timeline { list-style: none; padding: 0; margin: 18px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.timeline li { border: 1px solid var(--line); border-radius: 8px; padding: 10px; text-align: center; color: var(--muted); }
.timeline li b { display: block; font-size: 13px; }
.timeline li.done { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.timeline li.now { border-color: var(--brand); color: var(--brand); }
.distance { background: var(--bg); border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; min-height: 20px; }
.distance:empty { display: none; }

/* ── Modal ── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 50; }
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); border: 1px solid var(--line); }
.modal.wide { max-width: 760px; }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px 20px 4px; }
.modal .form-error { margin: 0 20px 8px; }
.modal footer { display: flex; gap: 8px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); }

/* ── Toasts ── */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--surface-2); color: var(--text); border: 1px solid var(--brand); padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); font-weight: 600; animation: rise .2s ease-out; }
.toast.err { background: var(--danger); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ── Small screens ── */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 8px; }
  .brand { flex: 1; }
  #nav { order: 3; flex-basis: 100%; }
  .me-name { display: none; }
  main { padding: 16px 12px 64px; }
  .grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .elapsed { font-size: 40px; }
  .timeline { grid-template-columns: 1fr; }
  .btn.big { width: 100%; }
  .modal-backdrop { padding: 0; }
  .modal { border-radius: 0; min-height: 100%; }
}

/* ── Time entry form ── */
.clock-card h3 { margin-bottom: 12px; }
.times-grid select:disabled { background: var(--bg); color: var(--muted); }
.times-summary { justify-content: flex-end; padding-bottom: 10px; font-weight: 600; }
.in-progress { border-top: 4px solid var(--warn); margin-bottom: 16px; }
.ip-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
@media (max-width: 760px) { .ip-row { flex-direction: column; align-items: flex-start; } }
.trio { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.times-summary { justify-content: flex-end; color: var(--ok); }
@media (max-width: 520px) { .trio { grid-template-columns: 1fr; } }


/* ════════ Norozay branding ════════ */
body { -webkit-font-smoothing: antialiased; }
::selection { background: var(--brand); color: var(--brand-ink); }

/* Buttons: copper solid + copper outline, like norozay.com */
.btn { background: transparent; border-color: var(--input-line); border-radius: 4px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--brand-ink); filter: none; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.link { color: var(--brand); }

/* Header */
.topbar { background: rgba(5, 5, 5, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-logo { width: 30px; height: 30px; display: block; }
.wordmark { font-weight: 800; letter-spacing: 2px; font-size: 18px; }
.brand-sub { font-size: 11px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: var(--brand); padding-left: 10px; border-left: 1px solid var(--line); }
#nav a:hover { background: transparent; color: var(--text); }
#nav a.active { background: transparent; color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); border-radius: 0; }
.role { background: var(--brand-soft); border-color: transparent; color: var(--brand); }

/* Sign-in screen: lion + wordmark + tagline over a subtle copper glow */
.auth-wrap { background: radial-gradient(ellipse at 50% 0%, rgba(184, 126, 73, .14), transparent 60%), radial-gradient(ellipse at 80% 100%, rgba(20, 40, 25, .5), transparent 60%), var(--bg); }
.auth-brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 26px; }
.auth-logo { width: 64px; height: 64px; margin-bottom: 14px; }
.auth-brand .wordmark { font-size: 34px; letter-spacing: 6px; }
.tagline { margin-top: 8px; font-size: 11px; font-weight: 600; letter-spacing: 5px; text-transform: uppercase; color: var(--brand); }
.auth-card { border-top: 2px solid var(--brand); }

/* Surfaces */
.card, .stat { background: var(--surface); border-color: var(--line); }
.stat b { color: var(--text); }
.stat span { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.count { background: transparent; border-color: var(--line); }
.count.hot { background: var(--brand); color: var(--brand-ink); }
.banner { background: var(--brand-soft); border: 1px solid var(--line); }
.banner.ok { border-color: rgba(127, 197, 150, .3); }
.banner.warn { border-color: rgba(227, 168, 87, .3); }
.filters select, .search { background: #0a0a0a; border-color: var(--input-line); color: var(--text); }
.field input:focus, .field select:focus, .field textarea:focus, .filters select:focus, .search:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.field input:disabled, .times-grid select:disabled { background: #0d0d0d; color: rgba(253, 241, 234, .35); }
.field select option:disabled { color: #555; }
input[type=date]::-webkit-calendar-picker-indicator { filter: invert(.8) sepia(1) saturate(2) hue-rotate(-10deg); }
.subform, .distance { background: var(--surface-2); }
.seg label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
input[type=radio], input[type=checkbox] { accent-color: var(--brand); }
.badge { background: rgba(253, 241, 234, .06); }
.modal header, .modal footer { border-color: var(--line); }
.modal header h3 { letter-spacing: .02em; }
.back { color: var(--brand); }
.clock-card.is-active { border-top-color: var(--brand); }
.timeline li.done { border-color: rgba(127, 197, 150, .4); }
.form-error { border: 1px solid rgba(240, 138, 126, .3); }
.error-card { border-color: var(--danger); }

/* ════════ Tickets & projects ════════ */
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 13px; color: var(--brand); }
.pre { white-space: pre-wrap; margin: 0; }
.full-row { grid-column: 1 / -1; }
.check.inline { margin: 0; font-weight: 500; white-space: nowrap; }
.filters .search { margin: 0; width: 200px; }
.eyebrow { font-family: ui-monospace, Consolas, monospace; font-size: 12px; letter-spacing: .08em; color: var(--brand); text-transform: uppercase; margin-bottom: 6px; }
.ticket-head h2 { font-size: 24px; }
.head-badges { display: flex; gap: 10px; align-items: center; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.detail-main, .detail-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.detail-main .card + .card, .detail-side .card + .card { margin-top: 0; }
.card h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 12px; }
.detail-side .kv { grid-template-columns: 1fr; gap: 2px; }
.detail-side .kv dd { margin-bottom: 10px; }
.actions.stack { flex-direction: column; align-items: stretch; margin-top: 4px; }
.resolution { border-left: 3px solid var(--ok); }
.status-help { margin: 14px 0 16px; }
.b-acknowledged { background: var(--brand-soft); color: var(--brand); }
.b-resolved { background: var(--ok-soft); color: var(--ok); }
.b-closed { background: rgba(253, 241, 234, .08); color: var(--muted); }
.b-planning { background: var(--brand-soft); color: var(--brand); }

/* Step tracker */
.stepper { list-style: none; margin: 8px 0 0; padding: 0; display: flex; }
.stepper li { flex: 1; position: relative; text-align: center; padding-top: 22px; font-size: 12px; color: var(--muted); font-weight: 600; }
.stepper li::before { content: ""; position: absolute; top: 7px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.stepper li:first-child::before { display: none; }
.stepper .dot { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line); z-index: 1; }
.stepper li.done { color: var(--text); }
.stepper li.done::before, .stepper li.current::before { background: var(--brand); }
.stepper li.done .dot { background: var(--brand); border-color: var(--brand); }
.stepper li.current { color: var(--brand); }
.stepper li.current .dot { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); background: var(--bg); }
.stepper.off { opacity: .45; }
.stepper-flag { margin-top: 10px; }

/* Progress */
.progress { display: inline-block; vertical-align: middle; width: 90px; height: 6px; background: rgba(253, 241, 234, .08); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.progress-lbl { margin-left: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress-big { margin-bottom: 14px; }
.progress-big .progress { width: calc(100% - 52px); height: 10px; }
.progress-big .progress-lbl { font-size: 16px; font-weight: 700; color: var(--text); }
.progress-cell { white-space: nowrap; }
.by-person { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; display: grid; gap: 6px; }
.by-person div { display: flex; justify-content: space-between; font-size: 14px; }

/* Updates thread */
.composer textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--input-line); border-radius: var(--radius); background: #0a0a0a; color: var(--text); font: inherit; resize: vertical; }
.composer textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.composer-row { margin-top: 10px; }
.composer .actions { margin-top: 8px; }
.small-seg label { padding: 5px 10px; font-size: 13px; }
.email-check { font-weight: 500; font-size: 14px; margin-top: 10px; }
.activity { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--line); }
.act { position: relative; padding: 14px 0 14px 22px; border-bottom: 1px solid var(--line); }
.act::before { content: ""; position: absolute; left: 4px; top: 20px; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.act-status::before { background: var(--brand); }
.act-created::before { background: var(--ok); }
.act.is-internal { background: rgba(227, 168, 87, .05); }
.act.is-internal::before { background: var(--warn); }
.act-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; }
.act-time { margin-left: auto; font-size: 12px; color: var(--muted); }
.act-meta { font-size: 13px; color: var(--brand); margin-top: 4px; }
.act-text { margin-top: 6px; white-space: pre-wrap; color: rgba(253, 241, 234, .9); }
.internal-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--warn); background: var(--warn-soft); padding: 2px 7px; border-radius: 99px; }

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-side { order: -1; }
}
@media (max-width: 560px) {
  .stepper .lbl { font-size: 10px; }
  .filters .search { width: 100%; }
}
#toasts { left: auto; right: 20px; transform: none; align-items: flex-end; }
@media (max-width: 560px) { #toasts { right: 12px; left: 12px; align-items: stretch; } }

/* ── Top-bar dropdown (Time) ── */
.nav-group { display: flex; }
.nav-group-btn { background: none; border: 0; font: inherit; font-weight: 600; color: var(--muted); padding: 8px 12px; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.nav-group-btn:hover, .nav-group-btn[aria-expanded="true"] { color: var(--text); }
.nav-group-btn.active { color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); }
.nav-group-btn .caret { font-size: 10px; transition: transform .15s; }
.nav-group-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }
.nav-menu { position: fixed; z-index: 40; min-width: 200px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 12px 32px rgba(0, 0, 0, .5); padding: 6px; display: flex; flex-direction: column; }
.nav-menu[hidden] { display: none; }
.nav-menu a { padding: 9px 12px; border-radius: 4px; color: var(--text); text-decoration: none; font-weight: 600; }
.nav-menu a:hover, .nav-menu a:focus { background: var(--brand-soft); color: var(--brand); outline: none; }
.nav-menu a.active { color: var(--brand); background: var(--brand-soft); box-shadow: none; border-radius: 4px; }

/* ── Type-to-search dropdown ── */
.combo { position: relative; }
.combo-input { width: 100%; padding: 9px 30px 9px 11px; border: 1px solid var(--input-line); border-radius: var(--radius); font: inherit; background: #0a0a0a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b87e49' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat right 11px center; color: var(--text); }
.combo-input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.combo-native { position: absolute !important; left: 12px; bottom: 0; width: 1px !important; height: 1px; opacity: 0; pointer-events: none; padding: 0 !important; border: 0 !important; }
.combo-list { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; right: 0; max-height: 260px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
.combo-list li { padding: 8px 10px; border-radius: 4px; cursor: pointer; }
.combo-list li:hover, .combo-list li.active { background: var(--brand-soft); color: var(--brand); }
.combo-list .combo-empty { color: var(--muted); cursor: default; }
.combo-list .combo-empty:hover { background: none; color: var(--muted); }
.login-kind { font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--brand); margin-bottom: 6px; }
.auth-card h1 + .muted { margin-top: -4px; margin-bottom: 18px; font-size: 14px; }

/* ── Mileage ── */
.mileage-card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; padding: 16px 18px 6px; }
.card-head h3 { margin: 0; }
.total-row td { border-top: 1px solid var(--brand); background: var(--brand-soft); }
.furthest { color: var(--brand); cursor: help; }
.stat.accent { border-color: var(--brand); }
.stat.accent b { color: var(--brand); }
.hint.warn { color: var(--warn); }

/* ── Google sign-in ── */
.google-btn { background: #fff; color: #1f1f1f; border-color: #dadce0; gap: 10px; }
.google-btn:hover { background: #f3f3f3; color: #1f1f1f; border-color: #c6c6c6; }
.google-btn svg { flex: none; }
.auth-card .google-btn.block { margin-top: 4px; padding: 11px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; margin: 18px 0 14px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.hint.center { text-align: center; }
.b-invited { background: var(--brand-soft); color: var(--brand); }
.kv-inline { margin-bottom: 16px; font-size: 15px; }
.jump { display: flex; gap: 4px; }
.jump input { width: 90px; padding: 7px 9px; border: 1px solid var(--input-line); border-radius: var(--radius); background: #0a0a0a; color: var(--text); font: inherit; }
.jump input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.filter-customer { min-width: 240px; }
.filter-customer .field > span:empty { display: none; }
.filter-customer .field { gap: 0; }

/* ── Installed app (PWA) ── */
.topbar { padding-top: env(safe-area-inset-top); height: auto; min-height: 58px; }
main { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
#offlineBar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: var(--warn); color: #1a1005; text-align: center; font-weight: 700; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
#offlineBar[hidden] { display: none; }
.install-wrap { margin-top: 16px; }
.install-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
@media (display-mode: standalone) { body { overscroll-behavior-y: none; } }

/* ════════ Phone layout ════════ */
@media (max-width: 760px) {
  /* Top bar: brand + account on one row, swipeable menu below */
  .topbar { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "brand me" "nav nav"; align-items: center; gap: 4px 10px; padding: env(safe-area-inset-top) 12px 0; height: auto; }
  .brand { grid-area: brand; min-width: 0; }
  .brand-sub { display: none; }
  .wordmark { font-size: 16px; letter-spacing: 1.5px; }
  .brand-logo { width: 28px; height: 28px; }
  .me { grid-area: me; gap: 8px; }
  .me .btn.small { min-height: 34px; }
  #nav { grid-area: nav; order: 0; flex-basis: auto; margin: 0 -12px; padding: 0 6px; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  #nav a, .nav-group-btn { padding: 13px 12px; }
  .nav-menu a { padding: 13px 14px; }

  /* Readable, tappable controls (16px stops iPhones zooming in on fields) */
  .field input, .field select, .field textarea, .combo-input, .search, .jump input, .composer textarea, .filters select { font-size: 16px; min-height: 46px; }
  .field textarea, .composer textarea { min-height: 96px; }
  .btn { min-height: 44px; padding: 10px 16px; }
  .btn.small { min-height: 38px; padding: 7px 12px; font-size: 14px; }
  .seg label { min-height: 44px; padding: 10px 14px; }
  .check { min-height: 40px; }
  input[type=checkbox], input[type=radio] { width: 20px; height: 20px; }

  /* Page headers & filters stack neatly */
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-head > .btn, .page-head > a.btn { width: 100%; }
  .filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; width: 100%; min-width: 0; }
  .filters select, .filters .combo, .filters .field { width: 100%; min-width: 0; }
  main, .page-head, .card { min-width: 0; max-width: 100%; }
  html, body { overflow-x: hidden; }
  .filters > * { grid-column: 1 / -1; }
  .filters > .jump, .filters > select { grid-column: auto; }
  .filters .btn { width: 100%; }
  .filters .search { width: 100%; max-width: none; }
  .jump { width: 100%; }
  .jump input { flex: 1; width: auto; }
  .filter-customer { min-width: 0; }
  .week-nav { width: 100%; justify-content: space-between; }
  .section-head { gap: 8px; flex-wrap: wrap; }
  .section-head > div { display: flex; gap: 6px; }
  .actions { gap: 8px; }
  .actions > .btn, .actions > button { flex: 1 1 auto; }
  .actions .spacer { display: none; }
  .ticket-head h2 { font-size: 20px; }
  .head-badges { align-self: flex-start; }

  /* Tables become stacked cards */
  .table-wrap { overflow: visible; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable thead { display: none; }
  .rtable tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .rtable tbody tr:last-child { border-bottom: 0; }
  .rtable td { border: 0; padding: 4px 0 4px 116px; position: relative; white-space: normal; min-height: 26px; overflow-wrap: anywhere; }
  .rtable td::before { content: attr(data-label); position: absolute; left: 0; top: 6px; width: 106px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; line-height: 1.3; }
  .rtable td[data-label=""] { padding-left: 0; }
  .rtable td[data-label=""]::before { display: none; }
  .rtable td:empty { display: none; }
  .rtable td:first-child { font-size: 15px; }
  .rtable td.row-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; text-align: left; }
  .rtable td.row-actions::before { display: none; }
  .rtable td.row-actions:empty { display: none; }
  .rtable td.row-actions .btn { flex: 1 1 auto; margin: 0; }
  .rtable .total-row td { background: none; border: 0; }
  .rtable .total-row { background: var(--brand-soft); }
  .progress-cell .progress { width: 120px; }

  /* Modals: full screen with the save button always in reach */
  .modal { display: flex; flex-direction: column; min-height: 100%; border: 0; }
  .modal-body { flex: 1; padding: 16px; }
  .modal header { position: sticky; top: 0; background: var(--surface); z-index: 2; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
  .modal footer { position: sticky; bottom: 0; background: var(--surface); z-index: 2; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .modal footer .btn { flex: 1; }
  .modal .form-error { margin: 0 16px 8px; }

  /* Ticket/project pages */
  .card { padding: 16px; }
  .card.flush { padding: 0; }
  .card-head { padding: 14px 16px 4px; }
  .act-head { font-size: 14px; }
  .act-time { margin-left: 0; width: 100%; }
  .composer-row .seg { width: 100%; }
  .composer-row .seg label { flex: 1; justify-content: center; }
  .composer .actions .btn { width: 100%; }
  .install-card .btn { width: 100%; }
}
@media (max-width: 520px) {
  .stepper li .lbl { display: none; }
  .stepper li.current .lbl { display: block; position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 12px; }
  .stepper { padding-bottom: 4px; }
  .stepper li:first-child.current .lbl { left: 0; transform: none; }
  .stepper li:last-child.current .lbl { left: auto; right: 0; transform: none; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat b { font-size: 19px; }
}
@media (max-width: 760px) { .jump input { min-width: 0; } .jump .btn { flex: none; } }
@media (max-width: 760px) {
  .filters .jump .btn { width: auto; min-width: 64px; }
  .seg { display: flex; flex-wrap: wrap; gap: 8px; }
  .seg label { flex: 1 1 30%; justify-content: center; text-align: center; }
}
.duo { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Attachments ─────────────────────────────────────────── */
.files { list-style: none; margin: 0 0 12px; padding: 0; }
.files li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--line); }
.files li:last-child { border-bottom: 0; }
.file-open { display: flex; gap: 8px; align-items: center; min-width: 0; background: none; border: 0; padding: 0;
  color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.file-open:hover .file-name { text-decoration: underline; }
.file-open:disabled { opacity: .6; cursor: progress; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { grid-column: 1; padding-left: 26px; }
.file-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 6px; }
.file-upload { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.file-upload label.btn { cursor: pointer; }
.file-upload label.disabled { opacity: .5; pointer-events: none; }
.file-field input[type=file] { padding: 8px; }
@media (max-width: 640px) {
  .file-actions { grid-row: auto; grid-column: 1; padding-left: 26px; }
  .files li { grid-template-columns: minmax(0, 1fr); }
}

/* ── Parts catalog ───────────────────────────────────────── */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 1px solid var(--input-line); background: transparent; color: var(--text); font: inherit; font-weight: 600;
  font-size: 13px; padding: 6px 12px; border-radius: 99px; cursor: pointer; }
.chip span { color: var(--muted); font-weight: 500; margin-left: 2px; }
.chip:hover { border-color: var(--brand); }
.chip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.chip.on span { color: var(--brand); }
td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vendors { border: 0; padding: 0; margin: 6px 0 14px; min-width: 0; }
.vendor-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.vendor-row { display: grid; grid-template-columns: 1.3fr 1.3fr 1fr auto; gap: 10px; align-items: end;
  background: var(--surface-2); border-radius: var(--radius); padding: 10px 12px; }
.vendor-row .icon-btn { padding-bottom: 6px; }
.import-help { margin: 0 0 12px; padding-left: 18px; }
.import-help li + li { margin-top: 4px; }
.import-stats { margin: 14px 0 10px; }
.import-errors { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
@media (max-width: 760px) {
  td.num { text-align: left; }
  .vendor-row { grid-template-columns: 1fr 1fr; }
  .vendor-row label:first-child { grid-column: 1 / -1; }
  .vendor-row .icon-btn { position: absolute; right: 8px; top: 6px; }
  .vendor-row { position: relative; padding-top: 14px; }
}

/* ── Ticket parts & invoices ─────────────────────────────── */
table.lines td, table.lines th { padding: 8px 10px; }
table.lines th.num, table.lines td.num { text-align: right; }
table.lines tfoot td { border-top: 1px solid var(--line); border-bottom: 0; }
.edit-lines input { width: 100%; padding: 7px 9px; border: 1px solid var(--input-line); border-radius: 6px; background: var(--bg);
  color: var(--text); font: inherit; }
.edit-lines input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.edit-lines td { vertical-align: middle; }
.pick-results { list-style: none; margin: 8px 0 12px; padding: 0; max-height: 260px; overflow-y: auto; }
.pick-results li + li { border-top: 1px solid var(--line); }
.pick-results button { width: 100%; display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: left;
  background: none; border: 0; color: var(--text); font: inherit; padding: 9px 8px; cursor: pointer; border-radius: 6px; }
.pick-results button:hover { background: var(--brand-soft); }
.pick-empty { padding: 8px; }
.section-mini { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 8px; }
.inv-mini { list-style: none; margin: 0; padding: 0; }
.inv-mini li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
.inv-mini li:last-child { border-bottom: 0; }
.inv-head-grid { grid-template-columns: 1fr 1fr; }
.inv-totals-edit { margin: 12px 0 0 auto; max-width: 340px; display: flex; flex-direction: column; gap: 6px; }
.inv-totals-edit > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.inv-totals-edit .grand { border-top: 1px solid var(--line); padding-top: 8px; font-size: 17px; }
.tax-row input { padding: 7px 9px; border: 1px solid var(--input-line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
.tax-row input[name=taxLabel] { flex: 1; min-width: 0; }
.tax-row input[name=tax] { width: 120px; text-align: right; }
.badge.inv-draft { background: rgba(253, 241, 234, .06); color: var(--muted); }
.badge.inv-sent { background: var(--violet-soft); color: var(--violet); }
.badge.inv-paid { background: var(--ok-soft); color: var(--ok); }
.badge.inv-void { background: var(--danger-soft); color: var(--danger); }

/* The invoice itself: a white sheet on screen and on paper */
.invoice-paper { position: relative; background: #fff; color: #1a1a1a; max-width: 860px; margin: 0 auto; padding: 48px 52px;
  border-radius: 4px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); font-size: 14px; line-height: 1.5; overflow: hidden; }
.ip-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 32px; }
.ip-from { display: flex; gap: 14px; align-items: flex-start; }
.ip-logo { width: 54px; height: 54px; }
.ip-company { font-weight: 800; font-size: 18px; letter-spacing: .02em; }
.ip-small { color: #555; font-size: 13px; }
.ip-title { text-align: right; }
.ip-title h1 { font-size: 30px; letter-spacing: .12em; color: #8a5a2b; margin: 0 0 8px; }
.ip-title dl { display: grid; grid-template-columns: auto auto; gap: 2px 14px; margin: 0; justify-content: end; }
.ip-title dt { color: #777; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
.ip-title dd { margin: 0; font-weight: 600; }
.ip-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin-bottom: 28px; }
.ip-parties h4 { margin: 0 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #8a5a2b; }
.ip-parties p { margin: 0; }
.ip-lines { width: 100%; border-collapse: collapse; }
.ip-lines th { background: #f4efea; color: #555; font-size: 11px; letter-spacing: .08em; padding: 9px 10px; border: 0; }
.ip-lines td { padding: 10px; border-bottom: 1px solid #eee; color: #1a1a1a; }
.ip-lines .r { text-align: right; white-space: nowrap; }
.ip-totals { margin: 16px 0 0 auto; width: 300px; max-width: 100%; }
.ip-totals > div { display: flex; justify-content: space-between; padding: 4px 10px; }
.ip-grand { border-top: 2px solid #1a1a1a; margin-top: 4px; padding-top: 8px !important; font-weight: 800; font-size: 17px; }
.ip-notes { margin-top: 36px; padding-top: 16px; border-top: 1px solid #eee; color: #444; font-size: 13px; }
.stamp { position: absolute; top: 48%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); pointer-events: none;
  border: 6px solid currentColor; border-radius: 10px; padding: 4px 28px; font-weight: 900; font-size: 72px; letter-spacing: .15em;
  text-transform: uppercase; opacity: .16; }
.stamp-paid { color: #2f8f57; }
.stamp-void { color: #b23b2e; }
@media (max-width: 640px) {
  .invoice-paper { padding: 24px 18px; }
  .ip-head { flex-direction: column; }
  .ip-title { text-align: left; }
  .ip-title dl { justify-content: start; }
  .inv-head-grid { grid-template-columns: 1fr; }
  .ip-lines th, .ip-lines td { padding: 8px 5px; font-size: 13px; }
  .ip-lines th { font-size: 10px; letter-spacing: .04em; }
  .stamp { font-size: 44px; }
}
@media print {
  @page { margin: 12mm; }
  body, :root { background: #fff !important; }
  .topbar, .no-print, #toasts, .nav-menu { display: none !important; }
  main { padding: 0 !important; max-width: none; }
  .invoice-paper { box-shadow: none; padding: 0; max-width: none; }
  .ip-lines thead { display: table-header-group !important; }
  .ip-lines, .ip-lines tbody, .ip-lines tr { display: revert !important; }
  .ip-lines td { display: table-cell !important; padding: 8px 10px !important; }
  .ip-lines td::before { display: none !important; }
  .ip-lines th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .stamp { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── Proposals, project billing & purchasing ─────────────── */
.card-title-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-title-row h3 { margin: 0; }
.quote-grid { grid-template-columns: minmax(0, 1fr) 300px; }
.quote-summary { position: sticky; top: 84px; }
.sum-rows > div, .sum-internal > div:not(.muted) { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0; }
.sum-rows .sub { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; }
.sum-rows .grand { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-size: 18px; }
.sum-rows .grand b { color: var(--brand); }
.sum-internal { margin-top: 14px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px dashed var(--line); }
.sum-internal .upper { letter-spacing: .08em; font-size: 11px; margin-bottom: 4px; }
.quote-summary .actions.stack { display: flex; flex-direction: column; align-items: stretch; }
.quote-summary .actions.stack .btn { width: 100%; }
.edit-lines input:disabled, .tax-row input:disabled { opacity: .7; }
.q-parts td:nth-child(2) { min-width: 200px; }
.badge.q-draft, .badge.po-draft { background: rgba(253, 241, 234, .06); color: var(--muted); }
.badge.q-sent, .badge.po-sent { background: var(--violet-soft); color: var(--violet); }
.badge.q-accepted, .badge.po-received { background: var(--ok-soft); color: var(--ok); }
.badge.q-declined, .badge.q-void, .badge.po-cancelled { background: var(--danger-soft); color: var(--danger); }
.badge.po-partial { background: var(--warn-soft); color: var(--warn); }
.budget-bar-cell { width: 28%; min-width: 90px; vertical-align: middle !important; }
.budget-bar { height: 8px; border-radius: 99px; background: rgba(253, 241, 234, .08); overflow: hidden; }
.budget-bar span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.budget-bar.over span { background: var(--danger); }
.po-pick td { vertical-align: middle; }

/* Proposal document */
.pd-sec { margin-top: 26px; }
.pd-sec h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: #8a5a2b; margin: 0 0 10px; border-bottom: 1px solid #eee; padding-bottom: 6px; }
.pd-text { color: #222; }
.pd-group td { background: #faf7f4; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #8a5a2b; }
.pd-summary { width: 100%; max-width: 520px; margin: 0 0 0 auto; }
.pd-summary > div { gap: 16px; }
.pd-summary .pd-sub { border-top: 1px solid #ddd; margin-top: 4px; padding-top: 8px; }
.pd-terms .pd-text { font-size: 12.5px; color: #333; }
.pd-sign { margin-top: 36px; break-before: page; page-break-before: always; }
.pd-sign h3 { font-size: 20px; letter-spacing: .1em; color: #8a5a2b; margin: 0 0 10px; text-transform: uppercase; }
.pd-sign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 24px; }
.pd-sign-grid h4 { margin: 0 0 6px; }
.sig-line { border-bottom: 1px solid #333; height: 42px; position: relative; margin-bottom: 22px; }
.sig-line span { position: absolute; bottom: -18px; left: 0; font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: .06em; }
.pd-accepted { margin-top: 14px; padding: 10px 14px; background: #eef7f1; border: 1px solid #b8dcc6; border-radius: 6px; color: #1f5d39; }
@media (max-width: 900px) { .quote-grid { grid-template-columns: 1fr; } .quote-summary { position: static; } }
@media (max-width: 640px) { .pd-sign-grid { grid-template-columns: 1fr; } }
@media print {
  .pd-keep { break-inside: avoid; }
  .pd-group td, .pd-accepted { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.q-parts { min-width: 760px; }
.q-parts input { min-width: 64px; }
.q-parts td:nth-child(3) input, .q-parts td:nth-child(4) input { min-width: 96px; }
.tax-row { display: flex; gap: 8px; align-items: center; }
.tax-row input { padding: 7px 9px; border: 1px solid var(--input-line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; min-width: 0; }
.tax-row input:first-child { flex: 1 1 auto; }
.tax-row input:last-child { flex: 0 0 104px; width: 104px; text-align: right; }

/* ── Settings: labor rates ─────────────────────────────── */
.rates-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.money-input { display: flex; align-items: center; border: 1px solid var(--input-line); border-radius: 6px; background: var(--bg); padding: 0 10px; }
.money-input:focus-within { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.money-input span { color: var(--muted); }
.money-input input { border: 0 !important; outline: 0 !important; background: transparent !important; flex: 1; min-width: 0; padding: 10px 6px !important; }
.money-input em { font-style: normal; color: var(--muted); font-size: 13px; white-space: nowrap; }
select.add-rate { appearance: auto; padding-right: 8px; }

/* Profile / settings spacing */
#main > .card + .card, #main > .card + p, #filesBox + .card { margin-top: 16px; }
#main > form.card + .card.install-wrap { margin-top: 16px; }
a.me-name { color: var(--text); text-decoration: none; }
a.me-name:hover { color: var(--brand); }
