:root {
  color-scheme: light;
  --paper: #fcfaf6;
  --white: #fffefa;
  --ink: #17382e;
  --muted: #566760;
  --line: #e5e7de;
  --mint: #d8eee2;
  --mint-light: #eaf5ee;
  --peach: #f8e7d9;
  --gold: #f5edda;
  --danger: #9a392e;
  --radius: 1.35rem;
  --shadow: 0 5px 18px #17382e08;
  font-family: "Aptos", "Inter", system-ui, sans-serif;
  font-size: 100%;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0; min-width: 0 }
button, input { font: inherit }
button { color: inherit; cursor: pointer }
button:disabled { cursor: default; opacity: .42 }
button, input { -webkit-tap-highlight-color: transparent }
button:focus-visible, input:focus-visible { outline: 3px solid #4b856e; outline-offset: 3px }
h1, h2, p { margin: 0 }
h1, h2 { line-height: 1.1; letter-spacing: -.045em }
h1 { font-size: clamp(2rem, 7vw, 3.25rem); font-weight: 760 }
h2 { font-size: 1.32rem }
p { color: var(--muted) }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.site-header { border-bottom: 1px solid var(--line); background: var(--paper) }
.header-inner {
  max-width: 69rem;
  margin: auto;
  padding: .75rem max(1rem, env(safe-area-inset-right)) .75rem max(1rem, env(safe-area-inset-left));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  min-height: 4.2rem;
}
.brand { display: flex; align-items: center; gap: .6rem; font-size: 1.5rem; letter-spacing: -.085em; font-weight: 800 }
.brand-dot { color: #3d795f }
.brand-mark, .feature-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--mint);
  border-radius: .72rem;
}
.brand-mark { display: flex; justify-content: center; align-items: flex-end; padding-bottom: .57rem; gap: .14rem }
.brand-mark i { width: .22rem; height: .46rem; background: var(--ink); border-radius: 1rem }
.brand-mark i:nth-child(2) { height: .75rem; margin-bottom: .19rem }
.account { display: flex; align-items: center; gap: .3rem }
.role-tag { border-radius: 2rem; background: var(--mint-light); padding: .35rem .65rem; font-size: .8rem; font-weight: 680 }
.share-button {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 2.75rem; padding: 0 .65rem;
  border: 0; border-radius: .72rem; background: var(--mint-light); font-size: .88rem; font-weight: 720;
}
.share-button:hover { background: var(--mint) }

.page {
  max-width: 67rem;
  margin: auto;
  padding: 1.45rem max(1rem, env(safe-area-inset-right)) calc(6.75rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}
.page-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .85rem; margin-bottom: 1rem }
.page-heading p { margin-top: .35rem }
.period-controls {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;
  align-items: center;
  width: 100%;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: .85rem;
}
.period-label { font-weight: 690; font-size: .94rem; padding: 0 .25rem }
.icon-button {
  display: grid;
  place-items: center;
  flex: none;
  border: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: .72rem;
  background: transparent;
}
.icon-button:hover:not(:disabled) { background: var(--mint-light) }

