/* Premium PsyMind skin for hidden professional surfaces. */
:root {
  color-scheme: dark;
  --bg: #0a0a0c;
  --surface: #1c1c1e;
  --surface-soft: rgba(255, 255, 255, 0.045);
  --text: #ffffff;
  --muted: #a1a1aa;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(232, 194, 96, 0.34);
  --primary: #e8c260;
  --primary-dark: #e8c260;
  --gold: #e8c260;
  --ok: #7fb6ff;
  --ok-bg: rgba(127, 182, 255, 0.12);
  --warn: #e8c260;
  --warn-bg: rgba(232, 194, 96, 0.12);
  --danger: #ff7a90;
  --danger-bg: rgba(255, 122, 144, 0.12);
  --locked: #a1a1aa;
  --locked-bg: rgba(255, 255, 255, 0.06);
  --missing-bg: rgba(232, 194, 96, 0.08);
  --panel: var(--surface);
  --panel-alt: rgba(255, 255, 255, 0.045);
  --strong-line: var(--line-strong);
  --accent: var(--gold);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 24px 70px rgba(0, 0, 0, 0.48);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Helvetica Neue", Arial, sans-serif;
}

html {
  background: #0a0a0c;
}

body {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 80% 48% at 50% -12%, rgba(232, 194, 96, 0.08), transparent 62%),
    radial-gradient(ellipse 52% 36% at 105% 18%, rgba(127, 182, 255, 0.06), transparent 58%),
    radial-gradient(ellipse 46% 34% at -8% 72%, rgba(232, 194, 96, 0.045), transparent 62%),
    #0a0a0c;
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 54% at 50% 10%, #000 0%, transparent 72%);
  opacity: 0.35;
}

a {
  color: inherit;
}

.page {
  position: relative;
  z-index: 1;
  width: min(100%, 1200px);
  padding: max(22px, env(safe-area-inset-top)) clamp(16px, 4vw, 38px) 76px;
}

.topbar {
  min-height: 52px;
  margin-bottom: clamp(22px, 4vw, 42px);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(20, 20, 22, 0.62);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 16px 38px rgba(0, 0, 0, 0.24);
  backdrop-filter: saturate(160%) blur(24px);
  -webkit-backdrop-filter: saturate(160%) blur(24px);
}

.brand {
  padding: 0 10px;
  color: var(--text);
}

.brand img {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.brand span {
  font-size: 1rem;
  letter-spacing: 0;
  font-weight: 650;
}

.top-actions {
  gap: 8px;
}

.toplink,
.dashboard-link,
.tool-action,
.secondary-action,
button,
.file-label {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  box-shadow: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.toplink:hover,
.dashboard-link:hover,
.tool-action:hover,
.secondary-action:hover,
button:hover:not(:disabled),
.file-label:hover {
  border-color: var(--line-strong);
  background: rgba(232, 194, 96, 0.1);
  color: var(--text);
  transform: translateY(-1px);
}

.tool-action.primary,
.primary {
  border-color: var(--gold);
  background: var(--gold);
  color: #171107;
  box-shadow: 0 12px 30px rgba(232, 194, 96, 0.22);
}

.tool-action.primary:hover,
.primary:hover:not(:disabled) {
  border-color: #f0ce74;
  background: #f0ce74;
  color: #171107;
}

button:disabled,
.secondary-action.disabled {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  opacity: 0.72;
  transform: none;
}

.intro {
  gap: clamp(16px, 3vw, 26px);
  margin-bottom: clamp(18px, 4vw, 28px);
}

.shell {
  gap: clamp(16px, 3vw, 28px);
}

.panel,
.tool-card,
.pilot-steps li,
.pilot-evidence,
.status-box,
.boundary-list li,
.session-data-controls,
.decision-workspace,
.decision-block,
.full-review,
.brief-card,
.generator-contract,
.client-scenario-panel,
.scenario-preflight,
.scenario-handoff,
.scenario-card,
.contract-cell,
.pilot-pulse,
.empty-state,
.mini-row,
.question,
.counter {
  border-color: var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 64%), var(--surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.055) inset;
}

.panel {
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.intro-main,
.access-panel,
.section-panel,
.panel-header,
.panel-body {
  padding: clamp(18px, 3vw, 28px);
}

.intro-main,
.section-panel,
.panel {
  overflow: hidden;
}

.intro-main {
  position: relative;
}

.intro-main::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -90px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(232, 194, 96, 0.18);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(232, 194, 96, 0.08), transparent 58%),
    repeating-radial-gradient(circle at 50% 50%, transparent 0 11px, rgba(232, 194, 96, 0.08) 12px 13px);
  opacity: 0.9;
  pointer-events: none;
}

