:root {
  --bg: #ffd23f;
  --surface: #fffdf6;
  --surface-alt: #fff7db;
  --ink: #1e1f24;
  --muted: #4f5570;
  --line: #e3c042;
  --line-strong: #d1b14e;
  --brand-cyan: #1db9d2;
  --brand-purple: #6d3ac6;
  --brand-green: #2f6b4f;
  --brand-amber: #a05f06;
  --danger: #b23838;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Onest", "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(29, 185, 210, 0.22), transparent 24%),
    linear-gradient(180deg, #ffe277 0%, var(--bg) 26%, #f8cd34 100%);
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 18px 40px;
}

.topbar {
  border-bottom: 1px solid rgba(67, 49, 12, 0.18);
  background: rgba(245, 232, 181, 0.92);
  backdrop-filter: blur(8px);
}

.topbar-inner {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  min-height: 52px;
}

.brand-logo {
  height: 52px;
  width: auto;
  display: block;
}

.topbar-note {
  margin: 0;
  font-size: 26px;
  color: var(--muted);
  font-weight: 700;
}

.hero,
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 28px rgba(85, 63, 17, 0.12);
  animation: reveal 360ms ease-out;
}

.hero {
  margin-top: 18px;
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.8fr);
  gap: 22px;
  background:
    linear-gradient(135deg, rgba(29, 185, 210, 0.16), transparent 46%),
    linear-gradient(180deg, #fffce9 0%, #fff7db 100%);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-purple);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

h1,
h2,
h3,
h4,
legend {
  margin: 0 0 10px;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h2 {
  font-size: 1.45rem;
}

h3 {
  font-size: 1.12rem;
}

.lead,
.muted {
  color: #3d4360;
}

.lead {
  margin: 0;
  max-width: 58ch;
  font-size: 1.05rem;
  line-height: 1.55;
}

.muted {
  margin: 0;
}

.hero-metrics,
.stats-grid {
  display: grid;
  gap: 12px;
}

.metric-card,
.stat-card {
  border: 1px solid rgba(109, 58, 198, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  padding: 14px 16px;
}

.metric-label,
.stat-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-card strong,
.stat-value {
  display: block;
  font-size: 1rem;
}

.card {
  margin-top: 18px;
  padding: 20px;
  background: rgba(255, 253, 246, 0.98);
}

.auth-card,
.section-head,
.toolbar,
.workspace-status,
.auth-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-card,
.section-head {
  justify-content: space-between;
}

body.auth-pending .auth-card {
  display: none !important;
}

.control-grid,
.panel-grid,
.form-grid {
  display: grid;
  gap: 14px;
}

.control-grid {
  margin-top: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: block;
  margin: 0;
  color: #2f312f;
  font-size: 14px;
  font-weight: 700;
}

.field-span-2 {
  grid-column: span 2;
}

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

input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  margin-top: 7px;
  padding: 12px 14px;
  border: 1px solid #e0cb75;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 3px rgba(29, 185, 210, 0.18);
  outline: none;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 13px 18px;
  font-weight: 700;
  color: #fff;
  background: var(--brand-purple);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease, background 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(109, 58, 198, 0.26);
}

button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.secondary-btn {
  background: var(--brand-cyan);
}

.ghost-btn {
  background: #fff3c0;
  color: #4d4f57;
  border: 1px solid #dfc76f;
}

.ghost-btn:hover {
  box-shadow: 0 10px 16px rgba(188, 152, 42, 0.2);
}

.warning-btn {
  background: var(--brand-amber);
}

.manager-preview-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid #dfc76f;
  border-radius: 999px;
  background: #fff8dd;
  color: #48516c;
  font-size: 13px;
  font-weight: 700;
}

.manager-preview-toggle input {
  width: auto;
  margin: 0;
}

#authState {
  font-weight: 700;
  color: var(--brand-green);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pill.info {
  background: #e9f7f9;
  color: #1d6d7a;
}

.pill.warn {
  background: #fff1d7;
  color: #8f5308;
}

.pill.ok {
  background: #e8f4ec;
  color: var(--brand-green);
}

.status-message {
  margin: 14px 0 0;
  min-height: 24px;
  color: var(--brand-purple);
  font-size: 16px;
  font-weight: 700;
}

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

.status-detail {
  margin: 6px 0 0;
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
}

.workspace-card {
  overflow: hidden;
}

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tab-btn {
  width: auto;
  min-height: 0;
  padding: 10px 14px;
  background: #fff6d1;
  color: #344156;
  border: 1px solid #e1ca75;
  box-shadow: none;
}

.tab-btn.active,
.tab-btn[aria-selected="true"] {
  background: var(--brand-purple);
  color: #fff;
}

body.generate-mode #tabBtn-summary,
body.generate-mode #tab-summary {
  display: none !important;
}