.icon { position: relative; display: inline-block; flex: none; width: 1.2rem; height: 1.2rem; color: inherit }
.i-left::before, .i-right::before {
  content: ""; position: absolute; left: .44rem; top: .34rem; width: .45rem; height: .45rem;
  border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(135deg);
}
.i-right::before { left: .25rem; transform: rotate(-45deg) }
.i-plus::before, .i-plus::after, .i-close::before, .i-close::after {
  content: ""; position: absolute; left: .14rem; right: .14rem; top: calc(50% - 1px); height: 2px;
  border-radius: 1rem; background: currentColor;
}
.i-plus::after { transform: rotate(90deg) }
.i-close::before { transform: rotate(45deg) }
.i-close::after { transform: rotate(-45deg) }
.i-clock { border: 2px solid currentColor; border-radius: 50% }
.i-clock::before { content: ""; position: absolute; width: .29rem; height: .37rem; left: .43rem; top: .12rem; border: solid currentColor; border-width: 0 0 2px 2px }
.i-calendar { border: 2px solid currentColor; border-radius: .26rem }
.i-calendar::before { content: ""; position: absolute; left: 0; top: .23rem; right: 0; border-top: 2px solid currentColor }
.i-calendar::after { content: ""; position: absolute; left: .18rem; top: -.22rem; width: .53rem; height: .34rem; border: solid currentColor; border-width: 0 2px }
.i-chart { border: solid currentColor; border-width: 0 0 2px 2px; border-radius: .18rem }
.i-chart::before { content: ""; position: absolute; left: .18rem; bottom: .12rem; width: .14rem; height: .32rem; border-radius: .1rem; background: currentColor; box-shadow: .26rem -.15rem 0 currentColor, .52rem -.31rem 0 currentColor }
.i-settings { border: 2px solid currentColor; border-radius: 50%; transform: scale(.86); outline: 1px dashed currentColor; outline-offset: 2px }
.i-settings::after { content: ""; position: absolute; inset: .23rem; border: 1px solid currentColor; border-radius: 50% }
.i-edit::before { content: ""; position: absolute; left: .47rem; top: .04rem; width: .24rem; height: 1.07rem; border: 1.5px solid currentColor; border-radius: .12rem .12rem .13rem .13rem; transform: rotate(42deg) }
.i-logout::before { content: ""; position: absolute; top: .09rem; bottom: .09rem; left: .02rem; width: .62rem; border: solid currentColor; border-width: 2px 0 2px 2px; border-radius: .24rem 0 0 .24rem }
.i-logout::after { content: ""; position: absolute; right: .02rem; top: .39rem; width: .43rem; height: .43rem; border: solid currentColor; border-width: 2px 2px 0 0; transform: rotate(45deg) }
.i-share::before {
  content: ""; position: absolute; left: .14rem; right: .14rem; bottom: .04rem; height: .67rem;
  border: solid currentColor; border-width: 0 2px 2px; border-radius: 0 0 .22rem .22rem;
}
.i-share::after {
  content: ""; position: absolute; top: .1rem; left: .38rem; width: .44rem; height: .44rem;
  border: solid currentColor; border-width: 2px 0 0 2px; transform: rotate(45deg);
}
.i-share { background: linear-gradient(currentColor, currentColor) center .12rem / 2px .68rem no-repeat }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow) }
.week-overview { display: grid; gap: .85rem }
.today-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--mint);
  padding: 1.25rem;
  min-height: 12rem;
  display: flex;
  align-items: center;
}
.today-copy { position: relative; z-index: 1 }
.today-label { display: inline-flex; align-items: center; gap: .38rem; font-size: .88rem; font-weight: 730 }
.today-label > span, .today-indicator { width: .42rem; height: .42rem; border-radius: 50%; background: #39785d }
.today-card h2 { margin-top: .4rem; font-size: clamp(1.55rem, 6vw, 2.4rem) }
.today-card p { margin: .35rem 0 .8rem; color: #345349 }
.clock-art {
  position: absolute; z-index: -1; right: -1.4rem; bottom: -2.4rem; height: 10rem; width: 10rem;
  border: 1px solid #7eaa96; border-radius: 50%; opacity: .55; transform: rotate(-13deg);
  background: #bcdcca; box-shadow: 0 0 0 .85rem #d8eee2, 0 0 0 .93rem #a5c9b6;
}
.clock-art::before { content: ""; position: absolute; inset: .9rem; border-radius: 50%; border: 2px dashed #60917a }
.clock-art::after { content: ""; position: absolute; left: 50%; bottom: 50%; width: 2.4rem; height: 2.3rem; border: solid #48876a; border-width: 0 0 .25rem .25rem; border-radius: .18rem }
.clock-art span { position: absolute; left: calc(50% - .15rem); top: calc(50% - .15rem); width: .5rem; height: .5rem; border-radius: 50%; background: #48876a }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  border-radius: .8rem;
  border: 1px solid transparent;
  padding: .55rem .9rem;
  min-height: 2.85rem;
  font-weight: 710;
}
.primary { color: #fff; background: var(--ink) }
.primary:hover:not(:disabled) { background: #285543 }
.secondary { background: var(--mint-light); border-color: var(--line) }
.week-summary { padding: 1rem }
.week-summary h2 { margin-bottom: .75rem }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .38rem }
.metric {
  display: flex; flex-direction: column; gap: .18rem; min-width: 0;
  padding: .65rem .4rem;
  border-radius: .75rem;
  font-variant-numeric: tabular-nums;
}
.metric.real { background: var(--mint-light) }
.metric.planned { background: var(--gold) }
.metric.overtime { background: var(--peach) }
.metric span { font-size: .81rem; font-weight: 650 }
.metric strong { font-size: clamp(1rem, 4.05vw, 1.6rem); letter-spacing: -.065em; line-height: 1.18; white-space: nowrap }
.metric small { font-size: .75rem; color: #715044 }
.quiet { font-size: .88rem; line-height: 1.45; margin-top: .65rem }
.days-section { margin-top: 1.4rem }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-height: 2.4rem; margin-bottom: .35rem }
.day-list { overflow: hidden }
.day-row, .month-row {
  display: flex; align-items: center; gap: .55rem; width: 100%; min-height: 3.7rem;
  padding: .42rem .68rem;
  text-align: left; border: 0; background: transparent;
}
.day-row + .day-row, .month-row + .month-row { border-top: 1px solid var(--line) }
button.day-row:hover, .month-row:hover { background: var(--mint-light) }
button.day-row:focus-visible, .month-row:focus-visible { outline-offset: -3px }
.day-row.current-day { background: #f2f7ee }
.day-date { display: grid; place-content: center; text-align: center; flex: none; width: 2.5rem; min-height: 2.65rem; border-radius: .65rem; background: #f3f3eb; line-height: 1.1 }
.day-date span { font-size: .69rem; font-weight: 700; text-transform: uppercase; letter-spacing: .035em; color: var(--muted) }
.day-date strong { font-size: 1.07rem; margin-top: .12rem }
.current-day .day-date { background: var(--mint) }
.day-copy, .month-week { display: grid; flex: 1; gap: .15rem; min-width: 0 }
.day-copy strong { display: flex; align-items: center; gap: .4rem; font-size: .91rem }
.day-copy small, .month-week small { font-size: .78rem; color: var(--muted) }
.day-result { font-size: .82rem; font-weight: 650; text-align: right; color: var(--muted) }
.day-result.recorded { color: var(--ink); white-space: nowrap }
.day-result.pending { background: var(--gold); color: #684812; padding: .2rem .37rem; border-radius: 1rem; white-space: nowrap }
.day-row .i-right, .month-row .i-right { color: var(--muted); width: .8rem }
.month-row { min-height: 4rem; padding-inline: .9rem }
.month-hours { white-space: nowrap; font-variant-numeric: tabular-nums }
.text-button {
  border: 0; background: transparent; text-decoration: underline; text-underline-offset: .17em;
  min-height: 2.75rem; padding: .25rem .25rem; font-size: .88rem; font-weight: 680;
}

.site-nav {
  position: fixed; z-index: 2; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: center;
  border-top: 1px solid var(--line); background: var(--white);
  padding: .35rem .5rem calc(.4rem + env(safe-area-inset-bottom));
}
.site-nav button {
  width: 8.2rem; min-height: 3.2rem; display: grid; justify-items: center; align-content: center; gap: .3rem;
  border: 0; border-radius: .73rem; background: transparent; font-weight: 650; font-size: .83rem;
}
.site-nav button[aria-current] { background: var(--mint-light) }
@media (hover: hover) {
  .site-nav button:hover { background: var(--mint) }
}
.notice {
  position: fixed; z-index: 3; bottom: calc(4.75rem + env(safe-area-inset-bottom)); left: 50%;
  width: max-content; max-width: calc(100vw - 2rem); transform: translateX(-50%);
  background: var(--ink); color: white; padding: .65rem 1rem; border-radius: .75rem; box-shadow: var(--shadow);
}

.login, .error-card { max-width: 28rem; margin: 7vh auto 0; padding: clamp(1.1rem, 5vw, 2rem) }
.login h1, .error-card h1 { margin: .8rem 0 .4rem; font-size: clamp(1.85rem, 7vw, 2.6rem) }
.login form { display: grid; gap: .6rem; margin-top: 1.25rem }
.login form label, .settings-intro label { font-weight: 690 }
.login .button, .error-card .button { margin-top: .3rem }
.loading { padding: 2rem 0 }
input:not([type="checkbox"]) {
  box-sizing: border-box; width: 100%; min-width: 0; min-height: 2.85rem;
  border: 1px solid #bfcac2; border-radius: .65rem; padding: .42rem .48rem; background: var(--white); color: var(--ink);
}
input[type="time"], input[type="date"] { font-variant-numeric: tabular-nums }
input[type="checkbox"] { accent-color: var(--ink); width: 1.16rem; height: 1.16rem; margin: 0; flex: none }
.form-error { color: var(--danger); font-weight: 650; font-size: .9rem }
.settings-form { max-width: 42rem; padding: 1rem }
.settings-intro { margin-bottom: .65rem }
.settings-intro input { display: block; margin-top: .35rem; max-width: 15rem }
.setting-day { margin: 0; border: 0; border-top: 1px solid var(--line); padding: .18rem 0; min-width: 0 }
.setting-day [data-fields] { padding-bottom: .7rem }
.day-toggle { display: flex; align-items: center; gap: .55rem; min-height: 2.75rem; font-weight: 690; cursor: pointer }
.shift-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .42rem }
.shift-fields label { min-width: 0; display: grid; gap: .2rem; font-size: .88rem; font-weight: 650 }
.shift-fields input { font-size: 1rem }
.settings-footer { display: grid; gap: .55rem; margin-top: .65rem; border-top: 1px solid var(--line); padding-top: .75rem }

dialog {
  inset: auto 0 0;
  margin: 0 auto;
  width: 100%;
  max-width: 32rem;
  max-height: calc(100% - .7rem);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 1.35rem 1.35rem 0 0;
  padding: 1.15rem max(1rem, env(safe-area-inset-right)) calc(1rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: var(--white);
  color: var(--ink);
}
body:has(dialog[open]) { overflow: hidden }
dialog::backdrop { background: #102b23a6 }
dialog form { display: grid; gap: .7rem }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: .2rem }
.dialog-heading h2 { font-size: clamp(1.3rem, 6vw, 1.85rem) }
.dialog-heading p { font-size: .9rem; margin-top: .28rem }
.dialog-heading .icon-button { margin-top: -.35rem; margin-right: -.35rem }
#share-dialog[open] {
  display: grid;
  gap: .75rem;
  inset: 0;
  width: calc(100% - 2rem);
  max-width: 25rem;
  height: max-content;
  max-height: calc(100% - 2rem);
  margin: auto;
  padding: 1.15rem;
  border-radius: 1.15rem;
  box-shadow: 0 16px 48px #102b2333;
}
#share-dialog .dialog-heading { align-items: center; gap: .5rem }
#share-dialog h2 { font-size: 1.3rem }
#share-dialog .dialog-heading .icon-button { margin: -.35rem -.35rem -.35rem 0 }
.share-field { display: grid; gap: .28rem; min-width: 0; font-size: .9rem; font-weight: 650 }
.share-field input { font-weight: 400 }
.share-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .5rem }
.share-actions .button { font-size: .9rem }
#share-dialog .delete { justify-self: start }
.share-feedback:empty { display: none }
.share-feedback { color: var(--ink); font-weight: 650 }
.off-toggle { font-size: .92rem }
.pause-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem; margin-top: .55rem }
.pause-presets button {
  min-height: 2.75rem; border: 1px solid var(--line); border-radius: .6rem;
  background: var(--paper); padding: .25rem .15rem; font-size: .82rem; font-weight: 660;
}
.pause-presets button[aria-pressed="true"] { background: var(--mint); border-color: #86ab9b }
.live-total {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  background: var(--mint-light); padding: .7rem .85rem; border-radius: .7rem; font-weight: 650;
}
.live-total output { font-size: 1.42rem; letter-spacing: -.045em; white-space: nowrap }
.delete { color: var(--danger) }

@media (min-width: 34rem) {
  .period-controls { width: auto; min-width: 12.5rem }
  .metric { padding: .7rem .65rem }
  .metrics { gap: .5rem }
  .day-row { padding-inline: .9rem; gap: .75rem }
  .day-copy strong, .day-result { font-size: .95rem }
  dialog { inset: 0; height: max-content; margin: auto; border-radius: 1.35rem; padding: 1.35rem }
}
@media (min-width: 49rem) {
  .page { padding-top: 2.3rem }
  .page-heading { margin-bottom: 1.2rem }
  .week-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 1rem }
  .week-summary { padding: 1.2rem }
  .week-summary:only-child, .month-summary { max-width: 45rem }
  .today-card { padding: 1.45rem }
  .days-section { margin-top: 1.5rem }
  .day-row { min-height: 3.85rem }
  .settings-form { padding: 1.35rem }
}
