:root {
  /* TradeClock brand: hi-vis yellow on asphalt, concrete in light mode. */
  --hivis: #ffc21a; --hivis-deep: #f2a900; --asphalt: #15171b; --asphalt-2: #1d2026;
  --bg: #f4f3ef; --card: #fff; --text: #1d1f23; --muted: #6b6f78; --line: #e3e1db;
  --accent: var(--hivis); --accent-text: #111; --link: #8a5a00; --danger: #b42318;
  --ok-bg: #e7f6ec; --err-bg: #fdecea; --warn-bg: #fff3d1; --warn-text: #7a4b00;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171b; --card: #1d2026; --text: #eef0f3; --muted: #9aa1ad; --line: #2c3038;
    --link: #ffc21a; --danger: #f97066;
    --ok-bg: #12301d; --err-bg: #3a1714; --warn-bg: #3a2c0c; --warn-text: #ffd27a;
  }
}
* { box-sizing: border-box; }
:root { color-scheme: light dark; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
       background: var(--bg); color: var(--text); }
header { background: var(--card); border-bottom: 1px solid var(--line); }
header .inner, main { max-width: 960px; margin: 0 auto; padding: 0 16px; }
header .inner { display: flex; align-items: center; gap: 20px; height: 54px; overflow-x: auto; }
header .brand { font-weight: 700; white-space: nowrap; }
header nav { display: flex; gap: 4px; }
header nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; white-space: nowrap; }
header nav a.active, header nav a:hover { color: var(--text); background: var(--bg); }
main { padding-top: 20px; padding-bottom: 40px; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=password], select, textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg); color: var(--text); font: inherit;
}
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; }
button, .btn { display: inline-block; border: 0; border-radius: 7px; padding: 9px 16px; font: inherit;
  background: var(--accent); color: var(--accent-text); cursor: pointer; text-decoration: none; }
button.secondary, .btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.link { background: none; color: var(--danger); padding: 4px 6px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.notice { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.notice.ok { background: var(--ok-bg); } .notice.err { background: var(--err-bg); }
.notice.warn { background: var(--warn-bg); color: var(--warn-text); }
.muted { color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 700; }
tr.job td { font-weight: 600; background: var(--bg); }
tr.leftoff td { color: var(--muted); }
button:disabled { opacity: .5; cursor: not-allowed; }
dialog.modal { width: min(520px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--text); padding: 20px; }
dialog.modal::backdrop { background: rgba(0, 0, 0, .5); }
dialog.modal h3 { font-size: 15px; margin: 0 0 6px; }
dialog.modal p { margin: 0 0 10px; }
dialog.modal .choice { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 12px 0; }
dialog.modal .choice.danger { border-color: var(--danger); }
dialog.modal input[type=text] { margin: 4px 0 10px; }
button.danger-btn { background: var(--danger); color: #fff; }
form.inline { display: inline; }
td.over { background: var(--warn-bg); color: var(--warn-text); }
td.notes { white-space: normal; min-width: 160px; }
p.overtime { margin: 6px 0 0; text-align: right; font-weight: 600; color: var(--warn-text); }
.logo-preview { max-height: 50px; max-width: 220px; background: #fff; padding: 4px; border-radius: 4px; }
[hidden] { display: none !important; }
header .who { margin-left: auto; white-space: nowrap; font-size: 14px; }
header button { white-space: nowrap; }
.tag { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 10px; background: var(--bg);
       border: 1px solid var(--line); color: var(--muted); }
td.loc { font-size: 13px; }
td.loc a { color: var(--link); }
.warn { color: var(--warn-text); background: var(--warn-bg); padding: 1px 5px; border-radius: 4px; font-weight: 600; }
tr.job.timeoff td { font-style: italic; }
h2.person { margin: 18px 0 4px; }
code { font-size: 13px; }
.docs h3 { font-size: 14px; margin: 16px 0 6px; }
.docs p { margin: 0 0 10px; }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; margin: 0 0 8px;
      white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.5; }
.newkey { border-color: var(--accent); }
.keyrow input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 14px; }
td.photos { font-size: 12px; }
td.photos a { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; margin-right: 4px;
              color: var(--muted); text-decoration: none; vertical-align: top; }
td.photos img { width: 40px; height: 40px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line);
                background: var(--bg); display: block; }
dialog.photo-view { width: min(720px, calc(100vw - 32px)); }
dialog.photo-view img { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: 6px; }

/* License page */
table.kv th { text-align: left; font-weight: 500; padding-right: 24px; width: 1%; white-space: nowrap; }
.license-banner a { margin-left: 6px; }

/* Change log */
table.audit td.when { color: var(--muted); font-variant-numeric: tabular-nums; }
table.audit td.what { white-space: normal; min-width: 280px; }
.tag.src-app { background: var(--ok-bg); }
.tag.src-web { background: var(--warn-bg); color: var(--warn-text); }
.tag.edited { margin-left: 4px; font-size: 11px; }
table.audit .reason { font-style: italic; margin-top: 2px; }
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }

