:root {
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  color:#252d3a;
  background:#f5f6f8;
  font-synthesis:none;
  --muted:#667181;
  --border:#e3e6eb;
  --accent:#315fc4;
  --blue-tint:#edf2ff;
  --amber:#8a6427;
  --amber-tint:#fff6e4;
}
* {
  box-sizing:border-box;
}
body {
  margin:0;
}
button,textarea,input {
  font:inherit;
}
button,summary {
  cursor:pointer;
}
button:disabled,textarea:disabled {
  cursor:wait;
}
button:disabled {
  opacity:.6;
}
[hidden] {
  display:none!important;
}
button {
  color:inherit;
}
a {
  color:var(--accent);
  text-underline-offset:3px;
}
:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:4px;
}
::selection {
  background:#cedcf8;
}
.logic-frame:not(:empty) {
  max-width:980px;
  margin-inline:auto;
  padding:12px clamp(24px,4vw,40px);
}
header.logic-frame:not(:empty) {
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
}
main {
  max-width:980px;
  margin:0 auto;
  padding:56px 40px 48px;
}
main:has(.has-result) {
  max-width:1216px;
}
.intro {
  max-width:900px;
  margin-bottom:32px;
}
h1 {
  font-size:28px;
  line-height:1.4;
  font-weight:650;
  letter-spacing:.015em;
  margin:0 0 15px;
}
.lead {
  font-size:15px;
  line-height:1.9;
  margin:0;
  color:#475364;
}
.usage-note {
  font-size:12px;
  line-height:1.9;
  color:var(--muted);
  margin:12px 0 0;
}
.workspace {
  max-width:900px;
  display:grid;
  gap:24px;
  align-items:start;
}
.input-card {
  min-width:0;
  padding:26px 28px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  box-shadow:0 3px 12px #222e4503;
}
.section-top {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  font-size:14px;
  font-weight:600;
}
.section-top h2 {
  font-size:18px;
  margin:0;
  font-weight:600;
}
.section-top>span {
  font-size:12px;
  color:#7a8492;
  font-weight:400;
  font-variant-numeric:tabular-nums;
}
textarea {
  display:block;
  width:100%;
  min-height:260px;
  resize:vertical;
  border:0;
  background:transparent;
  padding:22px 0;
  font-size:16px;
  line-height:1.95;
  color:#303b4b;
  border-radius:3px;
}
textarea::placeholder {
  color:#8b94a2;
}
textarea:focus {
  outline:none;
}
textarea:focus-visible {
  box-shadow:0 0 0 2px #dbe4f5;
}
.editor-footer {
  border-top:1px solid #edf0f3;
  padding-top:20px;
  display:flex;
  gap:22px;
  align-items:flex-end;
  justify-content:space-between;
}
.examples {
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  align-items:center;
  max-width:600px;
}
.examples>span {
  font-size:12px;
  color:var(--muted);
  margin-right:4px;
}
.examples button {
  background:#f4f6f9;
  border:1px solid transparent;
  border-radius:5px;
  padding:7px 10px;
  font-size:12px;
  color:#586578;
  min-height:32px;
}
.examples button:hover {
  background:var(--blue-tint);
  color:var(--accent);
  border-color:#d8e3fb;
}
#submit {
  flex-shrink:0;
  border:0;
  border-radius:7px;
  background:var(--accent);
  color:#fff;
  padding:12px 18px;
  font-size:14px;
  font-weight:500;
  min-height:44px;
}
#submit span {
  margin-left:15px;
}
#submit:hover {
  background:#254eab;
}
#error {
  font-size:14px;
  line-height:1.8;
  color:#9d3c37;
  margin:18px 0 0;
}
.text-button {
  font-size:12px;
  color:var(--accent);
  background:none;
  border:0;
  padding:8px 0;
}
.has-result {
  max-width:none;
  grid-template-columns:minmax(0,1fr) minmax(0,1.35fr);
  gap:32px;
}
.has-result .input-card {
  position:sticky;
  top:24px;
  max-height:calc(100dvh - 48px);
  overflow:auto;
}
.source-text {
  margin-top:22px;
  font-size:15px;
  line-height:2.25;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  padding-bottom:8px;
}
.source-mark {
  display:inline;
  color:inherit;
  text-decoration:none;
  padding:2px 0;
  border:0;
  border-radius:3px;
  background:#eaf0ff;
  font:inherit;
  text-align:left;
  white-space:pre-wrap;
  line-height:inherit;
  box-decoration-break:clone;
  -webkit-box-decoration-break:clone;
}
.source-mark:hover,.source-mark.is-active {
  background:#d7e3ff;
  box-shadow:0 1px 0 var(--accent);
}
.mark-number {
  font-size:10px;
  line-height:1;
  color:var(--accent);
  padding:0 3px;
  font-weight:600;
  white-space:nowrap;
}
.source-mark.conditional {
  background:var(--amber-tint);
}
.source-mark.conditional .mark-number {
  color:var(--amber);
}
.source-mark.conditional:hover,.source-mark.conditional.is-active {
  background:#ffedc5;
  box-shadow:0 1px 0 var(--amber);
}
.result-card {
  min-width:0;
  overflow-wrap:anywhere;
}
#loading {
  display:flex;
  align-items:flex-start;
  gap:16px;
  padding:22px 0;
}
#loading h2 {
  font-size:16px;
  margin:0 0 8px;
}
#loading p {
  font-size:13px;
  line-height:1.8;
  color:var(--muted);
  margin:0;
}
#loading #elapsed {
  font-size:12px;
  margin-top:10px;
  font-variant-numeric:tabular-nums;
}
.spinner {
  display:block;
  flex-shrink:0;
  width:18px;
  height:18px;
  border:2px solid #dce3ef;
  border-top-color:var(--accent);
  border-radius:50%;
  animation:spin 1s linear infinite;
  margin-top:3px;
}
.is-loading {
  gap:0;
}
#result {
  font-size:15px;
  line-height:1.9;
  scroll-margin-top:24px;
}
.result-overview {
  margin:0 0 22px;
  padding:0 2px;
}
h2 {
  font-size:23px;
  line-height:1.6;
  margin:0 0 12px;
  font-weight:600;
}
.result-concepts {
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:flex-start;
  font-size:15px;
}
.concept-tag {
  display:inline-flex;
  align-items:center;
  gap:9px;
  max-width:100%;
  min-height:40px;
  border:1px solid #dbe4f5;
  border-radius:7px;
  background:#edf2fc;
  color:var(--accent);
  overflow-wrap:anywhere;
}
.concept-tag:has(>.rule-link) {padding:0;}
.concept-tag:not(:has(>.rule-link)) {padding:7px 12px;flex-wrap:wrap;}
.concept-tag .rule-link {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:4px 10px;
  padding:7px 12px;
  min-height:40px;
  max-width:100%;
  text-decoration:none;
  border-radius:6px;
}
.concept-tag.conditional {background:#fff8ec;border-color:#ebd9b6;color:#72551e;}
.concept-tag.conditional .rule-link {color:#72551e;}
.concept-status {font-size:12px;font-weight:500;white-space:nowrap;color:#72551e;}
.rule-link {
  font:inherit;
  font-weight:500;
  border:0;
  background:none;
  padding:2px 0;
  text-align:left;
  line-height:inherit;
  color:var(--accent);
  text-decoration:underline;
  text-decoration-color:#bacbed;
  text-underline-offset:4px;
}
.rule-link:hover,.rule-link[aria-expanded="true"] {
  color:#214692;
  text-decoration-color:currentColor;
}
.finding {
  background:#fff;
  border:1px solid var(--border);
  border-radius:10px;
  padding:23px 25px;
  margin:0 0 16px;
  scroll-margin-top:24px;
  transition:border-color .15s,box-shadow .15s;
}
.finding.is-active {
  border-color:#9bb5ec;
  box-shadow:0 0 0 3px #315fc40a;
}
.finding-meta {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  color:var(--muted);
  font-size:12px;
  margin-bottom:14px;
}
.finding-number {
  flex-shrink:0;
  display:inline-flex;
  width:23px;
  height:23px;
  align-items:center;
  justify-content:center;
  border-radius:5px;
  background:var(--blue-tint);
  color:var(--accent);
  font-size:12px;
  font-weight:600;
}
.finding-title {
  font-size:20px;
  font-weight:600;
  line-height:1.6;
  margin:0 0 14px;
  color:#283445;
}
.finding p {
  margin:12px 0;
}
.finding blockquote {
  margin:14px 0;
  padding:0 0 0 13px;
  border-left:2px solid #cbd6e8;
  font-size:15px;
  color:#5f6b7c;
}
.finding blockquote p {
  white-space:pre-wrap;
  margin:0;
}
.finding-boundary {
  font-size:14px;
  line-height:1.9;
  color:#657080;
}
.finding-boundary strong {
  font-weight:500;
  color:#4e5a6d;
  margin-right:3px;
}
details {
  font-size:13px;
  line-height:1.9;
}
summary {
  color:#596576;
}
summary::marker {
  color:#93a0b2;
}
.finding-more {
  margin-top:15px;
  border-top:1px solid #edf0f3;
  padding-top:12px;
}
.finding-more>summary {
  font-size:13px;
}
.finding-more p {
  font-size:13px;
}
.conditional-label {
  white-space:nowrap;
  margin-left:auto;
  padding:2px 8px;
  background:var(--amber-tint);
  border-radius:4px;
  font-size:12px;
  color:var(--amber);
}
.conditional .finding-number {
  background:var(--amber-tint);
  color:var(--amber);
}
.conditional.is-active {
  border-color:#d8b777;
  box-shadow:0 0 0 3px #d8b7770a;
}
.coverage-warning {
  font-size:14px;
  line-height:1.9;
  color:#805d24;
  background:#fff5df;
  border-radius:6px;
  padding:11px 14px;
  margin:14px 0 0;
}
.analysis-basis {
  border-top:1px solid var(--border);
  margin:24px 0 0;
  padding:17px 2px 0;
  color:#667181;
}
.analysis-basis h3 {
  font-size:13px;
  color:#475364;
  margin:17px 0 5px;
}
.analysis-basis p {
  margin:6px 0;
}
.block {
  margin:14px 0;
}
ul {
  padding-left:20px;
}
li {
  margin:5px 0;
}
.result-summary {
  background:#fff;
  border:1px solid var(--border);
  border-radius:10px;
  padding:24px;
  margin:0;
}
.dictionary {
  margin-top:38px;
  width:100%;
  border-top:1px solid #dce1e8;
  padding-top:20px;
}
.dictionary>summary {
  font-size:20px;
  font-weight:600;
  color:#4a5669;
}
.dictionary-tools {
  display:flex;
  gap:16px;
  align-items:center;
  margin:22px 0;
}
.dictionary-tools input {
  font:inherit;
  min-width:0;
  flex:1;
  border:1px solid #dce1e8;
  border-radius:7px;
  padding:12px 14px;
  background:#fff;
  color:#283445;
}
.dictionary-tools span {
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
}
#dictionary-empty {
  font-size:13px;
  color:var(--muted);
}
.dictionary-entry {
  border-bottom:1px solid var(--border);
  min-width:0;
  scroll-margin-top:24px;
}
.dictionary-entry>summary {
  padding:15px 0;
  min-height:50px;
  font-size:18px;
  font-weight:500;
  line-height:1.7;
  color:#475364;
}
.dictionary-entry[open]>summary {
  color:var(--accent);
}
.dictionary-body {
  padding:3px 0 22px;
  line-height:1.9;
  font-size:14px;
  overflow-wrap:anywhere;
}
.dictionary-aliases {
  color:var(--muted);
  font-size:12px;
  margin:0 0 12px;
}
.definition {
  margin:0 0 16px;
  color:#465365;
}
.example-comparison {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:14px;
}
.example-panel {
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  padding:18px;
}
.example-panel.reasonable {
  background:#f0f4fa;
  border-color:#e0e7f2;
}
.example-panel h3 {
  font-size:12px;
  color:var(--muted);
  margin:0 0 10px;
  font-weight:500;
}
.example-panel.reasonable h3 {
  color:#48648c;
}
.example-panel p {
  font-size:14px;
  line-height:1.9;
  margin:0;
  color:#354154;
}
.example-explanation {
  font-size:13px;
  color:var(--muted);
  margin:13px 0 0;
}
.dictionary-note {
  font-size:12px;
  color:var(--muted);
  margin:20px 0 0;
}
.rule-popup {
  position:fixed;
  inset:auto;
  margin:0;
  width:min(460px,calc(100% - 32px));
  max-height:calc(100dvh - 32px);
  overflow:auto;
  border:1px solid #dce2ec;
  border-radius:12px;
  padding:24px;
  background:#fff;
  color:#283445;
  box-shadow:0 15px 60px #23395d24;
  font-size:14px;
  line-height:1.9;
  overflow-wrap:anywhere;
}
.popup-header {
  display:flex;
  align-items:flex-start;
  gap:16px;
  justify-content:space-between;
}
.popup-header h2 {
  font-size:17px;
  margin:0;
}
.popup-header button {
  flex-shrink:0;
  width:32px;
  height:32px;
  border:0;
  border-radius:6px;
  background:#f0f3f7;
  color:#627083;
  font-size:24px;
  line-height:1;
}
#rule-popup-content .dictionary-body {
  margin-top:14px;
  padding:0;
}
#rule-popup-content .example-comparison {
  grid-template-columns:1fr;
  gap:10px;
}
#rule-popup-content .example-panel {
  padding:13px 15px;
  background:#f7f8fa;
}
#rule-popup-content .example-panel.reasonable {
  background:#f0f4fa;
}
.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
@keyframes spin {
  to {
    transform:rotate(360deg);
  }
}
@media(max-width:960px) {
  main {
    padding:40px 24px;
  }
  .has-result {
    gap:22px;
    grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);
  }
  .has-result .input-card {
    padding:22px;
  }
  .finding {
    padding:21px;
  }
}
@media(max-width:980px), (pointer:coarse) {
  main {
    padding:28px 18px 35px;
  }
  .intro {
    margin-bottom:24px;
  }
  h1 {
    font-size:25px;
    margin-bottom:12px;
  }
  .lead {
    font-size:14px;
  }
  .usage-note {
    font-size:12px;
    line-height:1.9;
  }
  .workspace,.has-result {
    grid-template-columns:1fr;
    gap:25px;
  }
  .input-card,.has-result .input-card {
    padding:20px;
    position:static;
    max-height:none;
  }
  .editor-footer {
    align-items:stretch;
    flex-direction:column;
    gap:20px;
    padding-top:17px;
  }
  textarea {
    min-height:255px;
    font-size:16px;
    padding:20px 0;
  }
  .examples {
    gap:7px;
  }
  .examples button {
    min-height:36px;
    font-size:11px;
    padding:7px 9px;
  }
  #submit {
    align-self:flex-end;
    min-width:140px;
  }
  .source-text {
    font-size:14px;
    line-height:2.2;
  }
  .finding {
    padding:20px;
    margin-bottom:13px;
  }
  .finding-title {
    font-size:20px;
  }
  .finding blockquote {
    font-size:15px;
  }
  h2 {
    font-size:22px;
  }
  .result-overview {
    margin-bottom:19px;
  }
  .result-concepts {
    gap:6px 10px;
  }
  .dictionary {
    margin-top:30px;
  }
  .dictionary-tools {
    gap:8px;
  }
  .dictionary-tools input {
    font-size:16px;
  }
  .example-comparison {
    grid-template-columns:1fr;
    gap:10px;
  }
  .example-panel {
    padding:16px;
  }
  .rule-popup {
    left:0!important;
    top:auto!important;
    bottom:0;
    width:100%;
    max-height:80dvh;
    border-radius:18px 18px 0 0;
    padding:24px 22px max(26px,env(safe-area-inset-bottom));
    border-bottom:0;
    box-shadow:0 -12px 60px #23395d2b;
  }
  .rule-popup::backdrop {
    background:#1b2b4333;
  }
  .popup-header {
    position:sticky;
    top:-24px;
    background:#fff;
    padding:8px 0 12px;
  }
  .popup-header button {
    width:38px;
    height:38px;
  }
  .is-loading {
    gap:0;
  }
  #loading {
    padding:22px 2px;
  }
}
@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior:auto!important;
    transition:none!important;
  }
  .spinner {
    animation:none;
  }
}
.mark-number .conditional-number {
  color:var(--amber);
  text-decoration:underline dotted;
  text-underline-offset:2px;
}


@media (max-height:500px) and (orientation:landscape) {
  .rule-popup {max-height:90dvh;}
  .has-result .input-card {position:static;max-height:none;}
}
.finding-title .rule-link {font-weight:600;text-decoration:none;}
.finding-title .rule-link:hover {text-decoration:underline;}

.mark-tail {white-space:nowrap;}
