:root {
  --navy: #122033;
  --ink: #1b2838;
  --muted: #5b6b7c;
  --line: #d7deea;
  --paper: #f4f6fa;
  --card: #ffffff;
  --attend: #0f766e;
  --attend-soft: #e7f6f3;
  --skip: #6b7280;
  --skip-soft: #eef0f3;
  --warn: #b45309;
  --warn-soft: #fff4e5;
  --alert: #b42318;
  --alert-soft: #fde8e6;
  --vip: #c9a227;
  --vip-soft: #fff8e8;
  --shadow: 0 8px 24px rgba(18, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
}

body {
  padding: 24px 16px 48px;
}

.app-shell {
  max-width: 1180px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  letter-spacing: 0.16em;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
}

.executive-line {
  margin: 8px 0 0;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

button,
.file-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

button:hover,
.file-btn:hover {
  border-color: #b8c3d4;
}

.done-btn {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  padding: 12px 22px;
  font-size: 16px;
}

.done-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.file-btn input {
  display: none;
}

.banner {
  display: none;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--warn-soft);
  color: #7c2d12;
  border: 1px solid #f3d2a4;
}

.banner.visible {
  display: block;
}

.banner.error {
  background: var(--alert-soft);
  color: #7a271a;
  border-color: #f3c4bf;
}

.banner.success {
  background: var(--attend-soft);
  color: #115e59;
  border-color: #b7e0d8;
}

.columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.column.needs-decision {
  margin-bottom: 16px;
  border-color: #f0c48a;
  background: var(--warn-soft);
}

.column.needs-decision .column-header h2 {
  color: #92400e;
}

.column.needs-decision .event-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  min-height: 0;
}

.column.needs-decision.resolved {
  min-height: 0;
  background: var(--card);
  border-color: var(--line);
}

.column.needs-decision.resolved .column-header h2 {
  color: var(--muted);
}

.column.needs-decision.resolved .event-list {
  min-height: 0;
  padding: 10px 14px;
}

.column.needs-decision.resolved .empty {
  padding: 4px 8px;
}

.column {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  min-height: 280px;
  box-shadow: var(--shadow);
}

.column.drag-over {
  outline: 2px dashed var(--navy);
  outline-offset: -6px;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 16px 8px;
  border-bottom: 1px solid var(--line);
}

.column-header h2 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.12em;
}

.column.attending .column-header h2 {
  color: var(--attend);
}

.column.skipping .column-header h2 {
  color: var(--skip);
}

.column.fyi {
  background: #fbfcfd;
}

.column.fyi .column-header h2 {
  color: #8a94a3;
}

.count {
  color: var(--muted);
  font-size: 13px;
}

.event-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  min-height: 180px;
}

.event-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  cursor: grab;
  touch-action: none;
}

.event-card textarea,
.event-card button {
  touch-action: auto;
  cursor: auto;
}

.drag-ghost {
  position: fixed;
  z-index: 20;
  pointer-events: none;
  opacity: 0.92;
  box-shadow: var(--shadow);
}

.event-card.undecided {
  background: var(--warn-soft);
  border-color: #f0c48a;
}

.event-card.vip {
  box-shadow: inset 4px 0 0 var(--vip);
}

.event-card.fyi {
  background: #fafbfc;
  border-color: #e3e8ef;
  color: #56626f;
  box-shadow: none;
}

.event-card.fyi h3 {
  font-weight: 600;
  color: #56626f;
}

.event-card.fyi.vip {
  box-shadow: inset 4px 0 0 #e3d6a8;
}

.event-card.conflict {
  border-color: #f0a8a0;
  background: linear-gradient(#fff, #fff) padding-box, linear-gradient(#fff, #fff) border-box;
  box-shadow: inset 0 0 0 1px #f0a8a0;
}

.event-card.undecided.conflict {
  background: var(--alert-soft);
}

.meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.time {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 2px 8px;
}

.badge.vip {
  background: var(--vip);
  color: #1b1404;
}

.badge.needs {
  background: #d97706;
  color: #fff;
}

.badge.conflict {
  background: var(--alert);
  color: #fff;
}

.badge.fyi {
  background: #eef1f5;
  color: #6b7684;
  font-weight: 600;
}

.event-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.3;
}

textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  margin-bottom: 10px;
}

.card-actions {
  display: flex;
  gap: 6px;
}

.card-actions button {
  flex: 1;
  border-radius: 10px;
  padding: 8px 6px;
  font-size: 13px;
}

.card-actions .attend {
  background: var(--attend-soft);
  color: var(--attend);
  border-color: #b7e0d8;
}

.card-actions .skip {
  background: var(--skip-soft);
  color: #374151;
}

.card-actions .fyi {
  background: #f7f9fb;
  color: #6b7684;
}

.event-card[data-status="attending"] .attend,
.event-card[data-status="notAttending"] .skip,
.event-card[data-status="fyi"] .fyi {
  outline: 2px solid currentColor;
}

.empty {
  color: var(--muted);
  font-style: italic;
  padding: 18px 8px;
  text-align: center;
}

.json-panel {
  margin-top: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}

.json-panel h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.json-panel textarea {
  min-height: 160px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.output {
  display: none;
  margin-top: 16px;
}

.output.visible {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.output-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  min-width: 0;
}

.output-panel h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.output-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

pre,
.email-source {
  margin: 0;
  max-height: 360px;
  overflow: auto;
  background: #0f1722;
  color: #e8eef7;
  border-radius: 12px;
  padding: 12px;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.email-preview {
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 420px;
  width: 100%;
  background: #eef2f7;
}

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

@media (max-width: 800px) {
  .columns,
  .output.visible {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }
}
