:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #192928;
  background: #f3f3ed;
  --paper: #fff;
  --line: #dce1d8;
  --ink: #172627;
  --muted: #516360;
  --accent: #dffa75;
  --radius: 17px;
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button, .primary, .quiet, .danger, .link { min-height: 44px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #38746a;
  outline-offset: 3px;
}
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.15rem, 5.5vw, 4rem); line-height: 1; letter-spacing: -.055em; }
h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); letter-spacing: -.035em; }
h3 { font-size: 1.12rem; line-height: 1.25; }
.top { background: var(--ink); color: white; }
.top-inner { display: flex; justify-content: space-between; align-items: center; gap: .75rem; max-width: 1160px; padding: .75rem clamp(.8rem, 4vw, 2.2rem); margin: auto; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; text-decoration: none; letter-spacing: -.035em; }
.brand img { width: 34px; height: 34px; }
.brand-accent { color: var(--accent); }
.top-actions, .hero-actions, .form-actions, .file { display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; }
.top-actions { justify-content: flex-end; }
.sync { border: 0; border-radius: 20px; padding: .4rem .8rem; color: white; background: #304845; font-size: .8rem; }
.sync::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ffdb91; margin-right: .4rem; }
.sync[data-status=good]::before { background: var(--accent); }
.sync[data-status=warn]::before { background: #ff9278; }
.shell { max-width: 1160px; padding: clamp(1rem, 4vw, 2.5rem) clamp(.8rem, 4vw, 2.2rem) 3.5rem; margin: auto; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 1.4rem; border-radius: 23px; padding: clamp(1.2rem, 5vw, 3rem); background: var(--ink); color: #fff; }
.hero h1 { margin: .5rem 0 .85rem; }
.hero p:not(.eyebrow) { max-width: 52ch; color: #c5d5d0; }
.hero .primary { margin-top: 1.35rem; background: var(--accent); color: var(--ink); }
.hero-count { display: grid; gap: .45rem; min-width: min(13rem, 35%); color: var(--ink); background: var(--accent); border-radius: var(--radius); padding: 1rem 1.2rem; line-height: 1.1; }
.hero-count strong { font-size: clamp(2.1rem, 7vw, 4rem); font-weight: 800; }
.eyebrow { text-transform: uppercase; font-size: .69rem; letter-spacing: .12em; font-weight: 800; color: var(--muted); }
.hero .eyebrow { color: var(--accent); }
.primary, .quiet, .danger { border: 1px solid transparent; border-radius: 9px; padding: .55rem .85rem; font-weight: 680; }
.primary { color: white; background: var(--ink); }
.quiet { border-color: #c9d2c8; background: transparent; color: inherit; }
.top .quiet, .hero .quiet { border-color: #5d7770; color: #fff; }
.danger { color: #8f2a25; background: #fff2ef; border-color: #ecd0c9; }
.link { color: #245c50; background: none; border: 0; text-decoration: underline; padding: 0; overflow-wrap: anywhere; text-align: left; }
.section-head { display: flex; gap: 1rem; justify-content: space-between; align-items: end; margin: 1.75rem 0 .75rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); gap: .85rem; }
.card, .entry, .empty, .module, .login { border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius); }
.card { display: block; padding: 1.1rem; text-decoration: none; }
.card:hover, .module:hover { border-color: #658c80; }
.card h3 { margin: .8rem 0 .25rem; font-size: 1.25rem; }
.card p, .entry p:not(.eyebrow), .muted { color: var(--muted); }
.card-bottom { display: flex; justify-content: space-between; margin-top: .95rem; padding-top: .65rem; border-top: 1px solid var(--line); font-size: .9rem; }
.badge { display: inline-block; width: fit-content; border-radius: 14px; padding: .22rem .55rem; font-size: .77rem; font-weight: 650; color: #29443e; background: #edf3eb; }
.empty { padding: 1.4rem; color: var(--muted); }
.crumb { margin-bottom: .8rem; color: #345c52; font-size: .92rem; }
.project-hero h1 { font-size: clamp(1.85rem, 5vw, 3.45rem); }
.hero-actions { flex-shrink: 0; }
.modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: .55rem; margin-top: .85rem; }
.module { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .35rem; padding: .75rem; text-decoration: none; }
.module[aria-current] { background: #e6efd8; border-color: #99aa86; }
.module-icon { grid-column: 1 / -1; font-size: 1.5rem; color: #38685b; line-height: 1; }
.module-count { font-size: .8rem; color: var(--muted); }
.rows { display: grid; gap: .6rem; }
.entry { display: flex; gap: 1rem; padding: .95rem 1rem; justify-content: space-between; align-items: start; }
.entry-main { min-width: 0; }
.entry h3 { margin: .2rem 0 .25rem; }
.entry-side { display: grid; justify-items: end; gap: .5rem; }
.notes { white-space: pre-wrap; margin-top: .25rem; }
.timestamp { margin-top: .2rem; font-size: .8rem; }
.attachment-photo { display: block; width: 100%; max-height: 62dvh; object-fit: contain; }
.photo-download { display: inline-flex; align-items: center; }
.attachment { margin-top: .45rem; padding-top: .45rem; border-top: 1px solid var(--line); }
.calendar { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; margin-bottom: .75rem; }
.calendar-header, .calendar-footer, .calendar-filter { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.calendar-header .quiet { min-width: 44px; font-size: 1.15rem; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .25rem; margin-top: .55rem; }
.calendar-weekday { color: var(--muted); text-align: center; font-size: .8rem; font-weight: 700; }
.calendar-day { position: relative; padding: .25rem .1rem; min-width: 0; background: #f5f7f2; color: var(--ink); border: 1px solid transparent; border-radius: 8px; }
.calendar-day[aria-current=date] { border-color: #6b887b; font-weight: 750; }
.calendar-day[aria-pressed=true] { background: var(--ink); color: #fff; }
.calendar-count { display: inline-block; margin-left: .2rem; min-width: .95rem; border-radius: 9px; background: var(--accent); color: var(--ink); font-size: .68rem; font-weight: 750; }
.calendar-footer { color: var(--muted); font-size: .85rem; }
.calendar-filter { margin-bottom: .45rem; }
.login { max-width: 35rem; margin: 1.5rem auto; padding: clamp(1.25rem, 5vw, 2.4rem); }
.login h1 { font-size: clamp(2rem, 7vw, 3.15rem); margin: .5rem 0 .8rem; }
form { display: grid; gap: .85rem; margin-top: .9rem; }
label { display: grid; gap: .3rem; font-size: .9rem; font-weight: 650; min-width: 0; }
input, select, textarea { width: 100%; min-width: 0; min-height: 44px; border-radius: 8px; border: 1px solid #a9b7ac; padding: .5rem .65rem; color: var(--ink); background: #fff; font-size: 1rem; }
input[type=file] { font-size: .9rem; }
input[type=checkbox] { width: 1rem; min-height: auto; }
.checkbox { display: flex; align-items: center; }
.form-error { color: #a12020; }
.form-error:empty { display: none; }
.form-pair, .compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
dialog { width: min(550px, calc(100% - 1.25rem)); max-height: 88dvh; padding: 1.15rem; border-radius: var(--radius); border: 1px solid var(--line); color: var(--ink); }
dialog::backdrop { background: rgb(13 25 24 / .65); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: .75rem; }
.queue { display: grid; gap: .6rem; margin-top: .85rem; }
.queue article, .compare > div { border: 1px solid var(--line); border-radius: 10px; padding: .75rem; }
.queue .form-actions, .compare { margin-top: .65rem; }
.toast { position: fixed; z-index: 2; bottom: max(1rem, env(safe-area-inset-bottom)); right: .85rem; max-width: min(25rem, calc(100% - 1.7rem)); color: white; background: var(--ink); border-radius: 10px; padding: .75rem 1rem; box-shadow: 0 5px 20px #17262745; }
@media (max-width: 620px) {
  .hero { align-items: stretch; flex-direction: column; }
  .hero-count { display: flex; align-items: center; align-self: start; }
  .top-inner { flex-wrap: wrap; }
  .sync, .top .quiet { font-size: .76rem; }
  .top .quiet { padding-inline: .6rem; }
  .section-head { align-items: start; }
}
