:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #192824;
  background: #f0f4f2;
  font-synthesis: none;
  font-variant-numeric: tabular-nums;
  --muted: #52665e;
  --line: #dbe5df;
  --pine: #173e33;
  --green: #286d54;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
h1, h2, p, dl, dd { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #408768; outline-offset: 3px; }
[hidden] { display: none !important; }

.shell { width: min(100% - 3rem, 66rem); margin-inline: auto; }
.site-header { background: #fbfdfb; border-bottom: 1px solid var(--line); }
.header-inner, .header-actions, .app-name, .day-line, .section-heading {
  display: flex;
  align-items: center;
}
.header-inner { min-height: 4.8rem; justify-content: space-between; gap: .7rem; }
.app-name { gap: .65rem; font-size: 1.16rem; white-space: nowrap; }
.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  color: #e7faed;
  background: var(--pine);
  border-radius: .72rem;
}
.brand-mark::before {
  content: "";
  width: 53%;
  aspect-ratio: 1;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.brand-mark::after {
  content: "";
  position: absolute;
  left: calc(50% - 1px);
  top: 32%;
  width: 14%;
  height: 20%;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  border-radius: 0 0 0 1.5px;
}
.header-actions { gap: .45rem; }
.button {
  min-height: 2.65rem;
  padding: .46rem .82rem;
  border: 1px solid transparent;
  border-radius: .65rem;
  white-space: nowrap;
  color: inherit;
  font-size: .88rem;
  font-weight: 600;
  background: transparent;
}
.button-quiet { color: var(--muted); }
.button-quiet:hover, .button-quiet[aria-pressed="true"] { background: #e9f1ec; color: #24563f; }
.button-outline { border-color: #ccdcd3; background: #fff; }
.button-outline:hover { background: #edf5f0; }
.button-primary { background: var(--pine); color: #fff; padding-inline: 1.25rem; }
.button-primary:hover { background: #225342; }

.dashboard { padding-block: 2.25rem 2.5rem; }
.tool-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: .9rem 1.45rem;
  margin-bottom: 1.35rem;
}
.tool-intro h2 { font-size: clamp(1.55rem, 4.7vw, 2.25rem); letter-spacing: -.035em; line-height: 1.15; }
.tool-intro p { max-width: 38rem; margin-top: .35rem; color: var(--muted); line-height: 1.5; }
.setup-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem .8rem; flex-shrink: 0; }
.sample-label { color: var(--muted); font-size: .875rem; font-weight: 600; }
.day-line { justify-content: space-between; flex-wrap: wrap; gap: .45rem .75rem; margin-bottom: .85rem; color: var(--muted); font-size: .875rem; }
.shift-summary { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; }
#nowDate { text-align: right; }
.day-status {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  padding: .37rem .68rem;
  border-radius: 2rem;
  color: #4c5d54;
  background: #e3ebe6;
  font-weight: 650;
  white-space: nowrap;
}
.day-status::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.day-status[data-state="working"] { color: #225c43; background: #d8eddf; }
.day-status[data-state="break"] { color: #715217; background: #f6ecd0; }
.day-status[data-state="after"] { color: #345a70; background: #e0eaf0; }
.shift-countdown {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .15rem .45rem;
  min-width: 0;
  padding: .32rem .63rem;
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: #fbfdfb;
}
.shift-countdown strong { color: var(--pine); font-weight: 700; white-space: nowrap; }

.hero {
  padding: 2.25rem 2.35rem 1.45rem;
  border-radius: 1.35rem;
  color: #f1faf4;
  background: radial-gradient(ellipse at 88% -35%, #316e55, transparent 69%), var(--pine);
  overflow: hidden;
}
.hero h2 { color: #c4dfce; font-size: .96rem; font-weight: 600; }
.earned-value {
  margin-block: .35rem .55rem;
  color: #fff;
  font-size: clamp(2.25rem, 7.3vw, 5.5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.055em;
  overflow-wrap: anywhere;
}
.rate { display: flex; flex-wrap: wrap; gap: .35rem .55rem; align-items: baseline; font-size: .875rem; color: #c4dfce; }
.rate span:last-child { color: #f0faf3; font-weight: 600; }
.encouragement {
  margin-top: 1.65rem;
  padding-top: .92rem;
  border-top: 1px solid #ffffff29;
  display: flex;
  align-items: baseline;
  gap: .65rem;
  min-width: 0;
  color: #d9efe0;
  font-size: .9rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.spark { color: #c1ebaa; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 1rem; }
.workday { margin-block: 1rem; padding: 1.1rem 1.3rem 1rem; }
.section-heading { justify-content: space-between; gap: .5rem; }
.section-heading h2, .stat > dt { font-size: .96rem; font-weight: 650; }
.progress-value { color: var(--green); font-size: 1.1rem; }
progress {
  display: block;
  width: 100%;
  height: .68rem;
  margin: .68rem 0 .48rem;
  appearance: none;
  border: 0;
  border-radius: 1rem;
  overflow: hidden;
  background: #e9f0eb;
}
progress::-webkit-progress-bar { background: #e9f0eb; }
progress::-webkit-progress-value { background: #398663; border-radius: 1rem; }
progress::-moz-progress-bar { background: #398663; border-radius: 1rem; }
.secondary-text, .dashboard-note, .field-hint { font-size: .84rem; line-height: 1.5; color: var(--muted); }
.stats { display: grid; align-items: start; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.stat { padding: .96rem 1.2rem; }
.stat > dd:first-of-type { font-size: clamp(1.28rem, 3.6vw, 1.8rem); font-weight: 700; margin-block: .28rem .16rem; overflow-wrap: anywhere; }
.month-details { margin-top: .55rem; }
.month-details summary { width: fit-content; cursor: pointer; color: var(--green); font-weight: 650; }
.month-breakdown { margin-block: .5rem; color: #192824; }
.month-breakdown > div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .15rem .6rem; }
.month-breakdown dd { font-weight: 650; overflow-wrap: anywhere; }
.dashboard-note { margin-top: 1rem; }
.not-found { max-width: 36rem; padding: clamp(1.25rem, 5vw, 2.25rem); }
.not-found p { margin-block: .45rem 1.1rem; color: var(--muted); line-height: 1.5; }
.not-found .button { display: inline-flex; align-items: center; text-decoration: none; white-space: normal; }

.counter-guide { margin-block: 1rem; padding: clamp(1rem, 4vw, 1.5rem); line-height: 1.6; }
.counter-guide h2 { font-size: clamp(1.25rem, 3vw, 1.5rem); line-height: 1.3; }
.counter-guide h3 { margin: 1rem 0 .35rem; font-size: 1rem; }
.counter-guide ol { margin: .65rem 0 0; padding-inline-start: 1.35rem; }
.counter-guide li + li, .counter-guide p + p { margin-top: .4rem; }
.counter-guide p { max-width: 74ch; color: var(--muted); }
.shift-example { margin-top: 1rem; padding: .85rem 1rem; border-radius: .65rem; background: #edf5ef; }
.shift-example h3 { margin-top: 0; }
.counter-guide details { padding-block: .65rem; border-bottom: 1px solid var(--line); }
.counter-guide details:last-child { border-bottom: 0; padding-bottom: 0; }
.counter-guide summary { font-weight: 650; cursor: pointer; }
.counter-guide details p { margin: .4rem 0 .15rem; }

.settings-dialog {
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 1rem;
  width: min(100% - 1.6rem, 34rem);
  max-height: calc(100% - 1.6rem);
  padding: 1.25rem 1.35rem;
  background: #fff;
  overscroll-behavior: contain;
}
.settings-dialog::backdrop { background: #10292086; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.dialog-heading h2 { font-size: 1.2rem; }
.close-button { font-size: 1.45rem; line-height: 1; min-width: 2.65rem; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .77rem; }
.full { grid-column: 1 / -1; }
.field { display: grid; gap: .3rem; min-width: 0; }
.field label, .days-field legend { font-size: .88rem; font-weight: 650; }
.fields:has(#workdaysField[hidden]) #salaryField { grid-column: 1 / -1; }
.field input, .field select {
  width: 100%;
  min-width: 0;
  min-height: 2.65rem;
  padding: .38rem .56rem;
  border: 1px solid #c7d8ce;
  border-radius: .55rem;
  background: #fcfefc;
  color: inherit;
}
.field select {
  appearance: none;
  padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 1.1rem) 54%, calc(100% - .8rem) 54%;
  background-size: .3rem .3rem;
  background-repeat: no-repeat;
}
.field-hint { margin-top: -.32rem; }
.days-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.days-field legend { padding: 0; margin-bottom: .36rem; }
.weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .25rem; }
.weekdays label { position: relative; display: grid; cursor: pointer; }
.weekdays input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.weekdays span {
  display: grid;
  place-items: center;
  min-height: 2.35rem;
  border: 1px solid #d1dfd7;
  border-radius: .5rem;
  font-size: .86rem;
}
.weekdays input:checked + span { border-color: #a8ceba; background: #e3f2e9; color: #1e5a40; font-weight: 650; }
.weekdays input:focus-visible + span { outline: 3px solid #408768; outline-offset: 2px; }
.form-error { margin-top: .65rem; color: #972d2d; font-size: .88rem; }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: .9rem; }

@media (max-width: 45rem) {
  .tool-intro { align-items: start; flex-direction: column; }
  .shell { width: calc(100% - 1.7rem); }
  .header-inner { min-height: 4rem; }
  .dashboard { padding-top: 1.3rem; }
  .hero { padding: 1.45rem 1.15rem 1.05rem; }
  .stat { padding: .84rem; }
}
@media (max-width: 32rem) {
  .app-name { min-width: 0; font-size: 1rem; gap: .45rem; white-space: normal; }
  .brand-mark { flex: none; width: 1.75rem; height: 1.75rem; border-radius: .55rem; }
  .header-actions { flex: none; gap: .1rem; }
  .header-actions .button { padding-inline: .5rem; }
  .day-line { font-size: .8rem; gap: .35rem; }
  #nowDate { flex-basis: 100%; text-align: left; }
  .earned-value { font-size: clamp(2.25rem, 11vw, 4.1rem); }
  .encouragement { margin-top: .9rem; }
  .workday { padding-inline: .9rem; }
  .stats { grid-template-columns: 1fr; gap: .52rem; }
  .stat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); align-items: center; gap: .15rem .5rem; }
  .stat > dd:first-of-type { grid-column: 2; grid-row: 1 / span 2; margin: 0; text-align: right; }
  .month-details { grid-column: 1 / -1; }
}

@media (max-width: 22rem) {
  .header-inner { gap: .32rem; }
  .app-name { font-size: .9rem; gap: .32rem; }
  .header-actions .button { font-size: .76rem; padding-inline: .33rem; }
  .settings-dialog { padding-inline: .85rem; }
  .weekdays span { font-size: .75rem; }
}
