/* MWB Exchange web — mirrors ios/MWBExchange/Theme.swift (iOS system colours, SF type scale, 14 pt corners) */
:root {
  --bg: #ffffff;                 /* Color(.systemBackground) */
  --card: #f2f2f7;               /* Color(.secondarySystemBackground) */
  --text: #000000;               /* Color.primary */
  --muted: rgba(60, 60, 67, 0.6);/* Color.secondary */
  --ok: #1a8c40;                 /* Theme.ok  rgb(0.10, 0.55, 0.25) */
  --sell: #db3333;               /* Theme.sell rgb(0.86, 0.20, 0.20) */
  --blue: #007aff;
  --gray: #8e8e93;
  --red: #ff3b30;
  --sep: rgba(60, 60, 67, 0.29);
  --grouped: #f2f2f7;            /* Form background */
  --cell: #ffffff;               /* Form row */
  --seg-bg: rgba(118, 118, 128, 0.12);
  --seg-on: #ffffff;
  --track: rgba(120, 120, 128, 0.2);
  --bar: rgba(249, 249, 249, 0.86);
  --tab-off: #999999;
  --overlay: rgba(0, 0, 0, 0.4);
  --sheet: rgba(242, 242, 247, 0.96);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Georgian", sans-serif;
  --round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --col: 560px;
  --tabh: 49px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --card: #1c1c1e; --text: #ffffff; --muted: rgba(235, 235, 245, 0.6);
    --blue: #0a84ff; --red: #ff453a; --sep: rgba(84, 84, 88, 0.6);
    --grouped: #000000; --cell: #1c1c1e; --seg-bg: rgba(118, 118, 128, 0.24); --seg-on: #636366;
    --track: rgba(120, 120, 128, 0.36); --bar: rgba(22, 22, 22, 0.86); --tab-off: #757575;
    --overlay: rgba(0, 0, 0, 0.55); --sheet: rgba(44, 44, 46, 0.96);
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --card: #1c1c1e; --text: #ffffff; --muted: rgba(235, 235, 245, 0.6);
  --blue: #0a84ff; --red: #ff453a; --sep: rgba(84, 84, 88, 0.6);
  --grouped: #000000; --cell: #1c1c1e; --seg-bg: rgba(118, 118, 128, 0.24); --seg-on: #636366;
  --track: rgba(120, 120, 128, 0.36); --bar: rgba(22, 22, 22, 0.86); --tab-off: #757575;
  --overlay: rgba(0, 0, 0, 0.55); --sheet: rgba(44, 44, 46, 0.96);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 17px; line-height: 22px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}
body.grouped { background: var(--grouped); }
h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; }
img { display: block; }
input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

#view {
  max-width: var(--col); margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 16px calc(var(--tabh) + env(safe-area-inset-bottom, 0px) + 40px);
  min-height: 100vh;
}

/* type scale (iOS Dynamic Type, Large) */
.t-large { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: 0.37px; }
.t-title2 { font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: 0.35px; }
.t-title3 { font-size: 20px; line-height: 25px; }
.t-headline { font-size: 17px; line-height: 22px; font-weight: 600; }
.t-body { font-size: 17px; line-height: 22px; }
.t-sub { font-size: 15px; line-height: 20px; }
.t-foot { font-size: 13px; line-height: 18px; }
.t-cap { font-size: 12px; line-height: 16px; }
.t-cap2 { font-size: 11px; line-height: 13px; }
.b { font-weight: 700; } .semi { font-weight: 600; } .med { font-weight: 500; } .reg { font-weight: 400; }
.round { font-family: var(--round); }
.mono { font-family: var(--mono); }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ok { color: var(--ok); }
.red { color: var(--red); }
.center { text-align: center; }
.right { text-align: right; }
.u { text-decoration: underline; text-underline-offset: 2px; }

/* layout */
.stack { display: flex; flex-direction: column; gap: var(--g, 8px); }
.row { display: flex; align-items: center; gap: var(--g, 8px); min-width: 0; }
.row.top { align-items: flex-start; }
.row.base { align-items: baseline; }
.grow { flex: 1 1 auto; min-width: 0; }
.spacer { flex: 1 1 auto; }
.nowrap { white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hcenter { justify-content: center; }
.ic { display: inline-block; flex: none; vertical-align: middle; }

/* cards & buttons (Theme.swift: Card / PrimaryButtonStyle / SecondaryButtonStyle) */
.card {
  background: var(--card); border-radius: 14px; padding: 16px;
  display: flex; flex-direction: column; gap: 8px; width: 100%;
}
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 14px 12px; border-radius: 14px; font-size: 17px; line-height: 22px; font-weight: 600;
  text-align: center; transition: opacity .12s; user-select: none;
}
.btn-primary { background: var(--text); color: var(--bg); }
.btn-secondary { background: var(--card); color: var(--text); }
.btn-primary:active { opacity: .75; }
.btn-secondary:active { opacity: .6; }
.btn.off { background: rgba(142, 142, 147, 0.3); color: var(--muted); cursor: default; }
.btn.stack2 { flex-direction: column; gap: 2px; }
.btn .sub { font-size: 13px; line-height: 18px; font-weight: 400; opacity: .8; }
.btn.sm { padding: 12px 16px; border-radius: 12px; width: auto; flex: none; }
@media (hover: hover) {
  .btn-primary:not(.off):hover, .btn-secondary:hover, .acct:hover, .clink:hover { opacity: .85; }
  .side:hover { filter: brightness(0.98); }
}

