:root {
  --bg-top: #edf3fb;
  --bg-bottom: #d9e5f5;
  --ink: #10213f;
  --muted: #53627c;
  --line: rgba(16, 33, 63, 0.12);
  --panel: rgba(255, 255, 255, 0.84);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --brand-primary: #1b449d;
  --brand-secondary: #247fb6;
  --brand-accent: #63c4e0;
  --brand-green: #7ab24b;
  --brand-orange: #e88a35;
  --brand-gray: #75797d;
  --shadow: 0 24px 70px rgba(27, 68, 157, 0.14);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

body {
  position: relative;
}

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

.page-backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 8% 12%, rgba(99, 196, 224, 0.24), transparent 24%),
    radial-gradient(circle at 92% 10%, rgba(36, 127, 182, 0.18), transparent 18%),
    linear-gradient(145deg, rgba(27, 68, 157, 0.08), transparent 42%);
  pointer-events: none;
}

.page-backdrop::before,
.page-backdrop::after {
  content: "";
  position: absolute;
  inset: auto;
  width: 36vw;
  max-width: 420px;
  height: 36vw;
  max-height: 420px;
  border-radius: 40px;
  border: 1px solid rgba(27, 68, 157, 0.08);
  transform: rotate(24deg);
}

.page-backdrop::before {
  top: -10vw;
  right: -8vw;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0));
}

.page-backdrop::after {
  bottom: -16vw;
  left: -10vw;
  background: linear-gradient(180deg, rgba(99, 196, 224, 0.08), rgba(255, 255, 255, 0));
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1720px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 1.5rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(244, 248, 253, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  width: min(220px, 28vw);
  max-width: 220px;
  height: auto;
  display: block;
}

.eyebrow {
  margin: 0 0 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--brand-secondary);
}

.topbar h1,
.panel-heading h2,
.section-heading h2 {
  margin: 0;
  font-family: "Bahnschrift", "Arial Narrow", Arial, sans-serif;
}

.topbar h1 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 0.92;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  justify-content: flex-end;
}

.app-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.editor-column,
.preview-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel {
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  padding: 1.15rem;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.panel-heading h2 {
  font-size: 1.45rem;
}

.panel-copy {
  margin: 0 0 1rem;
  line-height: 1.55;
  color: var(--muted);
}

.library-panel {
  padding-bottom: 1.25rem;
}

.library-heading {
  align-items: center;
}

.presentation-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
}

