:root {
  color-scheme: dark;
  --bg: #0a0f1a;
  --bg-accent: #101829;
  --panel: rgba(14, 22, 38, 0.88);
  --panel-strong: rgba(19, 29, 48, 0.98);
  --panel-soft: rgba(255, 255, 255, 0.04);
  --border: rgba(161, 180, 214, 0.18);
  --border-strong: rgba(161, 180, 214, 0.29);
  --text: #eef3ff;
  --muted: #95a3bf;
  --accent: #53d3c2;
  --accent-strong: #80e8db;
  --danger: #ff7a90;
  --warning: #ffca72;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --card-width: 260px;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(83, 211, 194, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(104, 132, 255, 0.18), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, #060a12 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
  font-size: 14px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: 12px;
}

.app-frame {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: calc(100vh - 28px);
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(9, 15, 28, 0.94), rgba(5, 10, 18, 0.94));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.hero-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 300px;
}

.hero-logo {
  width: 84px;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(161, 180, 214, 0.24);
  background: rgba(10, 15, 26, 0.72);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  margin-left: 4px;
  flex: 0 0 auto;
}

.hero-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: auto;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.hero-copy p {
  margin: 2px 0 0;
  max-width: 44ch;
  font-size: 0.9rem;
  color: var(--muted);
}

.toolbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 0 1 320px;
  max-width: 340px;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border);
  border-radius: 16px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.search-input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.toolbar-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.task-composer {
  display: flex;
  align-items: end;
  gap: 6px;
  flex-wrap: wrap;
}

.button,
.ghost-button,
.danger-button,
.icon-button,
.drag-handle {
  border: 1px solid transparent;
  border-radius: 14px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, opacity 160ms ease;
}

.button:hover,
.ghost-button:hover,
.danger-button:hover,
.icon-button:hover,
.drag-handle:hover {
  transform: translateY(-1px);
}

.button {
  padding: 6px 9px;
  color: #051218;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
}

.ghost-button,
.danger-button,
.icon-button,
.drag-handle {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.danger-button {
  color: var(--danger);
}

.done-button {
  padding: 3px 6px;
  min-width: 0;
  font-size: 0.72rem;
  border: 1px solid rgba(255, 122, 144, 0.3);
  border-radius: 999px;
  color: #ffb3bf;
  background: rgba(255, 122, 144, 0.12);
}

.task-delete {
  padding: 3px 6px;
  min-width: 0;
  font-size: 0.72rem;
  border-radius: 999px;
}

.ghost-button,
.danger-button {
  padding: 4px 6px;
}

.icon-button,
.drag-handle {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 22px;
  padding-inline: 5px;
  font-size: 0.76rem;
}

.board-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
}

.columns-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
  min-height: 100%;
}

.column,
.column-drop-preview {
  width: min(236px, calc(100vw - 72px));
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
}

.column.is-over {
  border-color: rgba(83, 211, 194, 0.64);
  box-shadow: 0 0 0 1px rgba(83, 211, 194, 0.22);
}

.column.is-drop-target {
  border-color: rgba(83, 211, 194, 0.7);
  box-shadow:
    0 0 0 1px rgba(83, 211, 194, 0.25),
    0 0 24px rgba(83, 211, 194, 0.16);
}

.column.is-dragging,
.task-card.is-dragging {
  opacity: 0.35;
}

.column-overlay,
.task-overlay {
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4);
}

.column-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 2px;
  background: linear-gradient(180deg, rgba(19, 29, 48, 0.98), rgba(19, 29, 48, 0.9));
  border-bottom: 1px solid rgba(161, 180, 214, 0.14);
}

.column-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
}

.column-title {
  width: 100%;
  margin: 0;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 14px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}

.column-title:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
}

.column-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 64px;
}

.task-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025)),
    linear-gradient(135deg, rgba(83, 211, 194, 0.05), transparent 54%);
  font-size: 0.88rem;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    border-color 120ms ease,
    background 120ms ease;
}

.task-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, rgba(83, 211, 194, 0.85), rgba(104, 132, 255, 0.45));
  opacity: 0.7;
}

.task-card:nth-of-type(3n)::before {
  background: linear-gradient(180deg, rgba(255, 202, 114, 0.8), rgba(255, 122, 144, 0.42));
}

.task-card:nth-of-type(2n)::before {
  background: linear-gradient(180deg, rgba(104, 132, 255, 0.75), rgba(83, 211, 194, 0.35));
}

