@font-face {
  font-family: 'Thmanyah Serif Text';
  src: url('/fonts/thmanyah-serif-text-bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  font-family: Tahoma, Arial, sans-serif;
  color: #18364e;
  background: #d9f4ef;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --blue: #0874dc;
  --ink: #16334e;
  --green: #198768;
  --paper: #fffdfa;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: #d9f4ef radial-gradient(rgba(23, 118, 156, .12) .8px, transparent .8px) 0 0/10px 10px,
    radial-gradient(rgba(255, 255, 255, .55) 1px, transparent 1px) 5px 4px/15px 15px;
  color: var(--ink);
}
button, input { font: inherit; }
.page-shell { width: min(640px, calc(100% - 30px)); margin: 30px auto 20px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin: 0 4px 14px; }
.brand { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; text-decoration: none; color: var(--ink); }
.brand-flag { display: block; width: clamp(40px, 11vw, 48px); max-height: 32px; height: auto; border-radius: 2px; box-shadow: 0 2px 5px rgba(0, 0, 0, .14); }
.live-status { display: inline-flex; align-items: center; gap: 6px; color: #617887; font-size: 10px; font-weight: 700; white-space: nowrap; }
.live-status i { width: 7px; height: 7px; border-radius: 50%; background: #20a86b; box-shadow: 0 0 0 3px rgba(32, 168, 107, .12); }
.live-date { color: #8797a3; font-size: 9px; font-weight: 500; direction: rtl; unicode-bidi: isolate; }
.topbar { padding-bottom: 10px; border-bottom: 1px solid rgba(22, 51, 78, .18); }

.price-card { border: 2px solid var(--blue); border-radius: 19px; background: var(--paper); padding: 23px 22px 15px; box-shadow: 0 5px 0 rgba(7, 91, 181, .06); }
.price-card-top { display: flex; align-items: flex-start; justify-content: flex-start; position: relative; }
.price-title-group { width: fit-content; max-width: 100%; min-width: 0; }
.price-title-row { display: flex; align-items: center; gap: 8px; max-width: 100%; }
.price-card-top h1 { display: inline-block; padding-bottom: 6px; border-bottom: 1px solid #dceaf2; font: 700 clamp(24px, 5vw, 31px)/1.25 'Thmanyah Serif Text', serif; color: #173650; margin: 0; }
.price-card-top h1 span { color: var(--blue); }
.place-note { display: block; margin-top: 5px; color: #8596a2; font-size: 10px; }
.share-menu-anchor { position: absolute; top: 0; left: 0; z-index: 5; }
.share-menu-toggle { display: grid; place-items: center; width: 38px; height: 38px; padding: 8px; border: 1px solid #c6c6c8; border-radius: 10px; background: #fff; color: #007aff; cursor: pointer; transition: background .15s, border-color .15s; }
.share-menu-toggle:hover, .share-menu-toggle[aria-expanded="true"] { background: #eaf2ff; border-color: #007aff; }
.share-menu-toggle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.share-menu { position: absolute; top: calc(100% + 8px); left: 0; display: grid; gap: 5px; width: 180px; max-width: calc(100vw - 48px); padding: 7px; border: 1px solid #e5e5ea; border-radius: 12px; background: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, .15); }
.share-menu[hidden] { display: none !important; }
.share-menu-option { min-height: 38px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: #1c1c1e; text-align: right; font-size: 12px; font-weight: 600; cursor: pointer; }
.share-menu-option:hover:not(:disabled) { background: #f2f2f7; color: #007aff; }
.share-menu-option:disabled { opacity: .45; cursor: not-allowed; }
.share-feedback { padding: 4px 8px; color: #636366; font-size: 10px; text-align: right; line-height: 1.5; }
.share-feedback:empty { display: none; }
.trade-switch { display: flex; gap: 4px; width: min(410px, 100%); margin: 18px auto 14px; padding: 4px; background: #edf3f6; border: 1px solid #e2eaf0; border-radius: 12px; }
.trade-option { flex: 1; height: 42px; border: 0; border-radius: 9px; background: transparent; color: #74879a; font-size: 12px; font-weight: 700; cursor: pointer; transition: background .16s, color .16s; white-space: nowrap; }
.trade-option.is-active { background: var(--blue); color: #fff; box-shadow: 0 3px 8px rgba(8, 116, 220, .2); }
.custom-options[hidden] { display: none !important; }
.custom-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(430px, 100%); margin: 0 auto 14px; }
.custom-field { display: flex; flex-direction: column; gap: 5px; color: #718496; font-size: 10px; font-weight: 600; }
.grams-wrap, .custom-trade-switch { height: 38px; display: flex; align-items: center; border: 1px solid #e0e8ec; border-radius: 9px; background: #fff; }
.grams-wrap input { min-width: 0; width: 100%; height: 100%; border: 0; background: transparent; padding: 0 10px; color: #24445e; font-size: 12px; font-weight: 700; direction: rtl; text-align: right; outline: none; font-variant-numeric: tabular-nums; }
.grams-wrap input::placeholder { color: #9aa9b4; opacity: 1; }
.grams-wrap > span { padding: 0 9px; color: #8b9dab; font-size: 10px; white-space: nowrap; }
.custom-trade-switch { padding: 3px; gap: 3px; }
.custom-trade-option { flex: 1; height: 30px; border: 0; border-radius: 6px; background: transparent; color: #72879a; font-size: 10px; cursor: pointer; }
.custom-trade-option.is-active { background: #e8f4fd; color: #0868bc; font-weight: 700; }
.custom-field.is-disabled { opacity: .55; }
.grams-wrap input:disabled { cursor: not-allowed; }

.price-label { text-align: center; color: #6d8496; font-size: 12px; font-weight: 600; }
.price-line { display: flex; justify-content: center; align-items: baseline; gap: 9px; margin: 6px 0 0; direction: ltr; min-width: 0; width: 100%; }
.price-line strong { min-width: 0; flex: 0 1 auto; white-space: nowrap; color: #123854; font: 700 clamp(54px, 10vw, 72px)/1.12 'Thmanyah Serif Text', Tahoma, serif; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.currency { color: var(--blue); font-size: 14px; font-weight: 700; }
.price-unit { text-align: center; color: #8797a3; font-size: 10px; margin-top: 3px; }
.karat-section { margin-top: 19px; padding-top: 14px; border-top: 1px solid #e9eef0; }
.karat-heading { font: 700 13px 'Thmanyah Serif Text', Tahoma, serif; color: #294b64; margin: 0 0 10px; }
.karat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.karat-card { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 42px; text-align: center; border: 1px solid #e2e9ec; border-radius: 11px; background: #fff; padding: 7px 4px; color: #466176; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.karat-card:hover { border-color: #9ac8ee; transform: translateY(-1px); }
.karat-card.is-active { border-color: var(--blue); background: var(--blue); color: #fff; box-shadow: 0 3px 8px rgba(8, 116, 220, .15); }
.karat-title { font-size: 11px; font-weight: 700; white-space: nowrap; }
.disclaimer { text-align: center; color: #929fa9; font-size: 9px; margin: 13px 0 0; }

/* Apple-inspired iOS system palette */
:root { color: #1c1c1e; background: #f2f2f7; --blue: #007aff; --ink: #1c1c1e; --green: #34c759; --paper: #fff; }
body { background: #f2f2f7; color: var(--ink); }
.brand-name { color: var(--ink); }
.live-status { color: #636366; }
.live-status i { background: #34c759; box-shadow: 0 0 0 3px rgba(52, 199, 89, .14); }
.live-status.is-loading i { background: #ff9f0a; box-shadow: 0 0 0 3px rgba(255, 159, 10, .14); }
.live-status.is-error i { background: #ff3b30; box-shadow: 0 0 0 3px rgba(255, 59, 48, .14); }
.live-date, .place-note, .price-unit, .disclaimer { color: #8e8e93; }
.disclaimer a { color: var(--blue); text-decoration: none; }
.disclaimer a:hover { text-decoration: underline; }
.topbar { border-bottom-color: #c6c6c8; }
.price-card { border: 1px solid #e5e5ea; background: #fff; box-shadow: 0 8px 28px rgba(0, 0, 0, .06); }
.price-card-top h1, .karat-heading { color: #1c1c1e; }
.price-card-top h1 { border-bottom-color: #c6c6c8; }
.trade-switch { background: #f2f2f7; border-color: #e5e5ea; }
.trade-option { color: #636366; }
.trade-option.is-active { background: #007aff; box-shadow: 0 3px 8px rgba(0, 122, 255, .18); }
.custom-field { color: #636366; }
.grams-wrap, .custom-trade-switch { border-color: #c6c6c8; }
.grams-wrap:focus-within { border-color: #007aff; box-shadow: 0 0 0 3px rgba(0, 122, 255, .12); }
.grams-wrap input { color: #1c1c1e; }
.grams-wrap input::placeholder, .grams-wrap > span { color: #8e8e93; }
.custom-trade-option { color: #636366; }
.custom-trade-option.is-active { background: #eaf2ff; color: #007aff; }
.price-label { color: #636366; }
.price-line strong { color: #1c1c1e; }
.currency { color: #007aff; }
.karat-section { border-top-color: #e5e5ea; }
.karat-card { border-color: #c6c6c8; color: #3a3a3c; }
.karat-card:hover { border-color: #007aff; }
.karat-card.is-active { border-color: #007aff; background: #007aff; box-shadow: 0 3px 8px rgba(0, 122, 255, .18); }
button:focus-visible { outline: 2px solid #007aff; outline-offset: 2px; }

@media (max-width: 560px) {
  .page-shell { width: calc(100% - 22px); margin: 18px auto; }
  .topbar { margin-bottom: 12px; }
  .share-menu-toggle { width: 36px; height: 36px; }
  .share-menu { width: 172px; }
  .live-status { gap: 5px; font-size: 9px; }
  .live-status i { width: 6px; height: 6px; }
  .live-date { font-size: 9px; }
  .price-card { padding: 18px 13px 13px; border-radius: 16px; }
  .price-card-top h1 { font-size: 25px; }
  .trade-switch { margin: 14px auto 12px; gap: 3px; }
  .trade-option { height: 39px; font-size: 10px; }
  .custom-options { gap: 7px; margin-bottom: 12px; }
  .custom-field { font-size: 9px; }
  .grams-wrap, .custom-trade-switch { height: 35px; }
  .custom-trade-option { height: 27px; }
  .price-line strong { font-size: 60px; }
  .karat-section { margin-top: 16px; padding-top: 12px; }
  .karat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .karat-card { min-height: 39px; padding: 6px 2px; }
  .karat-title { font-size: 10px; }
  .disclaimer { font-size: 9px; line-height: 1.5; }
}
@media (max-width: 340px) {
  .page-shell { width: calc(100% - 22px); }
  .price-card { padding-inline: 10px; }
  .price-card-top h1 { font-size: 22px; }
  .trade-option { font-size: 9px; }
  .live-status { gap: 4px; font-size: 8px; }
  .live-date { font-size: 8px; }
  .price-line strong { font-size: 52px; }
  .karat-grid { gap: 4px; }
  .karat-card { min-height: 36px; }
  .karat-title { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
