@font-face {
  font-family: "B_Kufigraph";
  src: url("/assets/fonts/B_Kufigraph.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IranNastaliq";
  src: url("/assets/fonts/IranNastaliq.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "w_Yekan";
  src: url("/assets/fonts/w_Yekan.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "w_Yekan";
  src: url("/assets/fonts/w_Yekan Italic.ttf") format("truetype");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "w_Yekan";
  src: url("/assets/fonts/w_Yekan Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "w_Yekan";
  src: url("/assets/fonts/w_Yekan Black.ttf") format("truetype");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}


:root {
  color-scheme: light;
  --cream: #fcf6ee;
  --paper: #f7f2eb;
  --sand: #e4dacb;
  --taupe: #b59d89;
  --brown: #a37d63;
  --rust: #8b5a3c;
  --ink-soft: #433932;
  --ink: #281d15;
  --maroon: #3e000c;
  --red: #ff0c0a;
  --danger-bg: #fff0ee;
  --line: rgb(139 90 60 / 42%);
  --shadow: 0 12px 40px rgb(40 29 15 / 60%);
  --soft-shadow: 0 12px 32px rgb(40 29 21 / 8%);
  font-family: "w_Yekan", Tahoma, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.75;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button {
  color: inherit;
}

svg,
img {
  display: block;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 0.45rem;
  background: var(--red);
  color: white;
  text-decoration: none;
  transform: translateY(-170%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 10;
  min-height: 86px;
  padding: 0 max(1.5rem, calc((100vw - 1180px) / 2));
  border-bottom: 4px solid var(--red);
  background: var(--maroon);
  color: var(--cream);
}

.header-inner {
  display: flex;
  width: min(100%, 1180px);
  min-height: 82px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: block;
  width: 132px;
  flex: 0 0 auto;
}

.brand img {
  width: 100%;
  height: auto;
  filter: drop-shadow(3px 4px 0 rgb(40 29 21 / 45%));
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.header-actions a {
  color: var(--cream);
  text-decoration: none;
  transition: color 150ms ease;
}

.header-actions a:hover {
  color: white;
}

.data-link {
  padding: 0.2rem 0 0.25rem;
  border-bottom: 2px solid rgb(252 246 238 / 22%);
}

.data-link:hover {
  border-bottom-color: var(--red);
}

.icon-link {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border: 1px solid rgb(252 246 238 / 32%);
  border-radius: 0.2rem;
}

.icon-link:hover {
  border-color: var(--cream);
  background: var(--red);
}

.icon-link svg {
  width: 1.2rem;
  fill: currentcolor;
}

.service-state {
  display: inline-flex;
  min-height: 2.5rem;
  padding-right: 1.25rem;
  align-items: center;
  gap: 0.45rem;
  border-right: 1px solid rgb(252 246 238 / 25%);
  color: rgb(252 246 238 / 72%);
  font-size: 0.95rem;
  font-weight: 400;
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--brown);
  box-shadow: 0 0 0 4px rgb(163 125 99 / 18%);
}

.service-state.is-checking .status-dot {
  animation: service-pulse 1.2s ease-in-out infinite;
}

.service-state.is-online .status-dot {
  background: #6fc4a1;
  box-shadow: 0 0 0 4px rgb(111 196 161 / 15%);
}

.service-state.is-offline .status-dot {
  background: var(--red);
  box-shadow: 0 0 0 4px rgb(255 12 10 / 16%);
}

@keyframes service-pulse {
  50% {
    opacity: 0.45;
    transform: scale(0.8);
  }
}

main {
  background: var(--paper);
}

.hero-headline {
  display: grid;
  min-height: 110px;
  padding: 0 max(1.3rem, calc((100vw - 1180px) / 2)) 2rem;
  align-items: start;
  align-content: end;
  gap: 3rem;
  text-align: right;
  background: var(--cream);
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 0.35fr);
}

.hero-title-block {
  min-width: 0;
}

.hero-kicker {
  margin: 0 0 0.5rem;
  color: var(--rust);
  opacity: 0.4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.hero-headline h1 {
  display: flex;
  margin: 0;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35em;
  font-size: clamp(2.35rem, 4.1vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.title-detail {
  color: var(--rust);
  font-size: 0.62em;
  font-weight: 700;
}

.title-detail::before {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-left: 0.45em;
  background: var(--red);
  content: "";
}

.scope-note {
  margin: 0 0 0.35rem;
  padding: 0.65rem 1.1rem 0.55rem 0;
  border-right: 3px solid var(--red);
  color: var(--ink-soft);
  font-size: 1.12rem;
  line-height: 1.7;
}

.scope-note span {
  display: block;
  margin-bottom: 0.1rem;
  color: var(--rust);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.fst-flow {
  position: relative;
  isolation: isolate;
}

.hero-section {
  position: relative;
  padding: 0 max(1.5rem, calc((100vw - 1180px) / 2)) 4.5rem;
  background:
    linear-gradient(rgb(139 90 60 / 4%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(139 90 60 / 4%) 1px, transparent 1px),
    var(--cream);
  background-size: 48px 48px;
}

.workbench {
  position: relative;
  z-index: 3;
  overflow: hidden;
  width: min(100%, 1180px);
  margin: 0 auto;
  border: 1px solid var(--ink);
  border-radius: 0.3rem;
  background: var(--ink-soft);
  box-shadow:
    0 24px 52px rgb(40 29 21 / 28%),
    10px 10px 0 rgb(181 157 137 / 42%);
}

.workbench-header {
  display: flex;
  min-height: 90px;
  padding: 1rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--cream);
}

.section-kicker {
  margin: 0 0 0.25rem;
  color: var(--taupe);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.workbench-header h2 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 900;
}

.tabs {
  display: inline-flex;
  padding: 0;
  gap: 0.35rem;
  background: transparent;
}

.tab {
  position: relative;
  min-width: 7.75rem;
  padding: 0.62rem 0.9rem 0.52rem;
  border: 1px solid rgb(252 246 238 / 32%);
  border-radius: 0.15rem;
  background: rgb(40 29 21 / 22%);
  color: rgb(252 246 238 / 76%);
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 700;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.tab:hover {
  border-color: var(--cream);
  color: white;
  transform: translateY(-1px);
}

.tab.is-active {
  border-color: var(--cream);
  background: var(--cream);
  color: var(--ink);
  box-shadow: inset 0 -4px 0 var(--red);
}

.tool-panel {
  padding: 0 0.85rem 1.2rem;
}

.tool-grid {
  display: grid;
  overflow: hidden;
  min-height: 21.5rem;
  border: 1px solid var(--ink);
  border-radius: 0.15rem;
  background: var(--paper);
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  box-shadow: none;
}

.query-column,
.response-column {
  min-width: 0;
  padding: 1.65rem;
}

.query-column {
  border-left: 1px solid var(--line);
  background: var(--paper);
}

.field-label {
  display: block;
  color: var(--ink);
  font-size: 1.65rem;
  font-weight: 900;
}

.field-help {
  margin: 0.2rem 0 0.85rem;
  color: var(--ink-soft);
  font-size: 1.15rem;
}

.input-row {
  display: flex;
  overflow: hidden;
  gap: 0;
  border: 2px solid var(--ink);
  border-radius: 0.15rem;
  background: var(--cream);
  box-shadow: 5px 5px 0 var(--sand);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.input-row:focus-within {
  border-color: var(--red);
  box-shadow: 5px 5px 0 rgb(255 12 10 / 16%);
}

input[type="text"],
textarea {
  width: 100%;
  border: 1px solid var(--rust);
  border-radius: 0.15rem;
  background: var(--cream);
  color: var(--ink);
  outline: none;
  font-size: 1.25rem;
}

input[type="text"] {
  min-width: 0;
  padding: 0.9rem 1rem;
  border: 0;
  border-radius: 0;
}

textarea {
  display: block;
  min-height: 6.5rem;
  padding: 0.85rem;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1rem;
}

input[type="text"]:focus,
textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgb(255 12 10 / 10%);
}

.input-row input[type="text"]:focus {
  box-shadow: none;
}

.primary-button,
.report-button {
  display: inline-flex;
  min-width: 7.5rem;
  padding: 0.78rem 1rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid var(--red);
  border-radius: 0.15rem;
  background: var(--red);
  color: white;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 900;
  text-decoration: none;
  transition:
    box-shadow 150ms ease,
    filter 150ms ease,
    transform 150ms ease;
}

.input-row .primary-button {
  min-width: 9rem;
  border: 0;
  border-right: 2px solid var(--ink);
  border-radius: 0;
}

.primary-button:hover,
.report-button:hover {
  filter: brightness(0.96);
}

.primary-button:hover {
  box-shadow: inset 0 -4px 0 rgb(62 0 12 / 38%);
}

.primary-button:active,
.report-button:active {
  transform: translateY(1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.primary-button svg {
  width: 1.15rem;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transform: rotate(180deg);
}

.full-button {
  width: 100%;
  margin-top: 0.65rem;
}

.check-row {
  display: inline-flex;
  margin-top: 0.85rem;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 1.05rem;
}

.check-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.check-control {
  position: relative;
  width: 2rem;
  height: 1.08rem;
  border-radius: 1rem;
  background: var(--taupe);
  transition: background 150ms ease;
}

.check-control::after {
  position: absolute;
  top: 0.17rem;
  right: 0.17rem;
  width: 0.74rem;
  height: 0.74rem;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgb(40 29 21 / 30%);
  content: "";
  transition: transform 150ms ease;
}

.check-row input:checked + .check-control {
  background: var(--red);
}

.check-row input:checked + .check-control::after {
  transform: translateX(-0.92rem);
}

.examples {
  margin-top: 1.7rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.examples > span {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--ink-soft);
  font-size: 1.35rem;
  font-weight: 900;
}

.examples > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.examples button,
.copy-button {
  padding: 0.42rem 0.72rem 0.34rem;
  border: 1px solid var(--line);
  border-radius: 0.15rem;
  background: rgb(228 218 203 / 52%);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 1rem;
  transition:
    border-color 150ms ease,
    color 150ms ease,
    background 150ms ease;
}

.examples button:hover,
.copy-button:hover {
  border-color: var(--ink);
  background: var(--cream);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--sand);
}

.response-column {
  overflow: auto;
  max-height: 31rem;
  background:
    linear-gradient(rgb(139 90 60 / 5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(139 90 60 / 5%) 1px, transparent 1px),
    var(--cream);
  background-size: 22px 22px;
}

.empty-state,
.loading-state,
.error-state,
.no-results {
  display: grid;
  min-height: 16.5rem;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.empty-glyph {
  display: grid;
  width: 3.2rem;
  height: 3.2rem;
  margin-bottom: 0.85rem;
  place-items: center;
  border: 1px solid var(--rust);
  border-radius: 0.1rem;
  background: var(--sand);
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  box-shadow: 5px 5px 0 rgb(181 157 137 / 45%);
}

.empty-state h3,
.error-state h3,
.no-results h3 {
  margin: 0;
  font-size: 1.3rem;
}

.empty-state p,
.error-state p,
.no-results p {
  max-width: 21rem;
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.loading-state span {
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--sand);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.loading-state p {
  margin-top: 0.8rem;
  color: var(--ink-soft);
  font-size: 0.73rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.result-summary {
  display: flex;
  margin-bottom: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.result-summary h3 {
  margin: 0;
}

.result-summary p {
  margin: 0.2rem 0 0;
  color: var(--ink-soft);
}

.normalized-note,
.truncated-note {
  margin: 0 0 0.8rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.45rem;
  background: var(--sand);
  color: var(--ink);
  font-size: 0.92rem;
}

.truncated-note {
  background: #fff0ca;
  color: #68440d;
}

.result-list {
  display: grid;
  gap: 0.7rem;
}

.analysis-card,
.form-card {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: rgb(247 242 235 / 94%);
  box-shadow: 0 5px 16px rgb(40 29 21 / 5%);
}

.analysis-card-head,
.form-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.analysis-index {
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 750;
}

.analysis-code {
  display: block;
  overflow-wrap: anywhere;
  margin: 0.7rem 0;
  color: var(--maroon);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.7;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  display: inline-flex;
  padding: 0.24rem 0.48rem;
  align-items: center;
  gap: 0.28rem;
  border: 1px solid var(--line);
  border-radius: 0.38rem;
  background: var(--sand);
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.tag b {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 750;
}

.tag.root-tag {
  border-color: var(--rust);
  background: var(--taupe);
  color: var(--ink);
}

.weight {
  margin-top: 0.65rem;
  color: var(--brown);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  text-align: left;
}

.form-card {
  min-height: 4rem;
}

.generated-form {
  margin: 0;
  color: var(--maroon);
  font-size: 1.55rem;
  font-weight: 700;
}

.form-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.error-state .empty-glyph {
  border-color: var(--red);
  background: var(--danger-bg);
  color: var(--red);
}

.fst-error-route {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.fst-error-route svg {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.error-route-path {
  fill: none;
  stroke: var(--red);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 7;
  vector-effect: non-scaling-stroke;
}

.error-route-tip {
  fill: var(--red);
}

.error-route-label {
  position: absolute;
  z-index: 1;
  padding: 0.1rem 0.55rem 0.3rem;
  border-radius: 999px;
  background: var(--cream);
  color: var(--red);
  font-family: "w_Yekan";
  font-size: 2rem;
  line-height: 1;
  transform: translate(-50%, -50%);
}

.report-scene {
  --sib-x: 0px;
  --sib-y: 0px;
  --letter-x: 0px;
  --letter-y: 0px;
  position: relative;
  display: grid;
  min-height: 514px;
  padding: 7.5rem max(1.5rem, calc((100vw - 1000px) / 2));
  place-items: center;
  overflow: hidden;
  background: var(--cream);
}

.sibawayh {
  position: absolute;
  z-index: 1;
  right: max(-8rem, calc((100vw - 1250px) / 2));
  bottom: -0.2rem;
  width: min(59.5vw, 860px);
  max-width: none;
  opacity: 0.84;
  pointer-events: none;
  transform: translate3d(var(--sib-x), var(--sib-y), 0);
  transition: transform 80ms linear;
  will-change: transform;
}

.nastaliq-field {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  transform: translate3d(var(--letter-x), var(--letter-y), 0);
  transition: transform 90ms linear;
  will-change: transform;
}

.nastaliq-field span {
  position: absolute;
  color: var(--rust);
  font-family: "IranNastaliq", serif;
  font-size: clamp(4.5rem, 8vw, 8rem);
  line-height: 1;
  opacity: 0.09;
  translate: var(--char-x, 0) var(--char-y, 0);
  transition: translate 90ms linear;
  will-change: translate;
}

.nastaliq-field span:nth-child(1) {
  top: 8%;
  right: 9%;
  transform: rotate(-7deg);
}

.nastaliq-field span:nth-child(2) {
  top: 52%;
  right: 26%;
  transform: rotate(9deg) scale(0.78);
}

.nastaliq-field span:nth-child(3) {
  top: 12%;
  left: 14%;
  transform: rotate(12deg) scale(0.72);
}

.nastaliq-field span:nth-child(4) {
  bottom: 4%;
  left: 32%;
  transform: rotate(-9deg) scale(0.82);
}

.nastaliq-field span:nth-child(5) {
  top: 38%;
  left: 5%;
  transform: rotate(5deg) scale(0.64);
}

.report-card {
  position: relative;
  z-index: 3;
  display: flex;
  width: min(100%, 1000px);
  padding: 3rem;
  align-items: center;
  flex-direction: column;
  gap: 1.25rem;
  border: 1px solid rgb(255 255 255 / 62%);
  border-radius: 1.5rem;
  background: rgb(255 255 255 / 72%);
  box-shadow: var(--soft-shadow);
  text-align: center;
  backdrop-filter: blur(3px);
}

.report-card h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.5rem);
  line-height: 1.35;
}

.report-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.2rem;
  line-height: 1.8;
}

.report-button {
  min-height: 3.5rem;
  padding-inline: 1.75rem;
  border-radius: 1rem;
  box-shadow: 0 10px 18px rgb(255 12 10 / 20%);
  font-size: 1.25rem;
}

#report_icon {
  font-size: 2rem;
  font-weight: 100;
}

.site-footer {
  padding: 5rem max(1.5rem, calc((100vw - 1280px) / 2));
  background: var(--maroon);
  color: var(--cream);
  border-top: 4px solid var(--red);
}

.footer-inner {
  display: flex;
  width: min(100%, 1280px);
  margin: 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 5rem;
}

.footer-identity {
  width: min(100%, 23rem);
}

.footer-lockup {
  display: flex;
  min-height: 2.15rem;
  align-items: flex-end;
  gap: 0.7rem;
}

.footer-lockup img {
  width: 2rem;
  height: 2rem;
  object-fit: cover;
}

.footer-vakav {
  font-family: "B_Kufigraph", Tahoma, sans-serif;
  font-size: 1.5rem;
  line-height: 1;
}

img.footer-vakav:hover {
  transform: scale(-1);
  cursor: pointer;
}

.university-name {
  padding-right: 0.65rem;
  border-right: 1px solid rgb(252 246 238 / 28%);
  font-size: 1.25rem;
  font-weight: 700;
}

.footer-identity p {
  margin: 1.25rem 0 0;
  color: rgb(252 246 238 / 86%);
  font-size: 1rem;
  line-height: 1.8;
}

.footer-version {
  display: block;
  margin-top: 0.7rem;
  color: rgb(252 246 238 / 55%);
  font-size: 0.9rem;
}

.footer-version #version-dash {
  padding: 0px 0.1rem 0px 0.1rem;
}

.footer-links {
  display: flex;
  gap: 5rem;
}

.footer-links section {
  display: grid;
  justify-items: start;
  gap: 0.65rem;
}

.footer-links h2 {
  margin: 0 0 0.15rem;
  color: var(--cream);
  font-size: 1.2rem;
}

.footer-links a,
.footer-links span {
  color: rgb(252 246 238 / 84%);
  font-size: 1rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--taupe);
}

:focus-visible {
  outline: 3px solid rgb(255 12 10 / 35%);
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .site-header {
    padding-inline: 1.5rem;
  }

  .header-actions {
    gap: 1rem;
  }

  .service-state {
    display: none;
  }

  .hero-headline {
    align-items: start;
    margin-top: 1rem;
    gap: 1.5rem;
    grid-template-columns: 1fr;
  }

  .scope-note {
    width: min(100%, 28rem);
  }

  .hero-section {
    padding-bottom: 7rem;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .query-column {
    border-bottom: 1px solid var(--line);
    border-left: 0;
  }

  .response-column {
    min-height: 22rem;
  }

  .sibawayh {
    right: -13rem;
    width: 58rem;
    opacity: 0.62;
  }

  .footer-inner {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  html {
    font-size: 16px;
  }

  .site-header {
    min-height: 72px;
    padding: 0.85rem 1rem;
  }

  .header-inner {
    min-height: 48px;
  }

  .header-actions > a:not(.icon-link),
  .service-state {
    display: none;
  }

  .brand {
    width: 112px;
    height: auto;
  }

  .icon-link {
    width: 2.35rem;
    height: 2.35rem;
  }

  .hero-headline {
    min-height: auto;
    padding: 0rem 1rem 1.75rem;
    gap: 1.25rem;
    background: var(--cream);
  }

  .hero-kicker {
    font-size: 0.62rem;
    letter-spacing: 0.1em;
  }

  .hero-headline h1 {
    display: block;
    font-size: clamp(2rem, 10vw, 2.65rem);
    line-height: 1.15;
  }

  .title-detail {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.58em;
  }

  .scope-note {
    margin: 0;
    font-size: 1rem;
  }

  .hero-section {
    padding: 1.25rem 0.65rem 6.5rem;
  }

  .workbench {
    border-radius: 0.2rem;
    box-shadow:
      0 18px 36px rgb(40 29 21 / 25%),
      5px 5px 0 rgb(181 157 137 / 42%);
  }

  .workbench-header {
    min-height: auto;
    padding: 1.15rem 1rem;
    align-items: stretch;
    flex-direction: column;
  }

  .tabs {
    width: 100%;
  }

  .tab {
    min-width: 0;
    flex: 1;
  }

  .tool-panel {
    padding: 0 0.55rem 0.55rem;
  }

  .query-column,
  .response-column {
    padding: 1.25rem 1rem;
  }

  .input-row {
    flex-direction: column;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .input-row:focus-within {
    border-color: transparent;
    box-shadow: none;
  }

  .input-row input[type="text"] {
    border: 2px solid var(--ink);
    box-shadow: 4px 4px 0 var(--sand);
  }

  .input-row .primary-button {
    min-height: 3.25rem;
    border-right: 0;
    box-shadow: 4px 4px 0 rgb(62 0 12 / 25%);
  }

  .primary-button {
    width: 100%;
  }

  .result-summary {
    flex-direction: column;
  }

  .error-route-path {
    stroke-width: 5;
  }

  .error-route-label {
    font-size: 1.25rem;
  }

  .report-scene {
    min-height: 500px;
    padding: 6rem 0.75rem 4rem;
  }

  .sibawayh {
    right: -17rem;
    width: 50rem;
    opacity: 0.5;
  }

  .nastaliq-field span {
    font-size: 4.2rem;
  }

  .report-card {
    padding: 2.25rem 1.2rem;
    border-radius: 1.15rem;
  }

  .report-card p {
    font-size: 1rem;
  }

  .site-footer {
    padding: 3.5rem 1.25rem;
  }

  .footer-inner,
  .footer-links {
    gap: 2.5rem;
  }

  .footer-links {
    width: 100%;
    justify-content: space-between;
  }

  .university-name {
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