.task-card:hover {
  transform: translateY(-1px);
  box-shadow:
    0 7px 16px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

.task-card.is-over {
  border-color: rgba(83, 211, 194, 0.7);
  box-shadow:
    0 0 0 1px rgba(83, 211, 194, 0.26) inset,
    0 0 28px rgba(83, 211, 194, 0.16);
  transform: translateY(-1px) scale(1.01);
}

.task-card:focus-within {
  border-color: rgba(83, 211, 194, 0.46);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(83, 211, 194, 0.18) inset,
    0 0 22px rgba(83, 211, 194, 0.08);
  background:
    linear-gradient(180deg, rgba(83, 211, 194, 0.08), rgba(255, 255, 255, 0.03)),
    linear-gradient(135deg, rgba(83, 211, 194, 0.08), transparent 54%);
}

.task-card.is-done {
  border-color: rgba(83, 211, 194, 0.28);
  opacity: 0.68;
  filter: saturate(0.88);
  background:
    linear-gradient(180deg, rgba(83, 211, 194, 0.06), rgba(255, 255, 255, 0.012)),
    linear-gradient(135deg, rgba(83, 211, 194, 0.03), transparent 54%);
}

.task-card.is-highlighted {
  border-color: rgba(255, 202, 114, 0.5);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(255, 202, 114, 0.12) inset;
  background:
    linear-gradient(180deg, rgba(255, 202, 114, 0.12), rgba(255, 255, 255, 0.03)),
    linear-gradient(135deg, rgba(255, 202, 114, 0.12), transparent 54%);
}

.task-card.is-highlighted::before {
  background: linear-gradient(180deg, rgba(255, 202, 114, 0.96), rgba(255, 166, 77, 0.55));
}

.task-title-row {
  display: flex;
  align-items: center;
  gap: 3px;
}

.task-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.task-check {
  width: 14px;
  height: 14px;
  accent-color: var(--warning);
}

.task-title {
  flex: 1;
  min-width: 0;
  padding: 1px 3px;
  border: 1px solid transparent;
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: transparent;
  font-size: 0.88rem;
  line-height: 1.2;
}

.task-title:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
}

.task-card.is-done .task-title {
  color: var(--muted);
  text-decoration: line-through;
}

.task-list .task-card:nth-of-type(even) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.012)),
    linear-gradient(135deg, rgba(104, 132, 255, 0.035), transparent 54%);
}

.notes-toggle {
  align-self: flex-start;
  padding: 0;
  border: 0;
  color: var(--accent-strong);
  background: transparent;
}

.task-notes {
  width: 100%;
  min-height: 52px;
  resize: vertical;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 14px;
  outline: none;
  color: var(--text);
  background: rgba(0, 0, 0, 0.18);
  font-size: 0.84rem;
  line-height: 1.2;
}

.task-actions-row .done-button,
.task-actions-row .task-delete {
  padding: 2px 5px;
  font-size: 0.66rem;
}

.task-notes:focus {
  border-color: var(--accent);
}

.empty-state,
.empty-column {
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
}

.column-adder {
  width: min(236px, calc(100vw - 72px));
  flex: 0 0 auto;
  padding: 6px;
  border: 1px dashed var(--border-strong);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.02);
}

.column-adder h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.column-adder p {
  margin: 0 0 14px;
  color: var(--muted);
}

.column-handle-spacer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  user-select: none;
}

.task-target-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 124px;
}

.task-target-label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.task-target-select {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.drag-handle {
  cursor: grab;
  touch-action: none;
}

@supports (padding: max(0px)) {
  .app-shell {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 10px;
  }

  .app-frame {
    min-height: calc(100vh - 20px);
    padding: 12px;
    border-radius: 18px;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-main {
    min-width: 0;
  }

  .hero-logo {
    width: 74px;
  }

  .hero-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar-actions,
  .hero-actions {
    width: 100%;
  }

  .toolbar-actions > *,
  .hero-actions > * {
    flex: 1 1 auto;
  }
}

@media (max-width: 540px) {
  .hero-copy h1 {
    font-size: clamp(1.35rem, 6vw, 1.8rem);
  }

  .hero-copy p {
    font-size: 0.82rem;
  }

  .hero-logo {
    width: 84px;
  }

  .search-wrap {
    flex: 1 1 100%;
    max-width: none;
  }

  .search-input {
    min-height: 34px;
  }

  .hero-actions > *,
  .button,
  .ghost-button,
  .danger-button,
  .mini-button {
    min-height: 32px;
  }

  .hero-actions .hero-logo {
    min-height: 0;
  }

  .column,
  .column-adder,
  .column-drop-preview {
    width: min(224px, calc(100vw - 40px));
  }

  .column-title,
  .task-title {
    font-size: 0.84rem;
  }

  .task-notes {
    font-size: 0.8rem;
  }
}
