:root {
  color-scheme: light;
  --ink: #1d2522;
  --muted: #66736e;
  --line: #dce4df;
  --paper: #fbfcfa;
  --panel: #ffffff;
  --green: #236452;
  --green-dark: #143d33;
  --red: #b44735;
  --amber: #d89a2b;
  --blue: #356fb3;
  --shadow: 0 14px 36px rgba(28, 37, 34, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

html[lang="ur"] body {
  direction: rtl;
  font-family: "Segoe UI", Tahoma, ui-sans-serif, system-ui, sans-serif;
  line-height: 1.65;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(18px, 5vw, 56px) 20px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.topbar h1,
.panel h2,
.dialog-form h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(32px, 5vw, 58px);
}

html[lang="ur"] .topbar h1 {
  direction: ltr;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.actions,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.locale-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  min-height: 42px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8f6;
}

.locale-option {
  min-width: 48px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.locale-option.active {
  background: #ffffff;
  color: var(--green-dark);
  box-shadow: 0 4px 14px rgba(28, 37, 34, 0.08);
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-button {
  padding: 0 18px;
  background: var(--green);
  color: white;
}

.primary-button:hover {
  background: var(--green-dark);
}

.ghost-button {
  padding: 0 16px;
  background: #fff;
  color: var(--green-dark);
  border-color: var(--line);
}

.icon-button {
  width: 38px;
  background: #f5f7f5;
  color: var(--ink);
  border-color: var(--line);
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 18px clamp(16px, 4vw, 40px) 48px;
}

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid #e6d7ce;
  background: #fff7f2;
  border-radius: 8px;
  color: #4f2c22;
}

.focus-note {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef5f2;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.stat {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stat strong {
  display: block;
  margin-top: 20px;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1;
}

html[lang="ur"] .stat strong {
  font-size: clamp(26px, 3.2vw, 34px);
  line-height: 1.2;
}

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

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.issues-panel {
  padding: 18px;
}

.side-column {
  display: grid;
  gap: 16px;
}

.side-column .panel {
  padding: 16px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.panel-heading > div:first-child {
  min-width: 0;
}

.panel h2 {
  font-size: 22px;
}

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

.panel-heading .filters {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-inline-start: auto;
}

.panel-heading .filters label {
  flex: 0 0 176px;
  min-width: 160px;
}

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

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

textarea {
  resize: vertical;
}

.issues-list {
  display: grid;
  gap: 10px;
  min-height: 162px;
}

.issue-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 14px;
  min-height: 150px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.issue-card h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

html[lang="ur"] .issue-card h3 {
  font-size: 22px;
  line-height: 1.45;
}

.author-line {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.issue-card p {
  margin: 9px 0 13px;
  color: #40504a;
  line-height: 1.48;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef5f2;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.pill.category {
  background: #f7edda;
  color: #6f4b0e;
}

.vote-box {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

.vote-box strong {
  font-size: 28px;
}

.vote-button {
  width: 96px;
  min-height: 34px;
  border: 1px solid #c9dbd4;
  border-radius: 8px;
  background: #eef7f3;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
}

.mention-list,
.activity-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  min-height: 44px;
}

.mention,
.activity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.mention:first-child,
.activity:first-child {
  border-top: 0;
}

.mention strong,
.activity strong {
  font-size: 14px;
}

.mention span,
.activity span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

dialog {
  width: min(680px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 70px rgba(29, 37, 34, 0.25);
}

dialog::backdrop {
  background: rgba(29, 37, 34, 0.42);
}

.dialog-form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.dialog-scroll {
  display: grid;
  gap: 14px;
}

.dialog-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.demo-note {
  margin: 0;
  padding: 11px 12px;
  border: 1px solid #ead7b5;
  border-radius: 8px;
  background: #fff9eb;
  color: #62460f;
  font-size: 13px;
  line-height: 1.45;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.toggle-row input {
  width: 18px;
  height: 18px;
}

.help-text {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #eef4fb;
  color: #25486f;
  line-height: 1.45;
}

.help-text strong {
  color: #173a60;
}

.help-text.subtle {
  background: #f7faf8;
  color: #43514c;
}

.photo-field {
  display: grid;
  gap: 7px;
}

.field-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.visually-hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.photo-picker {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
}

.photo-picker:hover {
  border-color: #c9dbd4;
  background: #f8fbf9;
}

.photo-picker:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.visually-hidden-file:focus-visible + .photo-picker {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.photo-picker-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #eef7f3;
  color: var(--green-dark);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.photo-picker:active .photo-picker-icon {
  background: #dcefe7;
}

.photo-picker-copy strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}

.photo-picker-copy small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.photo-picker-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.photo-picker-status.error {
  color: var(--red);
}

.photo-picker-status.success {
  color: var(--green-dark);
}

.dialog-form.is-loading .primary-button[type="submit"]::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-inline-end: 8px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-top-color: #ffffff;
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin 0.8s linear infinite;
}

.metadata-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #cfe0d8;
  border-radius: 8px;
  background: #f5faf7;
}

.metadata-panel > strong {
  color: var(--green-dark);
  font-size: 13px;
}

.metadata-panel dl {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 7px 12px;
  margin: 0;
  font-size: 12px;
}

.metadata-panel dt {
  color: var(--muted);
  font-weight: 800;
}

.metadata-panel dd {
  margin: 0;
  color: #25352f;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.metadata-panel dd.muted {
  color: var(--muted);
}

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

.explain-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  margin-top: 18px;
  align-items: start;
}

.about-panel,
.faq-block,
.policy-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.about-panel {
  padding: 18px;
}

.about-panel h2,
.section-heading h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.18;
  letter-spacing: 0;
}

html[lang="ur"] .about-panel h2,
html[lang="ur"] .section-heading h2,
html[lang="ur"] .panel h2,
html[lang="ur"] .dialog-form h2 {
  line-height: 1.45;
}

.about-panel p {
  margin: 14px 0 0;
  color: #40504a;
}

.proof-steps {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.proof-steps div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.proof-steps strong {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--green);
  color: #ffffff;
  line-height: 1;
}

.proof-steps span {
  color: #40504a;
  font-size: 13px;
  font-weight: 700;
}

.faq-block {
  padding: 18px;
}

.policy-panel {
  padding: 18px;
}

.section-heading {
  margin-bottom: 14px;
}

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

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

.policy-grid article {
  min-height: 150px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.policy-grid h3 {
  margin: 0;
  color: var(--green-dark);
  font-size: 16px;
  line-height: 1.2;
}

.policy-grid p {
  margin: 10px 0 0;
  color: #40504a;
  font-size: 13px;
  line-height: 1.5;
}

details {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

summary {
  color: var(--green-dark);
  cursor: pointer;
  font-weight: 800;
  line-height: 1.25;
}

details p {
  margin: 10px 0 0;
  color: #40504a;
  font-size: 13px;
  line-height: 1.48;
}

html[lang="ur"] .topbar,
html[lang="ur"] .panel-heading,
html[lang="ur"] .dialog-heading,
html[lang="ur"] .mention,
html[lang="ur"] .activity,
html[lang="ur"] .notice {
  text-align: right;
}

html[lang="ur"] .eyebrow {
  text-transform: none;
  font-size: 13px;
  line-height: 1.4;
}

html[lang="ur"] .notice,
html[lang="ur"] .issue-card,
html[lang="ur"] .about-panel,
html[lang="ur"] .faq-block,
html[lang="ur"] .stat,
html[lang="ur"] .panel {
  word-spacing: 0.02em;
}

html[lang="ur"] strong,
html[lang="ur"] h2,
html[lang="ur"] h3,
html[lang="ur"] summary,
html[lang="ur"] button,
html[lang="ur"] label,
html[lang="ur"] .pill {
  font-weight: 700;
}

html[lang="ur"] .vote-box {
  border-left: 0;
  border-right: 1px solid var(--line);
  padding-left: 0;
  padding-right: 14px;
}

html[lang="ur"] .proof-steps div {
  grid-template-columns: minmax(0, 1fr) 34px;
}

html[lang="ur"] .proof-steps strong {
  grid-column: 2;
  grid-row: 1;
}

html[lang="ur"] .proof-steps span {
  grid-column: 1;
  grid-row: 1;
}

.hidden {
  display: none;
}

.turnstile-slot {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
}

.dialog-scroll > .hidden {
  display: none;
}

.empty {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 960px) {
  .topbar,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-heading .filters {
    width: 100%;
    margin-inline-start: 0;
    justify-content: flex-start;
  }

  .panel-heading .filters label {
    flex: 1 1 180px;
  }

  .stats-grid,
  .dashboard,
  .explain-section,
  .policy-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .actions button {
    width: 100%;
  }

  .locale-switch {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  body {
    padding-bottom: 136px;
  }

  body.modal-open,
  body:has(dialog[open]) {
    padding-bottom: 0;
  }

  body.modal-open .actions,
  body:has(dialog[open]) .actions {
    display: none;
  }

  main {
    padding: 14px 12px 34px;
  }

  .filters,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .panel-heading .filters label {
    flex-basis: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .policy-grid article {
    min-height: 0;
  }

  .stat {
    min-height: 88px;
    padding: 12px;
  }

  .stat span {
    font-size: 12px;
  }

  .stat strong {
    margin-top: 10px;
    font-size: 26px;
  }

  .topbar {
    gap: 18px;
    padding: 20px 16px 16px;
  }

  .topbar h1 {
    font-size: 34px;
  }

  .actions {
    width: auto;
    position: fixed;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    z-index: 20;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 48px rgba(28, 37, 34, 0.22);
    backdrop-filter: blur(14px);
  }

  .actions .primary-button,
  .actions .ghost-button,
  .locale-switch {
    min-height: 46px;
  }

  .locale-switch {
    min-height: 38px;
  }

  .notice {
    align-items: start;
    gap: 4px;
    padding: 11px 12px;
  }

  .issues-panel,
  .side-column .panel,
  .about-panel,
  .faq-block {
    padding: 14px;
  }

  .panel-heading {
    gap: 12px;
    margin-bottom: 12px;
  }

  .panel h2,
  .about-panel h2,
  .section-heading h2 {
    font-size: 19px;
  }

  .issue-card {
    grid-template-columns: 1fr;
    gap: 0;
    min-height: 0;
    padding: 13px;
  }

  .issue-card h3 {
    font-size: 17px;
  }

  .author-line {
    font-size: 12px;
  }

  .issue-card p {
    margin: 7px 0 11px;
    font-size: 14px;
    line-height: 1.45;
  }

  .vote-box {
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-items: start;
    gap: 10px;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 12px 0 0;
  }

  .vote-box strong {
    font-size: 24px;
  }

  .vote-button {
    width: auto;
    min-height: 38px;
    padding: 0 13px;
    font-size: 12px;
  }

  html[lang="ur"] .vote-box {
    justify-items: end;
    border-right: 0;
    padding-right: 0;
  }

  dialog {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    max-width: none;
    max-height: min(92dvh, 760px);
    margin: 0;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
  }

  .dialog-form {
    max-height: min(92dvh, 760px);
    overflow: hidden;
    padding: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0;
  }

  .dialog-heading {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
  }

  .dialog-scroll {
    display: grid;
    gap: 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 14px 16px 18px;
  }

  .dialog-scroll textarea {
    min-height: 118px;
    max-height: 180px;
  }

  .dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: #ffffff;
  }

  .dialog-actions button {
    width: 100%;
    min-height: 46px;
  }

  .dialog-form.is-loading .primary-button[type="submit"] {
    font-size: 0;
  }

  .dialog-form.is-loading .primary-button[type="submit"]::before {
    margin-inline-end: 0;
  }
}

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