/* Live demo */
.demo-bar { background: var(--warn-bg); color: var(--warn-text); text-align: center; padding: 8px 16px; font-size: 14px; }
.demo-login { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.demo-login button { padding: 14px 10px; font-size: 16px; font-weight: 600; display: flex; flex-direction: column; gap: 2px; align-items: center; }
.demo-login small { font-weight: 400; font-size: 12px; opacity: .85; }
.demo-other { margin-top: 14px; }
.demo-other summary { cursor: pointer; color: var(--muted); margin-bottom: 10px; }
@media (max-width: 420px) { .demo-login { grid-template-columns: 1fr; } }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- brand */
@font-face { font-family: "Saira Stencil One"; src: url("/static/fonts/SairaStencilOne-Regular.ttf") format("truetype"); font-display: swap; }
a { color: var(--link); }
header { background: var(--asphalt); border-bottom: 0; color: #eef0f3; }
header .inner { height: 58px; }
header .brand { display: flex; align-items: center; gap: 8px; color: #eef0f3; text-decoration: none;
  font: 22px/1 "Saira Stencil One", "Arial Black", Impact, sans-serif; letter-spacing: .3px; }
header .brand svg { width: 30px; height: 30px; flex: none; }
header .brand b { color: var(--hivis); font-weight: inherit; }
header nav a { color: #aeb4be; }
header nav a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
header nav a.active { color: var(--hivis); background: rgba(255, 194, 26, .1); }
header .who { color: #aeb4be; }
header button.secondary { color: #eef0f3; border-color: #3a3f49; }
.tape { height: 8px; background: repeating-linear-gradient(-45deg, var(--hivis) 0 12px, #111 12px 24px); }
h1 { font: 28px/1.1 "Saira Stencil One", "Arial Black", Impact, sans-serif; letter-spacing: .3px; margin-bottom: 18px; }
button, .btn { font-weight: 600; transition: transform .1s ease, box-shadow .1s ease, filter .1s ease; }
button:not(.secondary):not(.link):not(.danger-btn), .btn:not(.secondary) { box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
button:not(.secondary):not(.link):not(.danger-btn):hover, .btn:not(.secondary):hover { filter: brightness(1.05); }
button:not(.link):active, .btn:active { transform: translateY(1px); box-shadow: none; }
button.secondary:hover, .btn.secondary:hover { border-color: var(--hivis-deep); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--hivis); outline-offset: 0; border-color: transparent; }
.card { border-radius: 12px; }
.demo-bar { background: repeating-linear-gradient(-45deg, var(--hivis) 0 14px, var(--hivis-deep) 14px 28px);
  color: #111; font-weight: 600; }
.demo-bar a { color: #111; }

/* sign-in page */
body.signin { min-height: 100vh;
  background: radial-gradient(900px 500px at 70% 0%, rgba(255, 194, 26, .08), transparent 60%),
    linear-gradient(rgba(120, 170, 255, .05) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(120, 170, 255, .05) 1px, transparent 1px) 0 0 / 32px 32px, var(--asphalt);
  color: #eef0f3; }
body.signin .card { background: var(--asphalt-2); border-color: #2c3038; color: #eef0f3; }
body.signin .muted, body.signin label, body.signin .demo-other summary { color: #9aa1ad; }
body.signin input { background: #121418; border-color: #2c3038; color: #eef0f3; }
body.signin button.secondary { color: #eef0f3; border-color: #3a3f49; }
.signin-brand { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; }
.signin-brand svg { width: 52px; height: 52px; }
.signin-brand span { font: 36px/1 "Saira Stencil One", "Arial Black", Impact, sans-serif; letter-spacing: .4px; }
.signin-brand b { color: var(--hivis); font-weight: inherit; }
header .inner { scrollbar-width: none; }
header .inner::-webkit-scrollbar { display: none; }

/* ---------------------------------------------------------------- browser clock (/clock/) */
body.clockpage { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
.clock-top { background: var(--asphalt); color: #eef0f3; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
.clock-top .brand { display: flex; align-items: center; gap: 8px; color: #eef0f3; text-decoration: none;
  font: 22px/1 "Saira Stencil One", "Arial Black", Impact, sans-serif; }
.clock-top .brand svg { width: 30px; height: 30px; }
.clock-top .brand b { color: var(--hivis); font-weight: inherit; }
.clock-menu { position: relative; }
.clock-menu summary { list-style: none; cursor: pointer; color: #c9ced6; font-size: 14px; padding: 6px 4px; }
.clock-menu summary::-webkit-details-marker { display: none; }
.clock-menu > div { position: absolute; right: 0; top: 34px; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px; min-width: 170px; z-index: 5; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.clock-menu a, .clock-menu .link-plain { display: block; width: 100%; text-align: left; padding: 10px 12px; color: var(--text);
  text-decoration: none; background: none; border-radius: 7px; font-weight: 500; box-shadow: none; }
.clock-menu a:hover, .clock-menu .link-plain:hover { background: var(--bg); filter: none; }
.clock-main { max-width: 520px; margin: 0 auto; padding: 16px; }
.clock-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 14px; }
.clock-card h2 { margin: 0 0 10px; font-size: 17px; }
.status { text-align: center; border-top: 6px solid var(--line); }
.status.is-in { border-top-color: var(--hivis); }
.status-label { font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; font-size: 13px; color: var(--muted); }
.status.is-in .status-label { color: var(--link); }
.elapsed { font: 700 56px/1.1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.elapsed.idle { font-size: 44px; color: var(--muted); }
.since, .jobline { color: var(--muted); }
.jobline { margin-top: 6px; font-weight: 600; color: var(--text); }
.clock-form label { margin-top: 12px; }
.clock-form label:first-child { margin-top: 0; }
.clock-form select, .clock-form input[type=text] { font-size: 17px; padding: 12px; }
.clock-form .check { margin-top: 14px; font-size: 16px; }
.clock-form .check input { width: 22px; height: 22px; }
.clock-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
button.big { width: 100%; margin-top: 16px; padding: 20px; font-size: 22px; font-weight: 800; border-radius: 14px; letter-spacing: .3px; }
button.big.in { background: var(--hivis); color: #111; box-shadow: 0 4px 0 #9a6b00; }
button.big.out { background: #d8433f; color: #fff; box-shadow: 0 4px 0 #8c1f1c; }
button.big:active { transform: translateY(3px); box-shadow: none; }
.fine { font-size: 13.5px; color: var(--muted); margin: 10px 0 0; }
.center { text-align: center; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.today-row { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--line); font-size: 16px; }
.today-row small { color: var(--muted); }
input[type=checkbox], input[type=radio] { accent-color: var(--hivis-deep); }

/* browser clock camera */
body.camera-open { overflow: hidden; }
.camera { position: fixed; inset: 0; z-index: 50; background: #000; color: #fff; display: flex; flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom)); }
.camera[hidden] { display: none; }
.camera-title { text-align: center; font-weight: 700; letter-spacing: .5px; margin-bottom: 12px; }
.camera-frame { flex: 1; position: relative; display: grid; place-items: center; min-height: 0; }
.camera-frame video, .camera-frame img { max-width: 100%; max-height: 100%; border-radius: 16px; object-fit: contain;
  transform: scaleX(-1); /* like a mirror; the photo itself isn't flipped */ }
.camera-frame video[hidden], .camera-frame img[hidden] { display: none; }
.camera-msg { max-width: 340px; text-align: center; color: #eef0f3; background: #1d2026; border-radius: 14px; padding: 18px;
  line-height: 1.5; }
.camera-msg[hidden] { display: none; }
.camera-buttons { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; }
.camera-buttons[hidden] { display: none; }
.cam-secondary { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .35); padding: 12px 18px;
  border-radius: 12px; font-size: 16px; box-shadow: none; min-width: 96px; }
.cam-shutter { width: 74px; height: 74px; border-radius: 50%; background: #fff; border: 5px solid var(--hivis);
  box-shadow: 0 0 0 3px #000 inset; padding: 0; }
.cam-shutter:disabled { opacity: .3; }
.cam-spacer { min-width: 96px; }
.cam-use { flex: 1; background: var(--hivis); color: #111; font-weight: 800; font-size: 18px; padding: 14px; border-radius: 12px; }
