:root {
  --ink: #1d1733;
  --muted: #615b73;
  --paper: #f8f2e7;
  --panel: rgba(249, 247, 242, 0.96);
  --purple: #4b2a7a;
  --purple-2: #6c3483;
  --pink: #c62d75;
  --green: #4b7f2a;
  --green-soft: #e4efd8;
  --blue: #294f8b;
  --orange: #d77932;
  --border: #d8cfdf;
  --shadow: 0 20px 55px rgba(31, 20, 52, .12);
  --dcci-header-font: Inter, Aptos, "Segoe UI", Arial, sans-serif;
  --dcci-border: rgba(255,255,255,.28);
  --dcci-white-hi: #fff;
  --dcci-white-mid: rgba(255,255,255,.78);
  --dcci-pink: #ff5aa5;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { height: auto; min-height: 0; overflow: visible; margin: 0; padding: 0; }
body {
  background-image: url('https://dcciportal.co.uk/wp-content/uploads/2026/02/Picture1.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: scroll;
  color: var(--ink);
  font-family: Inter, Aptos, "Segoe UI", Arial, sans-serif;
  line-height: 1.55;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: var(--purple); }
.skip-link { position: absolute; left: -9999px; top: .5rem; z-index: 9999; background: #fff; padding: .8rem 1rem; border-radius: .5rem; }
.skip-link:focus { left: .5rem; }

.app-frame { width: min(1480px, calc(100% - 32px)); margin: 16px auto 30px; }
.hero, .app-section {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border-radius: 26px;
  box-shadow: var(--shadow);
}
.hero::before, .app-section::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, #8e44ad 0%, #e91e63 30%, #3f51b5 62%, #27ae60 100%);
}
.hero { background: linear-gradient(125deg, rgba(34,20,67,.98), rgba(72,35,112,.97)); color: #fff; padding: 24px clamp(22px, 4vw, 60px) 0; }
.dcci-app-logo { display: block; width: min(190px, 40vw); max-height: 82px; object-fit: contain; margin: 0 auto 18px; filter: none; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr); align-items: center; gap: clamp(28px, 5vw, 80px); padding: 28px 0 36px; }
.eyebrow, .section-kicker { display: inline-block; color: var(--pink); text-transform: uppercase; letter-spacing: .13em; font-size: .78rem; font-weight: 850; }
.hero .eyebrow { color: #ff82bd; }
.hero h1 { margin: 10px 0 14px; font-size: clamp(2.6rem, 6vw, 5.7rem); line-height: .92; letter-spacing: -.045em; max-width: 900px; }
.hero h1 span { color: #a6d35e; }
.hero-copy > p { max-width: 740px; font-size: clamp(1.05rem, 2vw, 1.35rem); color: rgba(255,255,255,.82); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.primary, .secondary, .danger { border: 0; border-radius: 999px; font-weight: 800; padding: .85rem 1.25rem; transition: transform .18s ease, box-shadow .18s ease; }
.complete-button { border: 0; border-radius: 999px; padding: .95rem 1.35rem; background: linear-gradient(135deg, #4b7f2a, #2f6720); color: #fff; font-weight: 900; box-shadow: 0 8px 24px rgba(75,127,42,.28); }
.primary { background: linear-gradient(135deg, #d5357d, #9f2473); color: #fff; box-shadow: 0 8px 24px rgba(213,53,125,.3); }
.secondary { background: rgba(255,255,255,.1); color: inherit; border: 1px solid currentColor; }
.danger { background: transparent; color: #9b2845; border: 1px solid #c88495; }
.primary:hover, .secondary:hover, .danger:hover { transform: translateY(-2px); }
.hero-visual { min-height: 320px; position: relative; display: grid; place-items: center; isolation: isolate; }
.lens { position: absolute; display: grid; place-items: center; align-content: center; border-radius: 50%; aspect-ratio: 1; color: #fff; text-align: center; box-shadow: inset 0 0 0 8px rgba(255,255,255,.16), 0 24px 50px rgba(0,0,0,.24); backdrop-filter: blur(4px); }
.lens span { display: block; font-size: clamp(2rem, 4vw, 4.2rem); font-weight: 950; line-height: .9; }
.lens small { text-transform: uppercase; letter-spacing: .12em; font-weight: 800; margin-top: 7px; }
.lens-one { width: 245px; left: 0; background: rgba(197,45,117,.88); z-index: 3; }
.lens-two { width: 205px; left: 35%; background: rgba(50,80,147,.82); z-index: 2; }
.lens-three { width: 165px; right: 1%; background: rgba(82,126,41,.88); z-index: 1; }
.light-beam { position: absolute; width: 90%; height: 65px; background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.22), rgba(166,211,94,.35)); clip-path: polygon(0 42%, 100% 0, 100% 100%, 0 58%); z-index: -1; }
.legal-shift { margin: 0 calc(clamp(22px, 4vw, 60px) * -1); padding: 15px clamp(22px, 4vw, 60px); display: grid; grid-template-columns: max-content 1fr; gap: 22px; background: #a6d35e; color: #202619; }

.section-nav { position: sticky; top: 0; z-index: 100; display: grid; grid-template-columns: repeat(5, 1fr); width: calc(100% - 28px); margin: -1px auto 18px; border-radius: 0 0 18px 18px; overflow: hidden; box-shadow: 0 12px 30px rgba(30,20,50,.14); }
.nav-tab { border: 0; background: #34215f; color: rgba(255,255,255,.72); padding: 15px 10px; font-weight: 750; }
.nav-tab span { opacity: .55; margin-right: 5px; }
.nav-tab.is-active { background: #b32d76; color: #fff; }
.nav-tab:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #f0a42b; outline-offset: 3px; }

.app-section { display: none; padding: clamp(24px, 4vw, 56px); min-height: 650px; }
.app-section.is-active { display: block; animation: sectionIn .28s ease; }
@keyframes sectionIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.section-heading { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr); gap: 36px; align-items: end; padding-bottom: 28px; border-bottom: 1px solid #ded6e3; margin-bottom: 32px; }
.section-heading h2 { margin: 5px 0 0; font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.03; letter-spacing: -.035em; }
.section-heading > p { margin: 0; color: var(--muted); }

.three-test { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.three-test article { position: relative; padding: 26px 22px 22px 68px; border-radius: 18px; background: #efe8f4; min-height: 175px; }
.three-test article:nth-child(2) { background: #e6eef7; }
.three-test article:nth-child(3) { background: #e8efdf; }
.test-number { position: absolute; left: 20px; top: 22px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--purple); color: #fff; font-weight: 900; }
.three-test h3 { margin: 0 0 8px; }
.three-test p { margin: 0; color: #4e485a; }

.reality-ribbon { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 34px; background: #2e1c54; padding: 7px; border-radius: 20px; }
.reality-ribbon button { min-width: 0; border: 0; border-radius: 14px; padding: 17px 7px; background: transparent; color: #fff; }
.reality-ribbon button:hover, .reality-ribbon button.is-active { background: #c42f77; }
.reality-ribbon b { display: block; font-size: 2rem; line-height: 1; }
.reality-ribbon span { display: block; margin-top: 7px; font-size: .76rem; font-weight: 700; line-height: 1.2; }
.reality-explainer { display: grid; grid-template-columns: 190px 1fr; gap: 20px; padding: 18px 22px; border-radius: 0 0 18px 18px; margin: 0 18px; background: #e9e0ef; }
.reality-explainer p { margin: 0; }
.principle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 34px; }
.principle-card { padding: 24px; border-top: 5px solid var(--pink); background: #f5f0e8; border-radius: 16px; }
.principle-card.uncertainty { border-color: var(--orange); }
.principle-card.distinction { border-color: var(--green); }
.principle-card .icon { font-size: 2rem; font-weight: 900; color: var(--purple); }
.principle-card h3 { margin: 8px 0; }
.principle-card p { margin: 0; color: var(--muted); }

.case-layout { display: grid; grid-template-columns: minmax(270px, .72fr) minmax(0, 1.28fr); gap: 24px; align-items: start; }
.case-timeline { position: relative; display: grid; gap: 10px; }
.case-timeline::before { content: ""; position: absolute; left: 35px; top: 18px; bottom: 18px; width: 3px; background: linear-gradient(var(--purple), var(--pink), var(--green)); }
.case-button { position: relative; display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 11px; width: 100%; border: 0; border-radius: 15px; padding: 11px 14px 11px 8px; background: #eee8f2; color: var(--ink); text-align: left; }
.case-button .year { position: relative; z-index: 1; display: grid; place-items: center; width: 56px; height: 44px; border-radius: 11px; background: #38205f; color: #fff; font-weight: 900; }
.case-button strong { line-height: 1.15; }
.case-button small { display: block; color: var(--muted); margin-top: 3px; }
.case-button .status-dot { width: 11px; height: 11px; border-radius: 50%; background: #777; }
.case-button[data-status="current"] .status-dot { background: #4e8a32; }
.case-button[data-status="qualified"] .status-dot { background: #d08a2e; }
.case-button[data-status="overruled"] .status-dot { background: #bd2c65; }
.case-button:hover, .case-button.is-active { background: #d9cae5; box-shadow: inset 0 0 0 2px var(--purple); }
.case-detail { position: sticky; top: 82px; min-height: 580px; padding: clamp(24px, 4vw, 42px); border-radius: 22px; background: linear-gradient(145deg, #2d1b52, #4a2876); color: #fff; overflow: hidden; }
.case-detail::after { content: attr(data-year); position: absolute; right: -15px; top: -45px; font-size: 12rem; font-weight: 950; color: rgba(255,255,255,.045); line-height: 1; }
.case-detail .case-meta { display: flex; flex-wrap: wrap; gap: 9px; position: relative; z-index: 1; }
.case-detail .pill { border-radius: 999px; padding: 5px 10px; background: rgba(255,255,255,.1); font-size: .75rem; font-weight: 800; }
.case-detail h3 { position: relative; z-index: 1; font-size: clamp(2rem, 4vw, 3.25rem); margin: 18px 0 6px; line-height: 1; }
.case-detail .citation { color: #d7cae7; margin: 0 0 24px; }
.case-detail-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.case-detail-grid > div { padding: 18px; border-radius: 15px; background: rgba(255,255,255,.08); }
.case-detail-grid h4 { color: #a6d35e; margin: 0 0 7px; font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; }
.case-detail-grid p, .case-detail-grid ul { margin: 0; }
.case-detail-grid ul { padding-left: 1.1rem; }
.case-detail .evidence-prompt { position: relative; z-index: 1; margin-top: 16px; padding: 20px; border-radius: 15px; background: #a6d35e; color: #1f2a14; }
.case-detail .evidence-prompt h4 { margin: 0 0 6px; }
.case-detail a { color: #fff; }
.correction-note { display: grid; grid-template-columns: max-content 1fr; gap: 18px; margin-top: 24px; padding: 18px 20px; background: #fff0cf; border-radius: 14px; border-left: 5px solid var(--orange); }
.correction-note p { margin: 0; }

.progress-block { min-width: 240px; }
.progress-block > span { display: block; font-weight: 800; text-align: right; margin-bottom: 6px; }
.progress-track { height: 10px; background: #ded6e3; border-radius: 999px; overflow: hidden; }
.progress-track span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--pink), var(--green)); transition: width .25s ease; }
.identity-strip { display: grid; grid-template-columns: 1fr 1fr .7fr; gap: 14px; background: #35215e; color: #fff; border-radius: 18px; padding: 18px; margin-bottom: 20px; }
label { font-weight: 750; }
input, textarea, select { width: 100%; color: var(--ink); background: #fbfaf7; border: 1px solid #bdb3c7; border-radius: 10px; padding: .8rem; margin-top: 6px; }
textarea { resize: vertical; min-height: 92px; }
.builder-panels { display: grid; gap: 14px; }
.builder-panel { border: 1px solid #d6ccdd; border-radius: 18px; background: #f5f1eb; overflow: hidden; }
.builder-panel > button { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 16px; width: 100%; border: 0; padding: 18px 20px; text-align: left; background: transparent; color: var(--ink); }
.builder-panel > button .letter { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; color: #fff; background: var(--purple); font-size: 1.75rem; font-weight: 950; }
.builder-panel:nth-child(2) .letter { background: var(--blue); }
.builder-panel:nth-child(3) .letter { background: var(--pink); }
.builder-panel:nth-child(4) .letter { background: var(--green); }
.builder-panel:nth-child(5) .letter { background: var(--orange); }
.builder-panel:nth-child(6) .letter { background: #5a6577; }
.builder-panel:nth-child(7) .letter { background: #723a78; }
.builder-panel .panel-title strong { display: block; font-size: 1.16rem; }
.builder-panel .panel-title small { color: var(--muted); }
.builder-panel .chevron { font-size: 1.5rem; transition: transform .2s ease; }
.builder-panel.is-open .chevron { transform: rotate(180deg); }
.builder-panel-body { display: none; padding: 0 20px 22px 92px; }
.builder-panel.is-open .builder-panel-body { display: block; }
.prompt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.prompt-field { display: block; font-weight: 700; color: #332c3c; }
.prompt-field.full { grid-column: 1 / -1; }
.prompt-field .hint { display: block; color: var(--muted); font-size: .81rem; font-weight: 500; margin-top: 2px; }
.source-checks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.source-checks label { display: flex; align-items: center; gap: 6px; border: 1px solid #c7bdce; border-radius: 999px; padding: 6px 10px; font-size: .8rem; background: #fff; }
.source-checks input { width: auto; margin: 0; }
.evidence-ladder { margin-top: 26px; display: grid; grid-template-columns: .75fr 1.25fr; gap: 28px; padding: 28px; border-radius: 20px; background: #2e1c54; color: #fff; }
.evidence-ladder h3 { font-size: 1.8rem; line-height: 1.05; margin: 5px 0; }
.evidence-ladder ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.evidence-ladder li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; background: rgba(255,255,255,.08); }
.evidence-ladder li b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #a6d35e; color: #1c2711; }
.evidence-ladder li span strong { display: block; }
.evidence-ladder li.weak b { background: #f1a24a; }

.balance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.balance-column { border-radius: 18px; overflow: hidden; background: #f1ece6; border: 1px solid #d8d0dc; }
.balance-column header { display: grid; grid-template-columns: 46px 1fr; gap: 10px; align-items: center; padding: 18px; background: #3f296c; color: #fff; }
.balance-column.away header { background: #457329; }
.balance-column.unknown header { background: #9b6129; }
.balance-column header > span { display: grid; place-items: center; width: 42px; height: 42px; border: 2px solid rgba(255,255,255,.5); border-radius: 50%; font-size: 1.5rem; font-weight: 900; }
.balance-column h3 { margin: 0; font-size: 1.05rem; }
.balance-column header p { margin: 2px 0 0; font-size: .78rem; color: rgba(255,255,255,.75); }
.balance-column textarea { margin: 0; border: 0; border-radius: 0; min-height: 330px; background: transparent; padding: 18px; }
.challenge-panel { display: grid; grid-template-columns: .55fr 1.45fr; gap: 28px; margin-top: 24px; padding: 28px; border-radius: 19px; background: #e7dfed; }
.challenge-panel h3 { font-size: 1.8rem; margin: 0; line-height: 1.1; }
.challenge-list { display: grid; gap: 9px; }
.challenge-list label { display: grid; grid-template-columns: 22px 1fr; align-items: start; gap: 8px; padding: 10px; border-radius: 10px; background: rgba(255,255,255,.65); }
.challenge-list input { width: 18px; height: 18px; margin: 3px 0 0; }

.storck-conclusion { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.storck-conclusion article { position: relative; padding: 24px; border-radius: 18px; background: #eee7f3; }
.storck-conclusion article:nth-child(2) { background: #e7eef6; }
.storck-conclusion article:nth-child(3) { background: #e6eedf; }
.storck-conclusion article > span { position: absolute; right: 18px; top: 12px; font-size: 2.8rem; font-weight: 950; color: rgba(40,30,60,.12); }
.storck-conclusion h3 { margin-top: 0; }
.select-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; }
.overall-panel { margin-top: 20px; padding: 28px; border-radius: 20px; background: #35215e; color: #fff; display: grid; gap: 16px; }
.overall-choice { font-size: 1.25rem; }
.overall-choice select { font-size: 1rem; }
.action-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.action-bar .secondary { color: var(--purple); background: transparent; }
#save-status { margin-left: auto; color: var(--muted); font-size: .85rem; }
.completion-screen { margin-top: 24px; padding: 26px; border-radius: 20px; background: #e5efd9; color: #23351a; display: grid; grid-template-columns: 70px 1fr; gap: 18px; align-items: center; border: 2px solid #9cc276; }
.completion-screen[hidden] { display: none; }
.completion-mark { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #4b7f2a; color: #fff; font-size: 2rem; font-weight: 950; }
.completion-screen h3 { margin: 4px 0 5px; font-size: 1.5rem; }
.completion-screen p { margin: 0; }
.references { margin-top: 28px; border-top: 1px solid #d8cfdd; padding-top: 18px; }
.references summary { cursor: pointer; font-weight: 850; color: var(--purple); }
#reference-list { display: grid; gap: 8px; margin-top: 14px; }
#reference-list a { overflow-wrap: anywhere; }
.scope-note { padding: 15px; background: #fff3d8; border-radius: 12px; }
.print-annex { display: none; white-space: pre-wrap; font: 10pt/1.45 Aptos, "Segoe UI", Arial, sans-serif; color: #111; }
footer { display: flex; justify-content: space-between; gap: 16px; color: #fff; background: #2b1b4c; padding: 16px 24px; border-radius: 0 0 18px 18px; font-size: .82rem; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 1000; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #201536; color: #fff; padding: 11px 16px; border-radius: 999px; box-shadow: var(--shadow); transition: .2s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1050px) {
  .hero-grid, .section-heading, .case-layout, .evidence-ladder, .challenge-panel { grid-template-columns: 1fr; }
  .hero-visual { min-height: 260px; }
  .case-detail { position: relative; top: 0; }
  .reality-ribbon { grid-template-columns: repeat(4, 1fr); }
  .balance-grid, .storck-conclusion { grid-template-columns: 1fr; }
  .balance-column textarea { min-height: 190px; }
}
@media (max-width: 760px) {
  .app-frame { width: min(100% - 14px, 1480px); margin-top: 7px; }
  .hero { padding-inline: 20px; }
  .hero-grid { padding-top: 10px; }
  .hero-visual { min-height: 220px; transform: scale(.82); }
  .legal-shift { grid-template-columns: 1fr; gap: 3px; }
  .section-nav { position: relative; width: 100%; grid-template-columns: 1fr; border-radius: 16px; margin: 10px 0; }
  .nav-tab { text-align: left; padding: 10px 16px; }
  .app-section { padding: 24px 18px; }
  .three-test, .principle-grid, .identity-strip, .prompt-grid, .case-detail-grid { grid-template-columns: 1fr; }
  .reality-ribbon { grid-template-columns: repeat(2, 1fr); }
  .reality-explainer { grid-template-columns: 1fr; margin-inline: 5px; }
  .builder-panel-body { padding: 0 15px 18px; }
  .prompt-field.full { grid-column: auto; }
  .case-button { grid-template-columns: 58px 1fr; }
  .case-button .status-dot { display: none; }
  .correction-note { grid-template-columns: 1fr; }
  #save-status { width: 100%; margin-left: 0; }
  footer { flex-direction: column; }
}

@media print {
  body { background: #fff; }
  .app-frame { width: 100%; margin: 0; }
  .hero, .section-nav, #overview, #cases, #builder, #weigh, .action-bar, .completion-screen, .dcci-a11y-trigger, .dcci-a11y-panel, footer { display: none !important; }
  #conclusion { display: block !important; box-shadow: none; padding: 0; }
  #conclusion::before { display: none; }
  .section-heading { display: block; }
  .storck-conclusion { grid-template-columns: 1fr; }
  .overall-panel { color: #111; background: #f2f2f2; }
  textarea, input, select { border: 1px solid #777; background: #fff; }
  .references { display: block; }
  .print-annex { display: block; margin-top: 28px; padding-top: 18px; border-top: 2px solid #333; }
}
