/* Bloodline v18 — expanded whitelist and illegal rules. Loaded after prior themes. */
body.page-application .application-layout,
body.page-application .form-grid,
body.page-application .form-panel,
body.page-application .application-form,
body.page-rules .rules-layout,
body.page-rules .rules-content,
body.page-rules .rule-block > div { min-width: 0; }

body.page-application .application-questionnaire {
  display: grid;
  gap: clamp(16px, 2.4vw, 24px);
  min-width: 0;
  padding-top: 8px;
}
body.page-application .application-questionnaire__heading {
  margin: 12px 0 4px;
  padding: clamp(20px, 2.7vw, 28px);
  border-radius: 18px;
  border: 1px solid var(--ui-border);
  background: var(--ui-accent-soft);
}
body.page-application .application-questionnaire__heading h3 {
  margin: 8px 0 8px;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-family: var(--serif);
  color: var(--ui-ink);
  line-height: 1.2;
}
body.page-application .application-questionnaire__heading p:last-child { margin: 0; color: var(--ui-muted); }
body.page-application .character-question {
  min-width: 0;
  padding: clamp(17px, 2.5vw, 24px);
  border: 1px solid var(--ui-border);
  border-radius: 18px;
  background: var(--ui-panel);
  box-shadow: 0 12px 28px var(--ui-glow);
  gap: 12px;
}
body.page-application .character-question__number {
  display: block;
  color: var(--ui-accent) !important;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .18em;
}
body.page-application .character-question__title {
  display: block;
  color: var(--ui-ink) !important;
  font-size: clamp(.97rem, 1.25vw, 1.07rem);
  line-height: 1.65;
  overflow-wrap: anywhere;
}
body.page-application .character-question textarea {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 142px;
  max-height: 440px;
  resize: vertical;
  border-radius: 12px;
  background: var(--ui-bg) !important;
  color: var(--ui-ink) !important;
  border: 1px solid var(--ui-border) !important;
  padding: 15px 17px;
  line-height: 1.7;
}
body.page-application .character-question textarea:focus-visible {
  outline: 0;
  border-color: var(--ui-accent) !important;
  box-shadow: 0 0 0 3px var(--ui-accent-soft);
}
body.page-application .character-question small { color: var(--ui-muted); }
body.page-application .form-panel .form-grid-2 { align-items: start; }

/* Theme-specific scroll tracks for both document and answer textareas. */
body.page-application[data-theme="day"] {
  --application-scroll-track: #dce8f6;
  --application-scroll-thumb: #387dcc;
  --application-scroll-hover: #1b58a6;
}
body.page-application[data-theme="night"] {
  --application-scroll-track: #211a29;
  --application-scroll-thumb: #a94762;
  --application-scroll-hover: #d36b85;
}
body.page-application :is(textarea, .application-briefing-scroll, .application-form, .application-questionnaire) {
  scrollbar-width: thin;
  scrollbar-color: var(--application-scroll-thumb) var(--application-scroll-track);
}
body.page-application :is(textarea, .application-briefing-scroll)::-webkit-scrollbar { width: 11px; height: 11px; }
body.page-application :is(textarea, .application-briefing-scroll)::-webkit-scrollbar-track { background: var(--application-scroll-track); border-radius: 100px; }
body.page-application :is(textarea, .application-briefing-scroll)::-webkit-scrollbar-thumb {
  background: var(--application-scroll-thumb);
  border: 2px solid var(--application-scroll-track);
  border-radius: 100px;
}
body.page-application :is(textarea, .application-briefing-scroll)::-webkit-scrollbar-thumb:hover { background: var(--application-scroll-hover); }
html:has(body.page-application[data-theme="day"]) {
  scrollbar-color: #387dcc #dce8f6;
  scrollbar-width: thin;
}
html:has(body.page-application[data-theme="night"]) {
  scrollbar-color: #a94762 #211a29;
  scrollbar-width: thin;
}
html:has(body.page-application[data-theme="day"])::-webkit-scrollbar,
html:has(body.page-application[data-theme="night"])::-webkit-scrollbar { width: 11px; }
html:has(body.page-application[data-theme="day"])::-webkit-scrollbar-track { background: #dce8f6; }
html:has(body.page-application[data-theme="night"])::-webkit-scrollbar-track { background: #211a29; }
html:has(body.page-application[data-theme="day"])::-webkit-scrollbar-thumb { background: #387dcc; border-radius: 99px; }
html:has(body.page-application[data-theme="night"])::-webkit-scrollbar-thumb { background: #a94762; border-radius: 99px; }

body.page-rules .rules-index {
  max-height: calc(100dvh - 128px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--ui-accent) var(--ui-panel);
  scrollbar-width: thin;
  border-radius: 16px;
}
body.page-rules .rules-index::-webkit-scrollbar { width: 8px; }
body.page-rules .rules-index::-webkit-scrollbar-thumb { background: var(--ui-accent); border-radius: 99px; }
body.page-rules .rules-index a { display: block; overflow-wrap: break-word; }
body.page-rules .illegal-rule-block { scroll-margin-top: 96px; }
body.page-rules .illegal-rule-group + .illegal-rule-group {
  margin-top: 30px;
  padding-top: 25px;
  border-top: 1px solid var(--ui-border);
}
body.page-rules .illegal-rule-group h3 {
  margin: 0 0 13px;
  color: var(--ui-ink) !important;
  font-size: 1.12rem;
  line-height: 1.5;
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: -.01em;
}
body.page-rules .illegal-rule-group ol { color: var(--ui-muted); }
body.page-rules .illegal-rule-group li {
  margin-block: 6px;
  line-height: 1.75;
  overflow-wrap: break-word;
}
body.page-rules[data-theme="day"] .illegal-rule-group li { color: #415b77 !important; }
body.page-rules[data-theme="night"] .illegal-rule-group li { color: #c7becc !important; }
body.page-rules[data-theme="day"] .illegal-rule-group h3 { color: #174a86 !important; }
body.page-rules[data-theme="night"] .illegal-rule-group h3 { color: #f0bdc7 !important; }

@media (max-width: 1040px) {
  body.page-application .application-layout { gap: 28px; }
  body.page-rules .rules-index { position: relative; top: auto; max-height: 240px; }
}
@media (max-width: 760px) {
  body.page-application .form-panel { padding: 22px 16px; }
  body.page-application .form-grid-2 { grid-template-columns: 1fr; }
  body.page-application .application-questionnaire { gap: 14px; }
  body.page-application .character-question { padding: 17px 14px; border-radius: 15px; }
  body.page-application .character-question textarea { min-height: 150px; }
  body.page-rules .illegal-rule-group + .illegal-rule-group { margin-top: 20px; padding-top: 18px; }
  body.page-rules .rules-index { max-height: 205px; }
}