.tab-panel {
  display: grid;
  gap: 16px;
}

.panel-card,
.lane,
.action-group {
  border: 1px solid #ead88b;
  border-radius: 16px;
  background: var(--surface-alt);
  padding: 16px;
}

.prompt-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.idea-generator-card {
  gap: 18px;
}

.idea-mode-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.quick-idea-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.quick-idea-row input {
  margin-top: 0;
  min-height: 58px;
  font-size: 1.05rem;
  border-radius: 16px;
}

.quick-idea-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.idea-details-panel {
  display: grid;
  gap: 14px;
  border-top: 1px dashed #e1ca75;
  padding-top: 14px;
}

.prompt-chip,
.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  color: #4c4f5e;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(109, 58, 198, 0.14);
}

.suggestion-grid,
.idea-board,
.lane-body,
.action-groups {
  display: grid;
  gap: 14px;
}

.idea-board {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.idea-board.generate-board {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.lane-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.lane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.lane-count {
  min-width: 32px;
  padding: 4px 10px;
  border-radius: 999px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  background: #fff;
  color: var(--muted);
}

.suggestion-card,
.idea-card,
.action-card {
  border: 1px solid rgba(224, 203, 117, 0.9);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.idea-card.generate-card {
  gap: 10px;
  background: linear-gradient(180deg, #fffefa 0%, #fff8dd 100%);
}

.idea-card.generate-card .card-title-row {
  align-items: center;
}

.idea-card.generate-card h3 {
  margin-bottom: 4px;
}

.edit-icon-btn {
  min-height: 0;
  padding: 6px;
  border: 1px solid rgba(109, 58, 198, 0.14);
  border-radius: 999px;
  background: transparent;
  color: #6a6f82;
  box-shadow: none;
}

.edit-icon-btn:hover {
  background: #fff6d1;
  box-shadow: none;
}

.edit-icon-btn svg {
  display: block;
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.card-sync-note {
  margin: 0;
  color: #57607a;
  font-size: 13px;
  font-weight: 700;
}

.card-sync-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff1d7;
  color: #8f5308;
  font-size: 13px;
  font-weight: 700;
}

.card-title-row,
.card-meta,
.chip-row,
.card-actions,
.vote-row,
.comment-form,
.checkbox-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.card-title-row {
  justify-content: space-between;
  align-items: flex-start;
}

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

.card-actions button,
.vote-row button,
.comment-form button,
.tab-btn,
.chip-action {
  width: auto;
}

.small-btn {
  min-height: 0;
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 10px;
}

.vote-row button {
  min-height: 0;
  padding: 8px 10px;
  font-size: 12px;
}

.vote-row button.active-vote {
  background: var(--brand-green);
}

.idea-card.selected-card,
.action-card.done-card {
  border-color: rgba(47, 107, 79, 0.5);
  box-shadow: inset 0 0 0 1px rgba(47, 107, 79, 0.25);
}

.idea-card.discarded-card,
.action-card.deferred-card {
  opacity: 0.78;
}

.perma-grid {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.perma-grid label,
.checkbox-row {
  font-size: 14px;
  font-weight: 600;
  color: #314157;
}

.perma-grid input,
.checkbox-row input {
  width: auto;
  margin: 0 8px 0 0;
  padding: 0;
}

.comment-list {
  display: grid;
  gap: 10px;
}

.comment-item {
  border-top: 1px solid #f0e5b2;
  padding-top: 10px;
  color: #3c4257;
  font-size: 14px;
}

.comment-form input {
  flex: 1;
  min-width: 180px;
  margin-top: 0;
}

.empty-state {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.signout-row {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.signout-btn {
  width: auto;
  min-height: 0;
  padding: 8px 12px;
  border: 1px solid #c7b57a;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.signout-btn:hover {
  background: #f5e8b5;
  box-shadow: none;
  transform: none;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

@media (max-width: 920px) {
  .hero,
  .panel-grid,
  .lane-grid,
  .control-grid {
    grid-template-columns: 1fr;
  }

  .idea-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .quick-idea-row {
    grid-template-columns: 1fr;
  }

  .topbar-inner {
    min-height: auto;
    padding: 10px 0;
    gap: 12px;
  }

  .brand-logo {
    height: 44px;
  }

  .topbar-note {
    font-size: 18px;
  }

  .hero,
  .card {
    padding: 16px;
  }

  .auth-card,
  .auth-actions,
  .section-head,
  .toolbar,
  .workspace-status {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .field-span-2 {
    grid-column: auto;
  }

  button {
    width: 100%;
  }

  .tab-btn,
  .small-btn,
  .signout-btn,
  .comment-form button {
    width: auto;
  }

  .comment-form {
    align-items: stretch;
  }
}
