.skip-link { position: absolute; left: -999px; top: 8px; background: var(--primary); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip-link:focus { left: 8px; }
main { outline: none; padding-bottom: 48px; }
.muted { color: var(--muted); }
.narrow { max-width: 780px; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1440px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand-mark { font-size: 24px; width: 40px; height: 40px; display: grid; place-items: center; background: var(--primary-soft); border-radius: 10px; }
.brand strong { display: block; font-size: 16px; }
.brand-sub { display: block; font-size: 12px; color: var(--muted); }
.stepper ol { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; counter-reset: step; }
.stepper li { counter-increment: step; font-size: 13px; color: var(--muted); padding: 6px 10px; border-radius: 999px; display: flex; align-items: center; gap: 6px; }
.stepper li::before { content: counter(step); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--surface-2); }
.stepper li.done { color: var(--success); }
.stepper li.done::before { content: '✓'; background: var(--success-soft); }
.stepper li.current { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.stepper li.current::before { background: var(--primary); color: #fff; }
@media (max-width: 720px) { .stepper li:not(.current) { font-size: 0; padding: 6px 4px; gap: 0; } }

.screen { padding-top: 32px; }
#screen-workspace { padding-top: 0; }

.hero { text-align: center; padding: 32px 0 24px; max-width: 760px; margin: 0 auto; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; font-weight: 700; color: var(--primary); }
.hero h1 { font-size: clamp(30px, 5vw, 46px); letter-spacing: -0.02em; outline: none; }
.accent { color: var(--primary); }
.lead { font-size: 17px; color: var(--muted); }
.hero-actions { margin: 24px 0; }
.hero-actions .btn { padding: 14px 26px; font-size: 16px; }
.facts { list-style: none; padding: 0; margin: 0; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.facts li { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 8px 16px; font-size: 14px; display: flex; gap: 6px; }
.facts span { color: var(--muted); }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.how-card h2 { font-size: 18px; }
.how-card p { color: var(--muted); margin: 0; }
.how-num { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; margin-bottom: 12px; }
@media (max-width: 760px) { .how { grid-template-columns: 1fr; } }

.rules { padding-left: 20px; }
.rules li { margin-bottom: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; margin: 8px 0 12px; font-weight: 500; }
.check input { width: 20px; height: 20px; margin-top: 1px; flex-shrink: 0; accent-color: var(--primary); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
h1[tabindex] { outline: none; }

/* Workspace */
.ws-toolbar { position: sticky; top: 61px; z-index: 15; background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ws-stats { display: flex; gap: 20px; }
.stat { display: flex; flex-direction: column; }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.stat-value { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 16px; }
.ws-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ws-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; padding: 16px; max-width: 1440px; margin: 0 auto; }
.ws-app { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.app-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; background: var(--surface-2); }
.viewport-toggle { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.viewport-toggle button { font: inherit; font-size: 13px; border: none; background: transparent; padding: 6px 12px; border-radius: 6px; cursor: pointer; color: var(--muted); min-height: 32px; }
.viewport-toggle button[aria-checked='true'] { background: var(--primary); color: #fff; }
.app-bar-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.frame-wrap { background: repeating-linear-gradient(45deg, #eceef5, #eceef5 10px, #e6e8f0 10px, #e6e8f0 20px); display: flex; justify-content: center; overflow: auto; height: calc(100vh - 200px); min-height: 520px; }
#demo-frame { border: 0; width: 100%; height: 100%; background: #fff; transition: width 0.2s; }
.frame-wrap.constrained #demo-frame { box-shadow: 0 0 0 1px var(--border), 0 8px 30px rgba(0, 0, 0, 0.12); }

.ws-reports { padding: 16px; height: calc(100vh - 168px); min-height: 560px; overflow: auto; position: sticky; top: 130px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-head h2 { font-size: 16px; margin: 0; }
.report-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; background: var(--surface); }
.report-item h3 { font-size: 14px; margin: 0 0 6px; word-break: break-word; }
.report-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.report-actions { display: flex; gap: 6px; }

.ws-tabs { display: none; }
@media (max-width: 980px) {
  .ws-grid { grid-template-columns: 1fr; padding: 12px; }
  .ws-tabs { display: flex; gap: 4px; padding: 8px 12px 0; }
  .ws-tabs button { flex: 1; font: inherit; font-weight: 600; padding: 10px; border: 1px solid var(--border); border-bottom: none; background: var(--surface-2); border-radius: 8px 8px 0 0; cursor: pointer; color: var(--muted); }
  .ws-tabs button[aria-selected='true'] { background: var(--surface); color: var(--primary); }
  .ws-grid > [role='tabpanel'][data-hidden='true'] { display: none; }
  .ws-reports { position: static; height: auto; min-height: 0; }
  .frame-wrap { height: 75vh; min-height: 480px; }
  .ws-toolbar { position: static; }
}
@media (max-width: 520px) {
  .ws-stats { gap: 14px; width: 100%; justify-content: space-between; }
  .ws-actions { width: 100%; }
  .ws-actions .btn { flex: 1; }
  .viewport-toggle { display: none; }
}

.legend { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 14px; margin: -4px 0 16px; font-size: 13px; }
.legend summary { cursor: pointer; font-weight: 600; }
.legend p { margin: 8px 0 0; }
.grid-2.tight { gap: 0 12px; }
.evidence-current { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 8px; background: var(--surface-2); border-radius: var(--radius-sm); }
.evidence-current img { max-height: 60px; max-width: 100px; border-radius: 4px; }
.draft-note { font-style: italic; }
dialog.small { width: min(440px, calc(100vw - 32px)); }

.hint-list li { background: var(--warning-soft); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 8px; }

/* Review */
.review-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.review-list { display: grid; gap: 12px; margin-bottom: 16px; }
.review-card h3 { font-size: 16px; margin: 0 0 8px; word-break: break-word; }
.review-card dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 12px 0 0; font-size: 14px; }
.review-card dt { color: var(--muted); font-weight: 600; }
.review-card dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 560px) { .review-card dl { grid-template-columns: 1fr; } .review-card dd { margin-bottom: 8px; } }
.review-card .report-actions { margin-top: 12px; }
.submit-card { position: sticky; bottom: 12px; }

.done { text-align: center; padding: 40px 24px; }
.done-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--success-soft); color: var(--success); font-size: 34px; display: grid; place-items: center; margin: 0 auto 16px; font-weight: 700; }
