/* ── Specio AI — Paper Craft Theme ──────────────────────────── */

:root {
  /* Paper tones */
  --bg: #f5f2eb;
  --bg-surface: #faf9f6;
  --bg-elevated: #faf9f6;
  --bg-hover: #f0ece3;
  --bg-muted: #ebe5d9;

  /* Ink */
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-tertiary: #8a8580;
  --text-inverse: #faf9f6;

  /* Borders — warm */
  --border: #d8d2c8;
  --border-light: #e8e2d8;
  --border-hover: #b8b0a4;

  /* Accents */
  --accent: #c44536;
  --accent-hover: #a83828;
  --accent-subtle: rgba(196, 69, 54, 0.08);

  /* Semantic colors */
  --green: #2e7d4f;
  --green-subtle: #ecf5ef;
  --amber: #92600a;
  --amber-subtle: #fdf6e3;
  --red: #c44536;
  --red-subtle: #fef2f2;
  --blue: #2a5075;
  --blue-subtle: rgba(42, 80, 117, 0.08);
  --purple: #2a5075;
  --purple-subtle: rgba(42, 80, 117, 0.08);

  /* Typography */
  --font-display: 'Crimson Pro', Georgia, serif;
  --font-body: 'Karla', sans-serif;

  /* Spacing */
  --space-xs: 6px;
  --space-sm: 10px;
  --space-md: 14px;
  --space-lg: 20px;
  --space-xl: 28px;
  --space-2xl: 40px;
  --space-3xl: 56px;

  /* Radii */
  --radius-sm: 3px;
  --radius-md: 4px;
  --radius-lg: 4px;
  --radius-xl: 4px;

  /* Shadows — layered paper */
  --shadow-soft: rgba(0, 0, 0, 0.08);
  --shadow-medium: rgba(0, 0, 0, 0.12);
  --paper-shadow:
    0 1px 1px var(--shadow-soft),
    0 2px 2px var(--shadow-soft),
    0 4px 4px var(--shadow-soft),
    0 8px 8px var(--shadow-soft);
  --paper-shadow-lifted:
    0 2px 4px var(--shadow-soft),
    0 4px 8px var(--shadow-soft),
    0 8px 16px var(--shadow-soft),
    0 16px 32px var(--shadow-medium);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: 200ms var(--ease-out);
}

/* ── Reset ──────────────────────────────────────────────────── */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: light;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg);
  min-height: 100vh;
}

/* Paper texture overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 1000;
}

#app {
  min-height: 100vh;
}

/* ── Custom Scrollbar ───────────────────────────────────────── */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* ── Loading & Error States ─────────────────────────────────── */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  min-height: 60vh;
  color: var(--text-tertiary);
  font-size: 15px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-small {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  min-height: 60vh;
  color: var(--text-secondary);
}

.error-icon {
  width: 44px;
  height: 44px;
  border: 2px solid var(--red);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 20px;
  border-radius: var(--radius-md);
}

.error-detail {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ── Buttons ────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(196, 69, 54, 0.3);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(196, 69, 54, 0.4);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  border-color: transparent;
  color: var(--text-primary);
}

/* ── Board Header ───────────────────────────────────────────── */

.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-2xl);
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  box-shadow: 0 1px 2px var(--shadow-soft);
}

.board-header-left {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
}

.board-branding {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
}

.board-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.board-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.board-card-count {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 400;
}

/* ── Board Columns ──────────────────────────────────────────── */

.board-columns {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 65px);
  width: 100%;
  background: var(--bg);
}

.board-column {
  flex: 1 1 0%;
  min-width: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-light);
}

.board-column:last-child {
  border-right: none;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--space-md) var(--space-md) var(--space-sm);
  height: 52px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
  border-bottom: 1px solid var(--border-light);
}

.column-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.column-title {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
}

.column-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-left: auto;
}

.column-cards {
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  flex: 1;
}

.empty-column {
  font-family: var(--font-display);
  font-size: 14px;
  font-style: italic;
  color: var(--text-tertiary);
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
}

/* ── Drag and Drop ─────────────────────────────────────────── */

.column-drop-target {
  background: var(--accent-subtle);
}