/* segmented Picker */
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0;
  background: var(--seg-bg); border-radius: 9px; padding: 2px; min-height: 32px; position: relative;
}
.seg button {
  font-size: 13px; line-height: 16px; font-weight: 500; text-align: center; border-radius: 7px;
  padding: 6px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative;
  transition: background .18s, box-shadow .18s;
}
.seg button.on { background: var(--seg-on); font-weight: 600; box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04); }
.seg button + button:not(.on):not(.after-on)::before {
  content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 1px; background: var(--sep); opacity: .6;
}

/* progress */
.progress { height: 4px; border-radius: 2px; background: var(--track); overflow: hidden; width: 100%; }
.progress > i { display: block; height: 100%; border-radius: 2px; background: currentColor; transition: width .3s; }

.divider { height: 1px; background: var(--sep); transform: scaleY(.5); transform-origin: top; margin: 0; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray); flex: none; }
.dot.on { background: var(--ok); }
.dot.ring { box-shadow: 0 0 0 4px color-mix(in srgb, var(--gray) 30%, transparent); margin: 0 2px; }
.dot.ring.on { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 30%, transparent); }

.spin {
  width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent;
  animation: spin .8s linear infinite; display: inline-block; opacity: .8;
}
.spin.lg { width: 24px; height: 24px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Home */
.home { gap: 18px; }
.hdr { gap: 10px; padding-top: 8px; }
.logo { width: 48px; height: 48px; object-fit: contain; }
.lang {
  position: relative; display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--muted) 50%, transparent); cursor: pointer;
}
.lang select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }

