/* Revalio shared components for the working app (/app and the Telegram Mini App); tokens come from tokens.css, which the public demo uses too.
   The look is the demo's: light blue-grey background, white cards, blue accent, compact controls. Screens add only their own layout on top. */
html { -webkit-text-size-adjust: 100%; }
html, body { max-width: 100%; overflow-x: hidden; }
body { font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* header */
.topbar { background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: 8px; }
.topbar .muted { font-size: 12px; color: var(--soft); }

/* cards and text */
.wrap { max-width: 920px; }
h2 { font-size: 15px; letter-spacing: -.2px; }
h3 { font-size: 13px; }
.card { border-radius: 16px; padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow); }
.muted { font-size: 12px; }
label { font-size: 10px; font-weight: 700; color: #8d99ad; text-transform: uppercase; letter-spacing: .4px; margin: 8px 0 3px; }
.checks label, .picker-row-label { text-transform: none; letter-spacing: 0; }

/* controls */
input[type=text], input[type=search], input[type=number], input[type=password], input[type=email], select, textarea { min-height: 40px; padding: 6px 10px; font-size: 14px; border-color: var(--border-strong); border-radius: 12px; }
input:focus, select:focus, textarea:focus { outline-width: 2px; }
button, .btn { min-height: 36px; padding: 4px 12px; font-size: 13px; font-weight: 700; border-radius: 12px; }
button.primary { box-shadow: 0 3px 10px rgba(22,91,247,.22); }
button.danger { border-color: #e5484d; color: #c62a2f; }
.badge { font-size: 11px; padding: 2px 9px; }

/* sections: pills like the demo (also the sign-in tabs) */
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin: 0 0 10px; border-bottom: 0; overflow: visible; }
.tab { display: flex; align-items: center; justify-content: center; min-height: 38px; padding: 4px 2px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 12px; font-weight: 720; color: var(--soft); min-width: 0; white-space: nowrap; }
button.tab:hover:not(:disabled) { background: #fff; border-color: var(--line); color: var(--blue-d); }
.tab[aria-selected="true"], button.tab[aria-selected="true"]:hover:not(:disabled) { background: var(--blue); border-color: var(--blue); color: #fff; }

/* segmented switch (Новые | Б/у), like the demo's mode switch */
.seg { background: #eef2fa; border: 0; border-radius: 10px; padding: 2px; gap: 2px; overflow: visible; }
.seg-btn { min-height: 32px; border-radius: 8px; background: transparent; color: var(--soft); font-size: 12px; font-weight: 700; }
.seg-btn + .seg-btn { border-left: 0; }
.seg-btn[aria-pressed="true"] { background: #fff; color: var(--blue-d); box-shadow: 0 1px 4px rgba(20,40,90,.12); }
.seg-btn[aria-pressed="true"]:hover:not(:disabled) { color: var(--blue-d); background: #fff; }
.seg-btn:hover:not(:disabled) { background: transparent; border-color: transparent; }

/* prices read first */
.amount { font-size: 1.7rem; }
.fold { border-radius: 12px; } .fold > summary { padding: 8px 12px; font-size: 13px; }
.sale-top { margin-bottom: 8px; }

@media (max-width: 640px) {
  body { font-size: 14px; }
  .wrap { padding: 8px 10px 40px; }
  .card { padding: 10px; }
  .amount { font-size: 1.45rem; }
  .tab { font-size: 11px; min-height: 36px; }
  input, select, textarea { font-size: 16px; }   /* no zoom-on-focus on iOS */
}
@media (max-width: 359px) { .tab { font-size: 10px; } }
@media (min-width: 900px) { .tab { font-size: 13px; } }
