/* Worknear theme: warm paper, deep green ink, marigold highlights.
   Geist for reading; Caveat Brush only for the brand and headings. */
@font-face { font-family: 'Geist'; src: url('/fonts/geist-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('/fonts/geist-sans-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('/fonts/geist-sans-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Caveat Brush'; src: url('/fonts/caveat-brush-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --paper: #fbf7ef;
  --card: #ffffff;
  --ink: #1c2421;
  --soft: #4d5a55;
  --line: #e4ddcf;
  --green: #0f5c4c;
  --green-dark: #0a4337;
  --green-tint: #e3f0ec;
  --gold: #f2b233;
  --gold-tint: #fdf1d6;
  --red: #a3261b;
  --red-tint: #fbe7e4;
  --blue-tint: #e6eef8;
  --radius: 14px;
  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --brush: 'Caveat Brush', 'Segoe Print', 'Comic Sans MS', cursive;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 18px; line-height: 1.55; }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: var(--green-dark); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--card); padding: 8px 12px; z-index: 10; }

.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 18px; background: var(--green); color: #fff; }
.brand { font-family: var(--brush); font-size: 34px; line-height: 1; color: #fff; text-decoration: none; letter-spacing: .5px; }
.brand::after { content: ''; display: block; height: 5px; width: 60%; background: var(--gold); border-radius: 3px; margin-top: 2px; transform: rotate(-1.5deg); }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: 16px; }
.top nav a, .top .linklike { color: #fff; text-decoration: none; padding: 6px 2px; font: inherit; }
.top nav a:hover { text-decoration: underline; }
.count { background: var(--gold); color: var(--ink); border-radius: 999px; padding: 0 8px; font-weight: 700; font-size: 14px; }
.demo-clock { background: var(--gold-tint); text-align: center; padding: 6px; font-size: 15px; border-bottom: 1px solid var(--line); }

main { max-width: 640px; margin: 0 auto; padding: 20px 16px 48px; }
h1, h2 { font-family: var(--brush); font-weight: 400; line-height: 1.1; color: var(--green-dark); }
h1 { font-size: 42px; margin: 8px 0 12px; }
h2 { font-size: 30px; margin: 28px 0 10px; }
h3 { font-size: 18px; margin: 18px 0 6px; }
p { margin: 0 0 12px; }
.lead { font-size: 20px; color: var(--soft); }
.muted { color: var(--soft); font-size: 16px; }
.foot { text-align: center; font-size: 14px; color: var(--soft); padding: 24px 16px 32px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 14px 0; box-shadow: 0 1px 0 rgba(0,0,0,.03); }
.card.act { border: 2px solid var(--gold); background: #fffdf6; }
.card.help { border: 2px solid #b8cde8; background: #f7faff; }
.card h3:first-child, .card h2:first-child { margin-top: 0; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.row:last-child { border-bottom: 0; }
.row .k { color: var(--soft); }
.row .v { text-align: right; font-weight: 600; }
.row.total { font-size: 20px; font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 0; padding-top: 12px; }
.row.total .v { font-weight: 700; }
.earn { background: var(--green-tint); border-radius: 10px; padding: 10px 12px; margin-top: 10px; font-weight: 600; }

.pill { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 15px; font-weight: 600; background: #eee8dc; color: var(--ink); }
.pill.act { background: var(--gold); }
.pill.ok { background: var(--green-tint); color: var(--green-dark); }
.pill.done { background: var(--green); color: #fff; }
.pill.help { background: var(--blue-tint); color: #1d3f6e; }
.pill.warn { background: var(--red-tint); color: var(--red); }
.pill.wait { background: var(--gold-tint); }
.pill.muted { background: #eee; color: #666; }
.next { margin-top: 10px; font-weight: 600; }
.next::before { content: '\2192  '; color: var(--green); }

/* Home choices */
.choices { display: grid; gap: 14px; margin: 24px 0; }
.choice { display: flex; align-items: center; gap: 16px; padding: 22px 20px; border-radius: 18px; text-decoration: none; font-size: 24px; font-weight: 700; color: var(--ink); background: var(--card); border: 2px solid var(--line); }
.choice .ico { font-size: 36px; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 14px; background: var(--gold-tint); }
.choice.primary { background: var(--green); border-color: var(--green); color: #fff; }
.choice.primary .ico { background: rgba(255,255,255,.15); }
.choice small { display: block; font-size: 16px; font-weight: 400; opacity: .85; }

/* Forms */
form { margin: 0; }
.field { margin: 0 0 18px; }
label, .label { display: block; font-weight: 600; margin-bottom: 6px; }
.hint { display: block; font-weight: 400; color: var(--soft); font-size: 15px; margin-top: 2px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], input[type=time], select, textarea {
  width: 100%; font: inherit; font-size: 18px; padding: 12px 14px; border: 2px solid #cfc6b4; border-radius: 12px; background: #fff; color: var(--ink); min-height: 52px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px var(--gold-tint); }
.checks { display: grid; gap: 8px; }
.check { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font-weight: 600; }
.check input { width: 24px; height: 24px; accent-color: var(--green); }
.dayrow { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; align-items: center; margin-bottom: 8px; }
.dayrow input[type=time] { min-height: 44px; padding: 8px; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 600; margin-bottom: 6px; padding: 0; }

.btn { display: block; width: 100%; text-align: center; font: inherit; font-size: 20px; font-weight: 700; padding: 16px 20px; border-radius: 14px; border: 2px solid var(--green); background: var(--green); color: #fff; cursor: pointer; text-decoration: none; min-height: 58px; }
.btn:hover { background: var(--green-dark); color: #fff; }
.btn.secondary { background: #fff; color: var(--green); }
.btn.secondary:hover { background: var(--green-tint); color: var(--green-dark); }
.btn.danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn.small { display: inline-block; width: auto; font-size: 16px; padding: 8px 14px; min-height: 0; }
.btn:disabled { opacity: .6; cursor: wait; }
.actions { display: grid; gap: 10px; margin-top: 14px; }
.linklike { background: none; border: 0; color: var(--green); text-decoration: underline; font: inherit; cursor: pointer; padding: 4px 0; }
.inline { display: inline; }
details { margin: 12px 0; }
details > summary { cursor: pointer; font-weight: 600; color: var(--green); padding: 10px 0; list-style-position: inside; }
details[open] > summary { margin-bottom: 6px; }

.flash { padding: 14px 16px; border-radius: 12px; margin: 0 0 16px; font-weight: 600; }
.flash.ok { background: var(--green-tint); color: var(--green-dark); }
.flash.error { background: var(--red-tint); color: var(--red); }
.warnbox { background: var(--red-tint); color: var(--red); padding: 10px 12px; border-radius: 10px; font-weight: 600; margin: 10px 0; }
.infobox { background: var(--blue-tint); padding: 10px 12px; border-radius: 10px; margin: 10px 0; }
.private { background: var(--gold-tint); border: 1px dashed #d9a32c; border-radius: 12px; padding: 12px; }

.list { list-style: none; padding: 0; margin: 0; }
.list li { border-bottom: 1px solid var(--line); padding: 10px 0; }
.list li:last-child { border-bottom: 0; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 3px solid var(--line); }
.timeline li { padding: 4px 0 10px 14px; position: relative; font-size: 16px; }
.timeline li::before { content: ''; position: absolute; left: -8px; top: 10px; width: 13px; height: 13px; border-radius: 50%; background: var(--gold); }
.msg { padding: 10px 12px; border-radius: 12px; background: #f3efe6; margin: 8px 0; }
.msg.me { background: var(--green-tint); }
.msg .who { font-size: 14px; color: var(--soft); }

.learn { font-size: 16px; white-space: nowrap; }
dialog.pop { border: 0; border-radius: 18px; padding: 20px; width: min(92vw, 460px); box-shadow: 0 20px 60px rgba(0,0,0,.25); color: var(--ink); }
dialog.pop::backdrop { background: rgba(20,30,25,.45); }
.pop-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pop-head h2 { margin: 0 0 8px; font-size: 30px; }
.pop-x { font: inherit; font-weight: 600; font-size: 16px; background: #f3efe6; border: 0; border-radius: 999px; padding: 8px 14px; cursor: pointer; white-space: nowrap; min-height: 44px; }
.pop-x span { font-size: 22px; vertical-align: -2px; }

table { width: 100%; border-collapse: collapse; font-size: 16px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--soft); font-weight: 600; }
.tablewrap { overflow-x: auto; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat .n { font-size: 30px; font-weight: 700; color: var(--green-dark); }
.stat .l { font-size: 15px; color: var(--soft); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.tabs a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; text-decoration: none; font-size: 15px; }
.tabs a.on { background: var(--green); color: #fff; border-color: var(--green); }
.stars { display: flex; gap: 6px; flex-wrap: wrap; }
.stars label { font-weight: 600; border: 2px solid var(--line); border-radius: 10px; padding: 6px 10px; background: #fff; }
.offline { position: fixed; bottom: 12px; left: 12px; right: 12px; background: var(--ink); color: #fff; padding: 12px 14px; border-radius: 12px; font-size: 16px; z-index: 20; }

@media (min-width: 700px) {
  main { padding-top: 32px; }
  h1 { font-size: 50px; }
  .choices { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); }
}