.intro-main > *,
.access-panel > * {
  position: relative;
  z-index: 1;
}

.eyebrow,
.pilot-step-label,
.badge,
.contract-cell strong,
.decision-metric strong,
.practice-lab-card-kicker,
.source-meta {
  color: var(--gold);
  letter-spacing: 0;
}

.eyebrow {
  border-color: var(--line-strong);
  background: rgba(232, 194, 96, 0.1);
  color: var(--gold);
}

h1,
h2,
h3,
.panel-header h1,
.panel-header h2 {
  color: var(--text);
  letter-spacing: 0;
  font-weight: 650;
}

h1 {
  max-width: 820px;
  font-size: clamp(2rem, 4.8vw, 3.6rem);
  line-height: 1.06;
}

.panel-header h1,
.panel-header h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.12;
}

.lead,
.muted,
.tool-copy,
.status-line,
.status,
.panel-header p,
.session-data-controls p,
.decision-note,
.pilot-pulse p,
.empty-state,
.tool-meta,
.pilot-steps p,
.pilot-evidence ul,
.quote-list {
  color: var(--muted);
}

.access-list li,
.decision-block,
.review-item,
.hypothesis-item,
details,
.simple-brief-review,
.simple-brief-card,
.utility-section {
  border-color: var(--line);
}

.badge,
.badge.live,
.badge.manual,
.badge.ok,
.badge.warn {
  border: 1px solid var(--line-strong);
  background: rgba(232, 194, 96, 0.11);
  color: var(--gold);
}

.badge.danger {
  border-color: rgba(255, 122, 144, 0.34);
  background: var(--danger-bg);
  color: var(--danger);
}

.tool-card.available,
.brief-card.confirmed,
.brief-card.edited,
.scenario-card.confirmed,
.scenario-card.edited,
.scenario-handoff,
.approved {
  border-color: rgba(127, 182, 255, 0.28);
  background: linear-gradient(180deg, rgba(127, 182, 255, 0.09), rgba(255, 255, 255, 0) 72%), var(--surface);
}

.tool-card.next,
.brief-card.missing,
.brief-card.low_confidence,
.brief-card.cleared,
.scenario-card.cleared,
.scenario-card.missing {
  border-color: rgba(232, 194, 96, 0.24);
  background: linear-gradient(180deg, rgba(232, 194, 96, 0.075), rgba(255, 255, 255, 0) 72%), var(--surface);
}

.tool-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: clamp(12px, 2vw, 18px);
}

.tool-card {
  min-height: 248px;
  padding: 18px;
  border-radius: 18px;
}

.pilot-workflow {
  gap: clamp(18px, 3vw, 28px);
}

.pilot-steps li,
.pilot-evidence,
.boundary-list li,
.status-box,
.session-data-controls,
.brief-card,
.contract-cell,
.scenario-card,
.mini-row,
.question,
.counter {
  border-radius: 14px;
}

.pilot-pack-actions a {
  justify-content: center;
  text-align: center;
}

textarea,
input,
select {
  border-color: var(--line);
  background: #0f1115;
  color: var(--text);
}

select option {
  background: #14171b;
  color: var(--text);
}

textarea::placeholder,
input::placeholder {
  color: #707079;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 194, 96, 0.16);
}

.warning,
.input-integrity.blocked,
.scenario-preflight,
.counter {
  border-color: rgba(232, 194, 96, 0.34);
  background: rgba(232, 194, 96, 0.1);
  color: #f4d783;
}

.status.ok {
  color: var(--ok);
}

.status.error,
.empty-value {
  color: var(--danger);
}

.empty-note {
  color: var(--muted);
}

.decision-workspace,
.simple-brief-review,
.generator-contract,
.client-scenario-panel,
.approved {
  background: rgba(255, 255, 255, 0.035);
}

.panel-header {
  border-bottom-color: var(--line);
}

.field label,
.consent-label,
.session-data-controls h2,
.tool-head h3,
.pilot-steps strong,
.brief-card .card-title,
.field-value,
.contract-head h3 {
  color: var(--text);
  font-weight: 650;
}

.dashboard-link,
.toplink,
.tool-action,
.secondary-action,
button,
.file-label {
  font-weight: 650;
}

.guided-input-flow {
  display: grid;
  gap: 14px;
}

.guided-step {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.028);
}

.guided-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 36px;
  bottom: -15px;
  width: 1px;
  height: 30px;
  background: linear-gradient(180deg, rgba(232, 194, 96, 0.56), rgba(127, 182, 255, 0.34));
}

.guided-step-number {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #0c0c0f;
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: 650;
}

.guided-step-content {
  min-width: 0;
}

