/* ===== DEMO PAGE HERO ===== */
.demo-page-hero {
  background: var(--surface-dark);
  color: #fff;
  text-align: center;
  padding: 110px 24px 48px;
}
.demo-page-hero .demo__eyebrow {
  font-size: .82rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--blue); margin-bottom: 12px;
}
.demo-page-hero__title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700; letter-spacing: -.04em; line-height: 1.1; margin-bottom: 12px;
}
.demo-page-hero__sub {
  font-size: 1rem; color: #86868b; max-width: 520px; margin: 0 auto;
}

/* ===== DEMO AUDIT RULES SECTION ===== */
.demo-rules {
  background: #000; padding: 60px 24px;
}
.demo-rules__inner { max-width: 860px; margin: 0 auto; }
.demo-rules__title {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -.03em;
  color: #f5f5f7; text-align: center; margin-bottom: 8px;
}
.demo-rules__sub {
  font-size: .9rem; color: #86868b; text-align: center; margin-bottom: 36px;
}
.demo-rules__grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px;
}
.demo-rule {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px; padding: 16px 18px;
  transition: border-color .15s;
}
.demo-rule:hover { border-color: rgba(255,255,255,.14); }
.demo-rule__id {
  font-size: .68rem; font-weight: 700; letter-spacing: .06em;
  color: var(--blue); margin-bottom: 6px;
}
.demo-rule__name {
  font-size: .88rem; font-weight: 600; color: #f5f5f7; margin-bottom: 4px;
}
.demo-rule__desc { font-size: .78rem; color: #86868b; line-height: 1.45; }
.demo-rule--violation .demo-rule__id { color: #ff453a; }
.demo-rule--warning .demo-rule__id { color: #ff9f0a; }

/* ===== DEMO SECTION ===== */
.demo { background: #000; color: #fff; padding: 0 24px 100px; }
.demo__inner { max-width: var(--max-w); margin: 0 auto; }
.demo__eyebrow { font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #86868b; text-align: center; margin-bottom: 12px; }
.demo__heading { font-size: clamp(1.6rem,4vw,2.4rem); font-weight: 700; letter-spacing: -.03em; text-align: center; margin-bottom: 10px; }
.demo__sub { font-size: 1rem; color: #86868b; font-weight: 300; text-align: center; margin-bottom: 36px; }
.demo__upload { text-align: center; padding: 40px 0; }

/* Dashboard header */
.demo__header { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; padding: 16px 0; }
.demo__score-wrap { position: relative; flex-shrink: 0; cursor: help; }
.demo__score-tip { display: none; position: absolute; top: calc(100% + 10px); left: -10px; z-index: 50; background: #1e293b; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 14px 16px; width: 300px; box-shadow: 0 12px 40px rgba(0,0,0,.7); font-size: .78rem; line-height: 1.5; color: #f5f5f7; }
.demo__score-wrap:hover .demo__score-tip { display: block; }
.demo__counters { display: flex; gap: 10px; flex: 1; justify-content: center; }
.demo__cnt { position: relative; text-align: center; padding: 8px 16px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); cursor: default; transition: border-color .2s; }
.demo__cnt:hover { border-color: rgba(255,255,255,.2); }
.demo__cnt-v { display: block; font-size: 1.6rem; font-weight: 800; }
.demo__cnt--g .demo__cnt-v { color: #30d158; }
.demo__cnt--y .demo__cnt-v { color: #ff9f0a; }
.demo__cnt--r .demo__cnt-v { color: #ff453a; }
.demo__cnt-l { font-size: .68rem; color: #86868b; }
.demo__cnt-pop { display: none; position: absolute; top: calc(100% + 8px); right: -20px; z-index: 50; background: #1e293b; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 12px 14px; min-width: 260px; max-width: 340px; max-height: 280px; overflow-y: auto; text-align: left; box-shadow: 0 12px 40px rgba(0,0,0,.7); }
.demo__cnt:hover .demo__cnt-pop { display: block; }
.demo__cnt-pop:empty { display: none !important; }
.demo__reset { font-family: var(--font); font-size: .78rem; color: #86868b; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); padding: 6px 14px; border-radius: 8px; cursor: pointer; transition: all .15s; }
.demo__reset:hover { color: #fff; border-color: rgba(255,255,255,.2); }

/* Tabs */
.demo__tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.06); padding-bottom: 8px; overflow-x: auto; }
.demo__tab { font-family: var(--font); font-size: .82rem; font-weight: 600; color: #86868b; background: none; border: none; padding: 6px 14px; border-radius: 8px; cursor: pointer; transition: all .15s; white-space: nowrap; }
.demo__tab:hover { color: #fff; }
.demo__tab--on { background: rgba(255,255,255,.08); color: #fff; }

/* Grid table */
.demo__grid-hint { font-size: .7rem; color: rgba(255,255,255,.2); margin-bottom: 8px; }
.demo__tw { overflow-x: auto; border-radius: 10px; border: 1px solid rgba(255,255,255,.08); }
.demo__tbl { border-collapse: collapse; width: 100%; min-width: 700px; }
.demo__tbl th { padding: 5px 3px; background: rgba(255,255,255,.03); color: #86868b; font-weight: 600; font-size: .68rem; border-bottom: 1px solid rgba(255,255,255,.06); text-align: center; }
.demo__tbl td { padding: 1px; vertical-align: middle; border-bottom: 1px solid rgba(255,255,255,.04); }
.demo__cell { border-radius: 4px; padding: 3px 2px; text-align: center; font-size: .65rem; font-weight: 600; color: #fff; line-height: 1.15; text-shadow: 0 1px 2px rgba(0,0,0,.5); cursor: default; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 26px; }
.demo__cell-score { font-size: .5rem; opacity: .6; }
.demo__cell--warn { border: 2px solid #ff9f0a !important; }
.demo__cell--viol { border: 2px solid #ff453a !important; }

/* Tooltip */
.demo__ttip { position: fixed; z-index: 100; background: #1e293b; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 12px 16px; max-width: 310px; pointer-events: none; box-shadow: 0 8px 32px rgba(0,0,0,.7); font-size: .78rem; color: #f5f5f7; display: none; }
.demo__heat-note { font-size: .78rem; color: #86868b; line-height: 1.5; margin-bottom: 12px; padding: 10px 14px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06); border-radius: 10px; }

/* Panes */
.demo__pane {}

/* Table header/cell classes (replaces inline styles in engine.js) */
.tbl-day-hdr { border-left: 2px solid rgba(255,255,255,.1); }
.tbl-num-hdr { font-size: .6rem; color: #6e6e73; }
.tbl-num-hdr--first { border-left: 2px solid rgba(255,255,255,.1); }
.tbl-hdr-cls { position: sticky; left: 0; z-index: 3; background: rgba(0,0,0,.9); }
.tbl-cls-cell { position: sticky; left: 0; z-index: 2; background: rgba(0,0,0,.9); font-weight: 700; font-size: .72rem; padding: 0 6px; cursor: help; }
.tbl-cell { padding: 1px; }
.tbl-cell--first { border-left: 2px solid rgba(255,255,255,.1); }
.heat-class-col { width: 50px; }
.heat-class { font-weight: 700; padding: 6px 8px; }
.heat-cell { text-align: center; padding: 6px 12px; font-weight: 700; font-size: .88rem; }
.heat-sum { text-align: center; padding: 6px 12px; font-weight: 600; color: #6e6e73; }

/* Score ring (replaces inline style on scoreEl) */
.score-ring { position: relative; width: 72px; height: 72px; flex-shrink: 0; }
.score-ring__svg { transform: rotate(-90deg); }
.score-ring__label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-ring__score { font-size: 1.35rem; font-weight: 800; line-height: 1; }
.score-ring__sub { font-size: .42rem; color: #86868b; }

/* Rec items */
.rec-item { border-radius: 10px; padding: 11px 13px; margin-bottom: 8px; border: 1px solid; }
.rec-item--v { background: rgba(255,69,58,.06); border-color: rgba(255,69,58,.15); }
.rec-item--w { background: rgba(255,159,10,.06); border-color: rgba(255,159,10,.15); }
.rec-item__head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.rec-item__badge { font-size: .65rem; font-weight: 700; padding: 2px 7px; border-radius: 5px; color: #000; }
.rec-item__badge--v { background: #ff453a; }
.rec-item__badge--w { background: #ff9f0a; }
.rec-item__name { font-size: .82rem; font-weight: 600; color: #f5f5f7; }
.rec-item__classes { font-size: .72rem; color: #86868b; margin-left: auto; }
.rec-item__desc { font-size: .78rem; color: rgba(255,255,255,.65); line-height: 1.4; }
.rec-item__suggest { font-size: .78rem; color: #22d3ee; margin-top: 3px; }

/* Popup items (in counters) */
.pop-item { padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.06); display: flex; gap: 5px; }
.pop-item:last-child { border-bottom: none; }
.pop-item__badge { font-size: .6rem; font-weight: 700; padding: 1px 5px; border-radius: 4px; flex-shrink: 0; align-self: flex-start; margin-top: 1px; }
.pop-item__body { font-size: .72rem; }
.pop-item__desc { color: rgba(255,255,255,.7); line-height: 1.3; }
.pop-item__suggest { color: #22d3ee; font-size: .68rem; margin-top: 1px; }
.pop-more { color: #6e6e73; font-size: .6rem; margin-top: 4px; }

/* Variant popup */
.var-popup-wrap { position: relative; display: inline-block; cursor: help; }
.var-popup { display: none; position: absolute; bottom: calc(100% + 8px); right: 0; z-index: 60; background: #1e293b; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: 10px 12px; min-width: 280px; max-width: 360px; max-height: 300px; overflow-y: auto; box-shadow: 0 12px 40px rgba(0,0,0,.7); text-align: left; }
.var-popup-wrap:hover .var-popup { display: block; }
.var-popup__item { padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.06); font-size: .72rem; }
.var-popup__item:last-child { border-bottom: none; }
.var-popup__more { color: #6e6e73; font-size: .6rem; margin-top: 3px; }

/* Variant compare table */
.var-compare { background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; }
.var-compare__hdr { display: flex; gap: 6px; font-size: .75rem; margin-bottom: 6px; color: #6e6e73; align-items: center; }
.var-compare__row { display: flex; gap: 6px; font-size: .82rem; margin-bottom: 2px; align-items: center; }
.var-compare__lbl { width: 80px; text-align: right; color: #6e6e73; font-size: .75rem; }
.var-compare__col { width: 44px; text-align: center; }
.var-compare__col-hdr { font-weight: 700; }
.var-compare__col-a { color: #60a5fa; }
.var-compare__col-b { color: #a78bfa; }
.var-compare__curr { background: rgba(255,255,255,.06); border-radius: 4px; padding: 2px 4px; color: #86868b; }
.var-compare__arrow { width: 14px; color: rgba(255,255,255,.15); }
.var-compare__result { font-weight: 700; border-radius: 4px; padding: 2px 4px; }

/* Variant sections */
.var-section { margin-bottom: 20px; }
.var-section__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.var-section__badge { font-size: .68rem; font-weight: 700; padding: 3px 10px; border-radius: 6px; color: #fff; }
.var-section__badge--a { background: #1d4ed8; }
.var-section__badge--b { background: #7c3aed; }
.var-section__title { font-size: .88rem; font-weight: 600; color: #f5f5f7; }
.var-section__desc { font-size: .78rem; color: #6e6e73; }
.var-section__badge-right { margin-left: auto; font-size: .7rem; color: #6e6e73; }

/* CTA box at bottom of demo */
.demo__cta-box { text-align: center; margin-top: 40px; padding: 28px 24px; background: rgba(0,113,227,.06); border: 1px solid rgba(0,113,227,.15); border-radius: 16px; }

/* Tab description strip */
.demo__tab-desc { margin-bottom: 10px; }
.demo__tab-desc p { font-size: .82rem; color: #86868b; background: rgba(255,255,255,.03); border-radius: 8px; padding: 8px 12px; margin: 0; }

/* ===== NEW DEMO PAGE CLASSES ===== */
body.demo-page { background: #0a0a0a; color: #f5f5f7; min-height: 100vh; }

.demo-hero { background: var(--surface-dark); color: #fff; text-align: center; padding: 110px 24px 48px; }
.demo-hero__inner { max-width: var(--max-w-narrow); margin: 0 auto; }
.demo-hero__eyebrow { font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--blue); margin-bottom: 14px; }
.demo-hero__title { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; letter-spacing: -.04em; line-height: 1.08; margin-bottom: 16px; }
.demo-hero__sub { font-size: 1.05rem; color: #86868b; max-width: 520px; margin: 0 auto; font-weight: 300; line-height: 1.6; }

.demo-main { background: #0a0a0a; }
.demo-inner { max-width: var(--max-w); margin: 0 auto; padding: 40px 24px 80px; }

.demo-upload { margin-bottom: 32px; }
.demo-dropzone {
  border: 2px dashed rgba(255,255,255,.15); border-radius: 16px;
  padding: 48px 24px; cursor: pointer; text-align: center;
  transition: border-color .2s, background .2s;
}
.demo-dropzone:hover, .demo-dropzone--over { border-color: var(--blue); background: rgba(0,113,227,.06); }
.demo-dropzone__icon { display: block; margin: 0 auto 12px; opacity: .35; }
.demo-dropzone__title { font-size: 1rem; font-weight: 600; color: #f5f5f7; margin-bottom: 6px; }
.demo-dropzone__sub { font-size: .82rem; color: #86868b; }
.demo-dropzone__btn { background: none; border: none; color: var(--blue); cursor: pointer; font-family: var(--font); font-size: .82rem; font-weight: 500; padding: 0; text-decoration: underline; }
.demo-dropzone__fmt { font-size: .74rem; color: rgba(255,255,255,.25); margin-top: 10px; }
.demo-error { display: block; color: var(--red); font-size: .82rem; margin-top: 8px; }

.demo-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: rgba(255,255,255,.45); background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.09); border-radius: 980px;
  padding: 4px 12px; margin-bottom: 20px; margin-left: auto; margin-right: auto;
}

.demo-results { margin-bottom: 40px; }
.demo-tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.08); padding-bottom: 10px; justify-content: center; flex-wrap: wrap; }
.demo-tab { font-family: var(--font); font-size: .82rem; font-weight: 500; color: rgba(255,255,255,.4); background: none; border: none; padding: 6px 14px; border-radius: 980px; cursor: pointer; transition: all .15s; white-space: nowrap; }
.demo-tab:hover { color: #f5f5f7; }
.demo-tab--active { color: #f5f5f7; background: rgba(255,255,255,.1); }
.demo-tab-panel { color: #f5f5f7; }
.demo-tab-desc { font-size: .8rem; color: #86868b; padding: 8px 12px; background: rgba(255,255,255,.03); border-radius: 8px; margin-bottom: 14px; }

.demo-rules { padding: 40px 0 20px; }
.demo-rules__title { font-size: 1.4rem; font-weight: 700; letter-spacing: -.03em; color: #f5f5f7; text-align: center; margin-bottom: 24px; }
.demo-rules__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.demo-rule { display: flex; gap: 14px; align-items: flex-start; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07); border-radius: 12px; padding: 16px 18px; transition: border-color .15s; }
.demo-rule:hover { border-color: rgba(255,255,255,.14); }
.demo-rule__code { font-size: .7rem; font-weight: 800; font-family: monospace; color: var(--blue); background: rgba(0,113,227,.12); border-radius: 6px; padding: 3px 7px; flex-shrink: 0; align-self: flex-start; margin-top: 2px; }
.demo-rule__name { font-size: .88rem; font-weight: 600; color: #f5f5f7; margin-bottom: 4px; }
.demo-rule__desc { font-size: .76rem; color: #86868b; line-height: 1.45; }

.demo-cta-box { text-align: center; padding: 32px 28px; background: rgba(0,113,227,.06); border: 1px solid rgba(0,113,227,.15); border-radius: 16px; margin-top: 40px; }
.demo-cta-box__title { font-size: 1.2rem; font-weight: 700; color: #f5f5f7; margin-bottom: 6px; }
.demo-cta-box__sub { font-size: .9rem; color: #86868b; margin-bottom: 20px; }
.demo-cta-box .btn { margin: 0 4px; }

/* ===== RESPONSIVE DEMO ===== */
@media (max-width: 734px) {
  .demo__header { flex-direction: column; align-items: stretch; gap: 12px; }
  .demo__score-wrap { align-self: center; }
  .demo__score-tip { left: -60px; width: 260px; }
  .demo__counters { justify-content: center; }
  .demo__cnt-pop { right: -40px; min-width: 240px; }
  .demo__tabs { gap: 2px; }
  .demo__tab { font-size: .72rem; padding: 5px 10px; }
  .demo-rules__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .demo-rules__grid { grid-template-columns: 1fr; }
}

/* ═══ Grid scroll fix ═══ */
#inlineDemo { max-width: 100vw; overflow-x: visible; text-align: center; }
#inlineDemo .acc-tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: calc(100vw - 40px); display: inline-block; text-align: left; }
#inlineDemo .acc-grid-tbl { margin: 0 auto; }

/* ═══ Accordion-style recommendations ═══ */
.acc-list { max-width: 680px; margin: 0 auto; }
.acc-list__item { border-bottom: 1px solid rgba(255,255,255,.08); }
.acc-list__trigger { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 4px; background: none; border: none; cursor: pointer; font-family: inherit; transition: background .15s; text-align: left; }
.acc-list__trigger:hover { background: rgba(255,255,255,.03); }
.acc-list__left { display: flex; align-items: center; gap: 12px; flex: 1; }
.acc-list__cls { font-size: 1rem; font-weight: 700; min-width: 42px; width: 42px; text-align: left; }
.acc-list__meta { font-size: .78rem; color: #86868b; display: flex; gap: 16px; }
.acc-list__vi { color: #ff453a; min-width: 100px; }
.acc-list__wa { color: #ff9f0a; min-width: 110px; }
.acc-list__chevron { color: #555; flex-shrink: 0; transition: transform .25s ease; }
.acc-list__trigger--open .acc-list__chevron { transform: rotate(180deg); }
.acc-list__body { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.acc-list__issue { display: flex; gap: 10px; padding: 10px 4px 10px 48px; align-items: flex-start; }
.acc-list__badge { font-size: .62rem; font-weight: 800; padding: 3px 8px; border-radius: 5px; flex-shrink: 0; letter-spacing: .03em; margin-top: 2px; }
.acc-list__badge--v { background: rgba(255,69,58,.15); color: #ff453a; border: 1px solid rgba(255,69,58,.2); }
.acc-list__badge--w { background: rgba(255,159,10,.12); color: #ff9f0a; border: 1px solid rgba(255,159,10,.2); }
.acc-list__content { flex: 1; min-width: 0; }
.acc-list__name { font-size: .85rem; font-weight: 600; color: #f5f5f7; margin-bottom: 2px; }
.acc-list__desc { font-size: .78rem; color: rgba(255,255,255,.55); line-height: 1.45; }
.acc-list__suggest { font-size: .75rem; color: #22d3ee; margin-top: 4px; line-height: 1.4; }
.rec-empty { text-align: center; color: #86868b; padding: 40px 20px; font-size: .9rem; }
/* (old rec-class-group styles removed) */
.rec-item { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.rec-item:last-child { border-bottom: none; }
.rec-item__head { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.rec-item__badge { font-size: .65rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: rgba(255,159,10,.12); color: #ff9f0a; }
.rec-item--v .rec-item__badge { background: rgba(255,69,58,.12); color: #ff453a; }
.rec-item__name { font-size: .82rem; font-weight: 600; color: rgba(255,255,255,.8); }
.rec-item__desc { font-size: .75rem; color: rgba(255,255,255,.5); line-height: 1.4; }
.rec-item__suggest { font-size: .72rem; color: #30d158; margin-top: 2px; }
.rec-empty { font-size: .85rem; color: #555; text-align: center; padding: 20px; }

/* ═══ Recommendations: parallel row layout ═══ */
/* (old rec-parallel/rec-cls-card styles removed — replaced by acc-list) */

/* ═══ Audit rules screen ═══ */
.audit-rules-screen { margin-top: 24px; }
.audit-rules-screen__title { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; color: #f5f5f7; }
.audit-score-explain { background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07); border-radius: 12px; padding: 16px 20px; margin-bottom: 20px; }
.audit-score-explain__title { font-size: .9rem; font-weight: 700; color: #f5f5f7; margin-bottom: 8px; }
.audit-score-explain__text { font-size: .82rem; color: rgba(255,255,255,.6); line-height: 1.6; margin-bottom: 6px; }
.audit-score-explain__scale { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.audit-score-explain__range { padding: 6px 14px; border-radius: 8px; font-size: .78rem; font-weight: 600; }
.audit-rules-list { display: grid; gap: 10px; }
.audit-rule-card { background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07); border-radius: 10px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.audit-rule-card__badge { font-size: .7rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; flex-shrink: 0; margin-top: 2px; }
.audit-rule-card__badge--hard { background: rgba(255,69,58,.12); color: #ff453a; }
.audit-rule-card__badge--soft { background: rgba(255,159,10,.12); color: #ff9f0a; }
.audit-rule-card__body { flex: 1; }
.audit-rule-card__name { font-size: .88rem; font-weight: 600; color: #f5f5f7; margin-bottom: 3px; }
.audit-rule-card__desc { font-size: .78rem; color: rgba(255,255,255,.5); line-height: 1.5; }
.audit-rule-card__source { font-size: .68rem; color: #555; margin-top: 4px; }

/* ═══ Rules: Animated scrolling columns (testimonials style) ═══ */
.rules-hero { text-align: center; margin-bottom: 28px; }
.rules-hero__badge { display: inline-block; border: 1px solid rgba(255,255,255,.12); padding: 4px 16px; border-radius: 8px; font-size: .78rem; color: #86868b; margin-bottom: 16px; }
.rules-hero__title { font-size: 1.8rem; font-weight: 700; letter-spacing: -.02em; color: #f5f5f7; margin-bottom: 10px; }
.rules-hero__sub { font-size: .9rem; color: rgba(255,255,255,.5); max-width: 460px; margin: 0 auto; line-height: 1.5; }

.rules-score-box { text-align: center; margin-bottom: 28px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07); border-radius: 14px; padding: 18px 24px; }
.rules-score-box__formula { font-size: .82rem; color: rgba(255,255,255,.6); margin-bottom: 12px; font-family: 'JetBrains Mono', monospace; }
.rules-score-box__scale { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.rules-scale { padding: 5px 14px; border-radius: 8px; font-size: .75rem; font-weight: 600; }
.rules-scale--green { background: rgba(48,209,88,.1); color: #30d158; }
.rules-scale--yellow { background: rgba(255,214,10,.1); color: #ffd60a; }
.rules-scale--red { background: rgba(255,69,58,.1); color: #ff453a; }

.rules-columns { display: flex; justify-content: center; gap: 16px; max-height: 620px; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 12%, black 88%, transparent);
  mask-image: linear-gradient(to bottom, transparent, black 12%, black 88%, transparent); }
.rules-col { flex: 1; max-width: 320px; overflow: hidden; }
.rules-col--md { display: none; }
.rules-col--lg { display: none; }
@media(min-width:640px){ .rules-col--md { display: block; } }
@media(min-width:960px){ .rules-col--lg { display: block; } }

.rules-col__track { display: flex; flex-direction: column; gap: 14px; padding-bottom: 14px;
  animation: rulesScroll 20s linear infinite; }
.rules-col__track--slow { animation-duration: 26s; }
.rules-col__track--fast { animation-duration: 22s; }
@keyframes rulesScroll { 0% { transform: translateY(0); } 100% { transform: translateY(-50%); } }

.rules-card { padding: 18px 20px; border-radius: 16px; border: 1px solid rgba(255,255,255,.08); max-width: 320px; width: 100%;
  background: rgba(255,255,255,.03); transition: border-color .2s; }
.rules-card:hover { border-color: rgba(255,255,255,.18); }
.rules-card--hard { border-left: 3px solid #ff453a; }
.rules-card--soft { border-left: 3px solid #ff9f0a; }
.rules-card--info { border-left: 3px solid #2997ff; }

.rules-card__badge { display: inline-block; font-size: .65rem; font-weight: 700; padding: 2px 8px; border-radius: 5px; margin-bottom: 8px; }
.rules-card__badge--hard { background: rgba(255,69,58,.12); color: #ff453a; }
.rules-card__badge--soft { background: rgba(255,159,10,.12); color: #ff9f0a; }
.rules-card__badge--info { background: rgba(41,151,255,.12); color: #2997ff; }
.rules-card__title { font-size: .92rem; font-weight: 600; color: #f5f5f7; margin-bottom: 6px; letter-spacing: -.01em; }
.rules-card__text { font-size: .78rem; color: rgba(255,255,255,.55); line-height: 1.55; }
.rules-card__src { font-size: .65rem; color: #555; margin-top: 8px; }

/* ═══ Grid tooltip (floating on hover) ═══ */
.grid-tip {
  display: none; position: fixed; z-index: 200;
  background: #1a1d23; border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px; padding: 10px 14px;
  font-size: .78rem; color: rgba(255,255,255,.75);
  max-width: 320px; line-height: 1.5;
  box-shadow: 0 8px 32px rgba(0,0,0,.6);
  pointer-events: none;
}
.grid-tip b { color: #f5f5f7; font-weight: 700; }
.grid-tip__hr { border: none; border-top: 1px solid rgba(255,255,255,.08); margin: 6px 0; }
.grid-tip__issue { margin-bottom: 4px; line-height: 1.4; }
.grid-tip__issue span { color: #86868b; font-size: .7rem; }
.grid-tip__issue--v { color: #ff453a; }
.grid-tip__issue--w { color: #ffd60a; }

/* ═══ SP Alert component (shadcn-inspired) ═══ */
.sp-alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; margin-top: 10px; }
.sp-alert--warn { background: rgba(255,159,10,.06); border: 1px solid rgba(255,159,10,.2); border-left: 3px solid #ff9f0a; }
.sp-alert--error { background: rgba(255,69,58,.06); border: 1px solid rgba(255,69,58,.2); border-left: 3px solid #ff453a; }
.sp-alert__icon { flex-shrink: 0; margin-top: 1px; }
.sp-alert--warn .sp-alert__icon { color: #ff9f0a; }
.sp-alert--error .sp-alert__icon { color: #ff453a; }
.sp-alert__body { flex: 1; min-width: 0; }
.sp-alert__title { font-size: .88rem; font-weight: 600; color: #f5f5f7; margin-bottom: 4px; }
.sp-alert__desc { font-size: .78rem; color: rgba(255,255,255,.55); line-height: 1.55; margin-bottom: 10px; }
.sp-alert__list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.sp-alert__item { display: flex; align-items: baseline; gap: 8px; font-size: .8rem; }
.sp-alert__cls { font-weight: 700; color: #ff9f0a; min-width: 28px; }
.sp-alert--error .sp-alert__cls { color: #ff453a; }
.sp-alert__detail { color: rgba(255,255,255,.65); }
.sp-alert__tip { font-size: .78rem; color: #30d158; padding: 8px 12px; background: rgba(48,209,88,.06); border: 1px solid rgba(48,209,88,.12); border-radius: 8px; }

/* ═══ Comparison: fixed-width overlay ═══ */
.cmp-box { position: relative; margin-top: 16px; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,.1); display: inline-block; text-align: left; }
.cmp-box__scroll { overflow: auto; max-height: 520px; -webkit-overflow-scrolling: touch; max-width: calc(100vw - 40px); }
.cmp-box__layers { position: relative; width: max-content; }
.cmp-tbl { border-collapse: collapse; }
.cmp-tbl .tbl-day-cell { width: 90px !important; min-width: 90px !important; max-width: 90px !important; box-sizing: border-box; }
.cmp-tbl .tbl-num-cell { width: 24px !important; min-width: 24px !important; max-width: 24px !important; box-sizing: border-box; }
.cmp-tbl .tbl-subj-cell { width: 52px !important; min-width: 52px !important; max-width: 52px !important; box-sizing: border-box; padding: 2px !important; }
.cmp-tbl .tbl-cls-hdr { width: 52px !important; min-width: 52px !important; max-width: 52px !important; box-sizing: border-box; }
.cmp-tbl .demo__cell { width: 48px !important; min-width: 48px !important; height: 32px !important; max-height: 32px !important; box-sizing: border-box !important; overflow: hidden; }
.cmp-tbl--top { position: absolute; top: 0; left: 0; z-index: 2; clip-path: inset(0 0 0 50%); pointer-events: none; }
.cmp-box__tag { position: absolute; z-index: 15; padding: 3px 10px; font-size: .6rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border-radius: 5px; pointer-events: none; top: auto; bottom: 8px; }
.cmp-box__tag--left { left: 8px; background: rgba(255,69,58,.15); color: #ff453a; border: 1px solid rgba(255,69,58,.25); }
.cmp-box__tag--right { right: 8px; background: rgba(48,209,88,.15); color: #30d158; border: 1px solid rgba(48,209,88,.25); }
@media(max-width:640px) { .cmp-box__tag { display: none; } }
.cmp-box__slider { position: absolute; top: 0; bottom: 0; left: 50%; z-index: 20; width: 3px; transform: translateX(-50%); cursor: ew-resize; }
.cmp-box__line { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; transform: translateX(-50%); background: rgba(255,255,255,.5); }
.cmp-box__knob { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 36px; height: 36px; border-radius: 50%; background: #fff; color: #333; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 12px rgba(0,0,0,.5); user-select: none; cursor: ew-resize; letter-spacing: 2px; }

/* Fix: violation borders → outline (no layout shift) for comparison */
.cmp-tbl .demo__cell--warn { border: none !important; outline: 2px solid #ff9f0a; outline-offset: -2px; }
.cmp-tbl .demo__cell--viol { border: none !important; outline: 2px solid #ff453a; outline-offset: -2px; }
.cmp-tbl .tbl-day-first td { border-top: none !important; }
.cmp-tbl .tbl-day-cell { box-sizing: border-box !important; }

/* Old schedule: slightly faded but violations visible; New schedule: solid */
.cmp-tbl .demo__cell { opacity: 0.6; }
.cmp-tbl--top .demo__cell { opacity: 1; }

/* Force identical row heights */
.cmp-tbl .tbl-subj-cell { height: 38px !important; max-height: 38px !important; box-sizing: border-box !important; padding: 2px !important; }
.cmp-tbl .tbl-num-cell { height: 38px !important; max-height: 38px !important; }
.cmp-tbl .tbl-cls-hdr { height: 32px !important; }

/* ═══ Transposed grid: days vertical, classes horizontal ═══ */
.acc-grid-tbl { border-collapse: collapse; }
.tbl-day-col, .tbl-num-col { font-size: .7rem; font-weight: 700; color: #86868b; padding: 8px 6px; text-align: left; white-space: nowrap; background: rgba(255,255,255,.04); border-bottom: 1px solid rgba(255,255,255,.06); }
.tbl-num-col { text-align: center; width: 28px; }
.tbl-cls-hdr { font-size: .72rem; font-weight: 700; color: #f5f5f7; padding: 8px 4px; text-align: center; min-width: 52px; white-space: nowrap; background: rgba(255,255,255,.04); border-bottom: 1px solid rgba(255,255,255,.06); cursor: default; position: sticky; top: 0; z-index: 3; }
.tbl-cls-hdr--click { cursor: pointer; }
.tbl-cls-hdr--click:hover { background: rgba(255,255,255,.08); }
.tbl-day-cell { font-size: .72rem; font-weight: 700; color: #f5f5f7; padding: 6px 10px; vertical-align: top; white-space: nowrap; background: rgba(255,255,255,.03); border-right: 1px solid rgba(255,255,255,.06); position: sticky; left: 0; z-index: 2; min-width: 90px; }
.tbl-num-cell { font-size: .65rem; color: #555; text-align: center; padding: 2px 4px; width: 24px; min-width: 24px; position: sticky; left: 90px; z-index: 2; background: rgba(10,10,14,.95); border-right: 1px solid rgba(255,255,255,.06); }
.tbl-subj-cell { padding: 2px; vertical-align: middle; min-width: 52px; }
.tbl-day-first td { border-top: 2px solid rgba(255,255,255,.1); }
.acc-grid-tbl tbody tr:hover { background: rgba(255,255,255,.02); }

/* Center optimized tab content */
#inlineDemoTabOptimized { text-align: center; }
#inlineDemoTabOptimized .sp-alert { text-align: left; max-width: 600px; margin-left: auto; margin-right: auto; }

/* Center all tab panels */
#inlineDemoTabGrid { text-align: center; }
#inlineDemoTabGrid .acc-tbl-wrap { display: inline-block; text-align: left; }
#inlineDemoTabRecs { text-align: left; max-width: 800px; margin: 0 auto; }

/* Subtle table background */
.acc-grid-tbl { background: rgba(255,255,255,.03); border-radius: 8px; }
.acc-grid-tbl thead { background: rgba(255,255,255,.05); }
.acc-grid-tbl tbody tr:nth-child(even) { background: rgba(255,255,255,.015); }
.cmp-box { background: rgba(255,255,255,.02); }
