/* TimePro – compact, modern; dark navy by default (heritage of the original
   #222244 look), light when the system prefers it. */
:root {
  --bg: #1c1e38;
  --surface: #25284a;
  --surface-2: #2d3157;
  --line: #3a3e6b;
  --text: #e9eaf6;
  --muted: #9b9ec6;
  --accent: #9ea2ff;
  --accent-strong: #6f74f0;
  --on-accent: #ffffff;
  --run: #34c463;
  --run-bg: rgba(52, 196, 99, 0.13);
  --pause: #e8a93a;
  --pause-bg: rgba(232, 169, 58, 0.12);
  --danger: #f06464;
  --danger-bg: rgba(240, 100, 100, 0.13);
  --ok: #34c463;
  --warn: #f2c94c;
  --day-band: rgba(158, 162, 255, 0.09);
  --radius: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 4px 14px rgba(0, 0, 0, 0.18);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f4f9;
    --surface: #ffffff;
    --surface-2: #f6f7fc;
    --line: #e1e3ef;
    --text: #1d2040;
    --muted: #6d7196;
    --accent: #4c51d8;
    --accent-strong: #4c51d8;
    --run: #1f9d4b;
    --run-bg: rgba(31, 157, 75, 0.09);
    --pause: #b7790f;
    --pause-bg: rgba(232, 169, 58, 0.13);
    --danger: #d23c3c;
    --danger-bg: rgba(210, 60, 60, 0.08);
    --day-band: rgba(76, 81, 216, 0.06);
    --shadow: 0 1px 2px rgba(20, 22, 60, 0.06), 0 4px 14px rgba(20, 22, 60, 0.06);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: 600; }
.muted { color: var(--muted); }

/* ---------------------------------------------------------------- top bar */

.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 18px;
  height: 44px; padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 6px; color: var(--text); font-weight: 700; font-size: 14px; }
.brand:hover { text-decoration: none; }
.logo { color: var(--accent); font-size: 17px; line-height: 1; }
.bar nav { display: flex; gap: 2px; }
.bar nav a {
  padding: 5px 10px; border-radius: 6px; white-space: nowrap;
  color: var(--muted); font-weight: 500;
}
.bar nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.bar nav a.on { color: var(--text); background: var(--surface-2); }
.user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.who { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }

main { max-width: 960px; margin: 0 auto; padding: 14px 16px 32px; }

h1, h2 { margin: 0; font-weight: 600; }
h1 { font-size: 17px; }
h1.page { font-size: 17px; margin: 2px 0 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px 6px; }
p.sub { margin: 2px 0 10px; color: var(--muted); }

.toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toolbar > div:last-child { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  /* a table that is too wide scrolls instead of being cut off */
  overflow-x: auto;
}
.card.narrow { max-width: 340px; margin: 48px auto; padding: 20px; }
.card.narrow h1 { margin-bottom: 12px; }
.card.form { max-width: 560px; margin: 8px auto; padding: 16px 18px; overflow: visible; }

.empty { margin: 0; padding: 16px; text-align: center; color: var(--muted); }

/* ---------------------------------------------------------------- tables */

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 5px 8px; text-align: left; vertical-align: middle; }
th {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); white-space: nowrap;
}
table.list > thead th { background: var(--surface-2); border-bottom: 1px solid var(--line); }
table.list > tbody > tr > td { border-top: 1px solid var(--line); }
table.list > tbody > tr:first-child > td { border-top: none; }
table.list > tbody > tr:not(.detail):hover > td { background: var(--surface-2); }
table.list tfoot td { border-top: 1px solid var(--line); background: var(--surface-2); }

.num { text-align: right; white-space: nowrap; }
.tog { width: 26px; text-align: center; padding-right: 0; }
.act { text-align: right; white-space: nowrap; }
th.budget, td.budget { width: 130px; }
td.clip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

