/*
  The contractor's time screens, on the HHC design system (_content/HHC.UI.Design/hhc.css).
  Built for site: gloves (every target at least 56px, the main actions 76px), sunlight (strong contrast), one clear
  action per screen (CLAUDE.md). Colours come from the design tokens only. While someone is on a job (or picking one
  of its stages) the screen drops in DivisionTheme, so the app takes that job's division colour; each job in a list carries
  its division's class, coloured edge and name.
*/

main { max-width: 34rem; margin: 0 auto; padding: var(--hhc-space-5) var(--hhc-space-4) var(--hhc-space-5); }

h1 { font-size: var(--hhc-step-3); }

.message { font-size: var(--hhc-step-1); color: var(--hhc-text-soft); }
.loading-line { display: flex; align-items: center; gap: var(--hhc-space-3); }
.note { color: var(--hhc-text-soft); font-size: var(--hhc-step--1); margin: var(--hhc-space-1) 0; }

/* First sign-in */
.welcome { text-align: left; padding-top: var(--hhc-space-6); }
.welcome-mark { display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: var(--hhc-space-5); border-radius: var(--hhc-radius-lg); background: var(--hhc-blueprint), var(--hhc-brand); color: var(--hhc-on-brand); box-shadow: var(--hhc-shadow-2); border-bottom: 3px solid var(--hhc-brass); }
.welcome-badge { width: 40px; height: 40px; }
.welcome h1 { font-size: var(--hhc-step-4); }
.welcome .btn { margin-top: var(--hhc-space-6); }

/* Job cards: the Start screen */
.jobs { list-style: none; margin: var(--hhc-space-4) 0 0; padding: 0; display: grid; gap: var(--hhc-space-3); }
.job-card {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--hhc-space-4);
    width: 100%; min-height: 88px; padding: var(--hhc-space-4) var(--hhc-space-5);
    font: inherit; text-align: left; cursor: pointer; color: var(--hhc-text);
    background: var(--hhc-surface); border: 1px solid var(--hhc-border); border-radius: var(--hhc-radius-lg);
    box-shadow: var(--hhc-shadow-1);
    transition: transform var(--hhc-fast) var(--hhc-ease), box-shadow var(--hhc-fast) var(--hhc-ease), border-color var(--hhc-fast) var(--hhc-ease);
}
.job-card:hover { box-shadow: var(--hhc-shadow-2); border-color: var(--hhc-border-strong); }
.job-card:active { transform: scale(0.985); }
.job-card:disabled { opacity: 0.55; }
.job-card-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--hhc-radius); background: var(--hhc-division); color: var(--hhc-brass-light); }
.job-card-text { display: grid; gap: 2px; min-width: 0; }
.job-card .job { font-size: var(--hhc-step-1); font-weight: 700; line-height: 1.25; }
.job-card small { color: var(--hhc-text-faint); font-weight: 550; }
.job-card-text .hhc-division-tag { margin-top: var(--hhc-space-1); }
.job-card-go { display: inline-flex; align-items: center; gap: var(--hhc-space-1); padding: var(--hhc-space-2) var(--hhc-space-4); border-radius: var(--hhc-radius-pill); background: var(--hhc-success); color: #fff; font-weight: 750; }

/* On site now */
.working {
    position: relative; overflow: hidden;
    padding: var(--hhc-space-5); border-radius: var(--hhc-radius-lg);
    background: var(--hhc-blueprint), linear-gradient(160deg, var(--hhc-brand) 0%, var(--hhc-division-deep) 100%);
    border-bottom: 3px solid var(--hhc-brass);
    color: var(--hhc-on-brand); box-shadow: var(--hhc-shadow-3);
}
.working::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--hhc-brass-light) 22%, transparent), transparent); pointer-events: none; }
.working h1 { color: var(--hhc-on-brand); font-size: var(--hhc-step-2); margin-bottom: var(--hhc-space-2); }
.working-live { display: flex; align-items: center; gap: var(--hhc-space-2); margin: 0 0 var(--hhc-space-3); font-size: var(--hhc-step--1); font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; color: var(--hhc-limewash); }
.elapsed { margin: 0; font-size: 4rem; font-weight: 750; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--hhc-on-brand); }
.working .since { margin: var(--hhc-space-2) 0 var(--hhc-space-5); color: var(--hhc-limewash); font-size: var(--hhc-step-1); }
/* Limewash, not see-through white: 5.6:1 or better on every division colour. */
.working .hhc-choices legend { color: var(--hhc-limewash); }
.working .hhc-division-tag { color: var(--hhc-limewash); }
.working-division { margin: 0 0 var(--hhc-space-3); }
.working .hhc-choice { background: rgb(255 255 255 / 8%); color: #fff; border-color: rgb(255 255 255 / 20%); }
.working .hhc-choice[aria-pressed="true"] { background: var(--hhc-brass-light); border-color: var(--hhc-brass-light); color: var(--hhc-ink); box-shadow: none; }
.working .finish { margin-top: var(--hhc-space-5); position: relative; z-index: 1; }

.move { margin-top: var(--hhc-space-6); }
.move h2 { font-size: var(--hhc-step-1); color: var(--hhc-text-soft); }
.job-row {
    display: flex; align-items: center; gap: var(--hhc-space-3); width: 100%; min-height: 60px; padding: 0 var(--hhc-space-4);
    font: inherit; font-weight: 650; text-align: left; cursor: pointer; color: var(--hhc-text);
    background: var(--hhc-surface); border: 1px solid var(--hhc-border); border-radius: var(--hhc-radius);
}
.job-row small { display: block; color: var(--hhc-text-faint); font-weight: 500; }

/* Notice to agree */
.notice h1 { font-size: var(--hhc-step-3); }
.notice ul { padding-left: var(--hhc-space-5); color: var(--hhc-text-soft); }
.notice li { margin-bottom: var(--hhc-space-2); }
.notice li strong { color: var(--hhc-text); }
.notice .choices { margin: var(--hhc-space-5) 0; }
.notice .agree { margin-top: var(--hhc-space-4); }

/* Status: no signal, sign in again, refused taps */
.status:empty { display: none; }
.status p, .problems {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--hhc-space-2);
    padding: var(--hhc-space-3) var(--hhc-space-4); margin: 0 0 var(--hhc-space-4);
    border-radius: var(--hhc-radius); background: var(--hhc-warning-bg); color: var(--hhc-text);
}
.problems { display: block; background: var(--hhc-danger-bg); }
.problems h2 { margin: 0 0 var(--hhc-space-2); font-size: var(--hhc-step-1); }
.problems ul { margin: 0 0 var(--hhc-space-2); padding-left: var(--hhc-space-5); }