.guided-step-content h2 {
  margin: 1px 0 5px;
  font-size: clamp(1.06rem, 3.6vw, 1.28rem);
  line-height: 1.16;
  font-weight: 650;
}

.guided-step-content p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.94rem;
}

.guided-step .field:last-child,
.guided-step .button-row {
  margin-bottom: 0;
}

.guided-step .input-integrity {
  margin-bottom: 16px;
}

summary {
  color: var(--gold);
}

pre {
  border-color: var(--line);
  background: #08090b;
  color: #f5f6f8;
}

.pilot-pulse-reasons button.selected,
.pilot-pulse-reasons button[aria-pressed="true"],
.pilot-pulse-actions button[aria-pressed="true"] {
  border-color: var(--gold);
  background: rgba(232, 194, 96, 0.14);
  color: var(--text);
}

.client-brief-page .page {
  width: min(100%, 980px);
}

.client-brief-page .shell {
  grid-template-columns: 1fr;
  max-width: 880px;
  margin: 0 auto;
}

.client-brief-page .panel {
  border-radius: 24px;
}

.client-brief-page .panel-header,
.client-brief-page .panel-body {
  padding: clamp(20px, 4vw, 34px);
}

.client-brief-page .panel-header h1,
.client-brief-page .panel-header h2 {
  font-size: clamp(1.7rem, 4.4vw, 2.5rem);
  font-weight: 620;
}

.client-brief-page .panel-header p {
  max-width: 640px;
  font-size: clamp(1rem, 2vw, 1.12rem);
}

.client-brief-page .guided-input-flow {
  gap: clamp(18px, 3vw, 26px);
}

.client-brief-page .guided-step {
  grid-template-columns: 44px minmax(0, 1fr);
  gap: clamp(12px, 3vw, 18px);
  padding: clamp(18px, 4vw, 30px);
  border-radius: 22px;
}

.client-brief-page .guided-step-content h2 {
  font-size: clamp(1.35rem, 4vw, 2rem);
  font-weight: 620;
}

.client-brief-page .guided-step-content p {
  max-width: 620px;
  font-size: clamp(1rem, 2.4vw, 1.08rem);
}

.client-brief-page textarea {
  min-height: 190px;
}

.client-brief-page input,
.client-brief-page select,
.client-brief-page textarea {
  border-radius: 14px;
}

.client-brief-page .file-row,
.client-brief-page .button-row {
  gap: 12px;
}

.client-brief-page .input-integrity {
  border-radius: 14px;
}

.client-brief-page .session-data-controls {
  opacity: 0.72;
}

.client-brief-page .session-data-controls summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 620;
}

.client-brief-page .session-data-controls[open] {
  opacity: 1;
}

.client-brief-page .brief-working-panel {
  margin-top: 18px;
  padding: clamp(14px, 3vw, 18px);
  border: 1px solid rgba(232, 194, 96, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(232, 194, 96, 0.075), rgba(255, 255, 255, 0.018) 72%),
    rgba(12, 13, 16, 0.86);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.055) inset, 0 18px 44px rgba(0, 0, 0, 0.28);
}

.client-brief-page .brief-working-panel[hidden] {
  display: none;
}

.client-brief-page .brief-working-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.client-brief-page .brief-working-head strong,
.client-brief-page .brief-working-head span {
  display: block;
}

.client-brief-page .brief-working-head strong {
  color: var(--text);
  font-size: 1rem;
  font-weight: 620;
}

.client-brief-page .brief-working-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.92rem;
}

.client-brief-page .brief-working-orb {
  position: relative;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(232, 194, 96, 0.46);
  border-radius: 999px;
  background: radial-gradient(circle at 50% 50%, rgba(232, 194, 96, 0.42), rgba(232, 194, 96, 0.08) 48%, rgba(255, 255, 255, 0.03) 72%);
}

.client-brief-page .brief-working-orb::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1px solid rgba(127, 182, 255, 0.24);
  border-radius: inherit;
  animation: psymind-working-pulse 1.45s ease-in-out infinite;
}

.client-brief-page .brief-working-paper {
  display: grid;
  gap: 10px;
}

.client-brief-page .brief-writing-row {
  position: relative;
  overflow: hidden;
  min-height: 74px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.client-brief-page .brief-working-panel.is-active .brief-writing-row::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-120%);
  background: linear-gradient(90deg, transparent, rgba(127, 182, 255, 0.12), transparent);
  animation: psymind-writing-sweep 1.9s ease-in-out infinite;
}

.client-brief-page .brief-writing-row span {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.client-brief-page .brief-writing-row p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(0.94rem, 2.4vw, 1rem);
  line-height: 1.48;
}

