:root {
  --ink: #17231d;
  --muted: #5f6b64;
  --line: #d8dfda;
  --surface: #ffffff;
  --page: #f4f7f2;
  --green: #0b6149;
  --green-strong: #064330;
  --green-soft: #e9f2ed;
  --gold: #ad7818;
  --gold-soft: #fff3d4;
  --red: #a54132;
  --red-soft: #fae9e4;
  --blue: #315f86;
  --shadow: 0 14px 32px rgba(20, 43, 31, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-width: 0;
  scroll-behavior: smooth;
}

body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  /* Chrome can keep a stale, narrow paint surface after refresh when the
     root scrolling box uses overflow: clip. Hidden keeps the same horizontal
     overflow protection without creating that viewport-sized clip surface. */
  overflow-x: hidden;
  background: var(--page);
  color: var(--ink);
  font-family: "Times New Roman", SimSun, "Songti SC", serif;
  font-size: 16px;
  line-height: 1.55;
}

body[dir="rtl"] {
  direction: rtl;
}

a {
  color: inherit;
}

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

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p,
figure {
  margin-top: 0;
}

h1,
h2,
h3,
h4,
p,
a,
span {
  overflow-wrap: anywhere;
}

.topbar {
  /* Keep refresh paints in the normal document layer. Chrome can retain a
     narrow stale surface when sticky blur and body clipping are combined. */
  position: relative;
  top: auto;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(220px, auto) auto 1fr auto;
  gap: 18px;
  align-items: center;
  min-height: 74px;
  padding: 11px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.header-admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 176px;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--green);
  border-radius: 6px;
  color: var(--green-strong);
  font-weight: 700;
  text-decoration: none;
}

.header-admin-link:hover,
.header-admin-link:focus-visible {
  outline: 3px solid rgba(11, 97, 73, 0.14);
  background: var(--green-soft);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}

.brand img {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
}

.brand span {
  display: grid;
  min-width: 0;
  line-height: 1.1;
}

.brand strong {
  font-size: 20px;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.navlinks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

.navlinks a {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
}

.navlinks a:hover,
.navlinks a:focus-visible {
  border-color: var(--line);
  outline: none;
  background: var(--green-soft);
  color: var(--green-strong);
}

.language-control {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

.language-control select {
  height: 40px;
  min-width: 152px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}

.page-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 20px clamp(16px, 4vw, 48px) 44px;
}

.intro-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 34%);
  gap: 22px;
  align-items: start;
  min-height: 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3ea;
}

.intro-primary {
  display: grid;
  gap: 7px;
  align-content: start;
  min-width: 0;
}