.column-drop-target .column-cards {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius-md);
}

.card-dragging {
  opacity: 0.4;
}

.card-item[draggable="true"] {
  cursor: grab;
}

.card-item[draggable="true"]:active {
  cursor: grabbing;
}

/* ── Card Item ──────────────────────────────────────────────── */

.card-item {
  background: var(--bg-surface);
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-md);
  cursor: pointer;
  transition: all 0.3s;
  animation: cardFadeIn 0.25s var(--ease-out) both;
  box-shadow: var(--paper-shadow);
}

.card-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--paper-shadow-lifted);
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.card-type {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 3px 8px;
  border-radius: 3px;
}

.type-feature {
  background: var(--accent-subtle);
  color: var(--accent);
}

.type-bug {
  background: var(--red-subtle);
  color: var(--red);
}

.type-question {
  background: var(--amber-subtle);
  color: var(--amber);
}

.card-priority {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 3px;
  margin-left: auto;
}

.priority-high {
  background: var(--amber-subtle);
  color: var(--amber);
}

.priority-critical {
  background: var(--red-subtle);
  color: var(--red);
}

.card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 6px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.card-author::after {
  content: '\00b7';
  margin-left: 6px;
}

/* ── Page Header (form, detail) ─────────────────────────────── */

.page-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-2xl);
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  box-shadow: 0 1px 2px var(--shadow-soft);
}

.page-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

/* ── Card Form ──────────────────────────────────────────────── */

.card-form {
  max-width: 640px;
  margin: var(--space-2xl) auto;
  padding: 0 var(--space-2xl);
}

.form-group {
  margin-bottom: var(--space-xl);
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.3s;
  box-shadow: 0 1px 2px var(--shadow-soft);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 1px 2px var(--shadow-soft), 0 0 0 3px var(--accent-subtle);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-tertiary);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* ── Custom Select ──────────────────────────────────────────── */

.custom-select {
  position: relative;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 1px 2px var(--shadow-soft);
}

.custom-select-trigger:hover {
  border-color: var(--border-hover);
}

.custom-select.open .custom-select-trigger {
  border-color: var(--accent);
  box-shadow: 0 1px 2px var(--shadow-soft), 0 0 0 3px var(--accent-subtle);
}

.custom-select.open .custom-select-trigger svg {
  transform: rotate(180deg);
}

.custom-select-trigger svg {
  color: var(--text-tertiary);
  transition: transform 0.2s var(--ease-out);
  flex-shrink: 0;
}

.custom-select-options {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--paper-shadow-lifted);
  z-index: 10;
  overflow: hidden;
}

.custom-select.open .custom-select-options {
  display: block;
}

.custom-select-option {
  padding: 10px 16px;
  font-size: 15px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
}

.custom-select-option:hover {
  background: var(--bg-hover);
}

.custom-select-option.selected {
  color: var(--accent);
  font-weight: 600;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-light);
}

.form-error {
  margin-top: var(--space-lg);
  padding: 12px 16px;
  background: var(--red-subtle);
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  color: var(--red);
  font-size: 13px;
}

/* ── Card Detail ────────────────────────────────────────────── */

.card-detail {
  max-width: 720px;
  margin: var(--space-2xl) auto;
  padding: 0 var(--space-2xl);
}

.card-detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-sm);
}

.card-status {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border-radius: 3px;
}

.status-new { background: var(--blue-subtle); color: var(--blue); }
.status-ai_analyzing { background: var(--purple-subtle); color: var(--purple); }
.status-needs_clarification { background: var(--amber-subtle); color: var(--amber); }
.status-awaiting_confirmation { background: rgba(196, 69, 54, 0.08); color: var(--accent); }
.status-ai_failed { background: var(--red-subtle); color: var(--red); }
.status-spec_ready { background: var(--green-subtle); color: var(--green); }
.status-in_development { background: var(--blue-subtle); color: var(--blue); }
.status-done { background: var(--bg-muted); color: var(--text-tertiary); }
.status-archived { background: var(--bg-muted); color: var(--text-tertiary); }

.card-detail-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: var(--space-sm);
}

.card-detail-meta {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: var(--space-xl);
}

