:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #62706a;
  --line: #d7ddd8;
  --paper: #f7f8f4;
  --panel: #ffffff;
  --accent: #0f6b5c;
  --accent-2: #a24a35;
  --blue: #174b63;
  --soft: #e9f1ee;
  --warn: #8a5a00;
  --warn-bg: #fff5d8;
  --gold: #c79545;
  --cream: #fbfaf4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16px 16px, rgba(199, 149, 69, .13) 2px, transparent 2.5px),
    linear-gradient(180deg, rgba(15, 107, 92, .08), transparent 260px),
    var(--paper);
  background-size: 32px 32px, auto, auto;
  color: var(--ink);
  font-family: "Aptos", "Segoe UI", "Tahoma", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 456px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.panel {
  background: rgba(255, 255, 255, .93);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(20, 52, 48, .08);
  backdrop-filter: blur(10px);
}

.inputs {
  padding: 16px;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.brand,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  justify-content: flex-start;
  margin-bottom: 18px;
}

.brand-logo {
  width: 92px;
  height: 92px;
  border-radius: 24px;
  flex: 0 0 auto;
  box-shadow: 0 14px 30px rgba(23, 60, 56, .14);
}

.brand-owner {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 29px;
  color: #14352f;
  letter-spacing: 0;
}

h2 {
  font-size: 22px;
}

p {
  color: var(--muted);
  line-height: 1.6;
}

.top-controls {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.language-toggle {
  display: inline-grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  border: 1px solid rgba(15, 107, 92, .28);
  border-radius: 999px;
  background: linear-gradient(135deg, #0f6b5c, #174b63);
  color: white;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(15, 107, 92, .16);
}

.language-toggle strong {
  color: var(--gold);
}

.language-toggle.is-english {
  background: linear-gradient(135deg, #174b63, #9d4935);
}

.symbol-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--gold);
  font-size: 18px;
}

details {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

summary {
  cursor: pointer;
  font-weight: 700;
  margin-bottom: 12px;
}

.field-row,
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 12px 0 4px;
}

.quick-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  cursor: pointer;
}

.quick-actions button:hover {
  border-color: var(--accent);
  background: var(--soft);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: white;
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 2px solid color-mix(in srgb, var(--accent), white 65%);
  border-color: var(--accent);
}

.heir-control {
  display: grid;
  gap: 6px;
}

.stepper {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  gap: 6px;
  align-items: center;
}

.stepper button,
.result-actions button {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #f3f8f5, #e7f0ec);
  color: var(--ink);
  min-height: 40px;
  cursor: pointer;
}

.stepper button:hover,
.result-actions button:hover {
  border-color: var(--accent);
}

.advanced {
  display: grid;
  gap: 12px;
}

.check {
  grid-template-columns: 18px 1fr;
  align-items: center;
  color: var(--ink);
}

.check input {
  min-height: auto;
}

.results {
  min-height: calc(100vh - 40px);
  padding: 18px;
}

.toolbar {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.result-actions {
  display: flex;
  gap: 8px;
}

.result-actions button {
  width: 42px;
  font-size: 22px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stats div {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, var(--cream));
}

.stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.stats strong {
  display: block;
  color: var(--blue);
  font-size: 18px;
}

.alerts {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.alert {
  border: 1px solid #ead28a;
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: 12px;
  padding: 10px 12px;
  line-height: 1.6;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: top;
  line-height: 1.55;
}

[dir="ltr"] th,
[dir="ltr"] td {
  text-align: left;
}

th {
  background: linear-gradient(180deg, #eef6f1, #e6efea);
  color: #31413a;
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

.name {
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.badge::before {
  content: "۞";
  margin-inline-end: 5px;
  color: var(--gold);
}

.blocked {
  color: var(--accent-2);
}

.scenario {
  margin-top: 18px;
}

.scenario h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.seo-content {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.seo-content article {
  background: rgba(255, 255, 255, .93);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 18px 46px rgba(20, 52, 48, .06);
}

.seo-content h2,
.seo-content h3 {
  margin: 0 0 10px;
  color: #14352f;
  letter-spacing: 0;
}

.seo-content p,
.seo-content li {
  color: #44534d;
  line-height: 1.85;
}

.seo-content ul {
  margin: 0;
  padding-inline-start: 22px;
}

.seo-content details {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.seo-content details:first-of-type {
  border-top: 0;
}

.seo-content summary {
  margin: 0;
  color: #14352f;
}

@media (max-width: 920px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .inputs {
    position: static;
    max-height: none;
  }
}

@media (max-width: 560px) {
  .app {
    padding: 10px;
  }

  .field-row,
  .grid,
  .top-controls,
  .stats,
  .seo-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: white;
  }

  .app {
    padding: 0;
  }

  .workspace {
    display: block;
  }

  .inputs,
  .result-actions,
  .quick-actions {
    display: none;
  }

  .results {
    border: 0;
    min-height: auto;
  }

  .table-wrap {
    overflow: visible;
  }

  table {
    min-width: 0;
    font-size: 11px;
  }
}
