:root {
  color-scheme: dark;
  --acid: #b6ff00;
  --acid-soft: rgba(182, 255, 0, .12);
  --bg: #070807;
  --panel: rgba(19, 20, 18, .94);
  --panel-2: #181a17;
  --line: rgba(255, 255, 255, .1);
  --text: #f5f6f1;
  --muted: #9ea097;
  --danger: #ff6474;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--text); background: radial-gradient(circle at 12% 0%, rgba(182,255,0,.075), transparent 30rem), var(--bg); }
button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }

.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, #000, transparent 82%); }
.brand { margin: 0; color: var(--acid); font-size: clamp(1.8rem, 6vw, 3.3rem); font-weight: 1000; letter-spacing: -.07em; line-height: .85; text-decoration: none; }
.brand.compact { display: inline-block; margin-bottom: 18px; font-size: 1.35rem; letter-spacing: -.045em; }
.eyebrow { margin: 0 0 10px; color: var(--acid); font-size: .72rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(2rem, 4vw, 4rem); letter-spacing: -.055em; line-height: .95; }

.login-shell { display: grid; min-height: 100vh; padding: 24px; place-items: center; }
.login-card { width: min(100%, 470px); padding: clamp(28px, 6vw, 50px); border: 1px solid var(--line); border-radius: 25px; background: var(--panel); box-shadow: 0 30px 90px rgba(0,0,0,.5); }
.login-card .eyebrow { margin-top: 34px; }
.login-card h1 { font-size: clamp(2.3rem, 8vw, 3.6rem); }
.intro { margin: 18px 0 28px; color: var(--muted); line-height: 1.55; }
.login-form { display: grid; gap: 9px; }
label { color: #c8cac3; font-size: .75rem; font-weight: 850; letter-spacing: .075em; text-transform: uppercase; }
input, textarea, select { width: 100%; color: var(--text); border: 1px solid rgba(255,255,255,.14); border-radius: 11px; outline: none; background: #0d0e0c; transition: border-color .2s, box-shadow .2s; }
input, select { min-height: 48px; padding: 0 14px; }
textarea { min-height: 120px; padding: 13px 14px; line-height: 1.5; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--acid); box-shadow: 0 0 0 3px rgba(182,255,0,.1); }
.login-form label:not(:first-child) { margin-top: 8px; }
.primary-button, .ghost-button, .icon-button, .mini-button { border: 0; border-radius: 10px; font-weight: 850; }
.primary-button { min-height: 45px; padding: 0 18px; color: #080a06; background: var(--acid); box-shadow: 0 10px 30px rgba(182,255,0,.12); }
.primary-button:hover { filter: brightness(1.08); }
.primary-button:disabled { cursor: wait; opacity: .55; }
.login-form .primary-button { margin-top: 18px; }
.ghost-button { min-height: 42px; padding: 0 16px; color: var(--text); border: 1px solid var(--line); background: rgba(255,255,255,.035); }
.ghost-button:hover { border-color: rgba(182,255,0,.5); }
.back-link { display: inline-block; margin-top: 24px; color: var(--muted); font-size: .86rem; text-decoration: none; }
.back-link:hover { color: var(--acid); }
.notice { margin: 0 0 17px; padding: 12px 14px; border-radius: 10px; font-size: .88rem; }
.notice.error { color: #ffb1ba; border: 1px solid rgba(255,100,116,.3); background: rgba(255,100,116,.08); }

.app-shell { width: min(100% - 34px, 1720px); margin: 0 auto; padding: 26px 0 50px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 10px 4px 26px; border-bottom: 1px solid var(--line); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-actions form { margin: 0; }
.current-user { margin-right: 8px; color: var(--muted); font-size: .83rem; }

.board { display: grid; grid-template-columns: repeat(4, minmax(260px, 1fr)); align-items: start; gap: 15px; margin-top: 24px; overflow-x: auto; padding: 0 2px 18px; }
.column { min-height: calc(100vh - 195px); padding: 14px; border: 1px solid var(--line); border-radius: 17px; background: rgba(15,16,14,.83); }
.column > header { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; min-height: 44px; padding: 3px 5px 13px; }
.column h2 { margin: 0; font-size: .95rem; letter-spacing: -.015em; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; }
.status-dot.todo { background: #8f9489; }
.status-dot.issues { background: #ff5266; box-shadow: 0 0 12px rgba(255,82,102,.45); }
.status-dot.doing { background: #ffcd37; }
.status-dot.done { background: var(--acid); box-shadow: 0 0 12px rgba(182,255,0,.35); }
.task-count { display: grid; min-width: 27px; height: 27px; padding: 0 7px; place-items: center; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; font-size: .75rem; font-weight: 850; }
.task-list { display: grid; align-content: start; gap: 11px; min-height: calc(100vh - 270px); padding: 2px; border-radius: 12px; transition: background .18s, box-shadow .18s; }
.task-list.drag-over { background: var(--acid-soft); box-shadow: inset 0 0 0 1px rgba(182,255,0,.42); }
.empty-column { margin: 0; padding: 30px 12px; color: #666a62; border: 1px dashed rgba(255,255,255,.09); border-radius: 11px; font-size: .78rem; text-align: center; }

.task-card { position: relative; overflow: hidden; padding: 16px 15px 13px; border: 1px solid rgba(255,255,255,.105); border-radius: 13px; background: var(--panel-2); box-shadow: 0 10px 24px rgba(0,0,0,.18); cursor: grab; transition: transform .16s, opacity .16s, border-color .16s; }
.task-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--task-color) 55%, transparent); }
.task-card.dragging { opacity: .42; transform: rotate(2deg) scale(.98); }
.task-accent { position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--task-color); box-shadow: 0 0 17px color-mix(in srgb, var(--task-color) 45%, transparent); }
.task-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.task-heading h3 { margin: 1px 0 0; overflow-wrap: anywhere; font-size: .98rem; line-height: 1.28; }
.task-actions { display: flex; gap: 3px; opacity: 0; transition: opacity .16s; }
.task-card:hover .task-actions, .task-actions:focus-within { opacity: 1; }
.mini-button { padding: 5px 6px; color: var(--muted); background: transparent; font-size: .68rem; }
.mini-button:hover { color: var(--acid); background: rgba(255,255,255,.05); }
.mini-button.danger:hover { color: #ff9ca7; }
.task-description { margin: 12px 0 14px; overflow-wrap: anywhere; color: #b0b3aa; font-size: .82rem; line-height: 1.45; white-space: pre-wrap; }
.task-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 11px; border-top: 1px solid rgba(255,255,255,.07); }
.task-footer time { flex: 0 0 auto; color: #74776f; font-size: .65rem; }
.status-select { width: auto; min-width: 0; min-height: 30px; padding: 0 25px 0 8px; color: #afb2aa; border-radius: 7px; font-size: .7rem; }

.task-dialog { width: min(calc(100% - 30px), 600px); padding: 0; color: var(--text); border: 1px solid rgba(255,255,255,.15); border-radius: 20px; background: #151714; box-shadow: 0 35px 110px rgba(0,0,0,.75); }
.task-dialog::backdrop { background: rgba(0,0,0,.74); backdrop-filter: blur(6px); }
.task-dialog form { display: grid; gap: 10px; padding: clamp(22px, 5vw, 34px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 9px; }
.dialog-heading h2 { margin: 0; font-size: 1.85rem; letter-spacing: -.045em; }
.icon-button { width: 38px; height: 38px; color: var(--muted); background: rgba(255,255,255,.05); font-size: 1.45rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 3px; }
.form-row > div { display: grid; gap: 9px; }
.color-picker { display: flex; align-items: center; min-height: 48px; padding: 5px 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 11px; background: #0d0e0c; }
.color-picker input { width: 56px; min-height: 35px; height: 35px; padding: 2px; border: 0; background: transparent; }
.color-picker output { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .8rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 14px; }

.toast { position: fixed; z-index: 20; right: 22px; bottom: 22px; max-width: min(390px, calc(100% - 44px)); padding: 13px 17px; color: #0a0c08; border-radius: 10px; background: var(--acid); box-shadow: 0 18px 50px rgba(0,0,0,.45); font-size: .86rem; font-weight: 800; opacity: 0; pointer-events: none; transform: translateY(15px); transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { color: white; background: #d83247; }

@media (max-width: 1120px) {
  .board { grid-template-columns: repeat(4, minmax(285px, 1fr)); }
}

@media (max-width: 720px) {
  .app-shell { width: min(100% - 20px, 1720px); padding-top: 14px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-actions { width: 100%; flex-wrap: wrap; }
  .current-user { width: 100%; }
  .topbar-actions .primary-button { flex: 1; }
  .board { margin-top: 16px; scroll-snap-type: x mandatory; }
  .column { min-height: calc(100vh - 230px); scroll-snap-align: start; }
  .task-actions { opacity: 1; }
  .form-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