.card-detail-description {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-secondary);
  padding: var(--space-xl);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2xl);
  white-space: pre-wrap;
  box-shadow: var(--paper-shadow);
}

/* ── Card Actions ──────────────────────────────────────────── */

.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-light);
}

.btn-action {
  font-size: 12px;
  padding: 5px 12px;
}

.btn-danger {
  color: var(--red) !important;
}

.btn-danger:hover {
  background: var(--red-subtle) !important;
}

.btn-delete {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  background: var(--red);
  color: #fff;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(196, 69, 54, 0.3);
}

.btn-delete:hover {
  background: #a83828;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(196, 69, 54, 0.4);
}

.btn-delete:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Confirm Dialog ────────────────────────────────────────── */

.confirm-dialog {
  margin-bottom: var(--space-xl);
  animation: cardFadeIn 0.15s var(--ease-out) both;
}

.confirm-dialog-content {
  padding: var(--space-lg);
  background: var(--red-subtle);
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  box-shadow: var(--paper-shadow);
}

.confirm-dialog-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

/* ── AI Analyzing Banner ────────────────────────────────────── */

.ai-analyzing-banner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px 16px;
  background: var(--purple-subtle);
  border-left: 4px solid var(--purple);
  border-radius: var(--radius-md);
  color: var(--purple);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: var(--space-xl);
  box-shadow: var(--paper-shadow);
}

/* ── Awaiting Confirmation Banner ──────────────────────────── */

.awaiting-confirmation-banner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px 16px;
  background: var(--accent-subtle);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: var(--space-xl);
  animation: cardFadeIn 0.25s var(--ease-out) both;
  box-shadow: var(--paper-shadow);
}

/* ── AI Failed Banner ─────────────────────────────────────── */

.ai-failed-banner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px 16px;
  background: var(--red-subtle);
  border-left: 4px solid var(--red);
  border-radius: var(--radius-md);
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: var(--space-xl);
  animation: cardFadeIn 0.25s var(--ease-out) both;
  box-shadow: var(--paper-shadow);
}

.ai-failed-banner .btn {
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Spec Section ───────────────────────────────────────────── */

.spec-section {
  margin-bottom: var(--space-2xl);
  padding: var(--space-xl);
  background: var(--green-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--paper-shadow);
}

.spec-section h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--green);
  margin-bottom: var(--space-md);
}

.spec-content {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-secondary);
}

.spec-content h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.spec-content h3 {
  font-size: 14px;
  font-weight: 700;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
}

.spec-content li {
  margin-left: var(--space-xl);
  margin-bottom: var(--space-xs);
}

.spec-criterion {
  padding: var(--space-xs) 0;
}

/* ── Spec Confirmation ─────────────────────────────────────── */

.spec-confirmation {
  background: rgba(196, 69, 54, 0.06);
  border-left: 4px solid var(--accent);
}

.spec-confirmation h2 {
  color: var(--accent);
}

.spec-confirm-actions {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(196, 69, 54, 0.15);
}

.spec-confirm-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

/* ── Developer Spec ────────────────────────────────────────── */

.spec-developer {
  background: var(--blue-subtle);
  border-left: 4px solid var(--blue);
  margin-bottom: var(--space-2xl);
}

.spec-developer h2 {
  color: var(--blue);
}

.spec-developer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.spec-developer-header h2 {
  margin-bottom: 0;
}

/* ── Login ─────────────────────────────────────────────────── */

.board-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.user-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 10px;
  background: var(--bg-hover);
  border-radius: var(--radius-md);
}

.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.login-overlay.visible {
  display: flex;
}

.login-dialog {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  width: 380px;
  max-width: 90vw;
  box-shadow: var(--paper-shadow-lifted);
}

