:root {
  color-scheme: light;
  font-family: "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --ink: #23202a;
  --muted: #675f71;
  --page: #f8f6f2;
  --line: #e5dfdc;
  --paper: #fffdfa;
  --accent: #6c3150;
  --rail: #2d2230;
  --tint: #f1e6ec;
  --danger: #9d323e;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--page); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(27px, 3vw, 35px); letter-spacing: -.02em; font-weight: 690; }
h2 { font-size: 21px; font-weight: 660; }
h3 { font-size: 15px; }
p, li { line-height: 1.55; }
button, select, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .53; }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid #b17094; outline-offset: 3px; }
input, select, textarea { border: 1px solid #d9cfd4; border-radius: 7px; width: 100%; min-width: 0; color: var(--ink); padding: 8px 11px; min-height: 39px; background: #fffefd; }
textarea { resize: vertical; line-height: 1.55; }
label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.button { border: 1px solid transparent; border-radius: 7px; min-height: 37px; padding: 7px 13px; font-size: 14px; white-space: nowrap; }
.primary { background: var(--accent); color: #fff; }
.primary:hover { background: #52223c; }
.secondary { background: var(--paper); border-color: var(--line); color: var(--ink); }
.secondary:hover { border-color: #ab91a1; }
.text-button { color: var(--accent); background: transparent; border: 0; text-align: left; padding: 0; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.error { color: var(--danger); font-size: 13px; }
.muted { color: var(--muted); font-size: 13px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 680; font-size: 19px; }
.mark { width: 23px; height: 23px; display: block; border: 1px solid currentColor; border-radius: 6px; position: relative; }
.mark::after { content: ""; position: absolute; left: 6px; top: 6px; width: 8px; height: 4px; transform: rotate(-45deg); border-style: solid; border-width: 0 0 2px 2px; }
.login-layout { min-height: 100vh; display: grid; place-items: center; padding: 25px; }
.login-panel { width: min(100%, 430px); padding: 32px; border: 1px solid var(--line); background: var(--paper); border-radius: 14px; }
.login-panel .brand { color: var(--accent); margin-bottom: 27px; }
.login-panel h1 { margin-bottom: 21px; }
form:not([method="dialog"]) { display: grid; gap: 13px; }
.workspace { min-height: 100vh; display: grid; grid-template-columns: 225px minmax(0, 1fr); }
.rail { position: sticky; top: 0; height: 100vh; background: var(--rail); color: #fff8fb; padding: 27px 18px 18px; display: flex; flex-direction: column; gap: 25px; }
.rail .brand { padding-inline: 7px; }
.project-picker { color: #dfd2de; padding: 0 7px; }
.project-picker select { color: #fff5fb; border-color: #6a5266; background: #3c2f40; }
nav { display: grid; gap: 5px; }
nav button { display: flex; justify-content: space-between; gap: 7px; color: #ebdce5; border: 0; background: transparent; border-radius: 7px; text-align: left; padding: 11px; }
nav button:hover, nav button[aria-current] { color: #fff; background: #513b50; }
.account { margin-top: auto; border-top: 1px solid #654d62; padding: 12px 6px 2px; display: flex; align-items: center; justify-content: space-between; gap: 6px; color: #e6d9e5; font-size: 13px; }
.account button { color: inherit; background: none; border: none; text-decoration: underline; }
.content { display: flex; flex-direction: column; flex: 1; padding: 36px 34px 60px; min-width: 0; width: 100%; }
.top, .top-actions { display: flex; align-items: center; gap: 10px; }
.top { justify-content: space-between; margin-bottom: 22px; }
.filters { display: grid; grid-template-columns: minmax(0, 280px) 135px 150px; gap: 9px; margin-bottom: 17px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
#notice { margin-bottom: 12px; padding: 9px 12px; border-radius: 7px; background: var(--tint); color: var(--accent); font-size: 14px; }
#notice.error { color: var(--danger); background: #f6e7e9; }
#items { display: flex; flex-direction: column; flex: 1; }
.board { display: grid; flex: 1; grid-auto-flow: column; grid-auto-columns: minmax(238px, 1fr); align-items: stretch; gap: 13px; overflow-x: auto; padding: 2px 2px 17px; overscroll-behavior-inline: contain; }
.board:has(.lane:only-child) { grid-auto-columns: minmax(238px, 340px); }
.lane { --lane-dot: #846680; background: #eee9ed; border: 1px solid #e1d8df; border-radius: 12px; display: flex; flex-direction: column; padding: 10px; min-width: 0; min-height: 162px; }
.lane[data-lane=in_progress] { --lane-dot: #55799c; background: #ebeff4; border-color: #dbe3ec; }
.lane[data-lane=verify] { --lane-dot: #9b7534; background: #f5efdf; border-color: #eaddbe; }
.lane[data-lane=done] { --lane-dot: #4e7e67; background: #e9f0e9; border-color: #d8e7da; }
.lane[data-lane=cancelled] { --lane-dot: #746e76; background: #eeecec; border-color: #e5dfdf; }
.lane-heading { display: flex; gap: 8px; align-items: center; padding: 6px 5px 11px; }
.lane-heading::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--lane-dot); }
.lane-heading h2 { font-size: 15px; }
.lane-count { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.card-stack { min-height: 56px; position: relative; display: grid; align-content: start; gap: 8px; }
.task-card { position: relative; display: grid; gap: 8px; padding: 10px 12px 11px; min-width: 0; background: var(--paper); border: 1px solid #dfd6db; border-radius: 9px; box-shadow: 0 1px 2px rgb(46 31 42 / 8%); }
.task-card:hover { border-color: #ae94a5; }
.task-card[draggable=true] { cursor: grab; }
.task-card.holding { opacity: .38; }
.card-meta, .card-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; }
.card-meta { min-height: 21px; }
.card-id { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.priority-label { font-size: 11px; color: #775828; background: #f8ebcf; border-radius: 4px; padding: 1px 5px; }
.priority-label[data-priority=urgent] { color: #8b3345; background: #f5e2e6; }
.card-move { margin-left: auto; background: transparent; border: 0; padding: 3px 1px; color: #6f5165; font-size: 12px; }
.card-move:hover { text-decoration: underline; text-underline-offset: 3px; }
.card-title { text-align: left; padding: 0; border: 0; color: var(--ink); background: transparent; font-size: 14px; line-height: 1.44; font-weight: 625; overflow-wrap: anywhere; }
.card-title:hover { color: var(--accent); }
.card-description { color: var(--muted); font-size: 12px; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer { margin-top: 2px; justify-content: space-between; color: var(--muted); font-size: 12px; }
.card-person { display: flex; gap: 5px; align-items: center; min-width: 0; overflow-wrap: anywhere; }
.avatar { background: #f0e5eb; color: #6d3956; display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; flex: none; font-size: 11px; }
.card-date { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.card-date.late { color: var(--danger); }
.lane-add { margin-top: 7px; }
.lane-add-button { min-height: 35px; background: transparent; border: 1px solid transparent; border-radius: 6px; width: 100%; padding: 3px 7px; text-align: left; color: #514455; font-size: 13px; }
.lane-add-button:hover { background: rgb(255 255 255 / 68%); border-color: var(--line); }
.lane-empty { color: var(--muted); font-size: 12px; padding: 6px; }
form.quick-form:not([method="dialog"]) { gap: 7px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.quick-actions .button { min-height: 32px; padding: 4px 8px; font-size: 12px; }
.lane.drop-lane { outline: 2px solid #ae7594; outline-offset: -2px; }
.drop-before::before, .drop-end::after { content: ""; position: absolute; z-index: 2; height: 3px; border-radius: 2px; background: #975779; left: 0; right: 0; pointer-events: none; }
.drop-before::before { top: -6px; }
.drop-end::after { bottom: -4px; }
.empty { border: 1px dashed var(--line); padding: 18px; border-radius: 9px; color: var(--muted); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 9px; }
.card p { margin-top: 4px; }
dialog { width: min(calc(100% - 28px), 680px); max-height: 85dvh; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 22px; background: var(--paper); }
dialog.task-drawer { position: fixed; top: 0; right: 0; bottom: 0; left: auto; margin: 0; width: min(100%, 490px); height: 100dvh; max-height: 100dvh; border-radius: 13px 0 0 13px; padding: 23px 22px; }
dialog::backdrop { background: rgb(35 25 38 / 55%); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 15px; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 7px; }
.dialog-note { margin-bottom: 14px; }
.history { margin-top: 17px; padding-top: 11px; border-top: 1px solid var(--line); }
.history summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.history p, .receipt-line { padding: 8px 0; border-bottom: 1px solid var(--line); }
.task-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; }
.assignee-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; font-size: 13px; }
.assignee-editor { margin-top: 7px; padding: 9px; border: 1px solid var(--line); border-radius: 7px; }
.assignee-editor .error { margin-top: 5px; }
@media (max-width: 835px) {
  .workspace { grid-template-columns: 170px minmax(0, 1fr); }
  .rail { padding-inline: 10px; }
  .content { padding-inline: 21px; }
}
@media (max-width: 640px) {
  .workspace { display: flex; flex-direction: column; }
  .rail { position: static; height: auto; gap: 12px; padding: 13px; }
  .rail .brand, .project-picker { padding: 0; }
  .project-picker { max-width: 240px; }
  nav { display: flex; flex-wrap: wrap; }
  nav button { padding: 8px; }
  .account { margin-top: 0; }
  .content { padding: 22px 13px 45px; }
  .top { gap: 5px; align-items: flex-start; }
  .top-actions { gap: 5px; }
  .top-actions .button { padding-inline: 7px; }
  .board { grid-auto-columns: min(81vw, 280px); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #search { grid-column: 1 / -1; }
  .login-panel { padding: 23px; }
}
