/* SIGNAL external demo — framework-free with centrally synced WEAVIST assets. */

* {
  box-sizing: border-box;
}

body {
  line-height: 1.5;
}

h1, h2, h3, p {
  margin: 0 0 0.75rem;
}

.card {
  margin-bottom: 1.25rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--color-border);
  background: var(--color-card);
}

.url-row,
.checkbox-group,
.checkbox-pill {
  display: flex;
}

.url-row {
  align-items: center;
}

.query-row {
  display: grid;
  align-items: center;
  margin-bottom: 0.5rem;
}

.remove-query-btn {
  border: 1px solid var(--color-border);
  background: white;
  color: var(--color-muted);
  cursor: pointer;
}

.remove-query-btn:hover {
  border-color: var(--color-fail);
  color: var(--color-fail);
}

.checkbox-group {
  flex-wrap: wrap;
}

.checkbox-pill {
  align-items: center;
  border: 1px solid var(--color-border);
  background: white;
  cursor: pointer;
  gap: 0.4rem;
}

.checkbox-pill input {
  margin: 0;
}

.draft-banner,
.error-banner {
  margin: 0.75rem 0;
  padding: 0.65rem 0.85rem;
  border: 1px solid;
  font-size: 0.84rem;
}

.draft-banner {
  border-color: #fde68a;
  background: #fef3c7;
  color: #92400e;
}

