:root {
  --auth: #fd8a01;
  --auth-dark: #fd8a01;
  --navy: #fd8a01;
  --navy-2: #fd8a01;
  --ink: #1c1917;
  --muted: #757575;
  --amber: #fd8a01;
  --amber-2: #fd8a01;
  --paper: #f7f7f7;
  --card: #ffffff;
  --line: #e5e5e5;
  --danger: #b42318;
  --ok: #067647;
  --shadow: 0 8px 24px rgba(253, 138, 1, 0.10);
  --radius: 12px;
  --font: "Kantumruy Pro", "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  padding-bottom: 76px;
}
a { color: var(--navy); text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }
.app-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--navy); color: #fff;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
}
.app-header h1 { font-size: 16px; margin: 0; letter-spacing: 0.08em; font-weight: 700; }
.app-header .grow { flex: 1; }
.brand-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.brand-logo img {
  height: 32px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}
.lang-btn, .icon-btn {
  background: transparent; color: #fff; border: 0;
  padding: 4px 2px; cursor: pointer; font-weight: 700; font-size: 13px;
}
.lang-switch { position: relative; }
.lang-flag {
  width: 18px;
  height: 12px;
  object-fit: cover;
  border-radius: 2px;
  display: block;
  box-shadow: 0 0 0 1px rgba(255,255,255,.35);
}
.lang-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 148px;
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 40;
}
.lang-switch.open .lang-menu { display: block; }
.lang-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.lang-menu button img {
  width: 22px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
}
.lang-menu button:hover { background: #fff4ed; color: var(--auth); }
.lang-menu button.on { display: none; }
.icon-btn { font-size: 16px; position: relative; line-height: 1; }
.icon-btn i { color: #fff; }
.icon-btn .badge {
  position: absolute; top: -4px; right: -8px;
  display: none; min-width: 16px; padding: 0 5px; border-radius: 99px;
  background: #fff; color: var(--auth); font-size: 10px; line-height: 16px; font-weight: 800;
}
.search-wrap { padding: 12px 14px 0; }
.search-wrap input, .field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; font-size: 16px;
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 14px; }
.chip {
  white-space: nowrap; border: 1px solid var(--line); background: #fff;
  border-radius: 999px; padding: 8px 12px; font-size: 13px; cursor: pointer;
}
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 14px 20px;
}
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.card .thumb {
  aspect-ratio: 1; background: #f3f3f3; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .meta { padding: 10px; }
.card .name { font-size: 13px; font-weight: 600; line-height: 1.3; min-height: 34px; }
.card .sku { color: var(--muted); font-size: 11px; margin-top: 4px; }
.card .price { margin-top: 8px; font-weight: 700; color: var(--navy); font-size: 14px; }
.card .price small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: #fff;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}
.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}
.tabbar .tab-icon {
  display: block;
  position: relative;
  background: none;
  width: auto;
  height: auto;
  border-radius: 0;
  color: inherit;
}
.tabbar .tab-icon i { font-size: 20px; }
.tabbar a.on, .tabbar a:hover { color: var(--navy); font-weight: 700; }
.tabbar a.on .tab-icon, .tabbar a:hover .tab-icon {
  background: none;
  color: inherit;
}
.tabbar .badge {
  position: absolute; top: -6px; right: -10px;
  display: none; min-width: 16px; padding: 0 5px; border-radius: 99px;
  background: var(--auth); color: #fff; font-size: 10px; line-height: 16px; font-weight: 700;
}
.page { padding: 14px; }
.hero-title { margin: 0 0 8px; font-size: 22px; }
.muted { color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px 16px; border: 0; border-radius: 8px;
  background: var(--navy); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer;
}
.btn.secondary { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
.btn.amber { background: var(--amber); color: #fff; }
.btn.danger { background: var(--danger); }
.btn.ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.row-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.spec-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
.spec-table th, .spec-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.spec-table th { color: var(--muted); font-weight: 500; width: 40%; }
.line {
  display: flex; gap: 10px; background: #fff; border-radius: 12px; padding: 10px; margin-bottom: 10px;
}
.line img, .line .ph { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: #f3f3f3; }
.qty {
  display: flex; align-items: center; gap: 8px;
}
.qty button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.notice {
  background: #fff7ed; border: 1px solid #fdba74; color: #9a3412;
  padding: 12px; border-radius: 12px; margin-bottom: 12px;
}
.okbox { background: #ecfdf3; border: 1px solid #abefc6; color: #067647; padding: 12px; border-radius: 12px; }
.toast {
  position: fixed; left: 14px; right: 14px; bottom: 104px; background: var(--navy); color: #fff;
  padding: 12px 14px; border-radius: 12px; display: none; z-index: 80;
}
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.price-lg { font-size: 22px; font-weight: 700; color: var(--navy); }
.price-lg small { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.drawer-notes { background: #fff; border-radius: 12px; padding: 12px; }
.status {
  display: inline-block; font-size: 11px; padding: 3px 8px; border-radius: 99px;
  background: #eee; text-transform: uppercase; letter-spacing: .04em;
}
.status.sent, .status.confirmed, .status.paid { background: #d1fadf; color: #067647; }
.status.requested, .status.quoted, .status.pending, .status.unpaid { background: #fef0c7; color: #93370d; }
.status.renegotiate { background: #fde8e3; color: #b42318; }
.list-row {
  display: block; background: #fff; border-radius: 12px; padding: 12px; margin-bottom: 8px;
}
.totals { background: #fff; border-radius: 12px; padding: 12px; }
.totals div { display: flex; justify-content: space-between; margin: 6px 0; }
.totals .grand { font-weight: 700; font-size: 18px; border-top: 1px solid var(--line); padding-top: 8px; color: var(--auth); }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; margin-bottom: 6px; font-weight: 600; }
.hidden { display: none !important; }
.notif-panel {
  display: none; position: absolute; right: 10px; top: 52px; width: min(92vw, 340px);
  background: #fff; color: var(--ink); border-radius: 12px; box-shadow: var(--shadow); max-height: 60vh; overflow: auto;
}
.notif-panel.open { display: block; }
.notif-panel article { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.landing {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: #f2f2f2;
  color: #2d3440;
}
.landing-hero {
  padding: calc(36px + env(safe-area-inset-top)) 28px 8px;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  flex: 0 0 auto;
}
.landing-hero h1 {
  margin: 0 0 8px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #2d3440;
  line-height: 1.15;
}
.landing-hero p {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: #5c6470;
}
.landing-mid {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 8px 24px;
}
.landing .landing-logo {
  display: block;
  width: min(72vw, 260px);
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  object-fit: contain;
}
.landing-art {
  position: relative;
  flex: 0 0 auto;
  min-height: 38vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px 28px calc(28px + env(safe-area-inset-bottom));
}
.blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.blob.b1 {
  width: 150vw;
  height: 150vw;
  max-width: 720px;
  max-height: 720px;
  left: -58%;
  bottom: -62%;
  background: #c45e00;
}
.blob.b2 {
  width: 140vw;
  height: 140vw;
  max-width: 680px;
  max-height: 680px;
  right: -52%;
  bottom: -58%;
  background: #e07000;
}
.blob.b3 {
  width: 120vw;
  height: 120vw;
  max-width: 560px;
  max-height: 560px;
  left: -18%;
  bottom: -70%;
  background: #fd8a01;
}
.blob.b4 {
  width: 95vw;
  height: 95vw;
  max-width: 460px;
  max-height: 460px;
  right: -28%;
  bottom: -48%;
  background: #ff9c2a;
}
.landing-actions {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}
.landing .btn {
  margin-top: 0;
  border-radius: 999px;
  padding: 16px 18px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .06em;
  border: 0;
}
.landing-direct {
  background: #fff;
  color: #2d3440;
}
.landing-quote {
  background: #fd8a01;
  color: #fff;
}
.landing-staff {
  display: block;
  color: #fff;
  background: #2d3440;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  padding: 16px 18px;
  text-decoration: none;
  border-radius: 999px;
  letter-spacing: .06em;
}
.landing h1 { letter-spacing: -0.03em; }
@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(4, 1fr); max-width: 980px; margin: 0 auto; }
  .page, .search-wrap, .chips { max-width: 720px; margin-left: auto; margin-right: auto; }
  .app-header { padding-left: calc(50vw - 360px); padding-right: calc(50vw - 360px); }
}

/* Auth screens — welcome + sign in / sign up */
body.auth-screen {
  padding-bottom: 0;
  background: #fff;
  min-height: 100vh;
}
body.auth-screen .tabbar,
body.auth-screen #chrome { display: none !important; }
#view { min-height: 50vh; }

.auth-welcome {
  min-height: 100vh;
  background: var(--auth);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 28px 28px;
}
.auth-hello {
  font-size: 22px;
  font-weight: 400;
  margin: 0;
  opacity: .95;
}
.auth-welcome-title {
  font-size: 34px;
  font-weight: 800;
  margin: 0 0 36px;
  letter-spacing: -0.02em;
}
.auth-welcome .auth-logo-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.auth-welcome-actions {
  width: 100%;
  max-width: 320px;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 28px;
}
.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  border: 0;
  text-decoration: none;
}
.auth-btn-solid {
  background: #fff;
  color: var(--auth);
}
.auth-btn-outline {
  background: transparent;
  color: #fff;
  border: 1.5px solid #fff;
}
.auth-legal {
  font-size: 11px;
  opacity: .75;
  margin: 0;
}
.auth-legal a { color: #fff; }

.auth-head {
  background: var(--auth);
  padding: 40px 24px 20px;
  text-align: center;
}
.auth-fold {
  height: 56px;
  background: var(--auth);
  position: relative;
  clip-path: polygon(0 0, 100% 0, 100% 10px, 44px 100%, 0 100%);
}
.auth-fold::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 44px;
  height: 56px;
  background: var(--auth-dark);
  clip-path: polygon(0 0, 0 100%, 100% 100%);
}
.auth-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 220px;
}
.auth-logo-wrap img {
  width: 100%;
  height: auto;
  max-height: 72px;
  object-fit: contain;
}
.auth-body {
  background: #fff;
  padding: 8px 28px 32px;
  max-width: 420px;
  margin: 0 auto;
}
.auth-body h2 {
  margin: 0 0 6px;
  color: var(--auth);
  font-size: 32px;
  font-weight: 800;
}
.auth-sub {
  margin: 0 0 22px;
  color: #9e9e9e;
  font-size: 13px;
}
.auth-input {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #d4d4d4;
  border-radius: 8px;
  padding: 0 12px;
  margin-bottom: 12px;
  background: #fff;
}
.auth-input i {
  color: #9e9e9e;
  width: 18px;
  text-align: center;
}
.auth-input input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  padding: 13px 0;
  font-size: 14px;
  width: 100%;
}
.auth-help {
  display: block;
  text-align: right;
  color: #9e9e9e;
  font-size: 12px;
  margin: 4px 0 18px;
}
.auth-submit {
  width: 100%;
  background: var(--auth);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.auth-switch {
  text-align: center;
  margin: 22px 0 0;
  color: #757575;
  font-size: 13px;
}
.auth-switch a {
  color: var(--auth);
  font-weight: 700;
}
.auth-err {
  color: #b42318;
  font-size: 13px;
  min-height: 1.2em;
  margin: 0 0 10px;
}

body.product-screen .toast { bottom: 16px; }
.product-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.product-close {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  right: 12px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(28, 25, 23, .72);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.product-close:hover { background: var(--auth); }
.product-sheet {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.product-hero {
  background: #f4f4f4;
  flex: 1 1 48%;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 12px;
}
.product-hero img {
  width: 100%;
  height: 100%;
  max-height: 52vh;
  object-fit: contain;
}
.product-hero-empty {
  color: var(--muted);
  font-size: 14px;
}
.product-thumbs {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.product-thumb {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f3f3;
  cursor: pointer;
}
.product-thumb.on { border-color: var(--auth); }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-body {
  flex: 1 1 52%;
  overflow-y: auto;
  padding: 16px 16px 0;
  background: #fff;
}
.product-body .hero-title { margin-top: 0; }
.product-cta {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding: 12px 0 calc(14px + env(safe-area-inset-bottom));
  margin-top: 12px;
}

body.chat-screen { overflow: hidden; padding-bottom: 0; }
body.chat-screen .toast { bottom: 16px; }
.chat-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: #e8ebee;
  display: flex;
  flex-direction: column;
}
.chat-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--auth);
  color: #fff;
  padding: calc(8px + env(safe-area-inset-top)) 8px 10px 4px;
  min-height: 56px;
}
.chat-back {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.chat-back:hover { background: rgba(255,255,255,.12); }
.chat-top-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.chat-top-info b { display: block; font-size: 16px; line-height: 1.2; }
.chat-top-info small { display: block; font-size: 12px; opacity: .85; font-weight: 500; }
.chat-overlay .chat-msgs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 10px 8px;
  background:
    radial-gradient(circle at 20% 20%, rgba(253,138,1,.06), transparent 40%),
    #e8ebee;
}
.chat-overlay .empty { background: transparent; }
.chat-overlay .bubble {
  max-width: 78%;
  margin: 6px 4px;
  padding: 8px 10px 4px;
  border-radius: 16px;
  background: #fff;
  font-size: 15px;
  line-height: 1.35;
  box-shadow: 0 1px 1px rgba(0,0,0,.08);
  position: relative;
}
.chat-overlay .bubble.them { border-bottom-left-radius: 4px; }
.chat-overlay .bubble.me {
  margin-left: auto;
  background: #fff3e0;
  color: var(--ink);
  border-bottom-right-radius: 4px;
}
.chat-overlay .bubble small {
  display: block;
  text-align: right;
  opacity: .55;
  font-size: 11px;
  margin-top: 4px;
}
.chat-overlay .chat-send {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  background: #f0f0f0;
}
.chat-send-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.chat-overlay .chat-send input[type="text"],
.chat-overlay .chat-send #chat-text {
  flex: 1;
  margin: 0;
  border: 0;
  border-radius: 22px;
  padding: 10px 16px;
  background: #fff;
  font-size: 15px;
}
.chat-clip {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: #444;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  font-size: 18px;
}
.chat-pending {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #fff;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 13px;
}
.chat-pending button {
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.chat-att-img { display: block; margin-bottom: 6px; }
.chat-att-img img {
  display: block;
  max-width: 220px;
  width: 100%;
  height: auto;
  border-radius: 10px;
}
.chat-att-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: rgba(0,0,0,.05);
  color: inherit;
  font-weight: 600;
  font-size: 13px;
}
.chat-overlay .bubble.me .chat-att-file { background: rgba(253,138,1,.16); }
.chat-send-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--auth);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
