:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --surface: #fffefa;
  --forest: #2f5944;
  --graphite: #29332e;
  --line: #d4d9ce;
  --strong-line: #778270;
  --sage-wash: #e3ebdd;
  --muted: #606b61;
  --danger: #a3323a;
  color: var(--graphite);
  background: var(--paper);
  font: 15px/1.5 "Segoe UI", system-ui, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2, .brand { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.13; overflow-wrap: anywhere; }
h2 { font-size: 1.65rem; line-height: 1.2; }
h3 { font-size: 1rem; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
button, input, select, textarea { border: 1px solid var(--strong-line); border-radius: 6px; }
button {
  min-height: 38px;
  padding: .4rem .75rem;
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
}
button:hover { background: var(--sage-wash); }
button:disabled { opacity: .57; cursor: default; }
button.primary { border-color: var(--forest); background: var(--forest); color: white; }
button.primary:hover:enabled { background: #244635; }
button.quiet { background: transparent; border-color: transparent; color: var(--forest); }
button.quiet:hover:enabled { background: var(--sage-wash); }
button.danger { border-color: var(--danger); color: var(--danger); }
:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; }
input, select, textarea {
  display: block;
  width: 100%;
  min-height: 40px;
  background: var(--surface);
  padding: .4rem .55rem;
}
textarea { resize: vertical; }
summary { cursor: pointer; font-weight: 600; }
.muted { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.field { display: grid; gap: 4px; min-width: 0; font-size: .93rem; font-weight: 600; }
.field :is(input, select, textarea) { font-size: 1rem; font-weight: 400; }
.message { color: var(--forest); overflow-wrap: anywhere; }
.message:not(:empty) { margin-block: 10px; }
.message[data-error="true"] { color: var(--danger); }

.site-header {
  min-height: 64px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px max(20px, calc((100vw - 1320px) / 2));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { color: var(--forest); font-size: 1.6rem; line-height: 1.2; }
.site-header .muted { font-size: .86rem; }
.workspace { max-width: 1360px; margin-inline: auto; padding: 32px 20px 48px; }
.access { max-width: 440px; margin: 36px auto; }
.access > p { margin-top: 12px; }
.access-form { display: grid; gap: 12px; align-items: start; margin-top: 16px; }
.access-form button { justify-self: start; }
.join { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 24px; }
.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.identity { margin-top: 8px; }
.board-toolbar {
  margin-top: 25px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.filters { display: flex; gap: 2px; padding: 3px; border-radius: 8px; background: #ebeee5; }
.filters button { border-color: transparent; background: transparent; }
.filters button[aria-pressed="true"] { border-color: var(--line); background: var(--surface); color: var(--forest); }
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.lane { min-width: 0; min-height: 160px; padding: 10px; border-top: 2px solid var(--strong-line); background: #f0ede4; border-radius: 0 0 8px 8px; }
.lane[data-status="doing"], .lane[data-status="done"] { border-color: var(--forest); }
.lane-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 10px; font: 600 1rem/1.5 "Segoe UI", system-ui, Arial, sans-serif; }
.lane-count { font-size: .86rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.lane-list, .log-list, .member-list { list-style: none; padding: 0; margin: 0; overflow-wrap: anywhere; }
.lane-list { display: grid; gap: 8px; }
.lane-empty { font-size: .88rem; }
.task-card {
  display: grid;
  gap: .45rem;
  text-align: start;
  overflow-wrap: anywhere;
  width: 100%;
  border-color: var(--line);
  border-radius: 8px;
  padding: 10px;
}
.task-card-meta { font-size: .84rem; font-weight: 400; color: var(--muted); }
.activity { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 26px; }
.log-list li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.log-list time, .byline { color: var(--muted); font-size: .86rem; }
.log-list p { white-space: pre-wrap; overflow-wrap: anywhere; }

dialog {
  max-width: min(640px, calc(100% - 24px));
  width: 100%;
  max-height: calc(100% - 24px);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--graphite);
  box-shadow: 0 8px 24px #29332e1f;
}
dialog::backdrop { background: #29332e66; }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 16px; }
.dialog-header h2 { overflow-wrap: anywhere; }
.fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-block: 10px; }
#task-form > .actions { margin-top: 12px; }
.comments, .invite, .session { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.comments form, #invite-result, .session p { margin-top: 10px; }
.comments form button, #invite-result .actions, .session button { margin-top: 8px; }
.conflict { border: 1px solid var(--strong-line); border-radius: 6px; padding: 10px; margin-block: 12px; }
.conflict ul { padding-inline-start: 20px; overflow-wrap: anywhere; }
.member-list li { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.member-list li:last-child { border-bottom: 0; }

@media (max-width: 1000px) {
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .workspace { padding: 24px 14px 36px; }
  .site-header { padding-inline: 14px; }
  .access { margin-block: 12px; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .lane { min-height: 96px; }
  .fields { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 360px) {
  .board, .fields { grid-template-columns: 1fr; }
}