td.name { max-width: 0; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td.name a { color: var(--text); font-weight: 500; }
td.name .desc { color: var(--muted); margin-left: 8px; font-size: 12px; }

/* row states: running (green) and interrupted/active (amber) */
tr.running > td { background: var(--run-bg); }
tr.running > td:first-child { box-shadow: inset 3px 0 0 var(--run); }
tr.paused > td { background: var(--pause-bg); }
tr.paused > td:first-child { box-shadow: inset 3px 0 0 var(--pause); }
tr.remote > td { background: color-mix(in srgb, var(--accent) 9%, transparent); }
tr.remote > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tr.inactive td { color: var(--muted); }
tr.inactive td.name a { color: var(--muted); font-style: italic; }

.chev {
  display: inline-block; width: 18px; height: 18px; line-height: 18px; border-radius: 4px;
  color: var(--muted); text-align: center;
}
.chev:hover { background: var(--line); color: var(--text); text-decoration: none; }

/* expanded detail rows */
tr.detail > td { padding: 0 8px 8px 34px; background: var(--surface); }
table.sub { background: var(--surface-2); border-radius: 6px; overflow: hidden; font-size: 12px; }
table.sub th { padding: 4px 8px; border-bottom: 1px solid var(--line); }
table.sub td { padding: 3px 8px; border-top: 1px solid var(--line); }
table.sub tbody tr:first-child td { border-top: none; }
table.sub tr.open > td { background: var(--surface); }
table.sub tr.nested > td { padding: 0 8px 6px; border-top: none; background: var(--surface); }
table.inner { background: var(--bg); }
/* Time slices of one day form a group: every other day is tinted, and
   there is no line between slices of the same day. */
table.sub tr.day-b > td { background: var(--day-band); }
table.sub tr.same-day > td { border-top-color: transparent; }

/* ---------------------------------------------------------------- badges & chips */

.badge {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 16px; white-space: nowrap;
}
.badge:hover { text-decoration: none; filter: brightness(1.15); }
.badge.billed { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.badge.closed { color: var(--danger); background: var(--danger-bg); }
.badge.open { color: var(--pause); background: var(--pause-bg); }
.badge.off { color: var(--muted); background: var(--surface-2); font-weight: 500; }
.chip {
  display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 11px;
  color: var(--muted); background: var(--line); white-space: nowrap; cursor: default;
}
.chip.mini { padding: 0 3px; font-size: 10px; }
.icon { display: inline-block; padding: 0 5px; border-radius: 4px; color: var(--muted); }
.icon:hover { color: var(--text); background: var(--line); text-decoration: none; }

/* ---------------------------------------------------------------- buttons */

form.inline { display: inline; margin: 0; }
.act form.inline + form.inline, .act .icon + form.inline { margin-left: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 24px; padding: 0 10px;
  border: 1px solid transparent; border-radius: 6px;
  font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap;
  cursor: pointer; color: var(--text); background: var(--surface-2);
}
.btn:hover { text-decoration: none; filter: brightness(1.12); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.btn.primary { background: var(--accent-strong); color: var(--on-accent); }
.btn.secondary { background: var(--surface-2); border-color: var(--line); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn.ghost:hover { color: var(--text); }
.btn.start { background: var(--run-bg); color: var(--run); border-color: color-mix(in srgb, var(--run) 35%, transparent); }
.btn.stop { background: var(--danger); color: #fff; }
.btn.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn.danger:hover { background: var(--danger-bg); }
.btn.wide { width: 100%; height: 32px; margin-top: 14px; font-size: 13px; }
/* "oder" between password and Google login */
.or { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.or + .btn.wide { margin-top: 10px; }
.form .btn, .toolbar .btn { height: 28px; }
td.act .btn { height: 22px; padding: 0 8px; }
.btn.square { width: 22px; padding: 0; }

/* ---------------------------------------------------------------- status strip */

.status {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; margin-bottom: 10px;
  border-radius: var(--radius); border: 1px solid;
}
.status > span:nth-child(2) { flex: 1; }
.status.running { background: var(--run-bg); border-color: color-mix(in srgb, var(--run) 40%, transparent); }
.status.paused { background: var(--pause-bg); border-color: color-mix(in srgb, var(--pause) 40%, transparent); }
.status.remote {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.pulse {
  width: 9px; height: 9px; border-radius: 50%; background: var(--run); flex: none;
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--run) 60%, transparent); }
  100% { box-shadow: 0 0 0 7px transparent; }
}
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* ---------------------------------------------------------------- budget gauge */

.gauge { display: flex; align-items: center; gap: 6px; }
.gauge .track { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; min-width: 60px; }
.gauge .fill { height: 100%; border-radius: 3px; }
.gauge.ok .fill { background: var(--ok); }
.gauge.warn .fill { background: var(--warn); }
.gauge.over .fill { background: var(--danger); }
.gauge.over .track { background: var(--danger-bg); }
.gauge span { width: 34px; text-align: right; font-size: 11px; color: var(--muted); }
.gauge.over span { color: var(--danger); font-weight: 600; }

/* ---------------------------------------------------------------- forms */

label { color: var(--muted); font-size: 12px; font-weight: 500; }
input, select, textarea {
  font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 8px; min-height: 28px; width: 100%;
}
textarea { resize: vertical; }
.login label { display: block; margin: 10px 0 4px; }

.grid { display: grid; grid-template-columns: max-content 1fr; gap: 8px 12px; align-items: center; margin-top: 12px; }
.grid > label { text-align: right; }
.pair { display: flex; gap: 8px; align-items: center; }
.pair > label { flex: none; }
.pair > input, .pair > select { flex: 1; min-width: 0; }

.buttons { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.spacer { flex: 1; }

.alert {
  margin: 10px 0 0; padding: 7px 10px; border-radius: 6px;
  color: var(--danger); background: var(--danger-bg); font-weight: 500;
}

/* ---------------------------------------------------------------- bill */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; margin-bottom: 14px; }
.kpi {
  display: flex; flex-direction: column; gap: 1px;
  padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.kpi .k { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.kpi .v { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi .muted { font-size: 11px; }
.kpi.total { border-color: var(--accent-strong); }
.kpi.total .v { color: var(--accent); }

/* ---------------------------------------------------------------- small screens */

@media (max-width: 640px) {
  .bar { gap: 6px; padding: 0 8px; }
  .brandname, .who { display: none; }
  .bar nav a { padding: 5px 7px; }
  main { padding: 10px 8px 24px; }
  th.budget, td.budget { display: none; }
  th, td { padding: 6px 5px; }
  td.name .desc { display: none; }
  td.act { white-space: normal; width: 1%; }
  td.act form.inline { display: block; margin: 2px 0 !important; }
  td.act .btn { width: 100%; height: 26px; }
  td.act .btn.square { width: 26px; }
  td.clip { display: none; }
  table.sub:not(.inner):not(.assign) > * > tr > :nth-child(3) { display: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi.total { grid-column: span 2; }
  .grid { grid-template-columns: 1fr; }
  .grid > label { text-align: left; margin-bottom: -4px; }
  tr.detail > td { padding-left: 8px; }
}

/* ---------------------------------------------------------------- print (bills) */

@media print {
  :root {
    --bg: #fff; --surface: #fff; --surface-2: #f4f4f4; --line: #ccc;
    --text: #000; --muted: #555; --accent: #000; --accent-strong: #000; --shadow: none;
  }
  .bar, .noprint { display: none !important; }
  main { max-width: none; padding: 0; }
  .card, .kpi { break-inside: avoid; }
}
.nowrap { white-space: nowrap; }

/* unbilled time column: "h:mm" plus decimal hours */
td.open { color: var(--pause); }
td.open .dec { display: inline-block; min-width: 44px; margin-left: 6px; color: var(--muted); }

/* ---------------------------------------------------------------- contracts */

.card.form.wide { max-width: 760px; }
a.cname { color: var(--text); font-weight: 500; }
tr.inactive a.cname { color: var(--muted); font-style: italic; }
.tariff { line-height: 1.5; }
.tariff .when { white-space: nowrap; }
h2.formsub { padding: 16px 0 6px; }
table.tariffs th { padding: 4px 4px; }
table.tariffs td { padding: 3px 4px; }
table.tariffs input[type=time] { width: 110px; }
input.num { text-align: right; width: 100px; }
input.short { width: 90px; flex: none; }
input:disabled { opacity: .55; cursor: not-allowed; }
.tariff-tools { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 12px; }
.info {
  margin: 10px 0 0; padding: 7px 10px; border-radius: 6px; line-height: 1.45;
  color: var(--text); background: var(--pause-bg); border: 1px solid color-mix(in srgb, var(--pause) 35%, transparent);
}
@media (max-width: 640px) {
  .tariff { white-space: normal; }
  /* tariff rows as two lines: from / to / remove, then rate / description */
  table.tariffs thead { display: none; }
  table.tariffs, table.tariffs tbody { display: block; }
  table.tariffs tr {
    display: grid; grid-template-columns: 1fr 1fr auto; gap: 4px;
    grid-template-areas: "from to rm" "rate desc desc";
    padding: 6px 0; border-bottom: 1px solid var(--line);
  }
  table.tariffs td { padding: 0; }
  table.tariffs td:nth-child(1) { grid-area: from; }
  table.tariffs td:nth-child(2) { grid-area: to; }
  table.tariffs td:nth-child(3) { grid-area: rate; }
  table.tariffs td:nth-child(4) { grid-area: desc; }
  table.tariffs td:nth-child(5) { grid-area: rm; align-self: center; }
  table.tariffs input[type=time], table.tariffs input.num { width: 100%; }
  .tariff-tools { flex-wrap: wrap; }
}

/* ---------------------------------------------------------------- administration */

nav.subnav {
  display: flex; gap: 2px; margin: -4px 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line); overflow-x: auto;
}
nav.subnav a { padding: 4px 10px; border-radius: 6px; color: var(--muted); font-weight: 500; white-space: nowrap; }
nav.subnav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
nav.subnav a.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }

.checks { display: flex; flex-direction: column; gap: 6px; }
label.check { display: flex; align-items: baseline; gap: 6px; color: var(--text); font-size: 13px; cursor: pointer; }
label.check input { width: auto; min-height: 0; margin: 0; }
p.hint { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.info.spaced { margin: 0 0 12px; }
.info p { margin: 0; }
.info p + p { margin-top: 6px; }
.info form.inline { margin-left: 6px; }
.online {
  display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%;
  background: var(--run); vertical-align: middle;
}

/* user list: e-mail below the name; fewer columns on phones */
td.person { white-space: nowrap; }
td.person .email { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.grid > h2.formsub.span { grid-column: 1 / -1; padding: 10px 0 0; }
td.cname-cell { min-width: 150px; }
@media (max-width: 640px) {
  .hide-sm { display: none; }
  td.cname-cell { white-space: normal; word-break: break-word; }
  td.person .email { max-width: 190px; }
}

td.cname-cell .email { display: block; font-size: 12px; color: var(--muted); font-style: normal; }

/* ---------------------------------------------------------------- e-invoices */

input.cc { width: 52px; flex: none; text-transform: uppercase; text-align: center; }
.card > h2 { padding: 12px 12px 6px; }
p.more { margin: 0; padding: 8px 12px; font-size: 12px; border-top: 1px solid var(--line); }
p.hint.spaced { margin: -4px 0 12px; }
.warn-text { color: var(--pause); }
.success {
  margin: 10px 0 0; padding: 7px 10px; border-radius: 6px;
  color: var(--run); background: var(--run-bg); font-weight: 500;
}
.alert div + div { margin-top: 4px; }
table.preview { margin-top: 4px; }
table.preview tfoot td { border-top: 1px solid var(--line); }
table.preview tr.total td { border-top: 2px solid var(--text); }
.card.pad { padding: 14px 16px; }
.downloads { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.downloads .btn { height: 30px; }
table.facts { margin-top: 12px; width: auto; }
table.facts th { text-transform: none; letter-spacing: 0; font-size: 12px; padding: 4px 16px 4px 0; text-align: left; }
table.facts td { padding: 4px 0; }
a.icon + a.icon { margin-left: 2px; }
input.bic { width: 140px; flex: none; }
.card.form > h2.formsub { padding: 16px 0 6px; }

/* new project for several employees */
table.assign td { padding: 3px 8px; }
table.assign input.num { width: 120px; }
table.assign tfoot td { border-top: 1px solid var(--line); padding-top: 6px; }
.toolbar form.inline select { width: auto; min-height: 28px; }
table.assign tbody.candidates tr:first-child td { padding-top: 10px; border-top: 1px solid var(--line); }
table.assign td.c input[type=checkbox] { width: auto; min-height: 0; margin: 0; }
@media (max-width: 640px) {
  table.assign th, table.assign td { padding: 3px 4px; font-size: 12px; }
  table.assign th { letter-spacing: 0; }
  table.assign input.num { width: 76px; }
}
span.short { display: none; }
@media (max-width: 640px) {
  span.long { display: none; }
  span.short { display: inline; }
  .card.form { padding: 14px 10px; }
}
@media (max-width: 640px) {
  .bar .btn.ghost { padding: 0 8px; }
  .bar .btn span.short { display: inline-flex; }
  td.person, td.person .email { white-space: normal; }
  td.nowrap { white-space: normal; }
}
.c { text-align: center; }

/* ---------------------------------------------------------------- statistics */

.stats-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 12px 4px; }
.stats-head h2 { padding: 0; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); }
.stats-total strong { font-size: 15px; font-variant-numeric: tabular-nums; }
th.barcol, td.barcol { width: 40%; }
/* one series, one hue; thin bar from the baseline with a rounded data end */
.revbar { height: 8px; }
.revbar > div { height: 100%; background: var(--accent-strong); border-radius: 0 4px 4px 0; min-width: 2px; }
table.list tbody tr:hover .revbar > div { background: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 640px) {
  th.barcol, td.barcol { width: 30%; }
}

/* main menu scrolls sideways on narrow screens instead of overflowing */
.bar nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.bar nav::-webkit-scrollbar { display: none; }
.stats-head { flex-wrap: wrap; }
@media (max-width: 640px) {
  .bar nav { flex: 1; }
  .bar nav a { padding: 5px 6px; }
}
.stats-head h2 .sub-name { font-weight: 400; font-size: 12px; }
.toolbar h1.page .muted { font-weight: 400; font-size: 14px; }

/* wide tables: let roles and periods wrap */
td.roles { line-height: 1.9; }
td.period span { white-space: nowrap; }
@media (max-width: 640px) {
  td.cname-cell { min-width: 0; }
}
@media (max-width: 640px) {
  td.person > span:first-child, td.person > a:first-child { overflow-wrap: anywhere; }
}

/* performance index: bar from the baseline with a mark at the average (100) */
.idxbar { position: relative; height: 8px; }
.idxbar .fill { height: 100%; background: var(--accent-strong); border-radius: 0 4px 4px 0; min-width: 2px; }
.idxbar .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--muted); border-radius: 1px; }
table.list tbody tr:hover .idxbar .fill { background: var(--accent); }
.perf .delta { font-size: 11px; }
.perf td.barcol { min-width: 140px; }
@media (max-width: 640px) { .perf td.barcol { min-width: 90px; } }

/* small button inside table rows ("bis hier abrechnen") */
.btn.tiny { padding: 0 7px; font-size: 11px; line-height: 1.6; vertical-align: middle; }

/* language switch at the top right */
nav.lang { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
nav.lang a { padding: 3px 7px; font-size: 11px; font-weight: 600; color: var(--muted); line-height: 1.4; }
nav.lang a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
nav.lang a.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
@media (max-width: 640px) { nav.lang a { padding: 3px 5px; } }

/* phones: the bill's hours table and the project's employee table fit the screen */
.sm-only { display: none; }
@media (max-width: 640px) {
  .sm-only { display: block; font-size: 11px; }
  table.billsum td.num .muted { display: none; }
  table.billsum th, table.billsum td { padding-left: 6px; padding-right: 6px; }
  table.assign th, table.assign td { padding: 3px 3px; }
  table.assign input.num { width: 64px; padding-left: 4px; padding-right: 4px; }
  table.assign td:first-child { overflow-wrap: break-word; }
}
@media (max-width: 640px) {
  table.assign th { font-size: 10px; }
  table.assign input.num { width: 84px; min-width: 0; }
  table.billsum th, table.billsum td { padding-left: 4px; padding-right: 4px; }
  table.billsum td:first-child { overflow-wrap: anywhere; }
}
@media (max-width: 380px) {
  table.assign input.num { width: 64px; }
  table.assign td:first-child { overflow-wrap: anywhere; }
}

/* user menu at the top right: language and logout */
.usermenu { position: relative; }
.usermenu summary {
  display: flex; align-items: center; gap: 7px; cursor: pointer; list-style: none;
  padding: 3px 6px 3px 3px; border-radius: 16px; color: var(--muted); user-select: none;
}
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover, .usermenu[open] summary { color: var(--text); background: var(--surface-2); }
.usermenu summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.usermenu .avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 26px; height: 26px; border-radius: 50%; font-size: 11px; font-weight: 700; letter-spacing: .02em;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.usermenu .who { max-width: 22vw; }
.usermenu .caret { font-size: 10px; }
.usermenu .menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
  min-width: 220px; max-width: calc(100vw - 16px); padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
}
.menu-head { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-head strong, .menu-head .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-head .muted { font-size: 12px; }
.menu-label { padding: 6px 8px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border-radius: 6px;
  color: var(--text); background: none; border: 0; font: inherit; text-align: left; cursor: pointer;
}
.menu-item:hover { background: var(--surface-2); text-decoration: none; }
.menu-item.on { color: var(--accent); font-weight: 600; }
.menu-item .check { display: inline-flex; justify-content: center; width: 14px; flex: none; }
.menu-sep { height: 1px; background: var(--line); margin: 4px 0; }
.usermenu form { margin: 0; }
@media (max-width: 640px) {
  .usermenu .who, .usermenu .caret { display: none; }
  .usermenu summary { padding: 3px; }
}