/* The week */
nav.top a { display: inline-flex; align-items: center; gap: var(--hhc-space-1); min-height: 44px; color: var(--hhc-text-soft); font-weight: 600; text-decoration: none; }
.week-nav { display: flex; justify-content: space-between; margin-bottom: var(--hhc-space-4); }
.state { font-weight: 650; color: var(--hhc-text-soft); }
.query { padding: var(--hhc-space-3) var(--hhc-space-4); border-radius: var(--hhc-radius); background: var(--hhc-info-bg); }
.entries { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--hhc-space-2); }
.entries li {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--hhc-space-1) var(--hhc-space-3);
    padding: var(--hhc-space-3) var(--hhc-space-4);
    background: var(--hhc-surface); border: 1px solid var(--hhc-border); border-radius: var(--hhc-radius);
}
.entries .day { order: 1; font-weight: 750; min-width: 4rem; }
.entries .times { order: 2; font-variant-numeric: tabular-nums; color: var(--hhc-text-soft); }
.entries .worked { order: 3; font-weight: 750; margin-left: auto; font-variant-numeric: tabular-nums; }
.entries .change { order: 4; min-height: 48px; }
.entries .job { order: 5; flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: var(--hhc-space-1) var(--hhc-space-3); color: var(--hhc-text-soft); font-size: var(--hhc-step--1); }
.entries .break { order: 6; color: var(--hhc-text-faint); font-size: var(--hhc-step--1); }
.entries .corrected { order: 7; flex-basis: 100%; color: var(--hhc-info); font-weight: 600; font-size: var(--hhc-step--1); }
.total { font-size: var(--hhc-step-2); margin-top: var(--hhc-space-4); }
.add { margin-top: var(--hhc-space-4); }

