:root {
    color-scheme: light;
    --ink: #192e2a;
    --muted: #536963;
    --brand: #135c51;
    --brand-deep: #0c473e;
    --line: #d7e3de;
    --paper: #fff;
    --wash: #f3f7f5;
    --selected: #deefe7;
    --focus: #278778;
    background: var(--paper);
    color: var(--ink);
    font: 15px/1.5 system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--brand); text-underline-offset: .21em; }
a:hover { color: var(--brand-deep); }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.7rem, 3vw, 2.45rem); letter-spacing: -.045em; line-height: 1.15; }
h2 { font-size: 1.125rem; letter-spacing: -.012em; }
small { font-size: .83rem; }
form { margin: 0; }
img { display: block; }
.muted { color: var(--muted); }
.container { width: min(100% - 3rem, 1120px); margin-inline: auto; }
.top { border-bottom: 1px solid var(--line); background: var(--wash); }
.top-inner { display: flex; min-height: 77px; align-items: center; justify-content: space-between; gap: 1rem; }
.top-controls, .active-client label { display: flex; align-items: center; gap: .55rem; }
.top-controls { justify-content: flex-end; flex-wrap: wrap; }
.active-client label { font-size: .88rem; }
.active-client select { max-width: min(45vw, 19rem); }
.settings-link { font-size: 1.25rem; line-height: 1; }
.settings-link[aria-current] { background: var(--selected); border-color: var(--brand); }
.logo { display: inline-flex; align-items: center; }
.logo img { object-fit: contain; }
.navigation { display: flex; flex-wrap: wrap; column-gap: .35rem; }
.navigation a { padding: .67rem .79rem; border-bottom: 3px solid transparent; text-decoration: none; color: var(--ink); white-space: nowrap; }
.navigation a[aria-current] { border-color: var(--brand); color: var(--brand); font-weight: 650; }
.navigation a:hover { background: var(--selected); }
.main { padding-block: 2rem 3.5rem; }
.page-heading, .section-heading, .toolbar, .filter, .actions, .period-controls {
    display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;
}
.page-heading, .section-heading { justify-content: space-between; }
.page-heading { margin-bottom: 1.3rem; }
.page-heading p { margin-top: .35rem; }
.section { margin-top: 1.65rem; }
.section-heading { margin-bottom: .65rem; }
.with-icon { display: flex; align-items: center; gap: .6rem; }
.with-icon img { width: 1.3em; height: 1.3em; }
.with-icon img, .overlap img { filter: invert(24%) sepia(43%) saturate(784%) hue-rotate(119deg); }

