:root {
  color-scheme: light;
  --ink: #17221f;
  --muted: #63706b;
  --paper: #f4f1e9;
  --surface: #fffdf8;
  --green: #173b35;
  --green-2: #2e665c;
  --lime: #d9f09a;
  --amber: #f6c960;
  --red: #a23e31;
  --line: #d8d5cb;
  --shadow: 0 18px 50px rgba(23, 34, 31, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); line-height: 1.55; }
button, textarea, input { font: inherit; }
a { color: inherit; }
.skip-link { position: fixed; top: .75rem; left: .75rem; z-index: 10; padding: .65rem 1rem; color: white; background: var(--green); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid #1d6fe8; outline-offset: 3px; }

.site-header, main, footer { width: min(1180px, calc(100% - 2rem)); margin-inline: auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; min-height: 76px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: .65rem; align-items: center; font-weight: 760; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: var(--lime); background: var(--green); border-radius: 50%; font-family: Georgia, serif; }
nav { display: flex; gap: 1.25rem; }
nav a { min-height: 44px; display: inline-flex; align-items: center; color: var(--muted); font-size: .92rem; text-decoration: none; }
nav a:hover { color: var(--ink); }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 4rem; align-items: end; padding: 5.5rem 0 4.5rem; }
.eyebrow, .step { margin: 0 0 .8rem; color: var(--green-2); font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { max-width: 820px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.7rem, 6vw, 5.35rem); font-weight: 500; line-height: .98; letter-spacing: -.045em; }
.hero-copy { max-width: 720px; margin: 1.5rem 0 .6rem; color: #4f5c57; font-size: 1.15rem; }
.arabic-line { max-width: 720px; margin: .25rem 0 0; color: var(--green-2); font-size: 1rem; }
.privacy-card { display: flex; gap: .9rem; padding: 1.2rem; background: var(--lime); border-radius: 16px 16px 2px 16px; }
.privacy-card svg { flex: 0 0 28px; width: 28px; height: 28px; fill: var(--green); }
.privacy-card strong, .privacy-card span { display: block; }
.privacy-card span { margin-top: .15rem; color: #38524c; font-size: .83rem; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.panel { min-width: 0; padding: 2rem; }
.editor-panel { border-right: 1px solid var(--line); }
.panel-heading { display: flex; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.4rem; }
.panel-heading > div { display: flex; gap: .9rem; align-items: baseline; }
.panel-heading .step { margin: 0; }
h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.65rem, 3vw, 2.25rem); font-weight: 500; line-height: 1.1; letter-spacing: -.025em; }
label, legend { display: block; margin-bottom: .5rem; font-size: .9rem; font-weight: 750; }
textarea { width: 100%; min-height: 330px; resize: vertical; padding: 1rem; color: var(--ink); background: #faf9f4; border: 1px solid #bbbdb6; border-radius: 5px; line-height: 1.65; }
textarea:focus { background: white; border-color: var(--green-2); }
.field-help { margin: .45rem 0 1rem; color: var(--muted); font-size: .8rem; }
.local-tag { padding: .35rem .65rem; color: var(--green); background: #e5eed0; border-radius: 999px; font-size: .72rem; font-weight: 800; white-space: nowrap; }
details { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
summary { min-height: 48px; display: flex; align-items: center; font-size: .88rem; font-weight: 750; cursor: pointer; }
fieldset { margin: 0 0 1rem; padding: 0; border: 0; }
.rule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem 1rem; }
.rule-option { display: flex; gap: .55rem; align-items: flex-start; min-height: 34px; margin: 0; font-size: .8rem; font-weight: 600; }
.rule-option input { width: 18px; height: 18px; margin: .1rem 0 0; accent-color: var(--green); }
.actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.35rem; }
.button, .download-button { min-height: 44px; border: 1px solid transparent; border-radius: 3px; cursor: pointer; }
.button { padding: .65rem 1.1rem; font-weight: 760; }
.primary { color: white; background: var(--green); }
.primary:hover { background: #24534b; }
.secondary { color: var(--green); background: var(--lime); }
.ghost { color: var(--muted); background: transparent; border-color: var(--line); }
.download-button { padding: .5rem .75rem; color: var(--green); background: transparent; border-color: #a7b4af; font-size: .78rem; font-weight: 750; }
.download-button:disabled { opacity: .45; cursor: not-allowed; }

.result-panel { background: #f9f7f0; }
.result-status { display: flex; gap: .8rem; align-items: center; min-height: 74px; padding: 1rem; border: 1px solid var(--line); border-left-width: 5px; }
.result-status strong, .result-status span { display: block; }
.result-status span { color: var(--muted); font-size: .84rem; }
.result-status.idle { border-left-color: #9ba39f; }
.result-status.clear { border-left-color: var(--green-2); background: #edf5e8; }
.result-status.review { border-left-color: var(--amber); background: #fff7df; }
.result-status.error { border-left-color: var(--red); background: #fff0ec; }
.status-icon { display: grid !important; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; color: white !important; background: var(--green); border-radius: 50%; font-weight: 850; }
#result-list { margin-top: 1rem; }
.issue-list { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.issue-card { padding: 1rem; background: white; border: 1px solid var(--line); }
.issue-meta { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.rule-pill { padding: .2rem .45rem; color: #6a4700; background: #ffedb8; border-radius: 999px; font-size: .7rem; font-weight: 850; }
.location { color: var(--muted); font-size: .75rem; }
.issue-card h3 { margin: .7rem 0 .2rem; font-size: 1rem; }
.issue-card p { margin: .25rem 0; color: #4e5a56; font-size: .85rem; }
.excerpt { padding: .55rem .7rem; color: var(--ink) !important; background: #f4f1e9; border-left: 3px solid var(--amber); overflow-wrap: anywhere; }
.suggestion strong { color: var(--green); }
.noscript { color: var(--red); }

.principles { padding: 5.5rem 0; }
.principles > h2 { max-width: 650px; }
.principle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 2.5rem; background: var(--line); border: 1px solid var(--line); }
.principle-grid article { padding: 1.5rem; background: var(--paper); }
.principle-grid article > span { color: var(--green-2); font-size: .72rem; font-weight: 850; }
.principle-grid h3 { margin: .7rem 0 .3rem; font-family: Georgia, serif; font-size: 1.35rem; font-weight: 500; }
.principle-grid p { margin: 0; color: var(--muted); font-size: .9rem; }
footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.5rem 0 2.5rem; color: var(--muted); border-top: 1px solid var(--line); font-size: .8rem; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 4rem; }
  .privacy-card { max-width: 420px; }
  .workspace { grid-template-columns: 1fr; }
  .editor-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .principle-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .site-header { min-height: 64px; }
  nav a:first-child { display: none; }
  .hero { padding: 3rem 0; }
  h1 { font-size: 2.7rem; }
  .panel { padding: 1.25rem; }
  .panel-heading { align-items: flex-start; }
  .panel-heading > div { display: block; }
  .rule-grid { grid-template-columns: 1fr; }
  .button { flex: 1 1 100%; }
  footer { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
