/* ==========================================================
   Shovel Servis — Uygulama özel stilleri
   thema.css üzerindeki tokenları kullanır.
   ========================================================== */

body { background: var(--bg); color: var(--text); }

/* ---------- Safe areas & scroll containment (iOS PWA uyumlu) ---------- */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-text-size-adjust: 100%;
}
html { height: 100%; }
/* Bazı iOS sürümlerinde 100vh adres çubuğunu hesaba katmaz → dvh */
@supports (height: 100dvh) {
  body { min-height: 100dvh; }
}
img, video, canvas { max-width: 100%; height: auto; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed; top: 0; bottom: 0; left: 0;
  display: flex; flex-direction: column; z-index: 40;
  overflow-y: auto;
}
.sidebar .brand {
  display:flex; align-items:center; gap:10px; padding: 20px 18px; border-bottom: 1px solid var(--border);
}
.sidebar .brand-logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display:grid; place-items:center; color:#fff; font-weight:700;
}
.sidebar .brand-title { font-weight:700; font-size: 16px; line-height:1.1; }
.sidebar .brand-sub   { font-size: 11px; color: var(--muted); }
.sidebar nav { padding: 12px 10px; flex: 1; }
.sidebar nav a {
  display:flex; align-items:center; gap:12px;
  padding: 11px 14px; border-radius: 12px; color: var(--text); text-decoration:none;
  margin-bottom: 2px; font-size: 14px; transition: all .15s;
}
.sidebar nav a i { width: 20px; text-align:center; color: var(--muted); }
.sidebar nav a:hover { background: var(--surface-2); }
.sidebar nav a.active { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); font-weight: 600; }
.sidebar nav a.active i { color: var(--accent); }
.sidebar .side-foot { padding: 12px; border-top: 1px solid var(--border); }

