:root {
  color-scheme: dark;
  --bg: #04070e;
  --bg-soft: rgba(255, 255, 255, 0.04);
  --bg-card: rgba(16, 22, 35, 0.88);
  --bg-card-2: rgba(22, 29, 46, 0.9);
  --stroke: rgba(149, 169, 205, 0.18);
  --stroke-strong: rgba(111, 213, 214, 0.34);
  --text: #edf2ff;
  --muted: #92a1be;
  --muted-2: #6e7c98;
  --accent: #62e0d8;
  --accent-2: #40b7ff;
  --danger: #ff6d7f;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --board-gap: 4px;
  --column-width: 236px;
  --task-gap: 4px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 12px;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(98, 224, 216, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 171, 94, 0.12), transparent 22%),
    radial-gradient(circle at 86% 12%, rgba(64, 183, 255, 0.14), transparent 24%),
    linear-gradient(180deg, #07101d 0%, #04070e 60%, #02040a 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#app {
  min-height: 100vh;
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 7px 7px;
}

.header {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 8px 7px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(14, 18, 30, 0.96), rgba(8, 12, 20, 0.92)),
    var(--bg-card);
  box-shadow: var(--shadow);
}

.header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("./assets/header-bg.png") center/cover no-repeat;
  opacity: 0.28;
  filter: saturate(0.98) contrast(1.03);
  pointer-events: none;
}

.header::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 7, 14, 0.14), rgba(4, 7, 14, 0.26) 55%, rgba(4, 7, 14, 0.10)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.header > * {
  position: relative;
  z-index: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 5px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(98, 224, 216, 0.32), rgba(64, 183, 255, 0.18));
  border: 1px solid rgba(98, 224, 216, 0.3);
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: lowercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3.3vw, 2.35rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.brand p {
  margin: 3px 0 0;
  color: var(--muted);
  max-width: 52rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: flex-start;
  justify-content: space-between;
}

.search {
  min-width: min(100%, 320px);
  flex: 1 1 290px;
  display: grid;
  gap: 2px;
}

.search span,
.inline-select span {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
}

.search input,
.inline-select select,
.task-title,
.task-notes,
.column-title,
.event-title,
.event-date,
.move-select {
  width: 100%;
  border: 1px solid var(--stroke);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  outline: none;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.search input,
.inline-select select {
  padding: 6px 8px;
  min-height: 32px;
}

.search input:focus,
.inline-select select:focus,
.task-title:focus,
.task-notes:focus,
.column-title:focus,
.event-title:focus,
.event-date:focus,
.move-select:focus {
  border-color: rgba(98, 224, 216, 0.52);
  box-shadow: 0 0 0 4px rgba(98, 224, 216, 0.12);
  background: rgba(255, 255, 255, 0.045);
}

.control-group {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: flex-end;
}

.inline-select {
  display: grid;
  gap: 3px;
  min-width: 142px;
}

.btn,
.icon-btn {
  border: 1px solid var(--stroke);
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, opacity 120ms ease;
}

.btn:hover,
.icon-btn:hover {
  border-color: rgba(98, 224, 216, 0.34);
  transform: translateY(-1px);
}

.btn {
  min-height: 28px;
  padding: 0 8px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(180deg, rgba(98, 224, 216, 0.94), rgba(64, 183, 255, 0.72));
  color: #041018;
  border-color: rgba(98, 224, 216, 0.38);
  font-weight: 700;
}

.btn-small,
.icon-btn.small {
  min-height: 22px;
  height: 22px;
  padding-inline: 6px;
  border-radius: 9px;
  font-size: 0.8rem;
}

.icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  font-size: 0.92rem;
  line-height: 1;
}

.danger {
  color: #ffd1d8;
  border-color: rgba(255, 109, 127, 0.32);
}

.upcoming {
  display: grid;
  gap: 2px;
  padding-top: 0;
}

.upcoming.is-hidden {
  display: none;
}

.upcoming-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}

.upcoming-head h2 {
  margin: 0;
  font-size: 0.92rem;
  letter-spacing: -0.03em;
}

.upcoming-head p {
  margin: 3px 0 0;
  color: var(--muted);
}

.upcoming-tools {
  display: flex;
  gap: 2px;
  align-items: center;
  flex-wrap: wrap;
}

.toggle {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  user-select: none;
}

.toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.upcoming-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  align-items: start;
}

.event,
.task {
  position: relative;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(24, 32, 49, 0.92), rgba(18, 24, 38, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.event::after,
.task::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(98, 224, 216, 0.04), transparent 30%, rgba(255, 171, 94, 0.04));
  opacity: 0.72;
}

.event {
  position: relative;
  display: block;
  padding: 2px 34px 2px 4px;
  border-radius: 14px;
  overflow: hidden;
}

.event-completed {
  opacity: 0.78;
  background: linear-gradient(180deg, rgba(27, 35, 54, 0.86), rgba(16, 20, 30, 0.94));
  border-color: rgba(98, 224, 216, 0.14);
}

.event-date,
.event-title,
.move-select {
  min-height: 22px;
  padding: 2px 6px;
  border-radius: 999px;
}

.event-main {
  display: grid;
  grid-template-columns: 16px 46px minmax(0, 1fr);
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.event-check {
  min-width: 18px;
  justify-content: center;
  gap: 3px;
  width: 18px;
  overflow: hidden;
}

.event-date {
  width: 100%;
  text-align: center;
}

.event-title {
  min-width: 0;
  padding-left: 12px;
  padding-right: 12px;
  width: 100%;
}

.event-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  position: absolute;
  top: 4px;
  right: 6px;
  margin-left: 0;
  flex: 0 0 auto;
  opacity: 0.92;
}

