:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --text: #111827;
  --muted: #667085;
  --line: #e5e7eb;
  --accent: #111827;
  --accent-soft: #e5e7eb;
  --danger: #b42318;
  --shadow: 0 16px 40px rgba(17, 24, 39, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top, #fff 0, #f4f6f8 50%, #eef1f4 100%); }
.auth-card { width: min(440px, 100%); padding: 40px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--text); color: #fff; font-weight: 800; font-size: 26px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 7px; color: var(--muted); font-size: 11px; letter-spacing: .16em; font-weight: 800; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(26px, 4vw, 38px); letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-size: 19px; letter-spacing: -.02em; }
.muted { color: var(--muted); line-height: 1.6; }
.stack { display: grid; gap: 16px; margin-top: 28px; }
label { display: grid; gap: 8px; color: #344054; font-size: 13px; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid #d0d5dd; background: #fff; color: var(--text); border-radius: 12px; padding: 11px 13px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { border-color: #667085; box-shadow: 0 0 0 4px rgba(17, 24, 39, .08); }
textarea { resize: vertical; }
.button { border: 1px solid transparent; border-radius: 12px; padding: 10px 15px; font-weight: 750; transition: transform .12s, opacity .12s, background .12s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .55; transform: none; }
.button.primary { background: var(--accent); color: #fff; }
.button.ghost { background: #fff; border-color: var(--line); color: #344054; }
.danger-text { color: var(--danger) !important; }
.form-error { min-height: 20px; margin: 12px 0 0; color: var(--danger); font-size: 13px; line-height: 1.5; }
.binding-help { margin-top: 24px; padding: 16px; border-radius: 14px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; line-height: 1.55; }
.binding-help p { margin: 6px 0 0; }
code { padding: 2px 6px; border-radius: 6px; background: rgba(0,0,0,.06); }
.app-shell { width: min(1500px, 100%); margin: 0 auto; padding: 30px 28px 48px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.topbar-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.summary-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.summary-card span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.summary-card strong { font-size: 29px; letter-spacing: -.04em; }
.toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 190px auto; gap: 12px; margin-bottom: 18px; }
.search-wrap { position: relative; }
.search-wrap span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-wrap input { padding-left: 39px; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.column { min-width: 0; background: #edf0f3; border: 1px solid #e1e5e9; border-radius: 18px; padding: 12px; }
.column-heading { display: flex; align-items: center; justify-content: space-between; padding: 6px 5px 13px; }
.column-heading h2 { font-size: 15px; }
.badge { min-width: 26px; height: 26px; display: grid; place-items: center; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 800; }
.task-list { min-height: 150px; display: grid; align-content: start; gap: 10px; border-radius: 12px; }
.task-list.drag-over { outline: 2px dashed #98a2b3; outline-offset: 4px; }
.task-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 15px; box-shadow: 0 2px 8px rgba(17, 24, 39, .03); cursor: grab; }
.task-card:active { cursor: grabbing; }
.task-card.overdue { border-color: #fda29b; }
.task-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.task-title { margin: 0; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.task-actions { display: flex; gap: 3px; opacity: 0; transition: opacity .12s; }
.task-card:hover .task-actions, .task-actions:focus-within { opacity: 1; }
.icon-button { width: 31px; height: 31px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 18px; }
.icon-button:hover { background: #f2f4f7; color: var(--text); }
.task-description { margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.pill { padding: 5px 8px; border-radius: 999px; background: #f2f4f7; color: #475467; font-size: 11px; font-weight: 750; }
.pill.priority-urgent { background: #fee4e2; color: #b42318; }
.pill.priority-high { background: #fff1e6; color: #b54708; }
.pill.priority-normal { background: #eef4ff; color: #3538cd; }
.pill.priority-low { background: #ecfdf3; color: #027a48; }
.pill.due-overdue { background: #fee4e2; color: #b42318; }
.empty-state { margin: 5px; padding: 30px 12px; border: 1px dashed #cbd0d6; border-radius: 12px; color: var(--muted); text-align: center; font-size: 13px; }
.dialog { border: 0; padding: 0; background: transparent; width: min(650px, calc(100% - 24px)); max-height: calc(100vh - 28px); }
.dialog::backdrop { background: rgba(15, 23, 42, .48); backdrop-filter: blur(2px); }
.dialog-card { display: grid; gap: 16px; max-height: calc(100vh - 28px); overflow: auto; background: #fff; border-radius: 20px; padding: 24px; box-shadow: var(--shadow); }
.dialog-card.compact { width: min(460px, 100%); margin: auto; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: min(390px, calc(100% - 44px)); padding: 13px 16px; border-radius: 12px; background: #111827; color: #fff; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; z-index: 20; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #b42318; }
@media (max-width: 980px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .board { grid-template-columns: 1fr; }
  .task-actions { opacity: 1; }
}
@media (max-width: 680px) {
  .app-shell { padding: 22px 14px 36px; }
  .topbar { display: grid; }
  .topbar-actions { width: 100%; }
  .topbar-actions .button { flex: 1; }
  .toolbar { grid-template-columns: 1fr; }
  .summary-grid { gap: 9px; }
  .summary-card { padding: 15px; }
  .form-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 22px; }
}
