:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-muted: #eef2f7;
  --surface-hover: #e8eef8;
  --ink: #202936;
  --muted: #66758a;
  --line: #dce4ef;
  --line-strong: #c7d2e1;
  --accent: #2f63d7;
  --accent-strong: #244ca6;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --idea: #5d6df6;
  --exploring: #ca7a1c;
  --building: #0a8f9b;
  --shipped: #228a55;
  --shadow: 0 16px 48px rgba(31, 44, 67, 0.16);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0) 220px),
    var(--bg);
  color: var(--ink);
  font-family:
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(47, 99, 215, 0.26);
  outline-offset: 2px;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  min-height: 66px;
  padding: 12px 22px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1 {
  font-size: 18px;
  line-height: 1.1;
  margin: 0;
}

.topbar p {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 0;
}

.topbar .button {
  margin-left: auto;
}

.topbar-actions {
  align-items: center;
  display: flex;
  gap: 9px;
  margin-left: auto;
}

.topbar-actions .button {
  margin-left: 0;
}

.session-user {
  color: var(--muted);
  font-size: 12.5px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  display: inline-flex;
  gap: 7px;
  min-height: 36px;
  padding: 7px 13px;
  text-decoration: none;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.button:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.button-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.button-danger {
  background: var(--danger-soft);
  border-color: #f4b7b2;
  color: var(--danger);
}

.button-danger:hover {
  background: #ffe4e1;
  border-color: var(--danger);
}

.icon-button {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  display: inline-flex;
  height: 32px;
  justify-content: center;
  padding: 0;
  width: 32px;
}

.icon-button:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.board-shell {
  padding: 18px 22px 28px;
}

.board {
  align-items: flex-start;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(236px, 1fr));
  min-height: calc(100vh - 112px);
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 8px;
  width: 100%;
}

.column {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 200px;
  padding: 10px;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.column.is-drag-over {
  background: #e6edfb;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.column-header {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 8px;
  letter-spacing: 0;
  margin: 2px 2px 10px;
  min-height: 26px;
}

.column-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.column-dot {
  border-radius: 50%;
  flex: 0 0 auto;
  height: 9px;
  width: 9px;
}

.column-count {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  line-height: 20px;
  margin-left: auto;
  min-width: 24px;
  padding: 0 8px;
  text-align: center;
}

.column-cards {
  display: grid;
  gap: 9px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(20, 30, 50, 0.04);
  color: inherit;
  cursor: grab;
  display: grid;
  gap: 8px;
  padding: 11px 12px;
  text-align: left;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    opacity 140ms ease,
    transform 140ms ease;
  width: 100%;
}

.card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 10px 28px rgba(31, 44, 67, 0.1);
  transform: translateY(-1px);
}

.card:active {
  cursor: grabbing;
}

.card.is-dragging {
  opacity: 0.42;
}

.card-title {
  font-weight: 760;
}

.card-about {
  color: var(--muted);
  font-size: 12.5px;
  margin: 0;
  white-space: pre-wrap;
}

.card-footer {
  align-items: center;
  display: flex;
  gap: 8px;
  min-height: 22px;
}

.chip {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #4d5b70;
  display: inline-block;
  font-size: 11px;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 2px 7px;
}

.empty-column {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: #8b9aae;
  font-size: 12.5px;
  padding: 16px 10px;
  text-align: center;
}

.status-message {
  color: var(--muted);
  font-size: 12.5px;
  margin: 12px 0 0;
}

.status-message.is-error {
  color: var(--danger);
}

.login-page {
  min-height: 100vh;
}

.login-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 22px;
}

.login-panel {
  animation: dialog-enter 160ms ease-out;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
  width: min(410px, 100%);
}

.login-mark {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}

.login-mark span {
  border-radius: 999px;
  display: block;
  height: 32px;
  width: 10px;
}

.login-mark span:nth-child(1) {
  background: var(--idea);
}

.login-mark span:nth-child(2) {
  background: var(--exploring);
}

.login-mark span:nth-child(3) {
  background: var(--building);
}

.login-panel h1 {
  font-size: 22px;
  line-height: 1.15;
  margin: 0;
}

.login-copy {
  color: var(--muted);
  margin: 8px 0 18px;
}

.google-button {
  justify-content: center;
  width: 100%;
}

.login-error {
  background: var(--danger-soft);
  border: 1px solid #f4b7b2;
  border-radius: 8px;
  color: var(--danger);
  margin: 0 0 14px;
  padding: 10px 12px;
}

.login-note {
  color: var(--muted);
  font-size: 12.5px;
  margin: 14px 0 0;
  text-align: center;
}

.dialog-backdrop {
  align-items: center;
  background: rgba(28, 39, 55, 0.46);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 20;
}

.dialog-backdrop[hidden] {
  display: none;
}

.dialog {
  animation: dialog-enter 160ms ease-out;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  padding: 18px;
  width: min(470px, 100%);
}

.dialog-header {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.dialog h2 {
  font-size: 17px;
  line-height: 1.2;
  margin: 0;
}

.dialog-header .icon-button {
  margin-left: auto;
}

.dialog label {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 12px 0 5px;
  text-transform: uppercase;
}

.dialog input,
.dialog select,
.dialog textarea {
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  display: block;
  min-height: 38px;
  padding: 9px 10px;
  width: 100%;
}

.dialog textarea {
  min-height: 92px;
  resize: vertical;
}

.dialog-actions {
  align-items: center;
  display: flex;
  gap: 9px;
  margin-top: 18px;
}

.dialog-spacer {
  flex: 1;
}

@keyframes dialog-enter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
  }

  .topbar .button {
    width: 100%;
    justify-content: center;
  }

  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
    margin-left: 0;
    width: 100%;
  }

  .session-user {
    max-width: 100%;
  }

  .board-shell {
    padding: 14px;
  }

  .board {
    display: flex;
    min-height: calc(100vh - 156px);
  }

  .column {
    flex: 0 0 min(248px, 86vw);
  }

  .dialog-actions {
    flex-wrap: wrap;
  }

  .dialog-actions .button {
    justify-content: center;
  }

  .dialog-spacer {
    flex-basis: 100%;
    height: 0;
  }

  #delete-card-button {
    margin-right: auto;
  }
}