.site-intro {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.eyebrow {
  margin-bottom: 0;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.25;
}

h2 {
  margin-bottom: 8px;
  font-size: 26px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
  font-size: 23px;
  line-height: 1.25;
}

h4 {
  margin-bottom: 0;
  font-size: 19px;
  line-height: 1.3;
}

.product-lead,
.side-panel p,
.future-product p,
.panel-title-row p {
  margin-bottom: 0;
  color: var(--muted);
}

.announcement-panel {
  display: grid;
  gap: 5px;
  align-content: start;
  min-width: 0;
  width: 100%;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

body[dir="rtl"] .announcement-panel {
  border-left: 0;
  border-right: 0;
}

.announcement-panel h3 {
  margin: 0;
  color: var(--green-strong);
  font-size: 18px;
}

.announcement-panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.4;
}

.announcement-panel small {
  color: var(--gold);
}

.announcement-history {
  display: grid;
  gap: 5px;
  min-width: 0;
  margin: 0;
  padding: 2px 0 2px 18px;
  border-top: 0;
  border-left: 1px solid var(--line);
}

body[dir="rtl"] .announcement-history {
  padding-right: 18px;
  padding-left: 0;
  border-right: 1px solid var(--line);
  border-left: 0;
}

.announcement-history > strong {
  color: var(--green-strong);
  font-size: 14px;
}

.announcement-history ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.announcement-history li {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.announcement-history time {
  color: var(--gold);
  white-space: nowrap;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 360px);
  gap: 24px;
  align-items: start;
  margin-top: 14px;
}

.main-column {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.software-index {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.software-index button {
  display: grid;
  gap: 2px;
  min-height: 66px;
  padding: 12px 14px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

body[dir="rtl"] .software-index button {
  border-right: 0;
  border-left: 1px solid var(--line);
  text-align: right;
}

.software-index button:last-child,
body[dir="rtl"] .software-index button:last-child {
  border-right: 0;
  border-left: 0;
}

.software-index button:hover,
.software-index button:focus-visible,
.software-index button.is-active {
  outline: none;
  background: var(--green-soft);
}

.software-empty {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.software-index span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
}

.software-index strong {
  line-height: 1.25;
}

.product-card,
.side-panel,
.future-product,
.disclaimer-section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.product-card {
  overflow: hidden;
  box-shadow: var(--shadow);
}

.product-header {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.95fr);
  gap: 24px;
  align-items: start;
  padding: clamp(20px, 3vw, 28px);
}

.product-copy {
  min-width: 0;
}

.product-label-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.software-number,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.software-number {
  background: var(--green-soft);
  color: var(--green-strong);
}

.status-pill {
  border: 1px solid #e5c876;
  background: var(--gold-soft);
  color: #76500d;
}

.status-pill.muted {
  border-color: var(--line);
  background: #f1f3f1;
  color: var(--muted);
}

.product-lead {
  font-size: 16px;
  line-height: 1.72;
}

.android-download-qr {
  width: min(100%, 390px);
  margin-top: 16px;
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  color: var(--ink);
  text-decoration: none;
}

.android-download-qr[hidden] {
  display: none;
}

.android-download-qr img {
  width: 116px;
  height: 116px;
  padding: 7px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.android-download-qr strong {
  font-size: 18px;
  line-height: 1.45;
  font-weight: 700;
}

.android-download-qr:hover strong,
.android-download-qr:focus-visible strong {
  color: var(--green);
  text-decoration: underline;
}

.product-showcase {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.product-showcase img {
  width: 100%;
  border: 1px solid rgba(49, 95, 134, 0.28);
  border-radius: 6px;
  background: #dce8f1;
  object-fit: cover;
}

.showcase-main {
  aspect-ratio: 16 / 8.8;
}

.showcase-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
  height: 118px;
}

.showcase-thumb-button {
  min-height: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  overflow: hidden;
  cursor: pointer;
}

.showcase-thumb-button:focus-visible { outline: 3px solid rgba(11, 97, 73, 0.22); }

.showcase-thumbs img {
  width: 100%;
  height: 118px;
  object-fit: cover;
}

.showcase-thumbs img:last-child {
  object-position: center 18%;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8faf7;
}

.meta-grid div {
  min-width: 0;
  padding: 14px 18px;
  border-right: 1px solid var(--line);
}

body[dir="rtl"] .meta-grid div {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.meta-grid div:last-child,
body[dir="rtl"] .meta-grid div:last-child {
  border-right: 0;
  border-left: 0;
}

.meta-grid dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
}

.meta-grid dd {
  margin: 0;
  font-weight: 700;
  line-height: 1.35;
}

.download-panel,
.install-panel {
  padding: clamp(20px, 3vw, 28px);
}

.download-panel {
  border-bottom: 1px solid var(--line);
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
}

.panel-title-row p {
  margin: 4px 0 0;
  font-size: 14px;
}

.download-grid {
  display: grid;
  border-top: 1px solid var(--line);
}

.download-empty { margin: 0; padding: 18px 0; color: var(--muted); }

.download-card {
  display: grid;
  grid-template-columns: minmax(145px, 0.55fr) minmax(0, 1.45fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 90px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.download-card h5 {
  margin: 0 0 3px;
  color: var(--green-strong);
  font-size: 17px;
}

.download-card p,
.download-card small {
  margin: 0;
  color: var(--muted);
}

.download-card small {
  display: block;
  margin-top: 3px;
}

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 128px;
  min-height: 42px;
  padding: 8px 13px;
  border-radius: 6px;
  background: var(--green);
  color: #ffffff;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.download-button:hover,
.download-button:focus-visible {
  outline: 3px solid rgba(11, 97, 73, 0.18);
  background: var(--green-strong);
}

.download-card.is-pending {
  background: rgba(224, 229, 218, 0.28);
}

.download-button.is-disabled {
  cursor: not-allowed;
  background: #8c948d;
  color: #f7f7f4;
  opacity: 0.78;
}

.download-button.is-disabled:hover {
  outline: 0;
  background: #8c948d;
}

.ios-status {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 13px 0 0;
  color: var(--muted);
}

.ios-status strong {
  color: var(--ink);
}

.platform-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.platform-tab {
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.platform-tab[aria-pressed="true"] {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-strong);
  font-weight: 700;
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  gap: 18px;
  align-items: start;
}

.step-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  counter-reset: step;
  list-style: none;
  border-top: 1px solid var(--line);
}

.step-list li {
  position: relative;
  min-height: 76px;
  padding: 13px 12px 13px 52px;
  border-bottom: 1px solid var(--line);
}

body[dir="rtl"] .step-list li {
  padding: 13px 52px 13px 12px;
}

.step-list li::before {
  position: absolute;
  top: 14px;
  left: 10px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--green);
  color: #ffffff;
  content: counter(step);
  counter-increment: step;
  font-weight: 700;
}

body[dir="rtl"] .step-list li::before {
  right: 10px;
  left: auto;
}

.step-list strong,
.step-list span {
  display: block;
}

.step-list strong {
  margin-bottom: 4px;
}

.step-list span {
  color: var(--muted);
}

.step-list code {
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--gold-soft);
  color: #6f4904;
  font-family: "Times New Roman", SimSun, "Songti SC", serif;
  font-weight: 700;
}

.screenshot-stack {
  display: grid;
  gap: 10px;
}

.screenshot-stack img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #dce8f1;
  object-fit: cover;
}

.screenshot-stack img[hidden] {
  display: none !important;
}

.future-product {
  display: grid;
  grid-template-columns: minmax(210px, 0.75fr) minmax(0, 1.25fr);
  gap: 20px;
  align-items: start;
  padding: 20px;
  border-style: dashed;
}

.future-product h3,
.future-product p {
  margin-bottom: 0;
}

.future-product .status-pill {
  margin-bottom: 8px;
}

.disclaimer-section {
  padding: 20px;
  border-color: #e5b8ae;
  background: var(--red-soft);
}

.disclaimer-section h2 {
  color: var(--red);
  font-size: 22px;
}

.disclaimer-section p {
  margin-bottom: 0;
  color: #5d332d;
}

.side-column {
  position: static;
  top: auto;
  display: grid;
  gap: 16px;
  min-width: 0;
}

.side-panel {
  padding: 18px;
  box-shadow: var(--shadow);
}

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

.compact-list {
  display: grid;
  gap: 7px;
  margin: 14px 0;
  padding-left: 20px;
}

body[dir="rtl"] .compact-list {
  padding-right: 20px;
  padding-left: 0;
}

.mail-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--green);
  border-radius: 6px;
  color: var(--green-strong);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

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

.qr-contact {
  display: grid;
  gap: 6px;
  margin-bottom: 0;
  text-align: center;
}

.qr-contact img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  object-fit: contain;
}

