:root {
  --ink: #1c1915;
  --muted: #5e584f;
  --paper: #f3efe6;
  --card: #fffcf7;
  --line: #e3d9c8;
  --green: #1e4a38;
  --green-soft: #e5f0ea;
  --amber: #8a5a18;
  --amber-soft: #f8ecd8;
  --clay: #7a3b32;
  --clay-soft: #f6e6e2;
  --stone: #6d675e;
  --focus: #1e4a38;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "IBM Plex Sans Arabic", "IBM Plex Sans", sans-serif;
  line-height: 1.55;
}
a { color: var(--green); }
.top {
  width: 100%;
  background: var(--green);
  color: #f7f3ea;
  padding: 0.9rem 0;
}
.top-inner, .tabs, .notice, main { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
.top-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.brand { display: flex; gap: 0.75rem; align-items: center; text-decoration: none; color: inherit; }
.brand strong { display: block; font-size: 1.35rem; letter-spacing: 0.01em; }
.brand small { color: #d7e4dc; }
.brand-mark {
  width: 3.4rem; height: 3.4rem; object-fit: cover;
  border-radius: 0.7rem; background: #fff;
}
.top-actions, .langs, .toolbar, .inline { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.langs a, .text-btn, button, .tabs a {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 0.35rem 0.8rem; text-decoration: none; cursor: pointer;
  font: inherit;
}
.langs a[aria-current="true"], .tabs a[aria-current="page"] { background: var(--green); color: white; border-color: var(--green); }
.tabs {
  display: flex; gap: 0.35rem; overflow-x: auto; padding: 0.55rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  margin-top: 0.9rem; box-shadow: 0 8px 24px rgba(30, 74, 56, 0.06);
}
.notice, .flash, .warn { border: 1px solid var(--line); background: var(--card); border-radius: 0.6rem; padding: 0.7rem 0.9rem; }
.notice { color: var(--muted); font-size: 0.92rem; }
.flash { background: var(--green-soft); }
.warn { background: var(--amber-soft); margin: 1rem 0; }
main { padding-bottom: 3rem; }
h1 { font-size: 1.7rem; line-height: 1.3; margin: 0 0 0.4rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.5rem; }
.page-head { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin: 1rem 0; }
.stats { display: flex; gap: 0.8rem; list-style: none; padding: 0; margin: 0; }
.stats li { background: var(--card); border: 1px solid var(--line); border-radius: 0.6rem; padding: 0.6rem 0.8rem; min-width: 6rem; }
.stats strong { display: block; font-size: 1.3rem; }
.stats span, .muted { color: var(--muted); font-size: 0.9rem; }
.panel, .facts div { background: var(--card); border: 1px solid var(--line); border-radius: 0.7rem; padding: 1rem; }
.narrow { max-width: 32rem; margin-top: 1.2rem; }
.stack { display: grid; gap: 0.7rem; }
@keyframes form-blink {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  18%, 55% { box-shadow: 0 0 0 3px var(--clay); background: var(--clay-soft); }
  36%, 78% { box-shadow: 0 0 0 0 transparent; background: var(--card); }
}
form.blink { border-radius: 0.7rem; animation: form-blink 1.15s ease 1; }
details.edit-user, td details { min-width: 16rem; }
td details form { margin-top: 0.6rem; }
.flash.form-error { background: var(--clay-soft); color: var(--clay); }
label { display: grid; gap: 0.25rem; font-weight: 500; }
input, select, textarea {
  font: inherit; padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: 0.45rem; background: white; width: 100%;
}
textarea { min-height: 5rem; }
button[type="submit"] { background: var(--green); color: white; border-color: var(--green); width: fit-content; }
button.ghost { background: white; color: var(--ink); }
.legend { display: flex; gap: 0.8rem; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.swatch { width: 0.8rem; height: 0.8rem; display: inline-block; border-radius: 0.2rem; margin-inline-end: 0.3rem; }
.parcel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr)); gap: 0.45rem; }
.tile {
  display: grid; place-items: center; min-height: 4.4rem; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 0.45rem;
}
.tile b { font-size: 1.05rem; }
.tile small { color: var(--muted); }
.tile.match { background: var(--green-soft); }
.tile.changed { background: var(--amber-soft); }
.tile.split { background: #e7eef8; }
.tile.vacant { background: #f3f1ee; }
.swatch.match { background: #8fbfa8; }
.swatch.changed { background: #e2c08a; }
.swatch.split { background: #9bb6d6; }
.swatch.unassigned { background: #d9d3c8; }
.swatch.vacant { background: #eeeae4; }
.swatch.sheet-matched { background: #d9ead3; border: 1px solid #467056; }
.swatch.sheet-open { background: #f4cccc; border: 1px solid #c00000; }
.sheet-wrap {
  overflow: auto;
  max-height: 78vh;
  background: #f7f3ea;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
}
.sheet { width: 160%; min-width: 70rem; height: auto; display: block; }
.sheet a { cursor: pointer; }
.lot { stroke-width: 1.4; }
.lot.alloc-pending { fill: #eeeae4; stroke: #6d675e; }
.lot.alloc-disputed { fill: #f6e6e2; stroke: #7a3b32; }
.lot.alloc-under_review { fill: #f8ecd8; stroke: #8a5a18; }
.lot.alloc-confirmed { fill: #d9ead3; stroke: #467056; }
.lot.alloc-returned { fill: #e7eef8; stroke: #3d5a80; }
.lot.alloc-reserved { fill: #ece6f4; stroke: #5c4d73; }
.lot.mine { fill: #8fbfa8; stroke: #1e4a38; }
.lot.watch { fill: #9bb6d6; stroke: #3d5a80; }
.lot.rest { fill: #f3efe6; stroke: #c9c2b6; }
.sheet text {
  font-size: 13px;
  font-weight: 600;
  fill: #1c1915;
  text-anchor: middle;
  pointer-events: none;
  stroke: #fff;
  stroke-width: 2px;
  paint-order: stroke fill;
}
.sheet .lot-name, .sheet .lot-area { font-size: 8px; font-weight: 500; }
.sheet a[hidden] { display: none; }
.sheet-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  max-width: 36rem;
}
.sheet-no { font-size: 1.8rem; margin: 0.2rem 0; }
.name-original { color: #1a4f8b; font-weight: 600; }
.name-final { color: #c00000; font-weight: 600; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 0.7rem; }
table { width: 100%; border-collapse: collapse; }
table.fit { width: auto; }
table.fit th, table.fit td { white-space: nowrap; padding-inline: 1rem; }
th, td { text-align: start; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.85rem; color: var(--muted); }
.num { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.owner-line { display: inline-flex; align-items: center; gap: 0.3rem; margin-inline-end: 0.7rem; }
.name-line { display: block; }
.wa { display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 999px; background: #25d366; }
.wa svg { width: 0.95rem; height: 0.95rem; fill: white; }
.pill { display: inline-block; border-radius: 999px; padding: 0.1rem 0.55rem; background: #eeeae4; font-size: 0.85rem; }
.pill.match { background: var(--green-soft); }
.pill.changed { background: var(--amber-soft); }
.pill.split { background: #e7eef8; }
.alloc-pending { background: #eeeae4; }
.alloc-disputed { background: #f6e6e2; }
.alloc-under_review { background: #f8ecd8; }
.alloc-confirmed { background: #d9ead3; }
.alloc-returned { background: #e7eef8; }
.alloc-reserved { background: #ece6f4; }
tr.alloc-pending td { background: #f7f4ee; }
tr.alloc-disputed td { background: #f6e6e2; }
tr.alloc-under_review td { background: #f8ecd8; }
tr.alloc-confirmed td { background: #d9ead3; }
tr.alloc-returned td { background: #e7eef8; }
tr.alloc-reserved td { background: #ece6f4; }
.swatch.alloc-pending { background: #eeeae4; }
.swatch.alloc-disputed { background: #e7b2a8; }
.swatch.alloc-under_review { background: #e2c08a; }
.swatch.alloc-confirmed { background: #8fbfa8; }
.swatch.alloc-returned { background: #9bb6d6; }
.swatch.alloc-reserved { background: #b7a6cc; }
.table-wrap { margin-top: 1rem; }
.mine-list { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.8rem; }
.mine-card { background: var(--card); border: 1px solid var(--line); border-radius: 0.8rem; padding: 0.9rem 1rem; }
.mine-card header { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; }
.mine-no { font-size: 1.7rem; font-weight: 700; text-decoration: none; }
.mine-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem 0.8rem; margin: 0.7rem 0 0; }
.mine-card dt { color: var(--muted); font-size: 0.78rem; }
.mine-card dd { margin: 0; overflow-wrap: anywhere; }
.mine-card.alloc-confirmed { border-inline-start: 0.28rem solid #467056; }
.mine-card.alloc-pending { border-inline-start: 0.28rem solid #6d675e; }
.mine-card.alloc-disputed { border-inline-start: 0.28rem solid #7a3b32; }
.mine-card.alloc-under_review { border-inline-start: 0.28rem solid #8a5a18; }
.mine-card.alloc-returned { border-inline-start: 0.28rem solid #3d5a80; }
.mine-card.alloc-reserved { border-inline-start: 0.28rem solid #5c4d73; }
.mine-certify { margin-top: 0.85rem; }
.mine-certify button { width: 100%; white-space: normal; text-align: start; line-height: 1.45; padding: 0.75rem 0.9rem; }
.review-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 0.7rem; list-style: none; padding: 0; margin: 0.6rem 0 1.4rem; }
.review-card.alloc-pending { background: #eeeae4; border-color: #6d675e; }
.review-card.alloc-disputed { background: #f6e6e2; border-color: #7a3b32; }
.review-card.alloc-under_review { background: #f8ecd8; border-color: #8a5a18; }
.review-card.alloc-confirmed { background: #d9ead3; border-color: #467056; }
.review-card.alloc-returned { background: #e7eef8; border-color: #3d5a80; }
.review-card.alloc-reserved { background: #ece6f4; border-color: #5c4d73; }
.review-group.alloc-pending h2 { color: #6d675e; }
.review-group.alloc-disputed h2 { color: #7a3b32; }
.review-group.alloc-under_review h2 { color: #8a5a18; }
.review-group.alloc-reserved h2 { color: #5c4d73; }
.review-board a { display: block; text-decoration: none; color: inherit; }
.lot-status { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0.15rem 0; }
.share-tag { font-weight: 600; color: #b42318; }
.share-flag { display: inline-block; margin-inline-end: 0.35rem; color: #b42318; font-weight: 700; }
.share-sum { font-weight: 600; }
tr.share-review td { border-top: 2px solid #b42318; border-bottom: 2px solid #b42318; }
tr.share-review td:first-child { border-inline-start: 2px solid #b42318; }
tr.share-review td:last-child { border-inline-end: 2px solid #b42318; }
.history { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.history li { display: grid; gap: 0.15rem; }
.name-edits { list-style: none; padding: 0; margin: 0.6rem 0 0; display: grid; gap: 0.4rem; }
.name-edits li { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.name-edits button { width: auto; }
.captcha-row img { display: block; border: 1px solid var(--line); border-radius: 0.45rem; background: white; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.6rem; margin-bottom: 0.6rem; }
.facts span { display: block; color: var(--muted); font-size: 0.82rem; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.dispute { border-top: 1px solid var(--line); padding: 0.8rem 0; }
.prose p { max-width: 70ch; }
.check { font-weight: 400; grid-template-columns: auto 1fr; align-items: start; }
#filter, #kind { max-width: 22rem; }
@media (max-width: 800px) {
  .page-head, .cards { display: block; }
  .stats { margin-top: 0.8rem; flex-wrap: wrap; }
  .top-inner { align-items: flex-start; }
  .brand strong { font-size: 1.05rem; }
  .brand-mark { width: 2.6rem; height: 2.6rem; }
  .top-inner, .tabs, .notice, main { width: min(1120px, calc(100% - 1rem)); }
  .tabs {
    border-radius: 0.8rem;
    flex-wrap: wrap;
    overflow: visible;
  }
  .tabs a, button, .text-btn, .langs a { min-height: 2.6rem; display: inline-flex; align-items: center; }
  .stack button[type="submit"], .stack .ghost { width: 100%; justify-content: center; }
  input, select, textarea { font-size: 16px; }
  .sheet { width: 100%; min-width: 0; }
  .sheet-wrap { max-height: none; }
  .mine-map { max-height: 70vh; }
  .mine-map .sheet { width: 168%; min-width: 40rem; }
  .browse-table { display: none; }
  .cards-on-phone table, .cards-on-phone thead, .cards-on-phone tbody, .cards-on-phone tr, .cards-on-phone td { display: block; width: 100%; }
  .cards-on-phone thead { display: none; }
  .cards-on-phone tr { border-bottom: 1px solid var(--line); padding: 0.7rem 0.8rem; }
  .cards-on-phone td { border: 0; padding: 0.15rem 0; }
  .cards-on-phone td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
  }
  .inline { display: grid; }
  .mine-card dl { grid-template-columns: 1fr; }
  .legend { gap: 0.45rem; }
  h1 { font-size: 1.35rem; }
}