.client-brief-page .brief-working-panel.is-active .brief-writing-row p::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  border-radius: 2px;
  background: var(--gold);
  vertical-align: -0.14em;
  animation: psymind-caret-blink 0.92s steps(2, start) infinite;
}

.client-brief-page .brief-working-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.client-brief-page .brief-working-steps span {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.client-brief-page .brief-working-steps span.active {
  background: linear-gradient(90deg, var(--gold), var(--ok));
}

.client-brief-page .brief-working-panel.is-done {
  border-color: rgba(127, 182, 255, 0.32);
}

.client-brief-page .brief-working-panel.is-error {
  border-color: rgba(255, 122, 144, 0.34);
}

.client-brief-page .simple-brief-review {
  display: grid;
  gap: clamp(14px, 3vw, 20px);
  margin-top: 18px;
  padding: clamp(16px, 4vw, 24px);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.client-brief-page .simple-brief-review[hidden],
.client-brief-page .advanced-review[hidden] {
  display: none;
}

.client-brief-page .simple-brief-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.client-brief-page .simple-brief-head h3 {
  margin: 0 0 6px;
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  font-weight: 620;
}

.client-brief-page .simple-brief-head p {
  max-width: 580px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 2.4vw, 1.08rem);
  line-height: 1.5;
}

.client-brief-page .simple-brief-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.client-brief-page .simple-brief-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 9, 11, 0.58);
}

.client-brief-page .simple-brief-card label {
  color: var(--gold);
  font-size: 0.84rem;
  font-weight: 650;
}

.client-brief-page .simple-brief-card textarea {
  min-height: 118px;
  padding: 13px 14px;
  border-radius: 13px;
  font-size: clamp(1rem, 2.6vw, 1.08rem);
  line-height: 1.5;
  resize: vertical;
}

.client-brief-page .client-draft-text {
  min-height: 220px;
  padding: 16px;
  border-radius: 16px;
  background: #0f1115;
  color: #fff;
  font-size: clamp(1rem, 2.4vw, 1.08rem);
  line-height: 1.55;
  resize: vertical;
}

.client-brief-page .simple-brief-card .source-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.client-brief-page .simple-brief-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.client-brief-page .advanced-review {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
}

.client-brief-page .advanced-review > summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 650;
}

.client-brief-page .advanced-review[open] > summary {
  color: var(--gold);
}

@keyframes psymind-working-pulse {
  0%,
  100% {
    opacity: 0.32;
    transform: scale(0.92);
  }
  50% {
    opacity: 0.84;
    transform: scale(1.06);
  }
}

@keyframes psymind-writing-sweep {
  0% {
    transform: translateX(-120%);
  }
  58%,
  100% {
    transform: translateX(120%);
  }
}

@keyframes psymind-caret-blink {
  0%,
  45% {
    opacity: 1;
  }
  46%,
  100% {
    opacity: 0;
  }
}

@media (max-width: 860px) {
  .page {
    padding-inline: clamp(14px, 4vw, 22px);
  }

  .topbar {
    align-items: stretch;
  }

  .top-actions {
    width: 100%;
  }

  .toplink,
  .dashboard-link {
    flex: 1 1 auto;
  }
}

@media (max-width: 520px) {
  .page {
    padding: max(14px, env(safe-area-inset-top)) 12px 52px;
  }

  .topbar {
    border-radius: 16px;
  }

  .brand {
    justify-content: flex-start;
  }

  .toplink,
  .dashboard-link,
  .tool-action,
  .secondary-action,
  button,
  .file-label {
    width: 100%;
    min-height: 48px;
  }

  .dashboard-link {
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    padding-inline: 16px;
  }

  .intro-main,
  .access-panel,
  .section-panel,
  .panel-header,
  .panel-body {
    padding: 18px 14px;
  }

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

  .tool-card {
    min-height: 0;
  }

  .guided-step {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    padding: 13px;
    border-radius: 16px;
  }

  .guided-step:not(:last-child)::after {
    left: 33px;
  }

  .guided-step-number {
    width: 36px;
    height: 36px;
  }

  .guided-step-content h2 {
    font-size: 1.08rem;
  }

  .client-brief-page .brief-working-panel {
    border-radius: 16px;
  }

  .client-brief-page .brief-writing-row {
    min-height: 82px;
  }

  .client-brief-page .simple-brief-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .client-brief-page .simple-brief-grid {
    grid-template-columns: 1fr;
  }

  .client-brief-page .simple-brief-card textarea {
    min-height: 132px;
  }

  .client-brief-page .client-draft-text {
    min-height: 240px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .client-brief-page .brief-working-orb::after,
  .client-brief-page .brief-working-panel.is-active .brief-writing-row::after,
  .client-brief-page .brief-working-panel.is-active .brief-writing-row p::after {
    animation: none;
  }
}