.section-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.presentation-card {
  width: 100%;
  min-height: 100%;
  text-align: left;
  border: 1px solid rgba(27, 68, 157, 0.09);
  background: rgba(245, 248, 253, 0.82);
  border-radius: var(--radius-lg);
  padding: 1rem 1.05rem;
  color: var(--ink);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.presentation-card:hover,
.presentation-card.active {
  transform: translateY(-1px);
  border-color: rgba(27, 68, 157, 0.26);
  box-shadow: 0 12px 30px rgba(27, 68, 157, 0.12);
}

.presentation-card strong {
  display: block;
  font-size: 1rem;
}

.presentation-card span,
.presentation-card p {
  margin: 0.18rem 0 0;
  color: var(--muted);
}

.presentation-meta {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.7rem;
  font-size: 0.82rem;
  color: var(--brand-secondary);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.full-width {
  grid-column: 1 / -1;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  padding: 0.85rem 0.95rem;
}

textarea {
  resize: vertical;
  min-height: 3.8rem;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(99, 196, 224, 0.45);
  outline-offset: 1px;
  border-color: rgba(27, 68, 157, 0.28);
}

.status-chip,
.tiny-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  white-space: nowrap;
}

.status-chip {
  padding: 0.55rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-chip.neutral {
  background: rgba(16, 33, 63, 0.08);
  color: var(--ink);
}

.status-chip.success {
  background: rgba(122, 178, 75, 0.16);
  color: #2d6420;
}

.status-chip.warning {
  background: rgba(232, 138, 53, 0.16);
  color: #8d4d12;
}

.tiny-chip {
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
  background: rgba(27, 68, 157, 0.08);
  color: var(--brand-primary);
}

.primary-button,
.ghost-button {
  border: none;
  border-radius: 999px;
  padding: 0.8rem 1rem;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: white;
  box-shadow: 0 14px 28px rgba(27, 68, 157, 0.2);
}

.ghost-button {
  background: rgba(27, 68, 157, 0.08);
  color: var(--brand-primary);
}

.ghost-button.active {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: white;
}

.ghost-button[disabled],
.primary-button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.small-button {
  padding: 0.55rem 0.8rem;
  font-size: 0.88rem;
}

.validation-list {
  margin: 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.validation-list li {
  color: var(--muted);
  line-height: 1.45;
}

.validation-ok {
  color: #2d6420 !important;
}

.section-heading,
.goal-editor-header {
  align-items: center;
}

.section-actions,
.goal-editor-actions,
.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.goal-editor-list {
  display: grid;
  gap: 0.95rem;
}

.goal-editor-card {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(27, 68, 157, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 252, 0.92));
}

.goal-editor-header {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
}

.goal-editor-header strong {
  font-size: 1.05rem;
}

.inline-select {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.inline-select select {
  min-width: 11rem;
  padding: 0.55rem 0.7rem;
  margin: 0;
}

.empty-state {
  display: grid;
  justify-items: start;
  gap: 0.8rem;
  padding: 1rem 0;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}


@media (max-width: 960px) {
  .app-shell {
    width: min(100%, calc(100% - 1rem));
  }

  .topbar,
  .detail-grid,
  .goal-editor-header {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions,
  .preview-actions,
  .goal-editor-actions {
    justify-content: flex-start;
  }

  .presentation-list {
    grid-template-columns: 1fr;
  }

  .brand-logo {
    width: min(180px, 46vw);
  }

  .preview-stage {
    height: 58vh;
  }
}

.custom-field-cta {
  display: flex;
  justify-content: flex-start;
}

.custom-field-editor {
  display: grid;
  gap: 0.8rem;
  padding: 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(27, 68, 157, 0.1);
  background: rgba(236, 243, 252, 0.72);
}

.custom-field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.custom-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.custom-upload-stack {
  display: grid;
  gap: 0.75rem;
}

.custom-upload-hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.custom-image-preview {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
  padding: 0.8rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(27, 68, 157, 0.1);
}

.custom-image-preview img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(27, 68, 157, 0.08);
}

.custom-image-meta {
  display: grid;
  gap: 0.3rem;
}

.custom-image-meta strong,
.custom-image-meta span {
  overflow-wrap: anywhere;
}

.custom-image-meta span {
  color: var(--muted);
}

.custom-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.upload-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  background: rgba(27, 68, 157, 0.08);
  color: var(--brand-primary);
  cursor: pointer;
}

.upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

@media (max-width: 960px) {
  .custom-field-grid,
  .custom-image-preview {
    grid-template-columns: 1fr;
  }
}

.risk-dep-list {
  display: grid;
  gap: 0.95rem;
}

.risk-dep-card {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(27, 68, 157, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 252, 0.92));
}

.risk-dep-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.risk-dep-header strong {
  font-size: 1.05rem;
}

.risk-dep-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.goal-link-section {
  display: grid;
  gap: 0.6rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-md);
  background: rgba(236, 243, 252, 0.72);
  border: 1px solid rgba(27, 68, 157, 0.08);
}

.goal-link-toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  cursor: pointer;
}

.goal-link-toggle input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.goal-link-list {
  display: grid;
  gap: 0.4rem;
}

.goal-link-option {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 400;
  cursor: pointer;
  line-height: 1.4;
}

.goal-link-option input[type="checkbox"] {
  width: auto;
  margin: 0.2rem 0 0;
  flex-shrink: 0;
}

.goal-link-empty {
  margin: 0;
  color: var(--muted);
}

.empty-hint {
  margin: 0;
  color: var(--muted);
  padding: 0.5rem 0;
}

@media (max-width: 960px) {
  .risk-dep-row {
    grid-template-columns: 1fr;
  }
}

.custom-fields-stack {
  display: grid;
  gap: 0.75rem;
}

.goal-rd-section {
  display: grid;
  gap: 0.6rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(27, 68, 157, 0.08);
  background: rgba(236, 243, 252, 0.52);
}

.goal-rd-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.goal-rd-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-secondary);
}

.goal-rd-card {
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(27, 68, 157, 0.1);
  background: rgba(255, 255, 255, 0.88);
}

.goal-rd-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.goal-rd-header strong {
  font-size: 0.95rem;
}