.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.side {
  display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 14px;
  background: var(--card); color: var(--text); width: 100%; transition: background .18s, color .18s;
}
.side .title { font-size: 15px; line-height: 20px; color: var(--muted); }
.side .amt { font-family: var(--round); font-size: 28px; line-height: 34px; font-weight: 600; white-space: nowrap; }
.side .subl { font-size: 13px; line-height: 18px; color: var(--muted); min-height: 18px; }
.side .chip {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px;
  font-size: 12px; line-height: 16px; font-weight: 600; background: color-mix(in srgb, var(--text) 8%, transparent);
}
/* selected = «pressed» black card; uses --bg as the ink so dark mode stays readable */
.side.on { background: var(--text); color: var(--bg); }
.side.on .title { color: var(--bg); font-weight: 600; }
.side.on .subl { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.side.on .chip { background: color-mix(in srgb, var(--bg) 15%, transparent); }

.trow { display: flex; align-items: center; gap: 8px; padding: 4px 0; min-height: 34px; }
.trow.head { padding: 0; min-height: 0; }
.c90 { width: 90px; flex: none; text-align: right; }
.price { font-family: var(--round); font-size: 20px; line-height: 25px; font-weight: 600; }
.norate { max-width: 62%; text-align: right; }

.acct { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; background: var(--card); color: var(--text); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: start; }
.badge-img { width: 18px; height: 18px; object-fit: contain; }

.legal-toggle { width: 100%; justify-content: center; gap: 6px; padding: 4px 0; }
.bul { display: flex; gap: 8px; align-items: flex-start; }
.director { width: 170px; height: 170px; border-radius: 50%; object-fit: cover; margin: 0 auto; }

.clinks { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.clink { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--card); color: var(--text); }
.clink .ic-w { width: 22px; display: inline-flex; justify-content: center; }
.fsec .clink { background: var(--card); }

/* Request = SwiftUI Form (insetGrouped) */
.navtitle { padding: 6px 0 8px; }
.form { display: flex; flex-direction: column; gap: 16px; margin-top: 4px; }
.fgroup { display: flex; flex-direction: column; }
.fhead { font-size: 13px; line-height: 18px; color: var(--muted); text-transform: uppercase; padding: 0 16px 7px; letter-spacing: -0.08px; }
.ffoot { font-size: 13px; line-height: 18px; padding: 7px 16px 0; }
.fsec { background: var(--cell); border-radius: 10px; overflow: hidden; }
.fsec.dis { opacity: .45; pointer-events: none; }
.cell { padding: 11px 16px; min-height: 44px; position: relative; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.cell + .cell::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--sep); transform: scaleY(.5); transform-origin: top; }
.cell.tight { padding: 8px 12px; }
.cell.tap { cursor: pointer; }
.cell.tap:active { background: color-mix(in srgb, var(--text) 6%, transparent); }
.big34 { font-family: var(--round); font-size: 34px; line-height: 41px; font-weight: 600; }
.field {
  border: 0; outline: 0; background: transparent; padding: 6px 0; font-size: 17px; line-height: 22px; min-width: 0; width: 100%;
}
.field::placeholder { color: color-mix(in srgb, var(--muted) 85%, transparent); }
.field:focus-visible { outline: none; }
.box {
  background: var(--card); border-radius: 12px; padding: 12px; border: 0; outline: 0; width: 100%;
  font-size: 17px; line-height: 22px;
}
.box.on-bg { background: var(--bg); border-radius: 10px; }
.box:focus { box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 45%, transparent); }
.picker { position: relative; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.picker select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.picker .val { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.unitseg { width: 130px; flex: none; }
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px;
  font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; flex: none;
}
.linkbtn { color: var(--red); font-size: 13px; line-height: 18px; align-self: flex-start; padding: 2px 0; }
.orderbtn {
  display: flex; align-items: center; gap: 8px; padding: 13px 16px; border-radius: 12px;
  background: var(--text); color: var(--bg); font-weight: 600;
}
.orderbtn .tm { font-family: var(--round); font-variant-numeric: tabular-nums; }
.rowdel { color: var(--muted); font-size: 12px; line-height: 16px; padding: 2px 0 2px 8px; flex: none; }

/* Profile */
.prof { gap: 16px; }
.status {
  position: relative; padding: 18px; border-radius: 18px; color: #fff; cursor: pointer; user-select: none;
  background: linear-gradient(135deg, #242424, #000); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
:root[data-theme="dark"] .status { box-shadow: 0 6px 24px rgba(255, 255, 255, 0.04); }
.status .o7 { opacity: .7; } .status .o55 { opacity: .55; } .status .o6 { opacity: .6; } .status .o5 { opacity: .5; }
.status .progress { background: rgba(255, 255, 255, 0.22); color: #fff; }
.mwb { font-family: var(--round); font-size: 22px; line-height: 28px; font-weight: 800; }
.medal-big { filter: drop-shadow(0 0 14px var(--tc)); }
.tier-glow { text-shadow: 0 0 8px color-mix(in srgb, var(--tc) 50%, transparent); }
.qr { background: #fff; padding: 12px; border-radius: 14px; width: 204px; height: 204px; margin: 0 auto; }
.qr svg { width: 180px; height: 180px; display: block; shape-rendering: crispEdges; }
.tiers { padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); display: flex; flex-direction: column; gap: 6px; width: 100%; }
.benefit { display: flex; align-items: center; gap: 10px; }
.soon { padding: 3px 8px; border-radius: 999px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--muted) 60%, transparent); font-size: 12px; line-height: 16px; font-weight: 600; }

/* tab bar (SwiftUI TabView) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--sep); padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar .in { max-width: var(--col); margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); height: var(--tabh); }
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  color: var(--tab-off); font-size: 10px; line-height: 12px; font-weight: 500; text-align: center;
}
.tab.on { color: var(--text); }

/* dialogs: confirmationDialog = action sheet, alert = centered */
.overlay { position: fixed; inset: 0; z-index: 60; background: var(--overlay); display: flex; animation: fade .2s ease; }
.overlay.sheet-wrap { align-items: flex-end; justify-content: center; padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)); }
.overlay.alert-wrap { align-items: center; justify-content: center; padding: 16px; }
.sheet { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 8px; animation: up .25s ease; }
.sheet .grp { background: var(--sheet); border-radius: 14px; overflow: hidden; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.sheet .msg { padding: 14px 16px; text-align: center; color: var(--muted); }
.sheet .opt { display: block; width: 100%; padding: 17px 12px; font-size: 20px; line-height: 24px; text-align: center; color: var(--blue); border-top: 0.5px solid var(--sep); }
.sheet .opt.destr { color: var(--red); }
.sheet .opt.cancel { font-weight: 600; border-top: 0; background: var(--sheet); border-radius: 14px; }
.alert { width: 270px; background: var(--sheet); border-radius: 14px; overflow: hidden; text-align: center; animation: pop .2s ease; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.alert .body { padding: 19px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.alert .btns { display: grid; grid-template-columns: 1fr 1fr; border-top: 0.5px solid var(--sep); }
.alert .btns button { padding: 11px 8px; font-size: 17px; line-height: 22px; color: var(--blue); }
.alert .btns button + button { border-left: 0.5px solid var(--sep); }
.alert .btns .cancel { font-weight: 600; }
.alert .btns .destr { color: var(--red); }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop { from { transform: scale(1.12); opacity: 0; } }

/* in-page notification (when the Notification API is not allowed) */
.banner {
  position: fixed; z-index: 70; top: calc(env(safe-area-inset-top, 0px) + 8px); left: 50%; transform: translateX(-50%);
  width: calc(100% - 16px); max-width: 520px; display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border-radius: 18px; background: var(--sheet); color: var(--text);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .18); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  animation: drop .3s ease;
}
.banner img { width: 38px; height: 38px; border-radius: 9px; }
@keyframes drop { from { transform: translate(-50%, -30px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (max-width: 359px) {
  .side { padding: 12px; } .side .amt { font-size: 24px; } .c90 { width: 76px; } .unitseg { width: 116px; }
}
@media (min-width: 700px) {
  #view { padding-top: calc(env(safe-area-inset-top, 0px) + 20px); }
}