/* Changing or adding a time: one field per line, big enough for gloves. */
.times-form { display: grid; gap: var(--hhc-space-1); }
.times-form label { font-weight: 650; margin-top: var(--hhc-space-4); color: var(--hhc-text-soft); }
.times-form input, .times-form select {
    font: inherit; font-size: var(--hhc-step-1); min-height: 56px; padding: 0 var(--hhc-space-4);
    color: var(--hhc-text); background: var(--hhc-surface);
    border: 1px solid var(--hhc-border-strong); border-radius: var(--hhc-radius);
}
.times-form .btn { margin-top: var(--hhc-space-5); }
.danger { color: var(--hhc-danger); }

/* Asking to install the app */
.install { padding: var(--hhc-space-4) var(--hhc-space-5); margin: 0 0 var(--hhc-space-5); border-radius: var(--hhc-radius-lg); background: var(--hhc-surface); border: 1px solid var(--hhc-border); box-shadow: var(--hhc-shadow-1); }
.install h2 { margin: 0 0 var(--hhc-space-2); font-size: var(--hhc-step-1); }
.install ol { padding-left: var(--hhc-space-5); margin: var(--hhc-space-2) 0; }
.install .btn-xl { min-height: 60px; font-size: var(--hhc-step-1); }

/* The bar along the bottom: the app's menu, one row of four, icon over words, big enough for gloves */
nav.bottom {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    padding: var(--hhc-space-3) var(--hhc-space-4) calc(var(--hhc-space-3) + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--hhc-surface) 92%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--hhc-border); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--hhc-space-2); max-width: 34rem; margin: 0 auto;
}
nav.bottom a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; padding: var(--hhc-space-1); border-radius: var(--hhc-radius); text-align: center; line-height: 1.2; font-weight: 700; color: var(--hhc-text); text-decoration: none; background: var(--hhc-surface-2); }
nav.bottom a.current { background: var(--hhc-brand); color: var(--hhc-on-brand); box-shadow: inset 0 -3px 0 var(--hhc-brass); }
nav.bottom a:focus-visible { outline: 3px solid var(--hhc-brass); outline-offset: 2px; }
/* A count on a tab (Requests: replies not read yet), on the icon's top right corner, so the words keep their width. */
nav.bottom a { position: relative; }
nav.bottom .tab-badge {
    position: absolute; top: 4px; left: calc(50% + 6px);
    min-width: 1.25rem; height: 1.25rem; padding: 0 .3rem; border-radius: 999px;
    display: inline-grid; place-items: center; font-size: .75rem; font-weight: 800; line-height: 1; letter-spacing: 0;
    background: var(--hhc-brass); color: var(--hhc-ink); box-shadow: 0 0 0 2px var(--hhc-surface);
}
/* A small phone (iPhone SE and smaller): tighter spacing and slightly smaller words, so "Requests" fits its button. */
@media (max-width: 26rem) {
    nav.bottom { padding-inline: var(--hhc-space-2); gap: var(--hhc-space-1); }
    nav.bottom a { padding-inline: 2px; font-size: 0.82rem; letter-spacing: -0.01em; }
}
@media (max-width: 21rem) { nav.bottom a { font-size: 0.74rem; } }

/* The links to the receipts and the statement: outlined buttons, full width, big enough for gloves. */
.more-links { margin: var(--hhc-space-5) 0; display: grid; gap: var(--hhc-space-3); }
.more-links .btn { justify-content: flex-start; gap: var(--hhc-space-2); text-align: left; }

/* My work: the tab's name, then the week's own heading under "Not approved yet". */
.my-work-title { margin-bottom: var(--hhc-space-1); }
.my-work-intro { margin-top: 0; }
.week-title { font-size: var(--hhc-step-2); }

/* Asking the office to unlock a week */
.unlock { margin: var(--hhc-space-5) 0; display: grid; gap: var(--hhc-space-3); }
.unlock textarea { width: 100%; min-height: 96px; font-size: var(--hhc-step-1); padding: var(--hhc-space-3); border-radius: var(--hhc-radius-md, 8px); border: 2px solid var(--hhc-border); }
.unlock .asked { font-weight: 700; }
.message.shared, .message.locked { color: var(--hhc-text); font-weight: 700; }