.login-branding {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.login-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.login-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.login-error {
  font-size: 13px;
  color: var(--red);
  margin-bottom: var(--space-md);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* ── Comments ───────────────────────────────────────────────── */

.comments-section {
  border-top: 1px solid var(--border);
  padding-top: var(--space-xl);
}

.comments-section h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-lg);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.comment {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  box-shadow: var(--paper-shadow);
}

.comment-ai {
  background: var(--purple-subtle);
  border-left: 4px solid var(--purple);
}

.comment-dev {
  background: var(--blue-subtle);
  border-left: 4px solid var(--blue);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.comment-author {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.comment-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 2px 8px;
  border-radius: 3px;
}

.badge-dev {
  background: var(--blue-subtle);
  color: var(--blue);
}

.badge-ai {
  background: var(--purple-subtle);
  color: var(--purple);
}

.comment-date {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-left: auto;
}

.comment-body {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

/* ── Comment Form ───────────────────────────────────────────── */

.comment-form {
  padding: var(--space-xl);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--paper-shadow);
}

.comment-form .form-group {
  margin-bottom: var(--space-md);
}

.comment-form .btn {
  margin-top: var(--space-sm);
}

.comment-form-actions {
  display: flex;
  justify-content: flex-end;
}

/* ── Attachments ─────────────────────────────────────────────── */

.attachments-section {
  margin-bottom: var(--space-2xl);
}

.attachments-section h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.attachments-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s;
  max-width: 260px;
  box-shadow: var(--paper-shadow);
}

.attachment-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--paper-shadow-lifted);
}

.attachment-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

.attachment-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--red-subtle);
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  border-radius: 3px;
  flex-shrink: 0;
}

.attachment-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.attachment-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-size {
  font-size: 11px;
  color: var(--text-tertiary);
}

.attachment-upload {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.btn-upload {
  cursor: pointer;
}

.upload-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.file-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xl) var(--space-lg);
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  transition: all 0.3s;
  cursor: pointer;
}

.file-drop-zone:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.file-drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.drop-zone-icon {
  color: var(--text-tertiary);
}

.drop-zone-text {
  font-size: 13px;
  color: var(--text-secondary);
}

.drop-zone-browse {
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
}

.drop-zone-browse:hover {
  color: var(--accent-hover);
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.file-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 2px var(--shadow-soft);
}

.file-list-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.file-list-size {
  font-size: 11px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.file-list-remove {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
  flex-shrink: 0;
  transition: color 0.3s;
}

.file-list-remove:hover {
  color: var(--red);
}

.empty-state-small {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text-tertiary);
  padding: var(--space-sm) 0;
  font-style: italic;
}

.loading-small {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ── Empty State ────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-tertiary);
  font-family: var(--font-display);
  font-size: 15px;
  font-style: italic;
}

.empty-board {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  min-height: 50vh;
  color: var(--text-tertiary);
  font-size: 15px;
}

/* ── Small Button ──────────────────────────────────────────── */

.btn-sm {
  font-size: 11px;
  padding: 4px 10px;
}

/* ── Archive Section ───────────────────────────────────────── */

.archive-section {
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  padding: var(--space-sm) var(--space-2xl);
}

.archive-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: var(--space-xs) 0;
  transition: color 0.3s;
}

.archive-toggle:hover {
  color: var(--accent);
}

.archive-toggle-icon {
  transition: transform 0.3s;
}

.archive-toggle.open .archive-toggle-icon {
  transform: rotate(180deg);
}

.archive-cards {
  padding: var(--space-sm) 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.archive-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 8px var(--space-sm);
  background: var(--bg);
  border-radius: var(--radius-sm);
  transition: all 0.3s;
  box-shadow: 0 1px 2px var(--shadow-soft);
}

.archive-card-row:hover {
  transform: translateY(-1px);
  box-shadow: var(--paper-shadow);
}

.archive-card-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  cursor: pointer;
}

.archive-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archive-card-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
}

.archive-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 768px) {
  .board-header {
    padding: var(--space-md);
  }

  .board-columns {
    flex-direction: column;
    gap: 0;
    min-height: auto;
  }

  .board-column {
    min-width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }

  .column-cards {
    padding: var(--space-xs) var(--space-sm) var(--space-md);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .card-detail {
    padding: 0 var(--space-lg);
  }

  .card-detail-title {
    font-size: 1.5rem;
  }

  .page-header {
    padding: var(--space-md);
  }

  .card-form {
    padding: 0 var(--space-lg);
  }

  .archive-section {
    padding: var(--space-sm) var(--space-md);
  }

  .board-branding {
    flex-direction: column;
    gap: 2px;
  }
}
