:root {
  --paper: #e8e6e1;
  --sheet: #f2f0eb;
  --ink: #151513;
  --muted: #5c5954;
  --line: #c9c5bc;
  --ok: #3d5340;
  --used: #5c5346;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #ddd9d0 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, #d4d8d6 0%, transparent 45%),
    var(--paper);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -0.011em;
}

html[lang="ar"] body,
html[dir="rtl"] body {
  font-family: "IBM Plex Sans Arabic", "IBM Plex Sans", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

button,
input {
  font: inherit;
}

.wrap {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 24px;
}

.mark {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
}

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  margin-inline-start: 4px;
}

.lang-toggle button {
  min-width: 36px;
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
}

.lang-toggle button + button {
  border-inline-start: 1px solid var(--line);
}

.lang-toggle button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 2px;
}

.footer-links [data-shop-social]:not([hidden])::before {
  content: " · ";
  color: var(--muted);
}

.footer-sep {
  color: var(--muted);
}

.nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.cart-link {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 13px;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 72px;
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.hero {
  padding: 56px 0 28px;
  border-bottom: 1px solid var(--line);
}

.kicker {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(42px, 9vw, 88px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.92;
}

.hero p {
  max-width: 34em;
  margin: 22px 0 0;
  font-size: 18px;
  color: var(--muted);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-top: 28px;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
}

.catalog-section {
  padding: 36px 0 8px;
}

.catalog-section + .catalog-section {
  border-top: 1px solid var(--line);
  margin-top: 12px;
}

.section-head {
  margin-bottom: 8px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 400;
  letter-spacing: -0.04em;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 40em;
  font-size: 15px;
}

.empty-section {
  color: var(--muted);
  padding: 20px 0 28px;
}

.machine {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.machine:hover {
  background: color-mix(in srgb, var(--sheet) 70%, transparent);
  margin-inline: -16px;
  padding-inline: 16px;
}

.machine-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.cond {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border: 1px solid var(--line);
}

.cond.new {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.cond.used {
  background: transparent;
  color: var(--used);
  border-color: var(--used);
}

.cat-label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted, #6a6a64);
  text-transform: none;
}

.case {
  width: 140px;
  height: 92px;
}

.detail .case {
  width: min(100%, 280px);
  height: auto;
}

.case-photo {
  margin: 0;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 4 / 3;
  background: var(--sheet);
  border: 1px solid var(--line);
  overflow: hidden;
}

.case-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #1a1917;
}

html[dir="rtl"] .case-photo {
  margin-inline: 0;
}

.machine h2 {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.sku {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
}

.summary {
  margin: 8px 0 0;
  color: var(--ink);
}

.tag {
  display: inline-block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.buy {
  text-align: end;
  min-width: 140px;
}

.price {
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.price-ask {
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--muted);
}

.total-ask {
  font-weight: 500;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
}

.btn:hover {
  text-decoration: none;
  background: #2a2723;
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
}

.btn.ghost:hover {
  background: var(--sheet);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.page-head {
  padding: 40px 0 20px;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 400;
  letter-spacing: -0.045em;
}

.page-head p {
  margin: 12px 0 0;
  color: var(--muted);
  max-width: 42em;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0 8px;
  border-bottom: 1px solid var(--line);
}

.filter {
  border: 1px solid var(--line);
  background: transparent;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
}

.filter[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding: 28px 0 8px;
}

.detail h1 {
  margin: 8px 0 0;
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 400;
  letter-spacing: -0.05em;
}

.lede {
  margin: 16px 0 0;
  font-size: 18px;
  max-width: 28em;
}

.warranty-box {
  margin-top: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.warranty-box strong {
  display: block;
  font-size: 15px;
  margin-bottom: 6px;
}

.warranty-box p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.warranty-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 8px 0 40px;
}

.warranty-card {
  padding: 24px;
  background: var(--sheet);
  border: 1px solid var(--line);
}

.warranty-card h2 {
  margin: 4px 0 12px;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.warranty-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

table.specs {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.specs th,
table.specs td {
  text-align: left;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.specs th {
  width: 38%;
  color: var(--muted);
  font-weight: 400;
}

.notes {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.notes li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.notes li::before {
  content: "— ";
  color: var(--ink);
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
}

.cart-table th {
  text-align: left;
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
}

.cart-table td {
  padding: 18px 12px 18px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.qty {
  width: 52px;
  border: 1px solid var(--line);
  background: var(--sheet);
  padding: 6px 8px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.qty-stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  background: var(--sheet);
}

.qty-stepper .qty {
  width: 48px;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: transparent;
}

.qty-btn {
  min-width: 36px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.qty-btn:hover {
  background: var(--paper);
}

.add-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 24px;
  font-size: 20px;
}

.empty {
  padding: 48px 0;
  color: var(--muted);
}

.empty .btn {
  margin-top: 16px;
}

.prose h2 {
  margin: 36px 0 8px;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.prose p {
  max-width: 42em;
  color: var(--ink);
}

.prose ul {
  max-width: 42em;
  padding-inline-start: 18px;
  color: var(--muted);
}

html[dir="rtl"] .machine {
  direction: rtl;
}

html[dir="rtl"] .buy {
  text-align: start;
}

html[dir="rtl"] table.specs th,
html[dir="rtl"] table.specs td,
html[dir="rtl"] .cart-table th,
html[dir="rtl"] .cart-table td {
  text-align: right;
}

html[dir="rtl"] .toast {
  right: auto;
  left: 20px;
}

html[dir="rtl"] .notes li::before {
  content: " —";
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.notice {
  margin-top: 24px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.contact-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 48px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.contact-strip h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 500;
}

.contact-strip p {
  margin: 0;
  color: var(--muted);
}

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

.faq-list {
  margin-top: 8px;
}

.faq {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::before {
  content: "+ ";
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  color: var(--muted);
}

.faq[open] summary::before {
  content: "− ";
}

.faq p {
  margin: 10px 0 4px;
  color: var(--muted);
  font-size: 15px;
}

.anchor-note {
  font-size: 12px;
  color: var(--muted);
  margin: 24px 0 0;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: 0.2s ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: none;
}

.nav-quiet {
  color: var(--muted);
}

.manage-page {
  padding-bottom: 48px;
}

body.is-manage-locked {
  min-height: 100vh;
}

.manage-lock {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.manage-lock-card {
  width: min(420px, 100%);
  padding: 28px 24px 22px;
  background: var(--sheet);
  border: 1px solid var(--line);
}

.manage-lock-brand {
  margin: 0 0 8px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.manage-lock-card h1 {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.manage-lock-lead {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15px;
}

.manage-lock-hint {
  margin: 0 0 18px;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 14px;
}

.manage-lock-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.manage-lock-form .btn {
  align-self: flex-start;
  margin-top: 4px;
}

.manage-lock-form input[type="password"] {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.manage-lock-form input[type="password"]:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.manage-lock-remember {
  margin-top: 2px;
}

.manage-lock-error {
  margin: 0;
  color: #7a3430;
  font-size: 14px;
}

.manage-lock-back {
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.manage-private-note {
  font-size: 0.9em;
  opacity: 0.85;
}

.manage-private-note code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.95em;
}

.manage-golive {
  margin: 8px 0 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ok) 8%, var(--bg));
}

.manage-golive h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.manage-golive p {
  margin: 0 0 10px;
  max-width: 42rem;
  font-size: 0.95rem;
}

.manage-golive p:last-of-type {
  margin-bottom: 14px;
}

.manage-golive code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.92em;
}

.manage-publish .publish-steps {
  margin: 0 0 18px;
  padding-left: 1.25rem;
  max-width: 42rem;
  font-size: 0.95rem;
  line-height: 1.55;
}

.manage-publish .publish-steps li {
  margin-bottom: 8px;
}

.manage-publish .publish-steps code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.92em;
}

.publish-url-hint {
  margin: 0 0 14px;
  max-width: 42rem;
  font-size: 0.9rem;
  color: var(--muted, #5c5c56);
  word-break: break-all;
}

.publish-url-hint code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.88em;
}

body.is-catalog-loading [data-catalog],
body.is-catalog-loading [data-home],
body.is-catalog-loading [data-detail] {
  opacity: 0.65;
  transition: opacity 0.2s ease;
}

.manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 12px;
}

.manage-actions-bottom {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.manage-status {
  min-height: 1.4em;
  margin: 0 0 20px;
  color: var(--ok);
  font-size: 14px;
}

.manage-status.is-error {
  color: #7a3430;
}

.manage-section {
  padding: 28px 0 8px;
  border-top: 1px solid var(--line);
}

.manage-section:first-of-type {
  border-top: 0;
  padding-top: 8px;
}

.manage-list {
  margin-top: 8px;
}

.manage-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.manage-row h3 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.manage-row-price {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 13px;
  color: var(--muted);
}

.manage-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.manage-form {
  margin-top: 12px;
}

.form-subhead {
  margin: 28px 0 12px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-span,
.field-block {
  grid-column: 1 / -1;
}

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

.check-field {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
}

.check-field input[type="checkbox"] {
  width: auto;
  min-height: 0;
  margin-top: 4px;
  flex-shrink: 0;
}

.field-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.form-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
  max-width: 42em;
}

.manage-form input,
.manage-form select,
.manage-form textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--sheet);
  color: var(--ink);
  font: inherit;
}

.manage-form textarea {
  min-height: 88px;
  resize: vertical;
}

.manage-form input:focus,
.manage-form select:focus,
.manage-form textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.form-actions {
  margin-top: 20px;
}

.case-photo-field input[type="file"] {
  min-height: 0;
  padding: 8px 0;
  border: 0;
  background: transparent;
}

.case-photo-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-top: 10px;
}

.case-photo-preview img {
  width: min(100%, 240px);
  max-height: 180px;
  object-fit: contain;
  background: #1a1917;
  border: 1px solid var(--line);
}

.case-photo-warn {
  margin: 8px 0 0;
  font-size: 13px;
  color: #7a3430;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .wrap {
    width: min(1120px, calc(100% - 28px));
  }

  .nav {
    gap: 12px;
    font-size: 12px;
  }

  .machine,
  .detail,
  .split,
  .warranty-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .buy {
    text-align: start;
  }

  .site-footer .wrap {
    flex-direction: column;
  }

  .hero h1 {
    font-size: clamp(36px, 12vw, 56px);
  }

  .contact-strip {
    flex-direction: column;
    align-items: flex-start;
  }

  .cart-table th:nth-child(3),
  .cart-table td:nth-child(3) {
    display: none;
  }

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

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