:root {
  --ink: #08342e;
  --ink-hover: #14493f;
  --muted: #55665f;
  --line: #e0dacc;
  --input-line: #c4baa5;
  --strong-line: #08342e;
  --paper: #ffffff;
  --wash: #f6f4ef;
  --sand: #d4c7b0;
  --phase: #08342e;
  --sched: #d4c7b0;
  --done: #3c7a62;
  --done-text: #2c6650;
  --late: #a8321f;
  --late-wash: #f8e9e4;
  --warn-wash: #f5efe0;
  --warn: #7a5c2e;
  --me: #08342e;
  --client: #7a5c2e;
  --focus: #08342e;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  font-family: "Figtree", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--wash); color: var(--ink); font-size: 15px; line-height: 1.45; }
body.client { background: var(--paper); }
h1 { font-family: var(--serif); font-size: 34px; font-weight: 500; line-height: 1.15; margin: 0 0 4px; }
h2 { font-family: var(--serif); font-size: 22px; font-weight: 500; line-height: 1.2; margin: 0 0 10px; }
h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; margin: 18px 0 6px; color: var(--muted); }
h4 { font-size: 13px; margin: 0 0 8px; }
p { margin: 0 0 8px; }
a { color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: 13px; }
.lede { max-width: 62ch; margin-bottom: 20px; }
.late-text { color: var(--late); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.spaced { margin-top: 32px; }
.spaced-small { margin-top: 12px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 12px 24px; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; text-decoration: none; }
.logo { display: block; width: 226px; max-width: 100%; height: auto; }
.client-brand { margin-bottom: 28px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.login .logo { margin-bottom: 32px; }
.topbar nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.topbar nav a { text-decoration: none; }
.topbar nav a:hover { text-decoration: underline; }
.badge { display: inline-block; min-width: 19px; padding: 0 5px; text-align: center; background: var(--late); color: #fff; border-radius: 10px; font-size: 12px; }

.page { max-width: 1120px; margin: 0 auto; padding: 28px 24px 56px; }
.page.wide { max-width: 1320px; }
.narrow { max-width: 620px; margin: 0 auto; padding: 28px 24px 56px; }
.login { padding-top: 14vh; }
.login h1 { margin-bottom: 20px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.section-head h2 { margin: 0; }
.actions, .inline-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

button, .button { font: inherit; cursor: pointer; }
.button, .primary { display: inline-block; padding: 7px 13px; background: var(--paper); color: var(--ink); border: 1px solid var(--ink); border-radius: 0; text-decoration: none; font-size: 14px; }
.button:hover { background: var(--wash); }
.primary { background: var(--ink); color: #fff; }
.primary:hover { background: var(--ink-hover); }
button:disabled { opacity: .45; cursor: not-allowed; }
.button.danger { border-color: var(--late); color: var(--late); }
.linklike { background: none; border: 0; padding: 0; text-decoration: underline; color: inherit; font-size: 13px; }
.linklike.danger { color: var(--late); }
.linklike.on-dark { color: #fff; white-space: nowrap; }

input, select, textarea { font: inherit; color: inherit; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack label, .choice-body label, .field-pair label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.stack label .muted { display: inline; }
.stack input:not([type=radio]):not([type=checkbox]), .stack textarea, .stack select, .row-form input, .comment-form textarea, .add-phase input, .add-row input { padding: 8px 9px; border: 1px solid var(--input-line); border-radius: 0; background: var(--paper); font-weight: 400; width: 100%; }
.stack .check-label { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-label { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.choices { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.choices legend { font-size: 13px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.choices > label { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; }
.choice-body { display: flex; flex-direction: column; gap: 10px; padding: 12px; margin-left: 22px; background: var(--paper); border: 1px solid var(--line); }
.stack > .primary { align-self: flex-start; }

.flash { padding: 10px 13px; background: var(--paper); border-left: 3px solid var(--done); margin-bottom: 16px; }
.flash.error { border-left-color: var(--late); background: var(--late-wash); }
.flash.note { border-left-color: var(--warn); background: var(--warn-wash); }
.callout { display: flex; justify-content: space-between; gap: 12px; padding: 12px 15px; margin-bottom: 20px; background: var(--warn-wash); border: 1px solid var(--sand); text-decoration: none; }
.callout span { text-decoration: underline; }
.empty { padding: 28px; background: var(--paper); border: 1px solid var(--line); text-align: center; color: var(--muted); }

.columns { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; align-items: start; }
.focus { background: var(--paper); border: 1px solid var(--line); padding: 18px 20px; margin-bottom: 16px; }
.focus h3:first-of-type { margin-top: 4px; }
.focus-list li { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-top: 1px solid var(--line); }
.focus-list a { text-decoration: none; display: flex; flex-direction: column; min-width: 0; }
.focus-list a:hover .focus-title { text-decoration: underline; }
.focus-list .muted { font-size: 13px; }
.focus-date { white-space: nowrap; font-size: 13px; }
.events li { padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.events a { text-decoration: none; display: block; }
.events a:hover { text-decoration: underline; }
.events .muted { font-size: 13px; }
.quote { margin: 5px 0 0; padding-left: 9px; border-left: 2px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: var(--paper); border: 1px solid var(--line); text-decoration: none; }
.card:hover { border-color: var(--ink); }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.health { font-size: 12px; white-space: nowrap; }
.health.late { color: var(--late); font-weight: 600; }
.health.soon { color: var(--warn); }
.health.ok { color: var(--muted); }
.health.complete { color: var(--done-text); }
.progress { height: 5px; margin: 10px 0 4px; background: var(--line); }
.progress span { display: block; height: 100%; background: var(--done); }
.progress.large { height: 7px; max-width: 360px; }
.archived { margin-top: 28px; }
.archived li { padding: 4px 0; }

/* The schedule: carries the look of the original spreadsheet */
.sheet-title h1 { font-size: 32px; }
.sheet-title p { margin-bottom: 3px; }
.eyebrow { text-transform: uppercase; font-size: 12px; letter-spacing: .1em; }
.client-title { margin-bottom: 24px; }
.table-wrap { overflow-x: auto; background: var(--paper); }
table.sheet { border-collapse: collapse; width: 100%; font-size: 13px; }
.sheet th, .sheet td { border: 1px solid var(--strong-line); padding: 0; }
.sheet .blank { border: 0; background: var(--paper); }
.sheet .month { padding: 4px 2px; font-size: 11px; font-weight: 400; text-align: center; letter-spacing: .03em; border-width: 2px; }
.sheet .month.alt { background: var(--phase); color: #fff; font-weight: 700; }
.sheet .heads th { padding: 5px 7px; text-align: left; font-size: 13px; border-top-width: 2px; border-bottom-width: 2px; white-space: nowrap; }
.sheet .wk-head { min-width: 25px; width: 25px; text-align: center !important; padding: 5px 1px !important; font-size: 12px !important; }
.sheet .wk-head.now { background: var(--ink); color: #fff; }
.sheet td.wk { min-width: 25px; width: 25px; }
.wk.sched { background: var(--sched); }
.wk.done { background: var(--done); }
.wk.late { background: var(--late); }
.phase-row td { background: var(--phase); color: #fff; padding: 4px 7px; font-weight: 700; border-color: var(--phase); }
.phase-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.phase-title { flex: 1; min-width: 180px; background: none; border: 0; color: #fff; font-weight: 700; padding: 1px 0; }
.phase-title:focus { background: var(--ink-hover); }
.col-title { min-width: 300px; }
.col-owner { width: 104px; min-width: 104px; }
.col-status { width: 110px; min-width: 110px; }
.col-due { width: 136px; min-width: 136px; }
.col-more { width: 34px; min-width: 34px; text-align: center; }
.sheet .row input, .sheet .row select { width: 100%; padding: 5px 6px; border: 0; background: transparent; font-size: 13px; }
.sheet .row input:hover, .sheet .row select:hover { background: var(--wash); }
.sheet .row input:focus, .sheet .row select:focus { background: var(--wash); outline: 2px solid var(--focus); outline-offset: -2px; }
.owner-me { color: var(--me); }
.owner-client { color: var(--client); }
.is-done [data-field="status"], .is-done .status-text { color: var(--done-text); font-weight: 600; }
.is-late [data-field="due_date"] { color: var(--late); font-weight: 600; }
.more { width: 100%; height: 100%; background: none; border: 0; padding: 5px 0; color: var(--muted); letter-spacing: 1px; }
.more:hover { background: var(--wash); color: var(--ink); }
.count { display: inline-block; min-width: 18px; background: var(--ink); color: #fff; border-radius: 9px; font-size: 11px; letter-spacing: 0; line-height: 18px; }
.detail td { background: var(--wash); padding: 14px; }
.detail-grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(280px, 1fr); gap: 24px; max-width: 900px; }
.comment { padding: 7px 10px; margin-bottom: 7px; background: var(--paper); border: 1px solid var(--line); font-size: 13px; }
.comment p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-form { display: flex; gap: 8px; align-items: flex-start; }
.comment-form textarea { flex: 1; min-width: 0; font-size: 13px; }
.add-row td { padding: 3px 5px; border-color: var(--line); background: var(--paper); }
.add-row form { display: flex; gap: 6px; align-items: center; }
.add-row input { padding: 3px 6px; font-size: 13px; border-color: transparent; }
.add-row input[name=title] { max-width: 400px; }
.add-row input[type=date] { width: 140px; }
.add-row input:hover, .add-row input:focus { border-color: var(--input-line); }
.add-row .button { padding: 2px 9px; font-size: 12px; }
.add-phase { display: flex; gap: 8px; margin: 14px 0 28px; max-width: 460px; }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--line); padding: 16px 18px; }
.row-form { display: flex; gap: 8px; }
.toast { position: fixed; right: 20px; bottom: 20px; margin: 0; padding: 8px 14px; background: var(--ink); color: #fff; font-size: 13px; border-radius: 0; }
.toast.error { background: var(--late); }

/* Client page */
.your-items { padding: 18px 20px; background: var(--wash); border-top: 2px solid var(--ink); max-width: 860px; }
.your-items li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.your-title { flex: 1; min-width: 0; }
.your-date { font-size: 13px; white-space: nowrap; color: var(--muted); }
.check-form { display: inline-flex; flex: none; }
.check { width: 20px; height: 20px; padding: 0; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 0; }
.check:hover { background: var(--wash); }
.check.on { background: var(--done); border-color: var(--done); position: relative; }
.check.on::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.readonly .col-title, .readonly .col-owner, .readonly .col-due { padding: 6px 7px; vertical-align: top; }
.readonly .col-due { min-width: 170px; }
.readonly .col-due > span { display: block; }
.title-line { display: flex; gap: 8px; align-items: flex-start; }
.title-line .check-gap { flex: none; width: 20px; }
.comments { padding-left: 28px; }
.comments { margin-top: 3px; font-size: 12px; }
.comments summary { cursor: pointer; color: var(--muted); }
.comments[open] { margin-bottom: 4px; }
.comments[open] summary { margin-bottom: 6px; }
.footer-note { margin-top: 18px; }

/* Reminders */
.draft { background: var(--paper); border: 1px solid var(--line); padding: 18px 20px; margin-bottom: 16px; max-width: 760px; }
.draft-items { border-top: 1px solid var(--ink); }
.draft-items li { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.draft-items li span:last-child { white-space: nowrap; font-size: 13px; }
.history li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.history li > span:last-child { text-align: right; white-space: nowrap; }
.history li > span:first-child { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 820px) {
  .columns { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar { padding: 12px 16px; }
  .page, .narrow { padding: 20px 16px 44px; }
  .client .months, .client .heads, .client .wk { display: none; }
  .client table.sheet, .client .sheet tbody { display: block; }
  .client .sheet tr.row { display: grid; grid-template-columns: 1fr auto; padding: 9px 2px; border-bottom: 1px solid var(--line); }
  .client .sheet tr.phase-row { display: block; }
  .client .sheet tr.phase-row td { display: block; }
  .client .sheet tr.row td { border: 0; min-width: 0; width: auto; padding: 1px 4px; }
  .client .sheet tr.row .col-title { grid-column: 1 / -1; }
  .client .sheet tr.row .col-owner { grid-column: 1 / -1; font-size: 12px; padding-left: 32px; }
  .client .sheet tr.row .col-due { grid-column: 1 / -1; padding-left: 32px; font-size: 12px; }
  .client .sheet tr.row .col-due > span { display: inline; margin-right: 6px; }
  .your-items li { flex-wrap: wrap; }
  .your-date { width: 100%; padding-left: 32px; white-space: normal; }
  .field-pair { grid-template-columns: 1fr; }
  .comment-form { flex-direction: column; }
  .comment-form textarea { width: 100%; flex: none; }
}
@media print {
  .your-items, .comments, .check, .footer-note { display: none; }
  body.client { font-size: 11px; }
  .wk, .month.alt, .phase-row td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
