:root {
  color-scheme: light;
  --page: #f8f6f1;
  --paper: #fffefa;
  --ink: #25342c;
  --muted: #777d75;
  --quiet: #a3a69f;
  --line: #e8e7df;
  --green: #4c7158;
  --green-dark: #385743;
  --green-pale: #e9f0e8;
  --orange: #d9986f;
  --orange-pale: #f5e6d9;
  --blue: #8299a8;
  --blue-pale: #e8eef1;
  --shadow: 0 10px 30px rgb(38 51 43 / 5%);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--page);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--page); }
button, input, select, textarea { font: inherit; }
button, select { color: inherit; }
button { cursor: pointer; }
button:disabled, select:disabled { cursor: not-allowed; opacity: .53; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #9eb79e; outline-offset: 3px; }

.page-shell { width: min(1280px, 100% - 64px); margin: 0 auto; }
.skip-link { position: absolute; z-index: 10; top: 8px; left: 12px; padding: 10px 14px; border-radius: 8px; background: var(--ink); color: white; transform: translateY(-140%); }
.skip-link:focus { transform: translateY(0); }

.topbar { min-height: 88px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgb(50 67 55 / 9%); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 12px; background: var(--green); color: #f8f5ef; }
.brand-mark svg { width: 28px; height: 28px; }
.brand-name { font-size: 19px; font-weight: 750; letter-spacing: -.055em; }
.brand-name span { color: var(--orange); }
.actor-switch { display: grid; grid-template-columns: auto auto; align-items: center; gap: 1px 10px; }
.actor-switch label { color: var(--muted); font-size: 12px; font-weight: 650; }
.actor-switch select { border: 0; background: transparent; font-size: 13px; font-weight: 720; padding: 5px 3px; }
.actor-switch p { grid-column: 1 / -1; margin: 0; color: var(--quiet); font-size: 10px; }

.welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 54px 0 30px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--green); font-size: 10px; font-weight: 760; letter-spacing: .14em; }
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 5.4vw, 56px); font-weight: 500; letter-spacing: -.055em; line-height: 1.02; }
.title-period { color: var(--orange); }
.welcome-copy { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 17px; border: 1px solid transparent; border-radius: 10px; font-size: 12px; font-weight: 680; transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button-primary { background: var(--green); color: #fff; box-shadow: 0 5px 14px rgb(61 92 68 / 14%); }
.button-primary:hover:not(:disabled) { background: var(--green-dark); }
.button-quiet { border-color: var(--line); background: var(--paper); color: var(--ink); }
.button-plus { font-size: 20px; font-weight: 400; line-height: 0; }
.add-task-button { margin-bottom: 1px; }

.connection-banner, .notice { border-radius: 10px; margin: -5px 0 20px; padding: 12px 15px; font-size: 12px; }
.connection-banner { display: flex; align-items: center; gap: 10px; background: #fff1d9; color: #75552e; }
.connection-icon { font-size: 18px; }
.notice { margin-top: 0; background: var(--green-pale); color: var(--green-dark); }
.notice-error { background: #fae9e4; color: #8c4134; }

.board-controls { min-height: 60px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: rgb(255 254 250 / 75%); }
.search-field { flex: 1; min-width: 160px; display: flex; align-items: center; gap: 10px; padding: 0 10px; }
.field-icon { color: #879087; font-size: 24px; line-height: 1; transform: rotate(-15deg); }
.search-field input { width: 100%; min-width: 0; padding: 9px 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.search-field input::placeholder { color: #9b9e97; }
.search-field kbd { display: inline-grid; min-width: 19px; height: 20px; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: #92958e; font-size: 10px; }
.filter-field select { min-height: 36px; padding: 0 29px 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: #5f685f; font-size: 11px; }
.view-switch { display: flex; gap: 3px; padding: 3px; border-radius: 9px; background: #f0efe9; }
.view-button { min-height: 31px; display: inline-flex; align-items: center; gap: 6px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent; color: #888d85; font-size: 10px; font-weight: 650; }
.view-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.35; }
.view-button.is-active { background: var(--paper); color: var(--green-dark); box-shadow: 0 1px 4px rgb(40 50 43 / 10%); }

.board-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 21px 2px 12px; color: var(--muted); font-size: 11px; }
.board-summary p { margin: 0; }
#task-count { font-weight: 690; color: #58655a; }
.sync-label { display: inline-flex; align-items: center; gap: 7px; color: #92968e; font-size: 10px; }
.sync-dot { width: 6px; height: 6px; border-radius: 50%; background: #84a283; box-shadow: 0 0 0 3px #e8efe5; }
.lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 16px; }
.lane { min-height: 300px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: rgb(255 254 250 / 56%); }
.lane-header { min-height: 27px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.lane-heading { display: flex; align-items: center; gap: 8px; }
.lane-heading h2 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: -.01em; }
.lane-marker { width: 8px; height: 8px; border-radius: 3px; background: var(--orange); transform: rotate(45deg); }
.lane-doing .lane-marker { background: var(--blue); }
.lane-done .lane-marker { background: #7c9e78; }
.lane-count { min-width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 7px; background: #f0efe8; color: #777d74; font-size: 10px; font-weight: 650; }
.lane-cards, .list-cards { display: grid; gap: 10px; }
.lane-empty, .list-empty { margin: 0; padding: 29px 10px; color: #9a9e96; font-family: Georgia, "Times New Roman", serif; font-size: 13px; font-style: italic; text-align: center; }
.task-card { min-width: 0; padding: 14px 14px 11px; border: 1px solid #e8e7df; border-radius: 11px; background: var(--paper); box-shadow: 0 3px 10px rgb(39 53 43 / 3%); transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease; touch-action: pan-y; -webkit-touch-callout: none; }
.task-card:hover { border-color: #d9dfd6; box-shadow: var(--shadow); transform: translateY(-1px); }
.task-card.is-dragging { opacity: .28; }
.task-card.drag-ghost { position: fixed; z-index: 20; pointer-events: none; opacity: .96; box-shadow: 0 16px 38px rgb(38 51 43 / 22%); transform: rotate(-1deg); transition: none; }
body.is-dragging { cursor: grabbing; user-select: none; }
.lane.drop-target { border-color: #9bb49a; background: #f0f5ed; box-shadow: inset 0 0 0 1px #cbd9c7; }
.task-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.task-title-block { min-width: 0; }
.task-title { margin: 0; font-size: 13px; font-weight: 690; letter-spacing: -.02em; line-height: 1.42; }
.task-notes { margin: 7px 0 0; color: #777e76; font-size: 11px; line-height: 1.55; white-space: pre-line; }
.task-details { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.assignee-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 23px; padding: 2px 8px 2px 4px; border-radius: 7px; background: #f2f3ed; color: #646e61; font-size: 10px; font-weight: 600; }
.assignee-unset { color: #8d9289; background: #f4f3ee; }
.person-mark { width: 16px; height: 16px; display: inline-grid; place-items: center; border-radius: 50%; background: #dfe9dc; color: var(--green-dark); font-size: 8px; font-weight: 750; }
.assignee-unset .person-mark { background: #e8e6df; color: #999b94; }
.task-card-footer { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px; margin-top: 12px; padding-top: 9px; border-top: 1px solid #f0efe9; }
.status-control { min-width: 0; }
.status-select { max-width: 105px; min-height: 27px; padding: 0 20px 0 7px; border: 1px solid transparent; border-radius: 6px; background-color: #f3f1e9; color: #626b61; font-size: 9px; font-weight: 650; }
.task-card-todo .status-select { background-color: #f7ede3; color: #936640; }
.task-card-doing .status-select { background-color: var(--blue-pale); color: #617c8c; }
.task-card-done .status-select { background-color: var(--green-pale); color: var(--green-dark); }
.task-audit { min-width: 0; margin: 0; overflow: hidden; color: #a0a39c; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.task-actions { display: flex; gap: 1px; }
.icon-button { display: inline-grid; min-width: 29px; min-height: 27px; place-items: center; padding: 0 5px; border: 0; border-radius: 6px; background: transparent; color: #82877f; font-size: 9px; }
.icon-button:hover:not(:disabled) { background: #f2f1eb; color: var(--green-dark); }
.icon-button-delete:hover:not(:disabled) { background: #faece8; color: #9c5547; }

.list-view { max-width: 820px; margin: 0 auto; }
.list-view .task-card { padding: 15px 17px 12px; }
.list-view .task-title { font-size: 14px; }
.list-view .task-card-footer { margin-top: 13px; }
.footer-note { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 43px 0 26px; color: #a2a49d; font-size: 10px; }
.footer-note a { color: #788a78; text-decoration: none; }
.footer-note a:hover { text-decoration: underline; }
.footer-separator { color: #c2b4a6; }

.task-dialog { width: min(520px, calc(100% - 32px)); max-height: min(90vh, 740px); padding: 27px; overflow-y: auto; border: 1px solid #e8e7df; border-radius: 18px; background: var(--paper); color: var(--ink); box-shadow: 0 22px 80px rgb(26 39 29 / 20%); }
.task-dialog::backdrop { background: rgb(38 49 41 / 42%); backdrop-filter: blur(2px); }
.task-dialog form { display: grid; gap: 16px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 3px; }
.dialog-heading .eyebrow { margin-bottom: 7px; font-size: 9px; }
.dialog-heading h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 500; letter-spacing: -.035em; }
.close-dialog.icon-button { min-width: 30px; font-size: 23px; line-height: 1; }
.form-field { display: grid; gap: 7px; color: #59645a; font-size: 11px; font-weight: 670; }
.form-field input, .form-field textarea, .form-field select { width: 100%; padding: 11px 12px; border: 1px solid #e4e4dc; border-radius: 8px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 450; }
.form-field textarea { resize: vertical; line-height: 1.5; }
.form-field input::placeholder, .form-field textarea::placeholder { color: #b2b4ad; }
.optional-label { color: #969a91; font-size: 10px; font-weight: 450; }
.form-error { margin: -5px 0 0; color: #9c5041; font-size: 11px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 800px) {
  .page-shell { width: min(100% - 36px, 680px); }
  .welcome { padding-top: 42px; }
  .lanes { grid-template-columns: repeat(3, minmax(250px, 1fr)); overflow-x: auto; padding-bottom: 9px; scroll-snap-type: x proximity; }
  .lane { scroll-snap-align: start; }
  .board-view { overflow: hidden; }
}

@media (max-width: 560px) {
  .page-shell { width: calc(100% - 30px); }
  .topbar { min-height: 75px; }
  .brand-mark { width: 33px; height: 33px; }
  .actor-switch p { max-width: 183px; font-size: 9px; line-height: 1.35; }
  .welcome { align-items: flex-start; padding: 36px 0 24px; }
  h1 { font-size: 39px; }
  .welcome-copy { max-width: 270px; font-size: 12px; line-height: 1.5; }
  .add-task-button { min-width: 42px; width: 42px; min-height: 42px; gap: 0; overflow: hidden; padding: 0; border-radius: 13px; font-size: 0; }
  .button-plus { font-size: 23px; }
  .board-controls { flex-wrap: wrap; gap: 7px; padding: 8px; }
  .search-field { flex-basis: 100%; min-height: 37px; border-bottom: 1px solid #efeee8; }
  .filter-field { flex: 1; }
  .filter-field select { width: 100%; }
  .view-button { padding: 0 7px; }
  .view-button span { display: none; }
  .board-summary { margin-top: 16px; }
  .sync-label { font-size: 9px; }
  .footer-note { flex-wrap: wrap; margin-top: 34px; font-size: 9px; }
  .task-dialog { padding: 21px 18px; border-radius: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
