:root {
  color-scheme: light;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #232136;
  background: #f6f5fb;
  --ink: #232136;
  --muted: #615e72;
  --line: #e6e3ef;
  --paper: #fff;
  --accent: #5b42c9;
  --lavender: #f0ebff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
.shell { width: min(1030px, calc(100% - 48px)); margin-inline: auto; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-content { height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 710; letter-spacing: -.6px; white-space: nowrap; }
.mark { display: grid; align-content: center; justify-items: start; gap: 3px; width: 31px; height: 31px; background: #a68bff; border-radius: 8px; padding-left: 8px; }
.mark i { display: block; width: 14px; height: 2px; border-radius: 2px; background: #261b4f; }
.mark i:nth-child(2) { width: 10px; }
.mark i:nth-child(3) { width: 6px; }
.plain { background: none; border: 0; color: inherit; padding: 5px 0; font-weight: 650; }
.privacy-link { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #7653d0; }
.accent { color: var(--accent); font-size: 13px; }
.plain:hover { text-decoration: underline; }
.button { border: 1px solid transparent; padding: 10px 14px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 650; line-height: 1.2; min-height: 40px; white-space: nowrap; }
.button span { font-size: 16px; line-height: 1; }
.quiet { background: white; border-color: #ded9eb; color: var(--ink); }
.quiet:hover:not(:disabled) { background: #f6f2ff; border-color: #c8bae8; }
.primary { color: white; background: var(--accent); }
.primary:hover:not(:disabled) { background: #4e34bc; }
.dark { background: #29243e; color: #fff; }
.dark:hover:not(:disabled) { background: #43375c; }
.compact { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.danger { color: #a52d47; background: #fff2f4; }
.danger:hover { background: #fbe0e6; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 15px; min-width: 0; overflow: hidden; box-shadow: 0 7px 24px #2c1f4910; }
.panel-head { display: flex; justify-content: space-between; align-items: center; min-height: 65px; padding: 14px 21px; gap: 8px; border-bottom: 1px solid var(--line); }
.section-title { display: flex; align-items: center; gap: 10px; }
.section-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 8px; background: var(--lavender); color: #5940b5; font-size: 20px; line-height: 1; }
h2 { font-size: 17px; letter-spacing: -.025em; }
h3 { font-size: 15px; }
label { font-weight: 650; display: block; font-size: 13px; }
input:not([type="checkbox"]), select, textarea { display: block; width: 100%; background: #fdfcff; color: var(--ink); border: 1px solid #ded9e9; border-radius: 8px; padding: 9px 10px; line-height: 1.47; margin-top: 6px; }
textarea { resize: vertical; min-height: 54px; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.5; }
.story-details { margin-top: 14px; }
.story-details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.story-details .form-grid, .export-fields { margin-top: 12px; }
.naming-preview { background: #f7f4fc; border-radius: 8px; color: var(--ink); padding: 10px 12px; line-height: 1.55; overflow-wrap: anywhere; }
.naming-preview strong { margin-right: 6px; }
.check { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0 3px 0 0; }
.count { color: #554297; background: var(--lavender); border-radius: 99px; min-width: 24px; padding: 3px 7px; font-size: 11px; text-align: center; font-weight: 700; }
.review-toolbar { padding: 14px 20px 13px; border-bottom: 1px solid var(--line); }
#draft-source { color: var(--muted); font-size: 12px; margin-bottom: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.filters { display: flex; gap: 5px; flex-wrap: wrap; }
.filters button { border: 1px solid transparent; border-radius: 6px; color: #5d596d; background: transparent; padding: 5px 10px; font-size: 12px; font-weight: 650; }
.filters button:hover { background: #f7f4fc; }
.filters button[aria-pressed="true"] { background: var(--lavender); color: #4b328f; border-color: #e8dfff; }
.case-list { padding: 0 20px; max-height: 560px; overflow-y: auto; }
.case-row { width: 100%; border: 0; border-bottom: 1px solid #eeeaf4; background: white; color: var(--ink); text-align: left; padding: 13px 2px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.case-row:last-child { border-bottom: 0; }
.case-row:hover { background: #fbf9ff; }
.case-row:focus-visible { outline-offset: -2px; }
.case-name { display: block; font-size: 14px; font-weight: 680; line-height: 1.4; margin-bottom: 5px; overflow-wrap: anywhere; }
.row-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--muted); }
.badge { display: inline-block; border-radius: 6px; padding: 3px 7px; font-size: 11px; font-weight: 650; }
.badge.positive { background: #e6f6ed; color: #236045; }
.badge.negative { background: #fcebef; color: #9a3654; }
.badge.boundary { background: #eee8fd; color: #5b4196; }
.flag { color: #8a5819; }
.row-arrow { color: #6a607e; font-size: 20px; padding-right: 5px; }
.review-footer { border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 15px 20px; background: #fdfcff; }
.export-actions, .dialog-footer > div { display: flex; gap: 8px; }
.empty { padding: 36px 8px; color: var(--muted); text-align: center; line-height: 1.55; }
.error { background: #fff1f3; border-radius: 7px; color: #982641; font-size: 13px; padding: 9px 10px; margin-top: 10px; }
dialog { width: min(640px, calc(100% - 28px)); max-height: 90vh; padding: 0; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: white; box-shadow: 0 18px 80px #1f173b49; }
dialog::backdrop { background: #211a3a70; }
.dialog-head, .dialog-footer { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 14px 20px; background: white; position: sticky; z-index: 1; }
.dialog-head { border-bottom: 1px solid var(--line); top: 0; }
.close { font-size: 24px; line-height: 1; padding: 1px 5px; }
.dialog-footer { border-top: 1px solid var(--line); bottom: 0; }
.dialog-footer > div { margin-left: auto; }
.dialog-body { padding: 17px 20px 20px; }
.dialog-body > p:not(.error) { color: var(--muted); line-height: 1.55; }
.privacy-body p + p { margin-top: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; align-items: start; }
.wide { grid-column: 1 / -1; }
.subhead { margin-top: 18px; margin-bottom: 9px; display: flex; justify-content: space-between; align-items: center; }
.step { border: 1px solid var(--line); background: #faf8ff; border-radius: 8px; margin: 0 0 8px; padding: 8px 10px 10px; }
.step legend { padding: 0 4px; font-weight: 650; color: #554297; font-size: 12px; }
.step .plain { font-size: 12px; margin-top: 4px; color: #a52d47; }
.metadata { margin: 18px 0; }
.metadata summary { cursor: pointer; font-weight: 650; }
.metadata .form-grid, #qtest-sheet { margin-top: 12px; }
.review-check span { color: var(--muted); font-weight: 400; font-size: 12px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.workspace { max-width: 750px; padding: clamp(50px, 11vh, 105px) 0 44px; }
.intro { text-align: center; margin-bottom: 29px; }
.intro h1 { font-size: clamp(35px, 6vw, 57px); font-weight: 745; letter-spacing: -.065em; line-height: 1.04; }
.intro p { color: var(--muted); font-size: 15px; line-height: 1.6; margin-top: 12px; }
.composer { background: #fff; padding: 12px; border: 1px solid #ded7ef; border-radius: 17px; box-shadow: 0 12px 36px #37256612; }
.composer:focus-within { border-color: #ac9be7; }
.composer textarea { background: white; border: 0; min-height: 158px; margin: 0; padding: 12px; font-size: 15px; resize: vertical; }
.composer textarea::placeholder { color: #68637c; opacity: 1; }
.composer textarea:focus-visible { outline-offset: -1px; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 2px 1px; border-top: 1px solid #eeeaf5; }
.composer-actions .plain { padding: 8px; }
.local-note { color: var(--muted); margin: 12px 0 0; text-align: center; font-size: 12px; line-height: 1.45; }
#results { margin-top: 24px; scroll-margin-bottom: 14px; }
.result-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff; border: 1px solid var(--line); padding: 13px 15px; border-radius: 12px; }
.result-count { font-size: 15px; font-weight: 720; }
#result-note:not(:empty) { margin-top: 3px; }
#advanced > summary { cursor: pointer; padding: 14px 4px; font-weight: 650; color: var(--accent); }
.story-details { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 13px; }
.review-guidance { flex: 1 1 130px; }
.review-guidance .plain { margin-top: 3px; }

@media (max-width: 650px) {
  .shell { width: calc(100% - 32px); }
  .workspace { padding-top: 47px; }
  .panel-head, .review-toolbar, .review-footer, .case-list { padding-inline: 13px; }
  .case-list { max-height: 65vh; }
}
@media (max-width: 410px) {
  .composer-actions { gap: 5px; }
  .composer-actions .button { padding-inline: 9px; }
  .form-grid { grid-template-columns: 1fr; }
  .dialog-footer { flex-wrap: wrap; }
}