.error-banner {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.btn-primary,
.btn-secondary {
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  color: white;
}

.btn-primary:disabled,
.btn-secondary:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.btn-primary.is-loading::before {
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-right: 0.5em;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: white;
  border-radius: 50%;
  content: "";
  vertical-align: -0.1em;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- WEAVIST external preview direction ---- */

:root {
  --ink: var(--brand-ink);
  --paper: #f3f0e9;
  --blue: var(--brand-primary);
  --blue-light: color-mix(in srgb, var(--brand-primary) 55%, white);
  --green: var(--brand-secondary);
  --line: rgba(17, 19, 25, 0.17);
  --line-dark: rgba(255, 255, 255, 0.16);
  --muted: #656870;
  --white: #fff;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "PingFang TC",
    "Microsoft JhengHei", sans-serif;
  --serif: Iowan Old Style, Baskerville, "Noto Serif JP", "Yu Mincho",
    "Noto Serif TC", "Times New Roman", serif;
  --color-bg: var(--paper);
  --color-card: var(--white);
  --color-border: var(--line);
  --color-text: var(--ink);
  --color-muted: var(--muted);
  --color-primary: var(--blue);
  --color-primary-dark: color-mix(in srgb, var(--brand-primary) 78%, black);
  --radius: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

::selection {
  color: white;
  background: var(--blue);
}

[hidden] {
  display: none !important;
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 4.75rem);
  border-bottom: 1px solid var(--line);
  background: rgba(243, 240, 233, 0.96);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--ink);
  letter-spacing: 0.08em;
}

.weave-mark {
  width: 28px;
  height: 28px;
  margin-right: 0.75rem;
  object-fit: contain;
}

.brand-product {
  font-size: 0.94rem;
  font-weight: 800;
}

.brand-byline {
  margin-left: 0.7rem;
  padding-left: 0.7rem;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
}

.brand-byline b {
  color: var(--blue);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.header-actions form {
  margin: 0;
}

.expert-evidence {
  overflow-wrap: anywhere;
}

.locale-switcher {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
}

.locale-switcher a {
  display: inline-flex;
  min-width: 44px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.65rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.locale-switcher a + a {
  border-left: 1px solid var(--line);
}

.locale-switcher a[aria-current="page"] {
  background: var(--ink);
  color: white;
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.preview-status {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.67rem;
  font-weight: 700;
  gap: 0.55rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.preview-status i {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(100, 246, 170, 0.18);
}

.text-button {
  min-height: 44px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
}

a.text-button {
  display: inline-flex;
  align-items: center;
}

.access-form-wrap > a.text-button {
  margin: 0 1.25rem 2rem 0;
}

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

.setup-surface {
  display: grid;
  min-height: calc(100vh - 76px);
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.55fr);
}

.setup-intro {
  position: relative;
  overflow: hidden;
  padding: clamp(3rem, 6vw, 6rem) clamp(1.5rem, 4.5vw, 5.5rem);
  background: var(--ink);
  color: white;
}

.setup-intro::after {
  position: absolute;
  right: -35%;
  bottom: -18%;
  width: 75%;
  aspect-ratio: 1;
  border: 1px solid rgba(146, 167, 255, 0.25);
  border-radius: 50%;
  box-shadow: 0 0 0 5rem rgba(49, 87, 255, 0.04),
    0 0 0 10rem rgba(49, 87, 255, 0.025);
  content: "";
}

.eyebrow {
  display: flex;
  align-items: center;
  margin: 0 0 2rem;
  color: #b8bbc4;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow > span {
  width: 7px;
  height: 7px;
  margin-right: 0.65rem;
  background: var(--blue);
}

.setup-intro h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(2.35rem, 4.4vw, 5rem);
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.setup-intro h1 em {
  color: var(--blue-light);
  font-family: var(--serif);
  font-weight: 400;
}

.setup-lede {
  max-width: 470px;
  margin: 2.1rem 0 0;
  color: #b9bbc2;
  font-size: 1rem;
  line-height: 1.75;
}

.step-rail {
  position: relative;
  z-index: 1;
  display: grid;
  max-width: 470px;
  margin: clamp(4rem, 8vh, 7rem) 0 0;
  padding: 0;
  list-style: none;
}

.step-rail li {
  display: grid;
  min-height: 72px;
  align-items: center;
  border-top: 1px solid var(--line-dark);
  color: #70737c;
  grid-template-columns: 3rem 1fr auto;
}

.step-rail li:last-child {
  border-bottom: 1px solid var(--line-dark);
}

.step-rail li.is-active {
  color: white;
}

.step-rail li > span,
.section-index {
  margin: 0;
  color: var(--blue-light);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.step-rail strong {
  font-size: 0.9rem;
}

.step-rail small {
  font-size: 0.75rem;
  font-weight: 500;
}

.privacy-note {
  position: relative;
  z-index: 1;
  max-width: 420px;
  margin: 2rem 0 0;
  color: #858894;
  font-size: 0.76rem;
  line-height: 1.65;
}

.setup-panel {
  padding: clamp(2.5rem, 6vw, 6.5rem) clamp(1.5rem, 6vw, 7rem);
}

.panel-heading,
.step-heading,
.label-row,
.submit-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.panel-heading {
  margin-bottom: 2.4rem;
}

.panel-heading h2,
.step-heading h2 {
  margin: 0.45rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 3vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.03em;
}

.method-chip {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  white-space: nowrap;
}

.form-step {
  padding: 0 0 2.5rem;
}

.goal-step {
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}

.step-heading {
  margin-bottom: 2rem;
}

.step-heading > p {
  max-width: 280px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

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

.field {
  margin-bottom: 1.35rem;
}

.fieldset-reset {
  min-width: 0;
  margin-inline: 0;
  padding: 0;
  border: 0;
}

.field--wide {
  grid-column: 1 / -1;
}

.field > label,
.label-row > label,
.field-label,
.fieldset-reset > legend {
  display: block;
  margin-bottom: 0.5rem;
  color: #353840;
  font-size: 0.82rem;
  font-weight: 750;
}

.label-row {
  align-items: center;
  margin-bottom: 0.5rem;
}

.label-row > label {
  margin: 0;
}

.field-label,
.fieldset-reset > legend {
  margin-bottom: 0.5rem;
}

.label-row .text-button {
  min-height: auto;
  font-size: 0.76rem;
}

.optional {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

input[type="text"],
input[type="url"],
input[type="date"],
input[type="password"],
select {
  min-height: 48px;
  padding: 0.72rem 0.82rem;
  border: 1px solid rgba(17, 19, 25, 0.28);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  font-size: 0.92rem;
}

input:hover,
select:hover {
  border-color: var(--ink);
}

input:focus,
select:focus {
  border-color: var(--blue);
  outline: 2px solid var(--blue);
  outline-offset: 0;
}

.url-row {
  gap: 0;
}

.url-row input {
  min-width: 0;
  min-height: 58px;
  padding-left: 1rem;
  background: white;
  flex: 1;
  font-size: 1rem;
}

.url-row .btn-primary {
  min-width: 230px;
}

.btn-primary,
.btn-secondary {
  min-height: 48px;
  padding: 0.72rem 1.1rem;
  border-radius: 0;
  font-size: 0.84rem;
  font-weight: 750;
  transition: background 160ms ease, border-color 160ms ease,
    color 160ms ease, transform 160ms ease;
}

.btn-primary {
  border-color: var(--blue);
  background: var(--blue);
}

.btn-primary:hover:not(:disabled) {
  background: var(--ink);
  border-color: var(--ink);
  transform: translateY(-1px);
}

.btn-secondary {
  border-color: var(--ink);
  background: transparent;
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.query-columns,
.query-row {
  grid-template-columns: minmax(220px, 2.4fr) minmax(92px, 0.7fr)
    minmax(78px, 0.6fr) minmax(120px, 0.9fr) 44px;
}

.query-columns {
  display: grid;
  padding: 0 0.4rem 0.35rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.query-row {
  gap: 0.45rem;
}

.query-role {
  grid-column: 1 / -1;
  justify-self: start;
  padding: 0.2rem 0.45rem;
  background: var(--color-card);
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.query-constraints {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.query-constraints:empty { display: none; }

.search-suggestions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.search-suggestions-label {
  margin-bottom: 0.55rem;
  font-size: 0.86rem;
}

.search-suggestions-frame {
  display: block;
  width: 100%;
  min-height: 96px;
  border: 1px solid var(--line);
  background: white;
}

.search-suggestions-frames {
  display: grid;
  gap: 0.75rem;
}

.remove-query-btn {
  width: 44px;
  height: 48px;
  border-radius: 0;
}

.checkbox-group {
  gap: 0.5rem;
}

.checkbox-pill {
  min-height: 44px;
  padding: 0.52rem 0.8rem;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.5);
  font-size: 0.78rem;
}

.checkbox-pill:has(input:checked) {
  border-color: var(--blue);
  background: rgba(49, 87, 255, 0.08);
  color: #1733b2;
}

.draft-banner,
.error-banner {
  border-radius: 0;
}

.draft-banner {
  margin-bottom: 1.75rem;
  border-color: rgba(49, 87, 255, 0.28);
  background: rgba(49, 87, 255, 0.08);
  color: #24337d;
}

.draft-banner > span {
  margin-right: 0.65rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input.draft-filled,
select.draft-filled {
  border-color: var(--blue);
  background: rgba(49, 87, 255, 0.075);
}

.field-hint {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.5;
}

.submit-row {
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.submit-row p {
  margin: 0 0 0.25rem;
  font-size: 0.8rem;
  font-weight: 750;
}

.submit-row div > span {
  color: var(--muted);
  font-size: 0.74rem;
}

.submit-row .btn-primary {
  min-width: 165px;
}

.activity-panel {
  display: flex;
  align-items: center;
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid rgba(49, 87, 255, 0.3);
  background: rgba(49, 87, 255, 0.06);
  gap: 1rem;
}

.activity-mark {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 2px solid var(--blue-light);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.activity-panel strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.82rem;
}

.activity-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

/* assessment results */

.dashboard-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 6rem) clamp(1.25rem, 4vw, 4.75rem);
}

.result-header,
.section-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.result-header {
  margin-bottom: 2rem;
}

.result-header h1 {
  margin: 0.5rem 0 0.25rem;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.result-domain {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.dashboard-section .card {
  margin-bottom: 1.5rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.discipline-overview {
  display: grid;
  margin-bottom: 1.5rem;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.discipline-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 230px;
  flex-direction: column;
  align-items: stretch;
  padding: 1.35rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-align: left;
}

.discipline-card-title {
  padding-right: 1.5rem;
  font-family: var(--serif);
  font-size: 1.55rem;
  line-height: 1.1;
}

.discipline-card-current {
  margin-top: auto;
  padding-top: 1.6rem;
}

.discipline-score-label,
.discipline-card-projections dt {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.61rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.discipline-card-score {
  display: block;
  margin: 0.2rem 0 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 400;
  letter-spacing: -0.04em;
}

.discipline-card-projections {
  display: grid;
  margin: 1rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--line);
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.discipline-card-projections > div {
  min-width: 0;
}

.discipline-card-projections dd {
  margin: 0.28rem 0 0;
}

.discipline-card-projection {
  color: var(--blue);
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1;
}

.signals-section {
  margin: clamp(2.5rem, 5vw, 4rem) 0;
}

.section-title-row {
  margin-bottom: 1.5rem;
}

.section-title-row h2 {
  margin: 0.4rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.5vw, 3.1rem);
  font-weight: 400;
  letter-spacing: -0.04em;
}

.assessment-notice {
  margin: 0 0 1.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.95rem;
}

.assessment-notice > p { margin: 0; }
.assessment-notice > ul { margin: 0.65rem 0 0; padding-inline-start: 1.25rem; }

.plan-summary {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.plan-summary span {
  color: var(--ink);
  font-weight: 750;
}

.action-work-status {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.verified-checks {
  margin: 2rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
}

.verified-checks > summary {
  cursor: pointer;
  font-weight: 650;
}

.verified-checks > .signal-list { margin-top: 1rem; }

.advanced-plan-section {
  padding: clamp(1.35rem, 3vw, 2.5rem);
  border: 1px solid color-mix(in srgb, var(--green) 45%, var(--line));
  background: color-mix(in srgb, var(--green) 7%, transparent);
}

.advanced-plan-section .signal-list {
  border-top-color: var(--green);
}

.advanced-plan-section .signal-order {
  color: color-mix(in srgb, var(--green) 72%, var(--ink));
}

.signal-list {
  border-top: 1px solid var(--ink);
}

.observed-outcomes,
.evidence-summary > section,
.score-explanation {
  margin: 1.5rem 0;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid var(--line);
}

.observed-outcomes h2,
.evidence-summary h2,
.score-explanation h2 {
  margin-top: 0;
  font-family: var(--serif);
}

.observed-outcomes p,
.evidence-summary p,
.score-explanation p {
  max-width: 65ch;
}

.evidence-summary { overflow-wrap: anywhere; }
.evidence-summary dl > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.3rem 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
.evidence-summary dd { margin: 0; font-weight: 600; }

.score-explanation table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.score-table {
  overflow-x: auto;
}

.score-explanation th,
.score-explanation td {
  padding: 0.6rem 0.3rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.score-explanation caption {
  text-align: left;
  margin-bottom: 0.8rem;
}

.score-explanation td {
  white-space: nowrap;
  font-size: 0.8rem;
}

.signal-card {
  display: grid;
  padding: clamp(1.5rem, 3vw, 2.5rem) 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: 64px minmax(0, 1fr);
}

.signal-order {
  color: var(--blue);
  font-family: var(--mono);
  font-size: 0.7rem;
}

.signal-main h3 {
  max-width: 850px;
  margin: 0 0 0.5rem;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.7vw, 2.45rem);
  font-weight: 400;
  letter-spacing: -0.025em;
}

.signal-plan {
  display: grid;
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
  grid-template-columns: minmax(0, 1.2fr) minmax(110px, 0.45fr) minmax(0, 1.35fr);
}

.signal-plan > div {
  padding: 1.15rem 1.25rem 0 0;
}

.signal-plan > div + div {
  padding-left: 1.25rem;
  border-left: 1px solid var(--line);
}

.signal-plan span {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.61rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.signal-plan p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.55;
}

.signal-plan ol {
  margin: 0.65rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.empty-state {
  margin: 0 !important;
}

.app-footer {
  display: grid;
  min-height: 90px;
  align-items: center;
  padding: 1.5rem clamp(1.25rem, 4vw, 4.75rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  grid-template-columns: 1fr 1fr 1fr;
}

.app-footer span:nth-child(2) {
  text-align: center;
}

.app-footer a {
  justify-self: end;
  border-bottom: 1px solid var(--line);
}

/* access gate */

.access-page {
  background: var(--ink);
}

.access-shell {
  display: grid;
  max-width: none;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
}

.access-story {
  position: relative;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 5vw, 5rem);
  color: white;
}

.access-story::before,
.access-story::after {
  position: absolute;
  top: 50%;
  left: 67%;
  width: min(50vw, 640px);
  aspect-ratio: 1;
  border: 1px solid rgba(146, 167, 255, 0.22);
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
}

.access-story::after {
  width: min(32vw, 400px);
  border-color: rgba(146, 167, 255, 0.38);
  box-shadow: 0 0 100px rgba(49, 87, 255, 0.16);
}

.brand--light {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  color: white;
}

.brand--light .brand-byline {
  border-color: var(--line-dark);
  color: #aeb1ba;
}

.access-copy {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: auto 0;
}

.access-copy h1 {
  margin: 0;
  font-size: clamp(3.25rem, 7vw, 7.5rem);
  letter-spacing: -0.065em;
  line-height: 0.86;
}

.access-copy h1 em {
  color: var(--blue-light);
  font-family: var(--serif);
  font-weight: 400;
}

/* CJK hero: size to the copy column so each of the two lines fits (about 9 em wide) and never leaves an orphan. */
.access-page:lang(zh-TW) .access-copy,
.access-page:lang(ja) .access-copy {
  container-type: inline-size;
}

.access-page:lang(zh-TW) .access-copy h1,
.access-page:lang(ja) .access-copy h1 {
  font-size: min(clamp(3.25rem, 7vw, 7.5rem), 10.5cqi);
  word-break: keep-all;
  text-wrap: balance;
}

@media (min-width: 768px) {
  .access-page:lang(zh-TW) .access-copy h1,
  .access-page:lang(ja) .access-copy h1 {
    white-space: nowrap;
  }
}

.access-copy > p:last-child {
  max-width: 490px;
  margin: 2.5rem 0 0;
  color: #aeb1ba;
  font-size: 1rem;
  line-height: 1.7;
}

.access-signal {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  color: #858894;
  font-family: var(--mono);
  font-size: 0.6rem;
  gap: 1rem;
  letter-spacing: 0.12em;
}

.access-signal i {
  width: clamp(1.5rem, 5vw, 5rem);
  height: 1px;
  background: rgba(146, 167, 255, 0.5);
}

.access-form-panel {
  display: grid;
  align-items: center;
  padding: clamp(2rem, 6vw, 7rem);
  background: var(--paper);
}

.access-form-wrap {
  width: min(100%, 430px);
  margin: 0 auto;
}

.access-form-wrap > .locale-switcher {
  margin-bottom: 2rem;
}

.access-form-wrap h2 {
  margin: 0.55rem 0 1rem;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 400;
  letter-spacing: -0.04em;
}

.access-form-wrap > p:not(.section-index):not(.access-privacy) {
  margin-bottom: 2rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.65;
}

.access-error {
  padding: 0.8rem;
  border-left: 3px solid var(--color-fail);
  background: #fff0ef;
  color: #8c1c18;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
  margin-top: 0.25rem;
}

.access-form-wrap > p.prefill-note {
  margin: 1rem 0 0;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.access-privacy {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  text-align: center;
}

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

  .setup-intro {
    min-height: auto;
  }

  .setup-intro h1 {
    font-size: clamp(2.8rem, 8vw, 5rem);
  }

  .step-rail {
    margin-top: 3rem;
  }

  .access-shell {
    grid-template-columns: 1fr 420px;
  }

  .discipline-overview {
    grid-template-columns: 1fr 1fr;
  }

  .discipline-card:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .app-header {
    min-height: 68px;
    flex-wrap: wrap;
    padding-block: 0.6rem;
    row-gap: 0.45rem;
  }

  .brand-product {
    white-space: nowrap;
  }

  .brand-byline,
  .preview-status,
  .query-columns {
    display: none;
  }

  .header-actions {
    gap: 0.55rem;
    margin-left: auto;
  }

  .header-actions .locale-switcher a {
    min-width: 38px;
    padding-inline: 0.35rem;
    font-size: 0.64rem;
  }

  .setup-intro,
  .setup-panel {
    padding: 2.25rem 1.25rem;
  }

  .setup-intro h1 {
    font-size: clamp(2.4rem, 13vw, 4rem);
  }

  .step-rail li {
    grid-template-columns: 2.5rem 1fr;
  }

  .step-rail small {
    display: none;
  }

  .panel-heading,
  .step-heading,
  .submit-row,
  .result-header,
  .section-title-row {
    align-items: stretch;
    flex-direction: column;
  }

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

  .field--wide {
    grid-column: auto;
  }

  .query-row {
    position: relative;
    padding: 0 52px 1rem 0;
    border-bottom: 1px solid var(--line);
  }

  .remove-query-btn {
    position: absolute;
    top: 0;
    right: 0;
  }

  .url-row {
    flex-direction: column;
    gap: 0.6rem;
  }

  .url-row .btn-primary,
  .submit-row .btn-primary {
    width: 100%;
    min-width: 0;
  }

  .app-footer {
    gap: 0.65rem;
    grid-template-columns: 1fr;
  }

  .app-footer span:nth-child(2),
  .app-footer a {
    justify-self: start;
    text-align: left;
  }

  .access-shell {
    grid-template-columns: 1fr;
  }

  .access-story {
    min-height: 46vh;
    padding: 1.5rem 1.25rem 2rem;
  }

  .access-copy h1 {
    font-size: clamp(3rem, 16vw, 5rem);
  }

  .access-page:lang(zh-TW) .access-copy h1,
  .access-page:lang(ja) .access-copy h1 {
    font-size: min(clamp(3rem, 16vw, 5rem), 10.5cqi);
  }

  .access-signal {
    margin-top: 2.5rem;
  }

  .access-form-panel {
    padding: 3rem 1.25rem;
  }

  .dashboard-section {
    padding-top: 2.5rem;
  }

  .result-header .btn-secondary,
  .section-title-row .btn-secondary {
    width: 100%;
  }

  .discipline-overview,
  .discipline-card:first-child {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

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

  .signal-card {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .signal-plan {
    grid-template-columns: 1fr;
  }

  .signal-plan > div + div {
    padding-left: 0;
    border-left: 0;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ---- ACE report: the free check's result in the paid ACE report's layout (web/ace-report.js) ----
   Tokens copy the ACE app's light theme; web/brand/instinc-ace.css sets INSTINC's. */

:root {
  --ace-bg: #f6f7f9;
  --ace-surface: #fff;
  --ace-surface-muted: #f0f2f5;
  --ace-border: #e3e6eb;
  --ace-border-strong: #cbd1d9;
  --ace-fg: #131820;
  --ace-muted: #5d6673;
  --ace-subtle: #666e7a;
  --ace-accent: #0d6e66;
  --ace-accent-hover: #0a5953;
  --ace-accent-soft: #e3f3f1;
  --ace-danger: #c2352d;
  --ace-warning: #9a5b07;
  --ace-warning-soft: #fdf3e1;
  --ace-warning-border: #f1d9a8;
  --ace-success: #1c7a3e;
  --ace-series: #2a78d6;
}

body.has-ace-report {
  background: var(--ace-bg);
  color: var(--ace-fg);
}

body.has-ace-report .app-header {
  min-height: 56px;
  border-bottom-color: var(--ace-border);
  background: var(--ace-surface);
  backdrop-filter: none;
}

body.has-ace-report .dashboard-section {
  max-width: none;
  padding: 0;
}

body.has-ace-report .app-footer {
  border-top-color: var(--ace-border);
  background: var(--ace-surface);
}

.ace-report {
  display: grid;
  min-height: calc(100vh - 56px);
  /* The menu column runs the page's full height, as ACE's does, while the menu itself stays in view. */
  background: linear-gradient(90deg, var(--ace-surface) 239px, var(--ace-border) 239px 240px, transparent 240px);
  color: var(--ace-fg);
  font-family: var(--sans);
  font-size: 14px;
  grid-template-columns: 240px minmax(0, 1fr);
  line-height: 1.5;
}

.ace-report h1,
.ace-report h2,
.ace-report h3,
.ace-report h4 {
  font-family: var(--sans);
  letter-spacing: normal;
}

.ace-report a:focus-visible,
.ace-report button:focus-visible,
.ace-report summary:focus-visible {
  outline: 2px solid var(--ace-accent);
  outline-offset: 2px;
}

.ace-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ace-icon {
  width: 16px;
  height: 16px;
  flex: none;
}

/* sidebar */

.ace-sidebar {
  position: sticky;
  top: 56px;
  display: flex;
  height: calc(100vh - 56px);
  flex-direction: column;
  justify-content: space-between;
  align-self: start;
  padding: 16px 12px;
  overflow-y: auto;
}

.ace-nav-group {
  margin: 16px 10px 6px;
  color: var(--ace-subtle);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ace-nav-group:first-child {
  margin-top: 4px;
}

.ace-nav-item {
  display: flex;
  height: 36px;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--ace-muted);
  font-size: 14px;
  font-weight: 500;
}

.ace-nav-item:hover {
  background: var(--ace-surface-muted);
  color: var(--ace-fg);
}

.ace-nav-item.is-active {
  background: var(--ace-accent-soft);
  color: var(--ace-accent);
}

.ace-nav-lock {
  width: 13px;
  height: 13px;
  margin-left: auto;
  color: var(--ace-subtle);
}

.ace-sidebar-cta {
  margin-top: 24px;
  padding: 14px;
  border: 1px solid var(--ace-border);
  border-radius: 8px;
  background: var(--ace-surface-muted);
  color: var(--ace-muted);
  font-size: 12px;
}

.ace-sidebar-cta p {
  margin: 0;
}

.ace-sidebar-cta-title {
  margin-bottom: 4px !important;
  color: var(--ace-fg);
  font-size: 13px;
  font-weight: 600;
}

.ace-sidebar-cta .ace-btn {
  width: 100%;
  margin-top: 12px;
}

/* main column and report head */

.ace-main {
  width: 100%;
  max-width: 1240px;
  min-width: 0;
  margin: 0 auto;
  padding: 24px clamp(16px, 3vw, 32px) 64px;
}

.ace-crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  color: var(--ace-muted);
  font-size: 13px;
}

.ace-crumb .ace-icon {
  width: 14px;
  height: 14px;
}

.ace-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ace-title {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ace-title h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ace-title h1:focus {
  outline: none;
}

.ace-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ace-head-date {
  color: var(--ace-subtle);
  font-size: 12px;
}

.ace-subline {
  margin: 4px 0 0;
  color: var(--ace-muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

/* buttons and badges */

.ace-btn {
  display: inline-flex;
  height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ace-btn--primary {
  background: var(--ace-accent);
  color: #fff;
}

.ace-btn--primary:hover {
  background: var(--ace-accent-hover);
}

.ace-btn--secondary {
  border-color: var(--ace-border-strong);
  background: var(--ace-surface);
  color: var(--ace-fg);
}

.ace-btn--secondary:hover {
  background: var(--ace-surface-muted);
}

.ace-btn--sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.ace-badge {
  display: inline-flex;
  height: 20px;
  align-items: center;
  margin-right: 6px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}

.ace-title .ace-badge {
  margin: 0;
}

.ace-badge--warning {
  background: var(--ace-warning-soft);
  color: var(--ace-warning);
}

.ace-badge--accent {
  background: var(--ace-accent-soft);
  color: var(--ace-accent);
}

.ace-badge--neutral {
  background: var(--ace-surface-muted);
  color: var(--ace-muted);
}

/* tabs and sections */

.ace-tabs {
  display: flex;
  gap: 4px;
  margin: 20px 0 24px;
  overflow-x: auto;
  border-bottom: 1px solid var(--ace-border);
  scrollbar-width: none;
}

.ace-tabs::-webkit-scrollbar {
  display: none;
}

.ace-tabs a {
  margin-bottom: -1px;
  padding: 10px 12px;
  border-bottom: 2px solid transparent;
  color: var(--ace-muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.ace-tabs a:hover {
  color: var(--ace-fg);
}

.ace-tabs a.is-active {
  border-bottom-color: var(--ace-accent);
  color: var(--ace-fg);
}

.ace-section {
  margin-top: 36px;
  scroll-margin-top: 72px;
}

.ace-section:first-of-type {
  margin-top: 0;
}

.ace-section-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 600;
}

.ace-section-lede,
.ace-based-on {
  margin: 0 0 12px;
  color: var(--ace-muted);
  font-size: 13px;
}

.ace-report .assessment-notice {
  margin: 0 0 20px;
  padding: 12px 16px;
  border: 1px solid var(--ace-warning-border);
  border-radius: 8px;
  background: var(--ace-warning-soft);
  color: var(--ace-warning);
  font-size: 13px;
}

.ace-report .assessment-notice > ul {
  margin: 6px 0 0;
}

/* cards */

.ace-card {
  min-width: 0;
  margin-bottom: 16px;
  border: 1px solid var(--ace-border);
  border-radius: 8px;
  background: var(--ace-surface);
}

.ace-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ace-border);
}

.ace-card-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.ace-card-head p {
  margin: 2px 0 0;
  color: var(--ace-muted);
  font-size: 12px;
}

.ace-card-body {
  padding: 16px 20px;
}

.ace-grid-2 {
  display: grid;
  margin-bottom: 16px;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ace-grid-2 > .ace-card {
  margin-bottom: 0;
}

.ace-note,
.ace-empty {
  margin: 8px 0 0;
  color: var(--ace-muted);
  font-size: 12px;
}

.ace-empty {
  margin: 0;
  font-size: 13px;
}

/* score rings */

.ace-report .discipline-overview {
  margin: 0;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ace-report .discipline-card,
.ace-report .discipline-card:first-child {
  min-height: 0;
  align-items: center;
  padding: 4px;
  border: 0;
  background: none;
  grid-column: auto;
  text-align: center;
}

.ace-ring-wrap {
  position: relative;
  width: 112px;
  height: 112px;
}

.ace-ring {
  display: block;
  width: 100%;
  height: 100%;
}

.ace-ring-track,
.ace-ring-arc {
  fill: none;
  stroke-width: 10;
}

.ace-ring-track {
  stroke: var(--ace-surface-muted);
}

.ace-ring-arc {
  stroke: var(--ace-accent);
  stroke-linecap: round;
}

.ace-ring-center {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  inset: 0;
}

.ace-report .discipline-card-score {
  margin: 0;
  font-family: var(--sans);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: normal;
}

.ace-report .discipline-card-score small {
  color: var(--ace-subtle);
  font-size: 12px;
  font-weight: 500;
}

.ace-report .discipline-card-title {
  margin-top: 10px;
  padding: 0;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
}

.ace-report .discipline-card-projections {
  width: 100%;
  margin: 10px 0 0;
  padding: 10px 0 0;
  border-top-color: var(--ace-border);
  gap: 8px;
  font-size: 12px;
}

.ace-report .discipline-card-projections dt {
  font-family: var(--sans);
  letter-spacing: normal;
  text-transform: none;
}

.ace-report .plan-summary {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--ace-border);
  color: var(--ace-muted);
  font-size: 12px;
  text-align: center;
}

/* KPI tiles */

.ace-kpis {
  display: grid;
  margin: 0 0 16px;
  gap: 12px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.ace-kpi {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--ace-border);
  border-radius: 8px;
  background: var(--ace-surface);
}

.ace-kpi dt {
  color: var(--ace-muted);
  font-size: 12px;
}

.ace-kpi dd {
  margin: 0;
}

.ace-kpi-value {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 6px;
  margin-top: 4px !important;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.ace-kpi.is-locked .ace-kpi-value {
  color: var(--ace-subtle);
}

.ace-kpi-lock {
  width: 14px;
  height: 14px;
}

.ace-kpi-note {
  margin-top: 4px !important;
  color: var(--ace-subtle);
  font-size: 11px;
  line-height: 1.4;
}

/* bars, engines and tables */

.ace-bar {
  display: block;
  width: 100%;
  height: 6px;
}

.ace-bar-track {
  fill: var(--ace-surface-muted);
}

.ace-bar-fill {
  fill: var(--ace-accent);
}

.ace-engines {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.ace-engine {
  display: grid;
  align-items: center;
  gap: 12px;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 2fr) 48px;
}

.ace-engine .ace-bar-fill {
  fill: var(--ace-series);
}

.ace-engine-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}

.ace-engine-name .ace-badge {
  margin: 0;
}

.ace-engine-value {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
}

.ace-report .observed-outcomes {
  margin: 12px 0 0;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid var(--ace-border);
  color: var(--ace-muted);
  font-size: 12px;
}

.ace-report .observed-outcomes p {
  max-width: none;
  margin: 0 0 4px;
}

.ace-table-wrap {
  overflow-x: auto;
}

.ace-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ace-table th,
.ace-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--ace-border);
  text-align: left;
  vertical-align: middle;
}

.ace-table th:first-child,
.ace-table td:first-child {
  padding-left: 0;
}

.ace-table thead th {
  color: var(--ace-muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.ace-table tbody th {
  min-width: 8em;
  font-weight: 500;
  overflow-wrap: break-word;
}

.ace-table tbody th .ace-badge {
  margin: 0 0 0 4px;
}

.ace-table tbody tr:last-child > * {
  border-bottom: 0;
}

.ace-locked-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ace-subtle);
}

.ace-cell-lock {
  width: 12px;
  height: 12px;
  flex: none;
}

.ace-more-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0;
  color: var(--ace-muted);
  font-size: 12px;
}

/* locked placeholders: a grey shape under the lock, never invented content */

.ace-skel {
  display: inline-block;
  height: 10px;
  flex: none;
  border-radius: 999px;
  background: var(--ace-surface-muted);
}

.ace-skel--label {
  width: 28%;
}

.ace-skel--bar {
  height: 8px;
  flex: 1;
}

.ace-skel--value {
  width: 40px;
}

.ace-skel--kpi {
  width: 52px;
  height: 18px;
}

.ace-locked {
  display: grid;
  margin-top: 4px;
  border-radius: 8px;
}

.ace-locked > * {
  grid-area: 1 / 1;
}

.ace-locked > .ace-skeleton {
  opacity: 0.55;
  filter: blur(1.5px);
  pointer-events: none;
  user-select: none;
}

.ace-skeleton--rows {
  display: grid;
}

.ace-skeleton-row {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--ace-border);
}

.ace-skeleton-row:last-child {
  border-bottom: 0;
}

.ace-skeleton-label {
  width: 28%;
  overflow: hidden;
  color: var(--ace-muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ace-skeleton--chart {
  position: relative;
  display: flex;
  height: 200px;
  align-items: flex-end;
  gap: 8%;
  padding: 16px 8% 0;
  border-bottom: 1px solid var(--ace-border);
}

.ace-skeleton--chart i {
  flex: 1;
  border-radius: 4px 4px 0 0;
  background: var(--ace-surface-muted);
}

.ace-skeleton--chart i:nth-child(1) { height: 45%; }
.ace-skeleton--chart i:nth-child(2) { height: 70%; }
.ace-skeleton--chart i:nth-child(3) { height: 55%; }
.ace-skeleton--chart i:nth-child(4) { height: 85%; }

.ace-skeleton-line {
  position: absolute;
  width: 100%;
  height: calc(100% - 16px);
  inset: 16px 0 0;
}

.ace-skeleton-line path {
  fill: none;
  stroke: var(--ace-border-strong);
  stroke-dasharray: 4 4;
}

.ace-skeleton--map svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 260px;
}

.ace-skeleton--map line {
  stroke: var(--ace-border-strong);
  stroke-width: 1.5;
}

.ace-map-topic {
  fill: var(--ace-surface);
  stroke: var(--ace-border-strong);
  stroke-dasharray: 3 3;
  stroke-width: 1.5;
}

.ace-map-brand {
  fill: var(--ace-accent-soft);
  stroke: var(--ace-accent);
  stroke-width: 2;
}

.ace-map-brand-name {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ace-accent-soft);
  color: var(--ace-accent);
  font-size: 12px;
  font-weight: 600;
}

.ace-lock {
  z-index: 1;
  display: flex;
  max-width: 440px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ace-surface) 88%, transparent);
  flex-direction: column;
  align-items: center;
  align-self: center;
  justify-self: center;
  gap: 6px;
  padding: 20px 16px;
  text-align: center;
}

.ace-lock-icon {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--ace-accent);
}

.ace-lock > .ace-lock-icon {
  box-sizing: content-box;
  padding: 8px;
  border-radius: 999px;
  background: var(--ace-accent-soft);
}

.ace-lock-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.ace-lock-copy {
  margin: 0;
  color: var(--ace-muted);
  font-size: 12px;
}

.ace-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.ace-lock-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--ace-surface-muted);
  color: var(--ace-muted);
  font-size: 13px;
}

.ace-lock-strip p {
  min-width: 0;
  flex: 1 1 220px;
  margin: 0;
}

.ace-cta--inline {
  justify-content: flex-start;
  margin: 0;
}

.ace-cta--inline .ace-btn {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

/* recommendations */

.ace-report .signal-list {
  border-top: 0;
}

.ace-report .signal-card {
  display: grid;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--ace-border);
  grid-template-columns: 26px minmax(0, 1fr);
}

.ace-report .signal-list > .signal-card:first-child {
  padding-top: 0;
}

.ace-report .signal-order {
  display: flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--ace-accent-soft);
  color: var(--ace-accent);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
}

.ace-report .action-work-status {
  display: inline-flex;
  height: 20px;
  align-items: center;
  margin: 0;
  padding: 0 8px;
  border: 1px solid var(--ace-border);
  border-radius: 999px;
  color: var(--ace-muted);
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

.ace-report .signal-main h3 {
  max-width: none;
  margin: 6px 0 10px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.ace-report .signal-plan {
  display: grid;
  margin: 0;
  gap: 10px 20px;
  border-top: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ace-report .signal-plan > div,
.ace-report .signal-plan > div + div {
  padding: 0;
  border-left: 0;
}

.ace-report .signal-plan span {
  margin-bottom: 2px;
  color: var(--ace-subtle);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
}

.ace-report .signal-plan p {
  font-size: 13px;
}

.ace-report .signal-plan ol {
  margin: 0;
  padding-left: 18px;
  color: var(--ace-fg);
  font-size: 13px;
  grid-column: 1 / -1;
}

.ace-report .verified-checks {
  margin: 16px 0 0;
  padding: 0 16px;
  border: 1px solid var(--ace-border);
  border-radius: 8px;
}

.ace-report .verified-checks > summary {
  padding: 12px 0;
  font-size: 13px;
  font-weight: 600;
}

.ace-report .verified-checks > .signal-list {
  margin-top: 0;
}

/* citations, checklist and audits */

.ace-pages {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ace-pages li {
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--ace-border);
}

.ace-pages li:first-child {
  padding-top: 0;
}

.ace-pages a {
  color: var(--ace-accent);
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.ace-pages blockquote {
  display: -webkit-box;
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--ace-muted);
  font-size: 12px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ace-checklist {
  display: grid;
  margin: 0;
  padding: 0;
  column-gap: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
}

.ace-checklist li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--ace-border);
  font-size: 13px;
}

.ace-report .evidence-summary {
  display: grid;
  margin-bottom: 16px;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ace-report .evidence-summary > section {
  margin: 0;
  padding: 0;
  border: 1px solid var(--ace-border);
}

.ace-report .evidence-summary p {
  max-width: none;
}

.ace-stats {
  display: grid;
  margin: 0 0 8px;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ace-report .evidence-summary .ace-stat {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--ace-border);
  border-radius: 8px;
}

.ace-stat dt {
  color: var(--ace-muted);
  font-size: 12px;
}

.ace-report .evidence-summary .ace-stat dd {
  margin: 4px 0 0;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.ace-checks {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ace-check {
  display: grid;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--ace-border);
  font-size: 13px;
  grid-template-columns: 18px minmax(0, 1fr) auto;
}

.ace-check strong {
  font-size: 12px;
  font-weight: 500;
}

.ace-check-icon {
  width: 18px;
  height: 18px;
}

.ace-check--supported .ace-check-icon { color: var(--ace-success); }
.ace-check--contradicted .ace-check-icon { color: var(--ace-danger); }
.ace-check--unknown .ace-check-icon { color: var(--ace-subtle); }

.ace-scorebars {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 12px;
  list-style: none;
}

.ace-scorebar-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 13px;
}

.ace-scorebar-head strong {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.ace-report .score-explanation {
  margin: 12px 0 0;
  padding: 10px 0 0;
  border: 0;
  border-top: 1px solid var(--ace-border);
  color: var(--ace-muted);
  font-size: 12px;
}

.ace-report .score-explanation > summary {
  color: var(--ace-fg);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.ace-report .score-explanation p {
  max-width: none;
  margin: 6px 0 0;
}

/* unlock */

.ace-unlock {
  margin-top: 40px;
  padding: 28px;
  border: 1px solid var(--ace-border);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--ace-accent-soft), var(--ace-surface) 60%);
  scroll-margin-top: 72px;
}

.ace-unlock-intro {
  max-width: 640px;
  margin: 0 auto 24px;
  text-align: center;
}

.ace-unlock-icon {
  width: 24px;
  height: 24px;
  color: var(--ace-accent);
}

.ace-unlock-intro h2 {
  margin: 8px 0 6px;
  font-size: 22px;
  font-weight: 600;
}

.ace-unlock-intro p {
  margin: 0;
  color: var(--ace-muted);
}

.ace-unlock-grid {
  display: grid;
  align-items: start;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}

.ace-plan,
.ace-plan-group {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--ace-border);
  border-radius: 8px;
  background: var(--ace-surface);
}

.ace-plan--trial {
  border-color: var(--ace-accent);
  box-shadow: inset 0 0 0 1px var(--ace-accent);
}

.ace-plan--trial .ace-btn {
  align-self: flex-start;
  margin-top: 8px;
}

.ace-plan p,
.ace-plan-group p {
  margin: 0;
}

.ace-plan-name,
.ace-plan-group-title {
  font-size: 15px;
  font-weight: 600;
}

.ace-plan-price {
  color: var(--ace-muted);
  font-size: 13px;
}

.ace-plan-price span {
  display: block;
}

.ace-plan-price strong {
  color: var(--ace-fg);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.ace-plan-body {
  color: var(--ace-muted);
  font-size: 13px;
}

.ace-plans {
  display: grid;
  margin: 8px 0;
  padding: 0;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
}

.ace-plans .ace-plan {
  padding: 14px;
  background: var(--ace-bg);
}

.ace-plan-group > .ace-btn {
  align-self: flex-start;
}

.ace-report .expert-evidence {
  margin-top: 24px;
  padding: 0 20px;
  border: 1px solid var(--ace-border);
  border-radius: 8px;
  background: var(--ace-surface);
  color: var(--ace-muted);
  font-size: 13px;
}

.ace-report .expert-evidence > summary {
  padding: 14px 0;
  color: var(--ace-fg);
  cursor: pointer;
  font-weight: 600;
}

.ace-report .expert-evidence[open] {
  padding-bottom: 16px;
}

.ace-report .expert-evidence blockquote {
  margin: 12px 0 4px;
  padding-left: 12px;
  border-left: 2px solid var(--ace-border-strong);
}

.ace-report .expert-evidence a {
  color: var(--ace-accent);
  font-size: 12px;
}

.ace-report .search-suggestions {
  margin-top: 24px;
  border-top-color: var(--ace-border);
}

@media (max-width: 1199px) {
  .ace-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .ace-report {
    background: none;
    grid-template-columns: minmax(0, 1fr);
  }

  .ace-sidebar {
    display: none;
  }

  .ace-unlock-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767px) {
  .ace-grid-2,
  .ace-report .evidence-summary {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 639px) {
  .ace-main {
    padding: 16px 16px 48px;
  }

  .ace-head-actions {
    width: 100%;
  }

  .ace-head-date {
    width: 100%;
  }

  .ace-btn {
    height: auto;
    min-height: 36px;
    padding: 6px 12px;
    white-space: normal;
  }

  .ace-card-head {
    flex-wrap: wrap;
  }

  .ace-card-head,
  .ace-card-body {
    padding-right: 16px;
    padding-left: 16px;
  }

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

  .ace-report .discipline-overview {
    gap: 8px;
  }

  .ace-ring-wrap {
    width: 88px;
    height: 88px;
  }

  .ace-report .discipline-card-score {
    font-size: 22px;
  }

  .ace-report .discipline-card-projections {
    grid-template-columns: minmax(0, 1fr);
  }

  .ace-engine {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .ace-engine .ace-bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .ace-col-optional {
    display: none;
  }

  .ace-checklist,
  .ace-plans,
  .ace-report .signal-plan {
    grid-template-columns: minmax(0, 1fr);
  }

  .ace-unlock {
    padding: 20px 16px;
  }
}