.event-actions,
.task-actions,
.stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.completed-block {
  display: grid;
  gap: 4px;
  padding-top: 2px;
}

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

.board-wrap {
  flex: 1 1 auto;
  min-height: 0;
  border-radius: var(--radius-lg);
  position: relative;
}

.board-wrap::before {
  content: "";
  position: absolute;
  inset: 6px 8px auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(98, 224, 216, 0.28), rgba(255, 171, 94, 0.18), transparent);
  pointer-events: none;
  opacity: 0.55;
}

.board {
  display: flex;
  gap: var(--board-gap);
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
}

.column {
  position: relative;
  flex: 0 0 var(--column-width);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 208px;
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke);
  background:
    linear-gradient(180deg, rgba(17, 24, 40, 0.96), rgba(11, 15, 25, 0.92)),
    var(--bg-card-2);
  box-shadow: var(--shadow);
  scroll-snap-align: start;
}

.column::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(98, 224, 216, 0.06), transparent 18%);
  opacity: 0.65;
}

.column-today {
  border-color: rgba(98, 224, 216, 0.26);
}

.column-head {
  display: flex;
  gap: 4px;
  align-items: flex-start;
  justify-content: space-between;
}

.column-title-wrap {
  flex: 1 1 auto;
  display: flex;
  gap: 4px;
  align-items: center;
}

.column-drag {
  color: var(--muted-2);
  font-size: 0.78rem;
  user-select: none;
}

.column-title {
  padding: 4px 6px;
  min-height: 28px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.column-actions {
  display: inline-flex;
  gap: 3px;
}

.column-meta {
  color: var(--muted);
  font-size: 0.76rem;
}

.column-add-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-top: 1px;
}

.task-list {
  display: grid;
  gap: var(--task-gap);
  min-height: 100px;
}

.empty-state {
  padding: 8px 7px;
  border: 1px dashed rgba(146, 161, 190, 0.25);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.empty-state.subtle {
  opacity: 0.75;
}

.task {
  display: grid;
  gap: 4px;
  padding: 5px;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, opacity 140ms ease;
}

.task:hover {
  transform: translateY(-1px);
  border-color: rgba(98, 224, 216, 0.22);
}

.task-important {
  border-color: rgba(255, 150, 82, 0.5);
  background:
    linear-gradient(180deg, rgba(61, 31, 14, 0.96), rgba(27, 18, 14, 0.98)),
    linear-gradient(180deg, rgba(23, 40, 54, 0.96), rgba(15, 24, 33, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(255, 150, 82, 0.16),
    0 0 18px rgba(255, 131, 62, 0.18);
}

.task-important:hover {
  border-color: rgba(255, 167, 98, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(255, 167, 98, 0.24),
    0 0 24px rgba(255, 131, 62, 0.28);
}

.task-important .mini-toggle[title="Mark as important"] {
  color: #ffb16c;
}

.task-important .mini-toggle[title="Mark as important"] input {
  accent-color: #ff9d56;
}

.task-done {
  opacity: 0.68;
  border-color: rgba(149, 169, 205, 0.14);
  background:
    linear-gradient(180deg, rgba(12, 16, 24, 0.96), rgba(8, 11, 18, 0.98)),
    linear-gradient(180deg, rgba(24, 32, 49, 0.92), rgba(18, 24, 38, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.025),
    0 0 0 1px rgba(0, 0, 0, 0.18);
}

.task-mirror {
  border-style: dashed;
}

.task-done .task-title {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(237, 242, 255, 0.62);
  color: rgba(237, 242, 255, 0.72);
}

.task-done .task-notes {
  color: rgba(146, 161, 190, 0.78);
}

.task-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px;
  align-items: center;
}

.mini-toggle {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  color: var(--muted);
  font-size: 0.74rem;
  user-select: none;
}

.mini-toggle input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
}

.task-title {
  min-height: 29px;
  padding: 5px 7px;
  font-size: 0.88rem;
  font-weight: 600;
}

.task-notes {
  min-height: 42px;
  resize: vertical;
  padding: 6px 7px;
  line-height: 1.35;
}

.task-actions {
  justify-content: space-between;
  gap: 3px;
}

.task-actions > * {
  flex: 0 0 auto;
}

.task-badge {
  padding: 3px 6px;
  border-radius: 999px;
  color: #d4faf7;
  background: rgba(98, 224, 216, 0.1);
  border: 1px solid rgba(98, 224, 216, 0.22);
  font-size: 0.84rem;
}

.move-select {
  min-width: 82px;
  flex: 1 1 82px;
}

.stepper {
  margin-left: auto;
}

.column-footer {
  padding-top: 1px;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  padding: 0 3px;
}

.status {
  padding-top: 2px;
}

::placeholder {
  color: rgba(146, 161, 190, 0.8);
}

textarea {
  font-family: var(--font);
}

input[type="search"]::-webkit-search-cancel-button {
  filter: invert(1);
}

@media (max-width: 980px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .control-group {
    width: 100%;
  }

  .search {
    min-width: 100%;
  }
}

@media (max-width: 1040px) {
  .upcoming-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .upcoming-list {
    grid-template-columns: 1fr;
  }
}

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

  .header {
    padding: 11px 10px 10px;
  }

  .column {
    flex-basis: min(86vw, 306px);
  }

  .event {
    padding: 6px;
  }

  .event-main {
    grid-template-columns: 16px 54px minmax(0, 1fr);
  }

  .event-actions {
    justify-content: flex-end;
  }

  .task-actions {
    justify-content: flex-start;
  }

  .stepper {
    margin-left: 0;
  }
}
