:root {
  --ink: #20283a;
  --muted: #747b8a;
  --paper: #fffdfa;
  --canvas: #f4f1ea;
  --line: #dedbd3;
  --yellow: #ffd65a;
  --blue: #7cccf3;
  --green: #8ad7a8;
  --purple: #b9a1ff;
  --pink: #ff9eb5;
  --red: #df4665;
  --shadow: 0 12px 34px rgba(32, 40, 58, .09);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(78, 149, 245, .28); outline-offset: 2px; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px clamp(18px, 3vw, 40px); border-bottom: 1px solid var(--line); background: rgba(255, 253, 250, .94); backdrop-filter: blur(16px); }
.brand-block { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; background: var(--ink); color: white; font-weight: 900; font-size: 19px; box-shadow: 3px 3px 0 var(--yellow); }
.brand-block h1 { margin: 0; font-size: 20px; line-height: 1.15; letter-spacing: -.025em; }
.brand-block p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: stretch; gap: 9px; }

.sprint-picker { min-width: 156px; display: flex; flex-direction: column; justify-content: center; padding: 6px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.sprint-picker span, .capacity-label { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.sprint-picker select { max-width: 145px; padding: 2px 18px 1px 0; border: 0; background: transparent; font-size: 13px; font-weight: 800; outline: 0; }
.capacity-button { min-width: 128px; display: grid; grid-template-columns: 1fr auto; align-content: center; gap: 3px 8px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; }
.capacity-button strong { font-size: 12px; }
.capacity-track { grid-column: 1 / -1; height: 5px; overflow: hidden; border-radius: 99px; background: #ece9e2; }
.capacity-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--blue); transition: width .25s ease, background .25s ease; }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 14px; border: 1px solid transparent; border-radius: 12px; background: #fff; font-size: 13px; font-weight: 800; transition: transform .12s ease, background .12s ease, border-color .12s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--ink); color: white; box-shadow: 0 6px 16px rgba(32, 40, 58, .15); }
.button.secondary { border-color: var(--line); }
.button.quiet { min-height: 36px; border-color: var(--line); background: #fff; }
.button.danger { margin-right: auto; border-color: #f0b2bf; background: #fff5f7; color: #bd2547; }
.button.accept { width: 100%; margin-top: 13px; background: var(--green); color: #183f28; }
.button.accept:disabled { background: #ecebe7; color: #96999e; cursor: not-allowed; transform: none; }

.member-switcher { position: relative; }
.member-button { height: 100%; min-width: 134px; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; }
.member-avatar, .comment-avatar { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: #f1eee7; }
.member-button span:nth-child(2) { display: flex; flex: 1; flex-direction: column; }
.member-button small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.member-button strong { font-size: 12px; }
.member-menu { position: absolute; top: calc(100% + 7px); right: 0; z-index: 40; width: 210px; padding: 7px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.member-menu button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.member-menu button:hover { background: #f5f3ee; }
.member-menu button span { font-size: 23px; }
.member-menu button strong, .member-menu button small { display: block; }
.member-menu button small { margin-top: 2px; color: var(--muted); font-size: 11px; }

.sprint-strip { display: flex; align-items: center; gap: 10px; padding: 13px clamp(18px, 3vw, 40px); border-bottom: 1px solid var(--line); background: #faf8f3; }
.metric { display: flex; align-items: center; gap: 9px; min-width: 150px; padding-right: 18px; border-right: 1px solid var(--line); }
.metric-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; font-weight: 900; }
.metric-icon.amber { background: #fff1b9; }
.metric-icon.blue { background: #d9f2fd; }
.metric-icon.green { background: #d7f4e1; }
.metric strong, .metric small { display: block; }
.metric strong { font-size: 12px; }
.metric small { margin-top: 1px; color: var(--muted); font-size: 10px; }
.sync-state { display: flex; align-items: center; gap: 7px; margin-left: auto; color: var(--muted); font-size: 11px; }
.sync-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(138, 215, 168, .2); }

main { padding: 22px clamp(18px, 3vw, 40px) 40px; }
.history-note { display: flex; align-items: center; gap: 13px; margin-bottom: 14px; padding: 11px 14px; border: 1px solid #d6c9f8; border-radius: 12px; background: #f4efff; }
.history-note span { padding: 4px 8px; border-radius: 99px; background: var(--purple); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.history-note p { margin: 0; color: #645c78; font-size: 12px; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(275px, 1fr); gap: 14px; align-items: start; overflow-x: auto; padding: 2px 2px 18px; scroll-snap-type: x proximity; }
.lane { min-width: 0; min-height: 540px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 253, 250, .72); scroll-snap-align: start; transition: background .15s ease, border-color .15s ease; }
.lane.drag-over { border-color: var(--lane-color); background: color-mix(in srgb, var(--lane-color) 12%, white); }
.lane.add-lane { min-height: 120px; display: grid; place-items: center; border-style: dashed; background: transparent; }
.add-lane-button { width: 100%; min-height: 92px; border: 0; border-radius: 14px; background: transparent; color: var(--muted); font-weight: 800; }
.add-lane-button:hover { background: rgba(255,255,255,.7); color: var(--ink); }
.lane-header { display: flex; align-items: center; gap: 9px; padding: 3px 2px 13px; }
.lane-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--lane-color); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lane-color) 20%, transparent); }
.lane-header h2 { margin: 0; font-size: 14px; letter-spacing: -.01em; }
.lane-header .lane-stats { display: flex; align-items: center; gap: 5px; margin-left: auto; color: var(--muted); font-size: 10px; font-weight: 800; }
.lane-header .count { min-width: 24px; padding: 3px 7px; border-radius: 99px; background: #ece9e2; text-align: center; }
.lane-cards { min-height: 410px; display: flex; flex-direction: column; gap: 9px; }
.empty-lane { display: grid; place-items: center; min-height: 110px; padding: 18px; border: 1px dashed #d7d4cd; border-radius: 13px; color: #9b9ca1; text-align: center; font-size: 11px; line-height: 1.5; }
.lane-add-task { width: 100%; min-height: 39px; margin-top: 10px; border: 1px dashed #cbc8c0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 800; }
.lane-add-task:hover { border-style: solid; background: #fff; color: var(--ink); }

.task-card { padding: 13px; border: 1px solid #d9d6cf; border-left: 4px solid var(--lane-color); border-radius: 14px; background: #fff; box-shadow: 0 4px 13px rgba(32, 40, 58, .055); cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.task-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(32, 40, 58, .09); }
.task-card.dragging { opacity: .45; transform: rotate(1deg); }
.task-card-top { display: flex; align-items: flex-start; gap: 9px; }
.task-card-emoji { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: #f5f2eb; font-size: 17px; }
.task-card h3 { margin: 1px 0 0; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.task-card .purpose { margin: 8px 0 0; display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.task-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; border-radius: 7px; background: #f1efe9; color: #5d6370; font-size: 9px; font-weight: 850; }
.tag.points { background: #eaf6fc; color: #246782; }
.tag.dod.complete { background: #e0f5e7; color: #287144; }
.task-card-footer { display: flex; align-items: center; margin-top: 11px; padding-top: 9px; border-top: 1px solid #efede8; color: var(--muted); font-size: 10px; }
.assignee-chip { display: flex; align-items: center; gap: 5px; }
.assignee-chip span { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 7px; background: #f1eee7; font-size: 12px; }
.comment-badge { margin-left: auto; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(21, 27, 39, .24); backdrop-filter: blur(2px); }
.task-drawer { position: fixed; top: 0; right: 0; z-index: 80; width: min(520px, 100%); height: 100dvh; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--paper); box-shadow: -18px 0 50px rgba(32, 40, 58, .14); transform: translateX(102%); transition: transform .23s ease; }
.task-drawer.open { transform: translateX(0); }
.drawer-header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.icon-button { width: 35px; height: 35px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 20px; }
.drawer-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.drawer-heading > span { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; background: #f1eee7; font-size: 20px; }
.drawer-heading small { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.drawer-heading h2 { margin: 2px 0 0; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.drawer-body { min-height: 0; overflow-y: auto; padding: 22px; }
.task-summary { padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: #faf8f4; }
.task-summary span, .eyebrow { color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.task-summary p { margin: 7px 0 0; font-size: 13px; line-height: 1.55; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.drawer-section { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.section-heading h3 { margin: 3px 0 0; font-size: 15px; }
.section-heading > strong { min-width: 34px; padding: 4px 7px; border-radius: 8px; background: #f1efe9; font-size: 10px; text-align: center; }
.criteria-list { display: flex; flex-direction: column; gap: 7px; }
.criterion { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid #e2dfd8; border-radius: 11px; background: #fff; font-size: 12px; line-height: 1.4; }
.criterion input { width: 17px; height: 17px; margin: 0; accent-color: #45a56c; }
.criterion.done span { color: #80848c; text-decoration: line-through; }
.accept-hint { margin: 8px 2px 0; color: var(--muted); font-size: 10px; text-align: center; }
.comment-list { display: flex; flex-direction: column; gap: 10px; }
.comment { display: grid; grid-template-columns: 31px 1fr; gap: 8px; }
.comment > span { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; background: #f1eee7; }
.comment-bubble { padding: 9px 11px; border-radius: 4px 12px 12px 12px; background: #f1efe9; }
.comment-bubble header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.comment-bubble strong { font-size: 11px; }
.comment-bubble time { color: var(--muted); font-size: 9px; }
.comment-bubble p { margin: 5px 0 0; font-size: 12px; line-height: 1.45; white-space: pre-wrap; }
.no-comments { padding: 17px; border-radius: 12px; background: #f6f4ef; color: var(--muted); font-size: 11px; text-align: center; }
.comment-form { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 8px; margin-top: 13px; }
.comment-form textarea { min-height: 48px; max-height: 130px; resize: vertical; }
.comment-form button { width: 42px; height: 42px; border: 0; border-radius: 11px; background: var(--ink); color: white; }

dialog { width: min(620px, calc(100% - 28px)); max-height: calc(100dvh - 28px); padding: 0; overflow: visible; border: 0; border-radius: 20px; background: transparent; color: var(--ink); }
dialog::backdrop { background: rgba(21, 27, 39, .32); backdrop-filter: blur(4px); }
.dialog-card { max-height: calc(100dvh - 28px); overflow-y: auto; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: 0 28px 80px rgba(21, 27, 39, .24); }
.dialog-card.compact { width: min(430px, 100%); margin: auto; }
.dialog-card > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.dialog-card h2 { margin: 4px 0 0; font-size: 22px; letter-spacing: -.025em; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.form-grid .wide { grid-column: 1 / -1; }
label > span { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 850; }
label > span small { color: var(--muted); font-weight: 600; }
input, textarea, select { width: 100%; padding: 10px 11px; border: 1px solid #cbc8c0; border-radius: 10px; background: #fff; outline: 0; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, textarea:focus, select:focus { border-color: #5f8fc0; box-shadow: 0 0 0 3px rgba(124, 204, 243, .18); }
.dialog-card > label { display: block; margin-top: 12px; }
.dialog-copy { margin: -4px 0 16px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.dialog-card > footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.task-form:not(.editing) #deleteTaskButton { display: none; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 120; padding: 11px 16px; border-radius: 11px; background: var(--ink); color: #fff; box-shadow: var(--shadow); font-size: 12px; font-weight: 750; opacity: 0; transform: translate(-50%, 18px); transition: .18s ease; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1100px) {
  .brand-block p, .capacity-label, .button.secondary { display: none; }
  .capacity-button { min-width: 106px; }
  .topbar { align-items: flex-start; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-width: 760px) {
  .topbar { position: static; display: block; padding: 14px; }
  .top-actions { display: grid; grid-template-columns: 1fr 1fr; margin-top: 13px; }
  .sprint-picker, .capacity-button, .member-switcher, .member-button { width: 100%; min-width: 0; }
  .button.primary { grid-column: 1 / -1; }
  .member-menu { left: 0; right: auto; }
  .sprint-strip { overflow-x: auto; padding-inline: 14px; }
  .metric { min-width: 145px; }
  .sync-state { display: none; }
  main { padding-inline: 14px; }
  .board { grid-auto-columns: minmax(278px, 87vw); }
  .task-drawer { width: 100%; }
  .drawer-header { grid-template-columns: auto 1fr; }
  .drawer-header .button { grid-column: 1 / -1; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
}

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