button, .button, input:not([type="checkbox"]), select, textarea {
    border: 1px solid var(--line); border-radius: .4rem; background: var(--paper); color: var(--ink);
}
button, .button { min-height: 2.4rem; padding: .42rem .76rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; text-decoration: none; font-weight: 570; }
button:hover, .button:hover { background: var(--selected); border-color: #b7d1c6; }
.primary { color: #fff; background: var(--brand); border-color: var(--brand); }
.primary:hover { color: #fff; background: var(--brand-deep); border-color: var(--brand-deep); }
.quiet { background: transparent; }
.logout { font-size: .88rem; }
.square { min-width: 2.4rem; }
input:not([type="checkbox"]), select, textarea { min-width: 0; padding: .45rem .58rem; min-height: 2.4rem; }
input[type="checkbox"] { accent-color: var(--brand); inline-size: 1rem; block-size: 1rem; margin: 0; }
textarea { resize: vertical; }
label { font-weight: 550; }
.check { display: inline-flex; align-items: center; gap: .55rem; }
.filter { gap: .6rem .8rem; }
.filter label { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.date-field { display: grid; gap: .25rem; }
.filter .date-field { display: flex; align-items: center; gap: .5rem; }
.date-controls { position: relative; display: flex; gap: .25rem; }
.date-controls input[type="text"] { width: 100%; }
.filter .date-controls input[type="text"] { width: 8rem; }
.date-controls input[type="date"] { position: absolute; inset-inline-end: 0; width: 1px; padding: 0; opacity: 0; pointer-events: none; }
.toolbar { margin-bottom: 1rem; }
.period-controls { gap: .34rem; }
.actions { gap: .55rem .8rem; }
.total { display: flex; align-items: center; gap: 1.1rem; border-radius: .55rem; padding: .55rem .9rem; margin: 1rem 0; background: var(--selected); color: var(--brand-deep); }
.total strong { color: var(--brand-deep); font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.day { border: 1px solid var(--line); margin-bottom: .5rem; border-radius: .55rem; overflow: hidden; }
.day > summary { display: flex; align-items: center; gap: .65rem; padding: .7rem .85rem; cursor: pointer; list-style: none; background: var(--wash); }
.day > summary::-webkit-details-marker { display: none; }
.day > summary:focus-visible { outline-offset: -3px; }
.day > summary:hover { background: var(--selected); }
.day > summary strong { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.day-name { font-weight: 650; }
.day-count { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.disclosure { width: .44rem; height: .44rem; flex: 0 0 .44rem; border: solid var(--brand); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); margin-right: .18rem; }
.day[open] .disclosure { transform: rotate(45deg); }
.day-actions { display: flex; flex-wrap: wrap; gap: .55rem 1rem; padding: .65rem .85rem; }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: .56rem .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th, .table-date th, tfoot { background: var(--wash); }
thead th { color: var(--muted); font-size: .84rem; font-weight: 650; }
.entries { min-width: 690px; }
.number { white-space: nowrap; font-variant-numeric: tabular-nums; }
.line-label { display: block; color: var(--muted); font-size: .85rem; }
.wrapped { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 9rem; }
.overlap { display: flex; align-items: center; flex-wrap: wrap; gap: .26rem .35rem; margin-top: .23rem; color: var(--brand); font-size: .75rem; }
.overlap img { width: 1rem; height: 1rem; }
.task-group { margin-top: 1.25rem; }
.task-group h2, .section > h2 { margin-bottom: .55rem; }
.task-id { font-variant-numeric: tabular-nums; font-weight: 680; margin-right: .23rem; }
.tag { display: inline-block; border-radius: 1rem; background: var(--wash); border: 1px solid var(--line); padding: .17rem .55rem; color: var(--ink); font-size: .82rem; }
.tag.selected { margin-left: .5rem; }
.selected { background: var(--selected); color: var(--brand-deep); }
.back { display: inline-block; margin-bottom: .8rem; }
.card { border: 1px solid var(--line); border-radius: .6rem; padding: 1rem; }
.form-wide { max-width: 730px; margin-top: 1rem; }
.form-grid { display: grid; gap: .85rem; }
.form-grid label:not(.check) { display: grid; gap: .25rem; }
.form-grid label:not(.check) > :is(input, select, textarea) { width: 100%; }
.form-grid .actions { margin-top: .45rem; }
.form-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.time-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-hint { color: var(--muted); margin-top: -.6rem; }
.form-context { display: flex; flex-direction: column; justify-content: center; }
.form-context span { color: var(--muted); }
.login { max-width: 390px; margin: 2rem auto; padding: 1.4rem; }
.login h1 { margin-bottom: 1.2rem; }
.login button { justify-self: start; }
.passkey-login { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.compact { margin-bottom: .65rem; }
dl { display: grid; grid-template-columns: minmax(7rem, 10.5rem) minmax(0, 1fr); gap: .55rem 1rem; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; }
.doc-link { display: block; overflow-wrap: anywhere; }
.task-children { list-style: none; padding: 0; margin: 0; }
.task-children li { display: flex; gap: .8rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.project-type { display: flex; flex-wrap: wrap; gap: .7rem; }
.empty { padding: .8rem 1rem; background: var(--wash); border-radius: .4rem; color: var(--muted); }
.empty.inset { border-radius: 0; background: var(--paper); padding-bottom: .2rem; }
.message { border-left: 3px solid var(--brand); background: var(--wash); padding: .6rem .8rem; margin-bottom: .85rem; }
.error { border-color: #9c2c26; background: #fff2ef; color: #741f19; }
.report-filters fieldset { border: 0; margin: .7rem 0 0; padding: 0; }
.report-filters legend { color: var(--muted); padding: 0 0 .3rem; }
.report-edit { min-width: 660px; margin-top: .65rem; }
.report-edit td:nth-child(4) input { min-width: 13rem; width: 100%; }
.minute-input { width: 6rem; }
.report-actions { margin-top: .85rem; }
.private-detail { color: var(--muted); font-size: .85rem; }
.private-detail summary { cursor: pointer; }
.shared-report .scroll { margin-top: .8rem; }
.shared-report table { min-width: 450px; }
.skip, .sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip:focus { width: auto; height: auto; clip-path: none; padding: .55rem; background: var(--paper); z-index: 1; }

.journal { --ink: #203931; --folio: #fffcf1; --folio-rule: #d7ddcb; --cover: #204e43; }
.journal-cover {
    padding: 1.05rem 1.3rem; border: 1px solid #163b32; border-radius: .55rem .55rem .22rem .22rem;
    background: repeating-linear-gradient(116deg, #fff0 0 3px, #ffffff08 3px 4px), linear-gradient(#285a4c, var(--cover));
    box-shadow: inset 0 0 0 3px #ffffff12, 0 3px 0 #163c33;
    color: #fffcf1;
}
.journal-cover h1 { font-family: Georgia, serif; font-weight: 500; letter-spacing: -.025em; }
.journal-cover p { color: #e0ead8; }
.journal-cover .journal-add { background: #f3edda; border-color: #f3edda; color: #193e33; }
.journal-cover .journal-add:hover { background: #fffaf0; }
.journal-day {
    border-color: var(--folio-rule); background: var(--folio);
    box-shadow: 0 2px 0 #747c601c;
}
.journal-day > summary { background: #f3efdf; }
.journal-day > summary:hover { background: #eae8d6; }
.journal-day[open] > summary { border-bottom: 1px solid var(--folio-rule); }
.journal .total { background: #eef0e5; border: 1px solid #e1e4d7; }
.journal-table { table-layout: fixed; min-width: 760px; }
.journal-table th { background: #f8f4e7; color: #496054; }
.journal-table th, .journal-table td { border-bottom: 1px solid var(--folio-rule); padding: .38rem .55rem; }
.journal-table th:nth-child(-n+2) { width: 7rem; }
.journal-table th:nth-child(3) { width: 7.5rem; }
.journal-table th:nth-child(4) { width: 3.8rem; }
.journal-table th:nth-child(6) { width: 8.5rem; }
.journal-table th:nth-child(7) { width: 7.6rem; }
.journal-table th:first-child, .journal-table td:first-child { border-left: 3px solid #ad655977; }
.journal-table td { font-variant-numeric: tabular-nums; }
.journal-table tr:focus-within { background: #fff9e8; }
.journal-table [data-line-field]:is(input, textarea) {
    width: 100%; padding: .2rem .28rem; min-height: 1.9rem; border: 1px solid transparent;
    border-radius: .24rem; background: transparent;
}
.journal-table [data-line-field]:is(input, textarea):hover { border-color: #d1d5bc; }
.journal-table [data-line-field]:is(input, textarea):focus { border-color: #6b8c75; background: #fff; outline-offset: 0; }
.journal-table .clock-input, .journal-table input[name="task_id"], .journal-type { font-family: 'Cascadia Mono', Consolas, monospace; }
.journal-table input[name="task_id"] { text-transform: uppercase; }
.journal-table textarea { field-sizing: content; min-block-size: 1.9rem; max-block-size: 5.5rem; display: block; resize: none; }
.journal-project { display: block; margin-left: .3rem; font-size: .73rem; color: var(--muted); }
.journal-task { display: flex; align-items: center; gap: .2rem; }
.journal-task-link { flex: 0 0 auto; padding: 0 .24rem; text-decoration: none; }
.journal-task-link:hover { text-decoration: underline; }
.journal-type { display: inline-block; padding: .27rem 0; color: #536959; }
.journal-context { margin-top: .13rem; font-size: .76rem; }
.journal-context summary { color: var(--brand); cursor: pointer; }
.journal-context label { display: block; margin-top: .2rem; }
.journal-context select { display: block; min-height: 1.8rem; padding: .16rem .22rem; width: 100%; background: #fffdf6; }
.journal-table td:nth-child(6), .journal-actions { padding-top: .62rem; }
.journal-actions { font-size: .8rem; overflow-wrap: anywhere; }
.journal-convert { display: block; }
.journal-actions [role="status"] { display: block; color: var(--muted); }
.journal-table [data-status="error"] [role="status"] { color: #962e25; }
.journal-table [data-status="saved"] [role="status"] { color: var(--brand); }
.journal-link { background: none; border: 0; min-height: 0; padding: 0; color: var(--brand); text-decoration: underline; text-underline-offset: .21em; }
.journal-link:hover { background: none; color: var(--brand-deep); }
.journal-day .day-actions { font-size: .88rem; }

@media (max-width: 650px) {
    .container { width: calc(100% - 1.5rem); }
    .main { padding-top: 1.25rem; }
    .top-inner { min-height: 64px; }
    .top-controls { padding-block: .45rem; }
    .active-client label > span { position: absolute; clip-path: inset(50%); }
    .navigation { gap: 0; }
    .navigation a { padding: .48rem .52rem; font-size: .89rem; }
    .form-columns { grid-template-columns: 1fr; }
    .time-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .time-fields > .date-field { grid-column: 1 / -1; }
    .day-count { display: none; }
}