.qr-contact figcaption {
  color: var(--green-strong);
  font-size: 13px;
  font-weight: 700;
}

.fine-print {
  font-size: 14px;
}

.accent-panel {
  border-color: #e7cc83;
  background: #fff8e7;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  justify-content: space-between;
  padding: 22px clamp(18px, 4vw, 48px);
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.admin-link {
  color: var(--green-strong);
  font-weight: 700;
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .navlinks {
    grid-column: 1;
    justify-content: flex-start;
  }

  .header-admin-link {
    justify-self: end;
  }

  .language-control {
    grid-column: 2;
    grid-row: 2;
  }

  .content-layout {
    grid-template-columns: 1fr;
  }

  .side-column {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .intro-band,
  .product-header,
  .guide-layout {
    grid-template-columns: 1fr;
  }

  .intro-band {
    min-height: 0;
    gap: 10px;
  }

  .announcement-history,
  body[dir="rtl"] .announcement-history {
    padding: 8px 0 0;
    border-top: 1px solid var(--line);
    border-right: 0;
    border-left: 0;
  }

  .product-showcase {
    max-width: 720px;
  }
}

@media (max-width: 720px) {
  .android-download-qr {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
  }

  .android-download-qr img {
    width: 96px;
    height: 96px;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .navlinks {
    grid-column: auto;
    justify-content: flex-start;
  }

  .language-control {
    grid-column: auto;
    grid-row: auto;
    width: 100%;
    justify-content: space-between;
  }

  .header-admin-link {
    width: 100%;
    justify-self: stretch;
  }

  .language-control select {
    min-width: 0;
    flex: 1;
  }

  .software-index,
  .meta-grid,
  .side-column,
  .future-product {
    grid-template-columns: 1fr;
  }

  .software-index a,
  body[dir="rtl"] .software-index a {
    min-height: 54px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    border-left: 0;
  }

  .software-index a:last-child {
    border-bottom: 0;
  }

  .meta-grid div,
  body[dir="rtl"] .meta-grid div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    border-left: 0;
  }

  .meta-grid div:last-child {
    border-bottom: 0;
  }

  .download-card {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .download-button {
    width: 100%;
  }

  .ios-status {
    align-items: start;
    flex-direction: column;
    gap: 2px;
  }
}

@media (max-width: 520px) {
  .page-shell {
    padding-right: 12px;
    padding-left: 12px;
  }

  .intro-band,
  .product-header,
  .download-panel,
  .install-panel,
  .side-panel,
  .future-product,
  .disclaimer-section {
    padding: 15px;
  }

  h1 {
    font-size: 22px;
    line-height: 1.3;
  }

  h2 {
    font-size: 23px;
  }

  .showcase-thumbs {
    height: 92px;
  }

  .showcase-thumbs img {
    height: 92px;
  }

  .qr-row {
    grid-template-columns: 1fr 1fr;
  }
}
