

:root {
  --bg: #f4f8fb;
  --bg-soft: #eef4f8;
  --panel: #ffffff;
  --panel-2: #f8fbfd;
  --border: #d7e0ea;
  --text: #17324d;
  --muted: #5f7387;
  --accent: #0f8ec7;
  --accent-2: #6d4df2;
  --success: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --shadow: 0 12px 30px rgba(15, 35, 57, 0.08);
  --radius: 16px;
  --radius-sm: 12px;
  --hero-height: 280px;
  --font: Inter, Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  color: var(--text);
  min-height: 100vh;
}

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

.lap-hero {
  position: relative;
  min-height: var(--hero-height);
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 24px;
  background:
    linear-gradient(rgba(8, 26, 48, 0.30), rgba(8, 26, 48, 0.42)),
    url("images/lap-hero.png") center/cover no-repeat;
  box-shadow: 0 18px 44px rgba(8, 26, 48, 0.16);
}

.lap-hero__overlay {
  min-height: var(--hero-height);
  display: flex;
  align-items: flex-end;
  padding: 28px;
}

.lap-hero__content {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.lap-hero h1 {
  margin: 0 0 8px;
  font-size: 3rem;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}

.lap-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.08rem;
  max-width: 720px;
}

.lap-badge,
.badge,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 700;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  line-height: 1.1;
  color: #0f2940;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 860px;
  line-height: 1.5;
}

.grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 22px;
}

.two-col,
.row,
.toolbar,
.small-grid {
  display: grid;
  gap: 12px;
}

.two-col,
.row {
  grid-template-columns: 1fr 1fr;
}

.small-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.toolbar {
  grid-template-columns: 1fr auto auto;
  margin-bottom: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header {
  padding: 18px 20px 12px;
  border-bottom: 1px solid #e8eef4;
}

.panel-header h2,
.panel-header h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: #16324b;
}

.panel-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.panel-body {
  padding: 18px 20px 22px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 0.92rem;
  font-weight: 700;
  color: #29445c;
}

input[type="text"],
input[type="url"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.96rem;
  line-height: 1.45;
  resize: vertical;
}

textarea {
  min-height: 180px;
}

button {
  appearance: none;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-weight: 700;
  font-size: 0.94rem;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s ease, background 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  color: #032030;
}

.btn-secondary {
  background: #dbe7f1;
  color: #143049;
}

.btn-success {
  background: linear-gradient(90deg, #22c55e, #4ade80);
  color: #08240e;
}

.btn-warn {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  color: #2b1800;
}

.btn-danger {
  background: linear-gradient(90deg, #ef4444, #f87171);
  color: #310607;
}

.button-row,
.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab {
  background: #edf4f9;
  color: #284860;
  border: 1px solid #d4e1eb;
}

.tab.active {
  background: #dff4ff;
  color: #035b85;
  border-color: #97ddfb;
}

.list,
.artifact-list {
  display: grid;
  gap: 10px;
}

.item-card,
.artifact-row,
.artifact-link,
.status-card,
.inline-note {
  background: var(--panel-2);
  border: 1px solid #dbe6ef;
  border-radius: 14px;
  padding: 14px;
}

.item-card {
  cursor: pointer;
}

.item-card.active {
  border-color: #7dd3fc;
  background: #eefaff;
}

.item-card h4 {
  margin: 0;
  font-size: 0.98rem;
  color: #16324b;
}

.meta,
.hint {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  word-break: break-word;
}

.status-line,
.artifact-row,
.artifact-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.artifact-row a,
.artifact-link a {
  color: #0369a1;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.error-box {
  display: none;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  white-space: pre-wrap;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

@media (max-width: 1120px) {
  .grid,
  .two-col,
  .row,
  .toolbar,
  .small-grid {
    grid-template-columns: 1fr;
  }

  .lap-hero__content,
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .page {
    padding: 18px;
  }

  .lap-hero {
    min-height: 220px;
  }

  .lap-hero__overlay {
    min-height: 220px;
    padding: 20px;
  }

  .lap-hero h1 {
    font-size: 2.3rem;
  }
}

button.is-busy {
  opacity: 0.78;
  cursor: wait;
  pointer-events: none;
}

.btn-spinner {
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -0.12em;
  animation: lap-spin 0.75s linear infinite;
}

@keyframes lap-spin {
  to {
    transform: rotate(360deg);
  }
}

/* error modal */
.lap-modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 20, 34, 0.55);
  z-index: 9999;
}

.lap-modal-backdrop.is-visible {
  display: flex;
}

.lap-modal {
  width: min(560px, 100%);
  background: #ffffff;
  border: 1px solid #dbe6ef;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
  padding: 24px;
}

.lap-modal h2 {
  margin: 0 0 10px;
  color: #17324d;
  font-size: 1.35rem;
}

.lap-modal p {
  margin: 0 0 18px;
  color: #4c6277;
  line-height: 1.5;
  white-space: pre-wrap;
}
/* --- */
/* --- LAP section-based UI additions --- */
.main-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.transcript {
  min-height: 260px;
}

.compact {
  min-height: 150px;
}

.post {
  min-height: 300px;
}

.post-section {
  min-height: 220px;
}

.mini-textarea {
  min-height: 120px;
  font-size: 0.92rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 800;
  background: #e5eef7;
  color: #29445c;
  border: 1px solid #cfdae5;
}

.status-pill.running {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}

.status-pill.ready {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.status-pill.waiting {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.status-pill.failed {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.section-plan {
  display: grid;
  gap: 12px;
}

.section-row {
  display: grid;
  grid-template-columns: 190px 1fr 1fr;
  gap: 12px;
  align-items: end;
  padding: 14px;
  background: var(--panel-2);
  border: 1px solid #dbe6ef;
  border-radius: 14px;
}

.section-label strong {
  display: block;
  color: #16324b;
  margin-bottom: 4px;
}

.section-label span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
}

.advanced-section-preview {
  display: grid;
  gap: 18px;
  margin-top: 14px;
}

.advanced-section-preview h4 {
  margin: 0 0 10px;
  color: #16324b;
}

.section-actions {
  margin-top: 10px;
}

.legacy-instructions {
  border-top: 1px solid #e8eef4;
  padding-top: 12px;
}

.legacy-grid {
  margin-top: 12px;
}

.generated-section-stack {
  margin-top: 14px;
}

.char-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: -4px;
}

.final-char-row {
  margin-top: 2px;
}

.char-count {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}

.char-count.is-warning {
  color: var(--warn);
}

.char-count.is-over {
  color: var(--danger);
}

summary {
  cursor: pointer;
  font-weight: 800;
  color: #29445c;
}

@media (max-width: 1120px) {
  .section-row {
    grid-template-columns: 1fr;
  }
}
/* --- end LAP section-based UI additions --- */

.review-box {
  white-space: pre-wrap;
  background: #f7f7f7;
  border: 1px solid #ddd;
  padding: 12px;
  border-radius: 8px;
  max-height: 360px;
  overflow: auto;
}


.cost-panel {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fafafa;
  font-size: 0.95rem;
}

.cost-panel div {
  margin: 3px 0;
}

