:root {
  color-scheme: light;
  --ground: #f7f7f4;
  --sidebar: #f0f0eb;
  --surface: #ffffff;
  --ink: #232520;
  --muted: #64665f;
  --rule: #e8e8e1;
  --control: #d8dad2;
  --accent: #94631c;
  --accent-ink: #67430b;
  --accent-soft: #fbf0d9;
  --accent-line: #ebdab4;
  --neutral: #f1f1ed;
  --error: #a02a21;
  --radius: 8px;
  --panel-radius: 12px;
  font: 14px/1.45 "Inter", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--ground);
  font-variant-numeric: tabular-nums;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .52; }
button, input, select, textarea { border-radius: var(--radius); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: 32px; line-height: 1.15; letter-spacing: -.035em; font-weight: 720; }
h2 { font-size: 18px; line-height: 1.3; letter-spacing: -.018em; font-weight: 650; }
svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.workspace { min-height: 100dvh; display: grid; grid-template-columns: 214px minmax(0, 1fr); }
.sidebar { padding: 31px 16px 16px; background: var(--sidebar); border-right: 1px solid var(--rule); display: flex; flex-direction: column; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; }
.brand svg { width: 31px; height: 31px; color: var(--accent); }
.brand strong { display: block; font-weight: 720; font-size: 21px; letter-spacing: -.04em; line-height: 1.16; }
.brand span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.navigation { margin-top: 42px; display: grid; gap: 5px; }
.navigation button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 11px; min-height: 39px; border: 0; background: transparent; text-align: left; color: var(--muted); }
.navigation button:hover, .account:hover { background: #e7e7df; }
.navigation button[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }
.navigation svg { width: 17px; height: 17px; }
.sidebar-bottom { margin-top: auto; padding-top: 26px; }
.site-time { padding: 13px 9px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.site-time svg { width: 15px; height: 15px; }
.account { display: flex; align-items: center; width: 100%; padding: 11px 8px; gap: 9px; text-align: left; border: 1px solid var(--rule); background: var(--surface); }
.avatar { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--avatar-bg, #ebece6); color: var(--avatar-ink, #4a4e43); font-size: 11px; font-weight: 700; }
.account-avatar { background: var(--accent-soft); color: var(--accent-ink); }
.account-text { flex: 1; min-width: 0; }
.account-text strong, .account-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-text strong { font-size: 12px; }
.account-text small { color: var(--muted); font-size: 11px; }
.account-arrow { width: 13px; height: 13px; color: var(--muted); }

.canvas { padding: 34px clamp(23px, 2.5vw, 42px) 36px; max-width: 1700px; width: 100%; margin: 0 auto; }
.demo-note { display: flex; align-items: center; gap: 8px; margin: 0 0 19px; color: var(--muted); font-size: 12px; }
.demo-note strong { color: var(--accent-ink); font-weight: 670; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #a36d20; flex: none; }
.page-header { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.page-header p { margin-top: 6px; color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 13px; min-height: 39px; border: 1px solid transparent; font-size: 13px; font-weight: 620; white-space: nowrap; }
.button.outline { border-color: var(--control); background: var(--surface); }
.button.outline:hover:not(:disabled) { background: var(--neutral); }
.button.primary { border-color: #2a2b25; background: #2a2b25; color: #fff; }
.button.primary:hover:not(:disabled) { background: #44443a; }
.button svg { width: 16px; height: 16px; }
.text-button { padding: 0; color: var(--accent-ink); background: none; border: 0; font-weight: 640; text-align: left; }
.text-button:hover { text-decoration: underline; }
.icon-button { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid transparent; background: transparent; color: var(--muted); }
.icon-button:hover { background: var(--neutral); border-color: var(--rule); color: var(--ink); }
.icon-button.pending { color: var(--accent-ink); background: var(--accent-soft); }
.icon-button.pending:hover { border-color: var(--accent-line); }

.work-grid { display: grid; grid-template-columns: minmax(0, 1fr) 298px; gap: 20px; align-items: start; }
.work-grid.without-entry { grid-template-columns: minmax(0, 1fr); }
.without-entry thead th:last-child, .without-entry .row-action { display: none; }
.journal, .entry-panel, .people-panel { border: 1px solid var(--rule); border-radius: var(--panel-radius); background: var(--surface); min-width: 0; }
.journal-heading { padding: 20px 20px 0; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.journal-heading p { margin-top: 5px; font-size: 12px; color: var(--muted); }
.period-button { min-height: 36px; padding: 7px 9px; font-size: 12px; }
.period-button .chevron { width: 12px; height: 12px; color: var(--muted); }
.journal-controls { margin-top: 17px; padding: 0 20px; display: flex; gap: 12px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--rule); }
.filter-tabs { display: flex; gap: 16px; }
.filter-tabs button { display: flex; align-items: center; gap: 5px; padding: 10px 0 11px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); font-size: 13px; white-space: nowrap; }
.filter-tabs button[aria-pressed="true"] { border-color: var(--accent); color: var(--ink); font-weight: 650; }
.filter-tabs button:hover { color: var(--ink); }
.filter-tabs svg { width: 14px; height: 14px; }
.search { display: flex; position: relative; align-items: center; flex: 0 1 195px; min-width: 0; margin: 3px 0; }
.search svg { position: absolute; top: 9px; left: 10px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search input { padding: 6px 9px 6px 31px; height: 33px; min-width: 0; font-size: 12px; background: var(--ground); }
.table-shell { padding: 0 20px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 8px 8px; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; font-weight: 520; padding-top: 13px; padding-bottom: 9px; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
tbody tr { border-top: 1px solid var(--rule); }
td { height: 65px; }
td.time-cell, .time-heading { text-align: right; }
.identity { display: flex; align-items: center; gap: 9px; }
.identity strong { font-weight: 650; display: block; }
.identity small, .time-cell small { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }
.time-cell strong { display: block; font-size: 15px; font-weight: 660; }
.missing { color: var(--muted); }
.shift-tag { display: inline-flex; gap: 5px; align-items: center; min-height: 23px; padding: 2px 7px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; white-space: nowrap; }
.shift-tag.night { background: var(--neutral); color: #41433b; }
.shift-tag svg { width: 13px; height: 13px; }
.author-cell { font-size: 12px; }
.author-cell small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.author-cell span, .author-cell small { overflow-wrap: anywhere; }
.journal-footer { min-height: 45px; padding: 10px 20px; display: flex; gap: 15px; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; border-top: 1px solid var(--rule); }
.empty { min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; text-align: center; padding: 24px 16px; }
.empty svg { width: 23px; height: 23px; color: var(--muted); }
.empty span { font-size: 12px; color: var(--muted); }
.mobile-entry, #close-mobile-entry { display: none; }

.entry-panel { padding: 18px; }
.entry-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; }
.entry-icon { color: var(--accent); display: inline-flex; }
.entry-icon svg { width: 20px; height: 20px; }
form { display: grid; gap: 14px; }
form label, legend { font-size: 12px; font-weight: 620; }
form label { display: grid; gap: 6px; }
fieldset { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
legend { padding: 0; margin-bottom: 6px; width: 100%; }
legend small { margin-left: 4px; font-size: 11px; font-weight: 400; color: var(--muted); }
input, select, textarea { width: 100%; min-width: 0; border: 1px solid var(--control); padding: 7px 9px; background: var(--surface); font-weight: 400; }
input, select { height: 38px; }
input[type="date"], input[type="time"] { padding: 6px 7px; font-size: 12px; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.shift-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; background: var(--neutral); padding: 4px; border-radius: var(--radius); }
.shift-choice label { position: relative; cursor: pointer; min-width: 0; }
.shift-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.shift-choice span { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 5px 3px; min-height: 32px; border: 1px solid transparent; border-radius: 5px; color: var(--muted); }
.shift-choice svg { width: 15px; height: 15px; }
.shift-choice input:disabled + span { opacity: .58; cursor: default; }
.shift-choice input:checked + span { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.shift-choice input:focus-visible + span { outline: 2px solid var(--accent); }
.time-fields { display: grid; gap: 12px; }
.date-time { display: grid; grid-template-columns: minmax(0, 1fr) minmax(84px, .78fr); gap: 7px; }
.save-entry { width: 100%; min-height: 42px; }
.entry-author { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--rule); display: flex; align-items: start; gap: 7px; color: var(--muted); font-size: 11px; }
.entry-author svg { width: 15px; height: 15px; }
.entry-author strong { font-weight: 630; color: var(--ink); }
.overnight { color: var(--accent-ink); display: flex; align-items: center; gap: 6px; font-size: 12px; }
.overnight svg { width: 14px; height: 14px; }
.form-error { color: var(--error); font-size: 12px; }
.add-from-entry { font-size: 12px; margin-top: -5px; }

.people-panel { max-width: 850px; }
.people-panel .journal-heading { padding-bottom: 15px; }
.people-list { list-style: none; margin: 0; padding: 0 20px; }
.people-list li { border-top: 1px solid var(--rule); padding: 7px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.people-list .identity { min-height: 32px; min-width: 0; }
.people-list .icon-button { width: 44px; height: 44px; flex: none; }
.people-list .icon-button:hover { color: var(--error); }
.people-list .identity strong { overflow-wrap: anywhere; }
.standalone { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--panel-radius); width: min(390px, 100%); padding: 25px; gap: 17px; }
.login-card .brand { padding: 0; }
.login-card h1 { font-size: 24px; }
dialog { border: 1px solid var(--rule); padding: 21px; border-radius: var(--panel-radius); width: min(445px, calc(100% - 28px)); max-height: calc(100dvh - 30px); color: var(--ink); background: var(--surface); box-shadow: 0 12px 40px #2223; }
dialog::backdrop { background: #24251f63; }
.dialog-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.dialog-heading .icon-button { margin: -6px -6px -6px 0; }
.dialog-copy, .edit-history { color: var(--muted); font-size: 12px; }
.edit-person { font-weight: 650; }
#edit-fields { display: grid; gap: 14px; }
.quick-periods { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-periods .button { min-height: 32px; padding: 5px 8px; font-size: 12px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
#account-options { margin-top: 15px; display: grid; gap: 8px; }
#account-options .button { justify-content: start; white-space: normal; text-align: left; }
#access-form { margin-top: 16px; }
.access-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.access-code { display: grid; gap: 8px; border-top: 1px solid var(--rule); padding-top: 12px; }
.access-code .button { justify-self: start; }
.toast { position: fixed; right: 18px; bottom: 18px; max-width: calc(100% - 36px); z-index: 1; border-radius: var(--radius); padding: 11px 16px; color: white; background: var(--ink); box-shadow: 0 6px 22px #2223; font-size: 13px; }

@media (min-width: 1101px) {
  .sidebar { position: sticky; top: 0; height: 100dvh; }
}
@media (max-width: 1240px) {
  .workspace { grid-template-columns: 178px minmax(0, 1fr); }
  .sidebar { padding-inline: 10px; }
  .work-grid { grid-template-columns: minmax(0, 1fr) 264px; gap: 14px; }
  .entry-panel { padding: 15px; }
  .journal-heading, .journal-controls, .table-shell, .journal-footer { padding-inline: 13px; }
  th, td { padding-inline: 5px; }
}
@media (min-width: 1101px) and (max-width: 1240px) {
  .account { gap: 6px; padding-inline: 6px; }
  .account .avatar { width: 27px; height: 27px; }
  .site-time { padding-inline: 5px; }
}
@media (max-width: 1100px) {
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidebar { flex-direction: row; align-items: center; gap: 16px; padding: 9px 18px; border: 0; border-bottom: 1px solid var(--rule); }
  .brand { padding: 0; }
  .navigation { display: flex; gap: 5px; margin-top: 0; }
  .navigation button { white-space: nowrap; }
  .sidebar-bottom { padding: 0; margin: 0 0 0 auto; display: flex; align-items: center; }
  .site-time { display: none; }
  .account { min-width: 148px; }
  .canvas { padding-top: 22px; }
}
@media (max-width: 850px) {
  .work-grid { grid-template-columns: minmax(0, 1fr); }
  .entry-panel { display: none; }
  .entry-panel.mobile-open { display: block; grid-row: 1; }
  .mobile-entry { display: inline-flex; position: sticky; bottom: 12px; margin: 14px 0 0; min-height: 44px; }
  .mobile-entry[aria-expanded="true"] { display: none; }
  #close-mobile-entry { display: inline-grid; margin: -5px -3px -5px auto; }
}
@media (max-width: 600px) {
  .sidebar { display: grid; grid-template-columns: 1fr auto; gap: 9px; padding: 9px 14px 0; }
  .brand svg { width: 25px; height: 25px; }
  .brand strong { font-size: 18px; }
  .brand span { font-size: 11px; margin-top: 2px; }
  .navigation { grid-row: 2; grid-column: 1 / -1; }
  .navigation button { width: auto; min-height: 39px; border-radius: 7px 7px 0 0; padding-inline: 9px; font-size: 12px; gap: 6px; }
  .navigation svg { width: 15px; height: 15px; }
  .sidebar-bottom { grid-column: 2; grid-row: 1; }
  .account { min-width: 0; padding: 4px; border: 0; background: transparent; }
  .account-text { display: none; }
  .canvas { padding: 16px 12px 22px; }
  .demo-note { gap: 6px; margin-bottom: 14px; font-size: 11px; }
  .page-header { align-items: start; margin-bottom: 17px; gap: 10px; }
  h1 { font-size: 25px; }
  h2 { font-size: 16px; }
  .page-header p { font-size: 12px; }
  .page-header .button { min-height: 37px; font-size: 11px; padding: 6px 8px; gap: 4px; }
  .page-header .button svg { width: 13px; height: 13px; }
  .journal-heading { padding-top: 15px; gap: 7px; align-items: start; flex-wrap: wrap; }
  .period-button { min-height: 33px; gap: 5px; padding: 6px 7px; font-size: 11px; }
  .journal-controls { align-items: stretch; flex-direction: column-reverse; gap: 3px; margin-top: 12px; }
  .search { flex: initial; }
  .filter-tabs button { min-height: 42px; }
  table, tbody { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 39px; gap: 6px 12px; padding: 10px 0; }
  tbody tr:first-child { border-top: 0; }
  td { display: block; height: auto; padding: 0; min-width: 0; }
  td.person-cell { grid-column: 1 / 3; grid-row: 1; }
  td.type-cell { grid-column: 1; grid-row: 3; }
  td.time-cell { grid-row: 2; text-align: left; }
  .without-entry tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .without-entry td.author-cell { grid-column: 2; }
  td.time-cell::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); }
  td.author-cell { grid-column: 2 / 4; grid-row: 3; }
  td.row-action { grid-column: 3; grid-row: 1 / 3; text-align: right; }
  td.row-action .icon-button { width: 40px; height: 40px; }
  .identity small { display: inline; margin: 0 0 0 3px; }
  .identity strong { display: inline; }
  .people-panel .journal-heading .search { width: 100%; }
  input, select, textarea, input[type="date"], input[type="time"], .search input { font-size: 16px; }
}