.main {
  margin-left: var(--sidebar-w);
  width: calc(100% - var(--sidebar-w));
  padding: 20px 24px 80px;
  min-width: 0;
}
.topbar {
  display:flex; align-items:center; justify-content: space-between;
  padding: 12px 16px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  position: sticky; top: 10px; z-index: 30;
  gap: 8px;
}
.topbar .page-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .page-title { font-size: 18px; font-weight: 700; margin:0; }
.topbar .actions { display:flex; align-items:center; gap: 10px; }
.topbar .menu-btn { display:none; background:none; border:none; font-size:22px; color:var(--text); cursor:pointer; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-title { font-size: 14px; font-weight: 700; color: var(--text); margin: 0 0 12px; display:flex; align-items:center; gap: 8px; }
.card-sub { font-size: 12px; color: var(--muted); }

/* ---------- Grid / Stat ---------- */
.grid { display:grid; gap: 16px; }
.grid.g-2 { grid-template-columns: 1fr 1fr; }
.grid.g-3 { grid-template-columns: repeat(3, 1fr); }
.grid.g-4 { grid-template-columns: repeat(4, 1fr); }

.stat {
  background: var(--surface); border:1px solid var(--border); border-radius: 16px; padding: 16px;
  display:flex; flex-direction: column; gap: 6px; min-height: 98px;
  box-shadow: var(--shadow);
}
.stat .lbl { font-size:12px; color: var(--muted); font-weight: 500; }
.stat .val { font-size: 22px; font-weight: 700; }
.stat .icon { width: 36px; height: 36px; border-radius: 10px; display:grid; place-items:center; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.stat.ok  .icon { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.stat.warn .icon{ background: color-mix(in srgb, var(--warning) 20%, transparent); color: #ad820f; }
.stat.danger .icon { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }

/* ---------- Buttons ---------- */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap: 8px;
  padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; text-decoration:none;
  font-weight: 500; font-size: 14px; transition: all .15s; line-height: 1;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--accent); color:#fff; border-color: var(--accent); }
.btn.success { background: var(--success); color:#fff; border-color: var(--success); }
.btn.danger  { background: var(--danger);  color:#fff; border-color: var(--danger); }
.btn.ghost   { background: transparent; }
.btn.sm      { padding: 6px 10px; font-size: 13px; }
.btn.block   { width:100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display:block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.field .hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.input, .select, .textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 14px; font-family: inherit;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.textarea { min-height: 90px; resize: vertical; }
.row { display:grid; gap: 12px; }
.row.cols-2 { grid-template-columns: 1fr 1fr; }
.row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.checkbox { display:flex; align-items:center; gap:8px; font-size:14px; }
.inline-err { color: var(--danger); font-size: 12px; margin-top: 4px; }

/* ---------- Autocomplete / List items ---------- */
.autocomplete { position: relative; }
.autocomplete-box {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  margin-top: 4px; max-height: 240px; overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0,0,0,.08);
}
.autocomplete-box:empty { display: none; }
.list-item {
  display: block; padding: 10px 12px; border-bottom: 1px solid var(--border);
  color: var(--text); text-decoration: none; font-size: 14px;
  cursor: pointer; transition: background .12s;
}
.list-item:last-child { border-bottom: 0; }
.list-item:hover, .list-item:focus { background: var(--surface-2); }
.list-item b { font-weight: 600; }
.list-item .text-muted { margin-left: 6px; font-size: 12px; }

/* ---------- Tables ---------- */
.table { width:100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th, .table td { padding: 10px 12px; text-align:left; border-bottom: 1px solid var(--border); }
.table th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.table tbody tr:hover { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }

/* ---------- Badge ---------- */
.badge { display:inline-flex; align-items:center; gap:4px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge-info     { background: #e0f2fe; color: #075985; }
.badge-success  { background: #dcfce7; color: #15803d; }
.badge-warn     { background: #fef3c7; color: #a16207; }
.badge-danger   { background: #fee2e2; color: #b91c1c; }
.badge-primary  { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.badge-muted    { background: var(--surface-2); color: var(--muted); border:1px solid var(--border); }

/* ---------- Timeline ---------- */
.timeline { position:relative; padding-left: 22px; }
.timeline::before { content:""; position:absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline .item { position: relative; padding: 6px 0 14px 12px; }
.timeline .item::before {
  content: ""; position:absolute; left: -19px; top: 10px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border);
}
.timeline .item .tl-when { color: var(--muted); font-size: 11px; }
.timeline .item .tl-title { font-weight: 600; }

/* ---------- Media ---------- */
.media-grid {
  display:grid; gap:10px;
  grid-template-columns: repeat(auto-fill, minmax(120px, 180px));
  justify-content: start;
}
.media-grid .m {
  border-radius: 12px; overflow:hidden; background: var(--surface-2); border: 1px solid var(--border);
  aspect-ratio: 1; display:grid; place-items: center; position: relative;
  max-width: 100%;
}
.media-grid .m img, .media-grid .m video { width:100%; height:100%; object-fit: cover; }
.media-grid .m .ic { font-size: 28px; color: var(--muted); }

/* ---------- Alerts ---------- */
.alert { padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; font-size: 14px; }
.alert.success { background:#dcfce7; color:#166534; border:1px solid #bbf7d0; }
.alert.error   { background:#fee2e2; color:#991b1b; border:1px solid #fecaca; }
.alert.info    { background:#e0f2fe; color:#075985; border:1px solid #bae6fd; }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display:grid; place-items: center; padding: 20px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--bg)), var(--bg)); }
.auth-card { width:100%; max-width: 460px; background: var(--surface); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.auth-card.lg { max-width: 720px; }
.auth-card h1 { font-size: 22px; margin: 0 0 4px; }
.auth-card .lead { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.auth-card .brand { display:flex; align-items:center; gap: 10px; margin-bottom: 18px; }

/* ---------- Pricing / Packages ---------- */
.pkg { border: 2px solid var(--border); border-radius: 16px; padding: 18px; cursor: pointer; transition: all .15s; background: var(--surface); }
.pkg:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.pkg input[type=radio] { display:none; }
.pkg.selected, .pkg input:checked + * { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.pkg .pkg-name { font-weight: 700; font-size: 16px; }
.pkg .pkg-price { font-size: 22px; font-weight: 800; margin: 6px 0; }
.pkg .pkg-feat { font-size: 12px; color: var(--muted); }

/* ---------- Tracking public page ---------- */
.public-wrap { max-width: 820px; margin: 0 auto; padding: 20px; }
.public-hero { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color:#fff; border-radius: 20px; padding: 22px; margin-bottom: 18px; }
.public-hero h1 { margin: 0 0 6px; font-size: 22px; }
.public-hero .m { opacity: .9; font-size: 14px; }
.public-hero .order-no { background: rgba(255,255,255,.18); padding: 6px 12px; border-radius: 10px; display:inline-block; font-weight:700; margin-top:8px; }

/* ---------- Bottom tab bar (mobil) ---------- */
.bottom-tabs { display:none; }
@media (max-width: 900px) {
  :root { --sidebar-w: 0; }

  .sidebar {
    transform: translateX(-100%); transition: transform .25s ease;
    height: 100vh; height: 100dvh;
    /* iOS notch + status bar alanı */
    padding-top: calc(env(safe-area-inset-top, 0px) + 4px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .sidebar.open { transform: translateX(0); width: 280px; }

  .main {
    margin-left: 0; width: 100%;
    /* Üst + yan + alt safe-area (iPhone Dynamic Island / notch + yatay kenar boşlukları) */
    padding:
      calc(10px + env(safe-area-inset-top, 0px))
      calc(14px + env(safe-area-inset-right, 0px))
      calc(90px + env(safe-area-inset-bottom, 0px))
      calc(14px + env(safe-area-inset-left, 0px));
  }
  .topbar {
    /* Sticky olarak Dynamic Island / status bar'ın hemen ALTINA demirlen */
    top: env(safe-area-inset-top, 0px);
    border-radius: 14px;
    margin-top: 0;
  }
  .topbar .menu-btn { display:inline-flex; }
  .grid { gap: 10px; }
  .grid.g-4, .grid.g-3, .grid.g-2 { grid-template-columns: 1fr 1fr; }
  .grid > * { min-width: 0; }
  .row.cols-4, .row.cols-3, .row.cols-2 { grid-template-columns: 1fr; }

  .bottom-tabs {
    display:flex; justify-content: space-around; align-items:center;
    position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 8px calc(6px + env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) calc(6px + env(safe-area-inset-left, 0px));
    z-index: 50;
  }
  .bottom-tabs a {
    flex: 1; text-align:center; color: var(--muted); text-decoration: none;
    display:flex; flex-direction: column; gap: 2px; padding: 6px; font-size: 10px;
  }
  .bottom-tabs a i { font-size: 18px; }
  .bottom-tabs a.active { color: var(--accent); }
}

/* PWA standalone (ana ekrana eklendiğinde):
   viewport-fit=cover + status-bar black-translucent kullanıldığı için içerik
   ada / notch altına akar. .main padding-top'a safe-area-inset-top zaten eklendi.
   Burada sadece body arka planı Dynamic Island'ın altında da tutarlı görünsün,
   ve sidebar'ın üst başlığı altta kalmasın diye ek destek veriyoruz. */
@media (display-mode: standalone), (display-mode: fullscreen) {
  html, body { background: var(--bg); }
  .sidebar { padding-top: calc(18px + env(safe-area-inset-top, 0px)); }
  /* Ekstra güvence: daha küçük medya query'leri topbar padding'ini sıfırlamasın */
  .topbar { top: env(safe-area-inset-top, 0px) !important; }
}

/* ---------- Signature canvas ---------- */
.sig-pad {
  width:100%; height: 200px; background:#fafafa; border:2px dashed var(--border); border-radius: 12px; touch-action:none;
}

/* ---------- Media picker (kamera + galeri) ---------- */
.media-picker { display:block; }
.media-picker .mp-buttons {
  display:flex; gap:8px; flex-wrap:wrap;
}
.media-picker .mp-btn {
  display:inline-flex; align-items:center; gap:6px; cursor:pointer;
  padding:10px 14px; font-size:14px; user-select:none;
}
.media-picker .mp-btn i { font-size:16px; }
@media (max-width: 640px) {
  .media-picker .mp-btn {
    flex:1 1 calc(50% - 4px); justify-content:center; padding:14px 10px; font-size:13px;
  }
  .media-picker .mp-btn i { font-size:20px; }
}
.media-picker .mp-preview {
  display:grid; grid-template-columns: repeat(auto-fill, minmax(110px, 160px));
  gap:6px; margin-top:10px; justify-content: start;
}
.media-picker .mp-preview:empty { display:none; }
.media-picker .mp-item {
  position:relative; background:#f3f4f6; border:1px solid var(--border);
  border-radius:8px; overflow:hidden; aspect-ratio:1;
}
.media-picker .mp-item img {
  width:100%; height:100%; object-fit:cover;
}
.media-picker .mp-doc {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  height:100%; padding:8px; text-align:center; font-size:11px; color:#475569;
  word-break:break-all; overflow:hidden;
}
.media-picker .mp-doc i { font-size:32px; margin-bottom:6px; color:#64748b; }
.media-picker .mp-meta {
  position:absolute; bottom:0; left:0; right:0;
  background:rgba(0,0,0,0.65); color:#fff; font-size:10px;
  padding:3px 6px; text-align:center;
}
.media-picker .mp-x {
  position:absolute; top:4px; right:4px;
  width:22px; height:22px; border-radius:50%; border:none;
  background:rgba(220, 38, 38, 0.9); color:#fff; cursor:pointer;
  font-size:16px; font-weight:700; line-height:1; padding:0;
  display:flex; align-items:center; justify-content:center;
}
.media-picker .mp-x:hover { background:rgb(185, 28, 28); }
.media-picker .mp-hint {
  font-size:11px; color:var(--muted); margin:6px 0 0;
}

/* ---------- Webcam capture modal (desktop için) ---------- */
.mp-webcam-modal {
  display:none; position:fixed; inset:0; z-index:9998;
  background:rgba(0,0,0,.78); align-items:center; justify-content:center; padding:16px;
}
.mp-webcam-modal[aria-hidden="false"] { display:flex; }
.mp-wc-box {
  background:#0f172a; color:#fff; border-radius:12px; width:100%; max-width:720px;
  box-shadow:0 20px 60px rgba(0,0,0,.5); overflow:hidden;
  display:flex; flex-direction:column; max-height:calc(100vh - 32px);
}
.mp-wc-head {
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 16px; background:#1e293b; border-bottom:1px solid #334155;
  font-weight:600; font-size:15px;
}
.mp-wc-close {
  background:none; border:none; color:#fff; font-size:26px; line-height:1; cursor:pointer;
  padding:0 6px;
}
.mp-wc-body {
  position:relative; background:#000; display:flex; align-items:center; justify-content:center;
  min-height:240px; overflow:hidden;
}
.mp-wc-body video {
  width:100%; max-height:60vh; display:block; background:#000;
}
.mp-wc-err {
  padding:14px 16px; color:#fecaca; background:#7f1d1d; font-size:13px;
  position:absolute; left:10px; right:10px; bottom:10px; border-radius:8px;
}
.mp-wc-rec {
  position:absolute; top:10px; right:10px; background:rgba(220,38,38,.9); color:#fff;
  padding:4px 10px; border-radius:6px; font-size:12px; font-weight:600;
  align-items:center; gap:6px;
}
.mp-wc-rec-dot {
  display:inline-block; width:8px; height:8px; border-radius:50%; background:#fff;
  animation:mp-pulse 1s infinite;
}
@keyframes mp-pulse { 0%,100% { opacity:1 } 50% { opacity:.3 } }
.mp-wc-foot {
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding:12px 16px; background:#1e293b; border-top:1px solid #334155; flex-wrap:wrap;
}
.mp-wc-foot .mp-wc-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; flex:1; }
.mp-wc-foot .btn { border-color:#475569; background:#334155; color:#fff; }
.mp-wc-foot .btn.ghost { background:transparent; color:#cbd5e1; }
.mp-wc-foot .btn.primary { background:var(--accent); border-color:var(--accent); }
.mp-wc-foot .btn.danger  { background:#dc2626; border-color:#dc2626; }

/* ---------- Genel mobil düzeltmeler (< 640px) ---------- */
@media (max-width: 640px) {
  /* Her kart viewport'tan taşmasın */
  .card { padding: 14px; overflow: hidden; max-width: 100%; min-width: 0; box-sizing: border-box; }
  .card > *, .stat > * { min-width: 0; max-width: 100%; }
  .stat { padding: 12px; min-height: 0; min-width: 0; box-sizing: border-box; }
  .stat .lbl { font-size: 11px; }
  .stat .val { font-size: 20px; }
  .stat .icon { width: 28px; height: 28px; font-size: 13px; flex-shrink: 0; }

  /* flex-between içindeki label overflow etmesin */
  .flex-between { min-width: 0; }
  .flex-between > * { min-width: 0; }
  .flex-between .lbl { overflow: hidden; text-overflow: ellipsis; }

  /* Kart içindeki iç içe grid'ler tek sütun ol (stat-in-card sıkışmasını önler) */
  .card .grid.g-2,
  .card .grid.g-3,
  .card .grid.g-4 { grid-template-columns: 1fr 1fr; gap: 8px; }

  /* Uzun metin/IBAN/no'lar satır atlasın (kart dışına taşmasın) */
  .card, .stat, .table td, .mono, code, pre { word-break: break-word; overflow-wrap: anywhere; }
  .mono { font-size: 13px; }

  /* float:right → blok ak (kart taşmasını önler) */
  [style*="float:right"], [style*="float: right"] {
    float: none !important; display: inline-block !important; margin-left: auto !important;
  }

  /* Inline flex container'larda wrap yoksa otomatik wrap (kart dışına taşmayı durdurur).
     Hem kartın kendisinde hem de içindeki flex div'lerde geçerli. */
  .card[style*="display:flex"]:not([style*="flex-wrap"]),
  .card[style*="display: flex"]:not([style*="flex-wrap"]),
  .card [style*="display:flex"]:not([style*="flex-wrap"]),
  .card [style*="display: flex"]:not([style*="flex-wrap"]) {
    flex-wrap: wrap !important;
  }
  .card-title { flex-wrap: wrap; gap: 6px; }

  /* Sarılmamış tablolar için emniyet kemeri */
  .card > table, .card > form > table, .card > div > table:not(.table-wrap > table) {
    display:block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%;
  }

  /* Topbar sığdırma (üst) */
  .topbar { padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
  .topbar .page-title { font-size: 16px; }
  .topbar .actions { flex-shrink: 0; }
  .topbar .actions .btn { padding: 7px 10px; font-size: 12px; }

  /* Buton grupları otomatik sar */
  .btn-group, .flex-between { flex-wrap: wrap; }

  /* Fiyat / stat değerleri overflow etmesin (büyük sayılar) */
  .stat .val, .stat .v,
  .card [style*="font-size:26px"],
  .card [style*="font-size:24px"],
  .card [style*="font-size:22px"],
  .card [style*="font-size: 26px"],
  .card [style*="font-size: 24px"],
  .card [style*="font-size: 22px"] {
    font-size: 18px !important; line-height: 1.2;
    overflow-wrap: anywhere;
  }
  h1 { font-size: 20px; }
  h2 { font-size: 17px; }

  /* iOS zoom engeli — 16px altı inputlar focus'ta zoom yapar */
  .input, .select, .textarea, input, select, textarea { font-size: 16px; }

  /* Hide-sm ile gizlenen label'lar (butonlarda ikon-sadece) */
  .hide-sm { display: none; }
}

/* Orta-küçük ekranlar (< 540px) — dashboard 4'lü stat 2 sütun kalır ama iç grid'ler tek sütun */
@media (max-width: 540px) {
  /* Kartların içindeki iç grid'ler tek sütuna insin (Stok Özeti 4 kutu → alt alta) */
  .card .grid.g-2,
  .card .grid.g-3,
  .card .grid.g-4 { grid-template-columns: 1fr; }
  .main {
    padding:
      calc(8px + env(safe-area-inset-top, 0px))
      calc(10px + env(safe-area-inset-right, 0px))
      calc(90px + env(safe-area-inset-bottom, 0px))
      calc(10px + env(safe-area-inset-left, 0px));
  }
  .card { padding: 12px; border-radius: 12px; }
  .card + .card { margin-top: 10px; }
  .btn { padding: 9px 12px; font-size: 13px; }
}

/* Çok küçük ekranlar (< 420px) — tüm grid'ler tek sütun */
@media (max-width: 420px) {
  .grid.g-4, .grid.g-3, .grid.g-2 { grid-template-columns: 1fr; }
  .main {
    padding:
      calc(6px + env(safe-area-inset-top, 0px))
      calc(8px + env(safe-area-inset-right, 0px))
      calc(90px + env(safe-area-inset-bottom, 0px))
      calc(8px + env(safe-area-inset-left, 0px));
  }
  .card { padding: 10px; border-radius: 10px; }
  .btn { padding: 8px 10px; font-size: 13px; }
  .topbar { padding: 8px 10px; }
  .topbar .page-title { font-size: 15px; }
}

/* ---------- Utilities ---------- */
.mt-0{margin-top:0!important}.mt-1{margin-top:8px}.mt-2{margin-top:14px}.mt-3{margin-top:20px}
.mb-0{margin-bottom:0!important}.mb-1{margin-bottom:8px}.mb-2{margin-bottom:14px}.mb-3{margin-bottom:20px}
.text-muted{color:var(--muted)} .text-right{text-align:right} .text-center{text-align:center}
.flex{display:flex}.flex-between{display:flex;align-items:center;justify-content:space-between;gap:10px}
.gap-1{gap:8px}.gap-2{gap:14px}
.hide{display:none!important}
.spacer{flex:1}
.mono{font-family: ui-monospace, Menlo, monospace}
