:root {
  color-scheme: dark;
  --canvas: #152621;
  --bar: #111e1a;
  --panel: #1e322b;
  --card: #2a4037;
  --border: #3f554a;
  --text: #f4f5ec;
  --muted: #bbccc1;
  --accent: #e1f394;
  --ink: #1d2a15;
  font-family: "Avenir Next", Avenir, system-ui, sans-serif;
  background: var(--canvas);
  color: var(--text);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: inherit; }
button {
  min-height: 42px; border-radius: 9px; border: 1px solid transparent; padding: 0 14px;
  color: var(--text); background: transparent; font-weight: 650;
}
.bar {
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 64px); background: var(--bar); border-bottom: 1px solid #2e4138;
}
.brand { display: inline-flex; gap: 10px; align-items: center; font-weight: 750; text-decoration: none; white-space: nowrap; }
.mark {
  width: 28px; height: 28px; display: inline-grid; place-items: center; color: var(--ink);
  background: var(--accent); border-radius: 8px; font: 800 18px system-ui; flex: none;
}
.bar-actions, .heading-actions, .dialog-actions { display: flex; align-items: center; gap: 10px; }
.small-button { min-height: 35px; padding: 0 10px; color: var(--muted); font-size: .85rem; }
.small-button:hover, .secondary:hover, .close:hover { background: #32493d; color: var(--text); }
.avatar {
  background: #c8d8f1; color: #233651; min-height: 36px; width: 36px;
  border-radius: 50%; padding: 0; font-weight: 800; text-align: center;
}
#workspace {
  min-height: calc(100dvh - 64px);
  padding: clamp(23px, 4vw, 56px) 0 36px;
  background: radial-gradient(ellipse at 70% 0%, #264237 0, transparent 65%);
}
.heading, .filters, .board { padding-inline: clamp(16px, 4vw, 64px); }
.heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 26px; }
h1 { margin: 0; letter-spacing: -.05em; font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1.05; }
.heading p, .auth p, dialog p { color: var(--muted); line-height: 1.55; }
.heading p { margin: 10px 0 0; }
.primary { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.primary:hover { background: #f0ffb3; }
.secondary { border-color: var(--border); background: #1b2d26; }
.heading-actions { flex-wrap: wrap; }
.heading-actions .primary span { padding-right: 3px; font-size: 1.2em; }
.filters { display: flex; gap: 6px; margin-bottom: 16px; }
.filters button { min-height: 36px; color: var(--muted); font-size: .91rem; }
.filters button:hover { color: var(--text); background: #283e34; }
.filters button[aria-pressed=true] { color: var(--accent); background: #304736; border-color: #4a6246; }
.board {
  display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 14px;
  align-items: start; overflow-x: auto; padding-bottom: 14px; scroll-snap-type: x proximity;
  scroll-padding-inline: clamp(16px, 4vw, 64px);
}
.column {
  background: var(--panel); border: 1px solid #3a5146; border-radius: 15px;
  padding: 12px; min-width: 0; scroll-snap-align: start;
}
.column.target { outline: 2px dashed var(--accent); outline-offset: -4px; }
.column-header { display: flex; align-items: center; gap: 9px; min-height: 31px; margin: 1px 3px 12px; }
.column-header h2 { margin: 0; font-size: 1.02rem; }
.column-dot { width: 8px; height: 8px; border-radius: 50%; background: #b3c4bc; }
.column[data-status=working] .column-dot { background: #ffcf86; }
.column[data-status=done] .column-dot { background: #c2eb8e; }
.count { margin-left: auto; color: var(--muted); font-size: .82rem; background: #2b4237; border-radius: 12px; padding: 2px 8px; }
.cards { display: grid; gap: 9px; }
.card {
  width: 100%; min-width: 0; padding: 14px 13px 12px; text-align: left; background: var(--card);
  border: 1px solid #445c4e; border-radius: 10px; box-shadow: 0 2px 0 #12221a66;
}
.card:hover { border-color: #829f88; background: #324b3e; }
.card[draggable=true] { cursor: grab; }
.card[draggable=true]:active { cursor: grabbing; }
.card-title { display: block; margin: 9px 0 11px; font-size: 1rem; line-height: 1.38; overflow-wrap: anywhere; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .79rem; }
.person { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.person > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-initial {
  display: inline-grid; place-items: center; width: 23px; height: 23px; border-radius: 50%;
  background: #4a6456; color: #f0f5e9; flex: none; font-size: .71rem;
}
.due { flex: none; }
.overdue { color: #ffbcae; }
.priority {
  display: inline-flex; border-radius: 5px; padding: 3px 7px; line-height: 1.2;
  width: fit-content; font-size: .72rem; font-weight: 780;
}
.high { background: #ffb6a8; color: #551e17; }
.medium { background: #ffdb9c; color: #492d0d; }
.low { background: #badbe8; color: #193c4b; }
.empty { margin: 3px 0; border: 1px dashed #445b50; border-radius: 9px; text-align: center; color: var(--muted); padding: 20px 8px; font-size: .88rem; }
.add { width: 100%; margin-top: 6px; text-align: left; padding: 0 8px; color: var(--muted); min-height: 36px; font-size: .88rem; }
.add:hover { background: #2f473b; color: var(--text); }
.auth { padding: 8vh 16px 30px; display: grid; place-items: start center; }
.auth-card, dialog {
  width: min(100%, 490px); padding: clamp(20px, 5vw, 34px);
  background: #20342b; border: 1px solid var(--border); border-radius: 18px;
}
.auth-card h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.auth-mark { width: 44px; height: 44px; font-size: 26px; margin-bottom: 18px; }
form { display: grid; gap: 13px; margin-top: 20px; }
label { display: block; font-size: .91rem; font-weight: 680; }
input, select, textarea {
  width: 100%; padding: 9px 11px; margin-top: 5px; min-height: 43px; border-radius: 8px;
  color: var(--text); background: #152720; border: 1px solid #50695b; font-size: 1rem;
}
textarea { display: block; resize: vertical; }
.optional { color: var(--muted); font-weight: 450; }
.form-error { margin: 0; color: #ffb6a8 !important; font-size: .9rem; }
dialog { color: var(--text); max-width: calc(100% - 22px); max-height: calc(100dvh - 24px); overflow: auto; }
dialog::backdrop { background: #0a1410bd; }
dialog h2 { margin: 0; font-size: 1.55rem; letter-spacing: -.035em; line-height: 1.2; overflow-wrap: anywhere; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.close { min-height: 34px; width: 34px; padding: 0; font-size: 1.45rem; }
.dialog-actions { justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.danger { color: #ffb6a8; }
.danger:hover { color: #ffd2c9; }
.danger-confirm { background: #ffb6a8; color: #551e17; }
.danger-confirm:hover { background: #ffd2c9; }
.delete-warning { flex-basis: 100%; margin: 0; }
.description { white-space: pre-wrap; overflow-wrap: anywhere; }
dl { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: 8px 12px; font-size: .93rem; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.callout { background: var(--canvas); padding: 10px 12px; border-radius: 8px; font-size: .9rem; }
.toast {
  position: fixed; z-index: 2; inset: auto 14px max(14px, env(safe-area-inset-bottom)) auto;
  max-width: min(400px, calc(100vw - 28px)); background: var(--text); color: var(--canvas);
  padding: 12px 15px; border-radius: 9px; font-weight: 620; box-shadow: 0 6px 25px #101a1577;
}
@media (max-width: 590px) {
  .bar { height: 56px; padding-inline: 13px; }
  .brand { font-size: .94rem; gap: 7px; }
  .bar-actions { gap: 3px; }
  .small-button { font-size: .75rem; padding-inline: 5px; }
  #workspace { min-height: calc(100dvh - 56px); }
  .heading { align-items: start; flex-direction: column; gap: 14px; margin-bottom: 18px; }
  .heading-actions { flex-direction: row-reverse; justify-content: flex-end; }
  .board { grid-template-columns: repeat(3, 84vw); gap: 12px; }
}