/* The statement: a plain table that prints cleanly */
.statement-for { font-weight: 700; }
.statement-pick .choices { display: flex; gap: var(--hhc-space-2); border: 0; padding: 0; margin: 0 0 var(--hhc-space-3); }
.statement-pick .choice { min-height: 48px; flex: 1; font-size: var(--hhc-step-1); }
.statement-table { width: 100%; border-collapse: collapse; margin: var(--hhc-space-4) 0; font-size: var(--hhc-step-1); }
.statement-table th, .statement-table td { text-align: left; padding: var(--hhc-space-2); border-bottom: 1px solid var(--hhc-border); }
.statement-table .num { text-align: right; white-space: nowrap; }
.statement-table tfoot th, .statement-table tfoot td { font-weight: 700; }
.statement-table .total th, .statement-table .total td { border-top: 2px solid var(--hhc-text); }
.statement-expenses { margin: var(--hhc-space-5) 0; }
.print { margin-bottom: 96px; }

@media print {
    .no-print, nav.bottom, .install { display: none !important; }
    body, .statement-table { background: #fff; color: #000; font-size: 11pt; }
    .statement-table th, .statement-table td { border-color: #000; }
    a { color: #000; text-decoration: none; }
}

/* The help page: the design system's help parts, a little tighter on a phone. */
.field-help { margin-top: var(--hhc-space-5); }
.field-help .hhc-help-section { padding: var(--hhc-space-4); }
.field-help .hhc-help-contents a { display: inline-flex; align-items: center; min-height: 44px; }
/* What is saved on the phone waiting to send: a count to open, then each thing in order (docs/adr/0002). */
.status .waiting {
    margin: 0 0 var(--hhc-space-4); padding: var(--hhc-space-2) var(--hhc-space-4);
    border-radius: var(--hhc-radius); background: var(--hhc-surface); border: 2px solid var(--hhc-warning);
}
.status .waiting summary { display: flex; align-items: center; min-height: 44px; font-weight: 650; cursor: pointer; }
.status .waiting ul { margin: 0 0 var(--hhc-space-2); padding-left: var(--hhc-space-5); }
.status .waiting p { display: block; padding: 0; margin: 0 0 var(--hhc-space-2); background: none; }
.entries .waiting { display: inline-block; font-size: 0.85rem; font-weight: 650; color: var(--hhc-text); background: var(--hhc-warning-bg); border-radius: var(--hhc-radius-pill); padding: 0 var(--hhc-space-2); }

/* Jobs first (docs/adr/0002): Home's list of jobs, each opening its own screen. */
a.job-card { text-decoration: none; }
.job-card.on-site { border: 2px solid var(--hhc-success); }
.job-card-live { display: inline-flex; align-items: center; gap: var(--hhc-space-2); padding: var(--hhc-space-2) var(--hhc-space-3); border-radius: var(--hhc-radius-pill); background: var(--hhc-success); color: #fff; font-weight: 750; font-size: var(--hhc-step--1); white-space: nowrap; }
.job-card-open { color: var(--hhc-text-soft); }
.not-listed { margin: var(--hhc-space-5) 0; color: var(--hhc-text-soft); font-weight: 600; text-align: center; }

/* Where they're on site, on every other screen: one slim line that taps back to the job. */
.on-site-line {
    display: flex; align-items: center; gap: var(--hhc-space-2); min-height: 48px; margin: 0 0 var(--hhc-space-4); padding: 0 var(--hhc-space-4);
    border-radius: var(--hhc-radius); background: var(--hhc-success-bg, var(--hhc-surface-2)); color: var(--hhc-text); font-weight: 650; text-decoration: none;
    border: 1px solid var(--hhc-success);
}
.on-site-line .hhc-icon { margin-left: auto; }

/* A job's screen: its name, Start or the "On site now" card, then everything else for the job. */
.job-head { margin-bottom: var(--hhc-space-4); }
.job-head h1 { margin-bottom: var(--hhc-space-2); }
.job-head .hhc-eyebrow:empty { display: none; }
.elsewhere { color: var(--hhc-text); }
.job-actions { list-style: none; margin: var(--hhc-space-5) 0 0; padding: 0; display: grid; gap: var(--hhc-space-3); }
a.job-row { min-height: 64px; text-decoration: none; }
a.job-row .hhc-icon { color: var(--hhc-division-text, var(--hhc-text)); flex: none; }
.cancel, .cancel-time { margin-top: var(--hhc-space-6); }
.cancel-time { display: grid; gap: var(--hhc-space-3); padding: var(--hhc-space-4); border-radius: var(--hhc-radius); background: var(--hhc-danger-bg); }
.cancel-time .message { color: var(--hhc-text); margin: 0; }
.finish-step { padding-top: var(--hhc-space-4); }
.finish-step .skip { margin-top: var(--hhc-space-3); }
.finish-step .tell { margin-top: var(--hhc-space-5); display: flex; align-items: center; justify-content: center; gap: var(--hhc-space-2); }

/* Splitting time across a job's stages: a row per stage, big + buttons, and what's left on General. */
.split { display: grid; gap: var(--hhc-space-3); margin: var(--hhc-space-4) 0; }
.split-left { margin: 0; padding: var(--hhc-space-3) var(--hhc-space-4); border-radius: var(--hhc-radius); background: var(--hhc-info-bg); font-size: var(--hhc-step-1); }
.split-stages { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--hhc-space-2); }
.split-stage { padding: var(--hhc-space-3) var(--hhc-space-4); border-radius: var(--hhc-radius); background: var(--hhc-surface); border: 1px solid var(--hhc-border); }
.split-stage.has-time { border: 2px solid var(--hhc-brand); }
.split-name { display: block; font-weight: 700; margin-bottom: var(--hhc-space-2); }
.split-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--hhc-space-2); }
.split-hours { width: 5rem; min-height: 48px; padding: 0 var(--hhc-space-3); font: inherit; font-size: var(--hhc-step-1); border: 1px solid var(--hhc-border-strong); border-radius: var(--hhc-radius); }
.split-unit { color: var(--hhc-text-soft); margin-right: auto; }
.split-less, .split-more { min-height: 48px; min-width: 56px; font-weight: 700; }
.split-box { border: 0; padding: 0; margin: var(--hhc-space-4) 0 0; }
.split-box legend { font-weight: 650; color: var(--hhc-text-soft); }
.entries .split-text { order: 8; flex-basis: 100%; color: var(--hhc-text-soft); font-size: var(--hhc-step--1); }

/* My work: the weeks not approved yet, at the top. */
.not-approved { margin: 0 0 var(--hhc-space-5); }
.not-approved h2 { font-size: var(--hhc-step-1); }
.not-approved ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--hhc-space-2); }
.week-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--hhc-space-1) var(--hhc-space-3); min-height: 56px; padding: var(--hhc-space-2) var(--hhc-space-4); border-radius: var(--hhc-radius); background: var(--hhc-warning-bg); color: var(--hhc-text); text-decoration: none; }
.week-row-when { font-weight: 750; }
.week-row-state { flex: 1; }
.add-note { margin-top: var(--hhc-space-4); }

@media print {
    .on-site-line, .not-approved { display: none !important; }
}

/* The + beside a week on My work: always tappable; when time can't go on the week, a box says why, with OK first. */
.week-head { display: flex; align-items: center; justify-content: space-between; gap: var(--hhc-space-3); }
.week-head .week-title { margin: 0; }
.add-time { flex: none; width: 56px; height: 56px; min-height: 56px; padding: 0; border-radius: 50%; }
.add-time-box { margin: var(--hhc-space-3) 0; padding: var(--hhc-space-4); background: var(--hhc-surface); border: 2px solid var(--hhc-border-strong); border-radius: var(--hhc-radius); box-shadow: var(--hhc-shadow-2); }
.add-time-box h3 { margin: 0 0 var(--hhc-space-2); }
.add-time-actions { display: flex; flex-wrap: wrap; gap: var(--hhc-space-3); margin-top: var(--hhc-space-3); }
.add-time-actions .ok { min-width: 8rem; }
.add-time-jobs { display: grid; gap: var(--hhc-space-2); margin: var(--hhc-space-3) 0; }
.job-choice { justify-content: space-between; text-align: left; }
.job-choice small { color: var(--hhc-text-soft); font-weight: 500; }
