/* ============================================================================
 * Localpack — styles.css  (saf CSS, Tailwind YOK, build YOK)
 * Koyu charcoal tema + glassmorphism. Tüm renkler oklch (modern tarayıcılar).
 * ==========================================================================*/

:root {
  --radius: 1rem;
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --radius-2xl: calc(var(--radius) + 8px);
  --radius-3xl: calc(var(--radius) + 12px);
  --font-sans: "Outfit", ui-sans-serif, system-ui, -apple-system, sans-serif;

  --background: oklch(0.15 0 0);
  --foreground: oklch(0.97 0.005 90);
  --card: oklch(0.27 0.005 90);
  --card-foreground: oklch(0.97 0.005 90);
  --popover: oklch(0.18 0.005 90);
  --primary: oklch(0.78 0.17 55);
  --primary-foreground: oklch(0.18 0.01 90);
  --secondary: oklch(0.34 0.008 90);
  --secondary-foreground: oklch(0.97 0.005 90);
  --muted: oklch(0.34 0.005 90);
  --muted-foreground: oklch(0.72 0.01 90);
  --accent: oklch(0.74 0.18 45);
  --accent-foreground: oklch(0.18 0.01 90);
  --border: oklch(1 0 0 / 10%);
  --ring: oklch(0.78 0.17 55);

  --gradient-hero: radial-gradient(120% 100% at 0% 0%, oklch(0.55 0.22 35 / 0.55), transparent 55%),
                   radial-gradient(120% 100% at 100% 0%, oklch(0.50 0.22 320 / 0.45), transparent 60%),
                   radial-gradient(140% 120% at 50% 120%, oklch(0.40 0.18 250 / 0.55), transparent 60%),
                   linear-gradient(180deg, oklch(0.18 0 0), oklch(0.22 0 0));
  --gradient-card: linear-gradient(160deg, oklch(0.28 0.005 90) 0%, oklch(0.22 0.005 90) 100%);
  --shadow-soft: 0 8px 30px -12px oklch(0 0 0 / 0.55);
  --shadow-lift: 0 24px 60px -20px oklch(0 0 0 / 0.7);
}

* { box-sizing: border-box; border-color: var(--border); margin: 0; padding: 0; }

html { font-family: var(--font-sans); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--foreground);
  background-image:
    radial-gradient(circle at 0% 0%, oklch(0.74 0.18 45 / 0.08), transparent 45%),
    radial-gradient(circle at 100% 10%, oklch(0.55 0.18 320 / 0.06), transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

h1, h2, h3 { letter-spacing: -0.02em; font-weight: 600; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }

.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.muted { color: var(--muted-foreground); }
.accent { color: var(--accent); }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
#app { position: relative; min-height: 100vh; width: 100%; display: flex; flex-direction: column; overflow-x: clip; }
.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding-left: 1.5rem; padding-right: 1.5rem; }
@media (max-width: 640px) { .wrap { padding-left: 1rem; padding-right: 1rem; } }

/* ---------- Top toolbar ---------- */
.toolbar {
  position: absolute; top: 0.75rem; right: 0.75rem; left: 0.75rem; z-index: 50;
  display: flex; flex-direction: column; align-items: stretch; pointer-events: none;
}
.toolbar-row { display: flex; align-items: center; justify-content: flex-end; gap: 0.375rem; pointer-events: auto; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 0.5rem; flex-shrink: 0;
  border-radius: 9999px; background: rgba(255,255,255,0.95); backdrop-filter: blur(8px);
  font-size: 0.875rem; font-weight: 600; color: #171717;
  box-shadow: var(--shadow-soft); border: 1px solid rgba(0,0,0,0.05);
  padding: 0.5rem 0.75rem; transition: box-shadow 0.2s, border-color 0.2s;
}
.pill-btn:hover { box-shadow: var(--shadow-lift); }
.pill-btn .icon { width: 1rem; height: 1rem; color: #737373; }
.pill-btn .badge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.25rem; height: 1.25rem; padding: 0 0.375rem; border-radius: 9999px; background: var(--primary); color: var(--primary-foreground); font-size: 0.625rem; font-weight: 700; }
.pill-btn .flag { font-size: 1rem; line-height: 1; }

.menu-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,0.4); }

.panel {
  margin-top: 0.5rem; pointer-events: auto; width: 100%;
  border-radius: var(--radius-2xl); background: var(--card); color: var(--card-foreground);
  border: 1px solid var(--border); box-shadow: var(--shadow-lift);
  overflow: hidden; display: flex; flex-direction: column;
  max-height: min(28rem, calc(100dvh - 5.5rem));
}
@media (min-width: 640px) { .panel.align-right { margin-left: auto; max-width: 24rem; } .panel.lang.align-right { max-width: 20rem; } }
.panel-head { flex-shrink: 0; padding: 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.panel-head .title { font-size: 0.875rem; font-weight: 600; }
.panel-head .sub { font-size: 0.6875rem; color: var(--muted-foreground); margin-top: 0.125rem; line-height: 1.35; }
.panel-head.upper { font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted-foreground); padding-bottom: 0.5rem; }
.panel-body { min-height: 0; flex: 1; overflow-y: auto; padding: 0.5rem; }
.panel-foot { flex-shrink: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.375rem; padding: 0.75rem; padding-top: 0.5rem; border-top: 1px solid var(--border); background: var(--card); }
.panel-foot button { min-width: 0; font-size: 0.6875rem; font-weight: 600; color: var(--muted-foreground); padding: 0.5rem 0.25rem; border-radius: 0.5rem; transition: background 0.15s, color 0.15s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-foot button:hover { background: var(--secondary); color: var(--card-foreground); }
.panel-foot button.primary { font-weight: 700; background: var(--primary); color: var(--primary-foreground); }
.panel-foot button.primary:hover { opacity: 0.9; }

.pref-row { display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem 0.625rem; border-radius: 0.5rem; font-size: 0.875rem; text-align: left; width: 100%; transition: background 0.15s; color: var(--card-foreground); }
.pref-row:hover { background: var(--secondary); }
.pref-row.active { background: oklch(0.78 0.17 55 / 0.15); }
.pref-check { display: grid; place-content: center; height: 1.25rem; width: 1.25rem; flex-shrink: 0; border-radius: 0.375rem; border: 1px solid var(--border); background: var(--background); }
.pref-row.active .pref-check { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.pref-row .icon { width: 1rem; height: 1rem; color: var(--muted-foreground); flex-shrink: 0; }
.pref-row .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lang-row { width: 100%; display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem 0.75rem; font-size: 0.875rem; transition: background 0.15s; color: var(--card-foreground); }
.lang-row:hover { background: var(--secondary); }
.lang-row.active { color: var(--primary); font-weight: 500; background: oklch(0.78 0.17 55 / 0.1); }
.lang-row .flag { font-size: 1.125rem; line-height: 1; width: 1.5rem; text-align: center; flex-shrink: 0; }
.lang-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.lang-row .eng { font-size: 0.75rem; color: var(--muted-foreground); flex-shrink: 0; }

/* ---------- Home hero ---------- */
.hero { position: relative; border-bottom: 1px solid var(--border); }
.hero-inner { position: relative; max-width: 72rem; margin: 0 auto; padding: 4rem 1.5rem 2rem; }
@media (min-width: 640px) { .hero-inner { padding: 6rem 1.5rem 4rem; } }
.hero h1 { font-size: clamp(3rem, 8vw, 88px); font-weight: 600; line-height: 0.95; letter-spacing: -0.04em; }
.hero h1 .brand { color: var(--accent); font-weight: 700; }
.hero-sub { margin-top: 1.75rem; max-width: 36rem; font-size: 1rem; color: var(--muted-foreground); line-height: 1.6; }
@media (min-width: 640px) { .hero-sub { font-size: 1.125rem; } }

.geo-banner { margin-top: 1.5rem; display: inline-flex; align-items: center; gap: 0.5rem; border-radius: 9999px; background: oklch(0.74 0.18 45 / 0.1); padding: 0.5rem 1rem; font-size: 0.875rem; border: 1px solid oklch(0.74 0.18 45 / 0.25); }
.geo-banner .icon { width: 1rem; height: 1rem; color: var(--accent); }
.geo-banner a { color: var(--accent); font-weight: 600; }
.geo-banner a:hover { text-decoration: underline; }

.search-wrap { margin-top: 2.5rem; max-width: 36rem; position: relative; }
.search-box { display: flex; align-items: center; gap: 0.75rem; border-radius: var(--radius-2xl); background: var(--card); padding: 1rem 1.25rem; border: 1px solid var(--border); box-shadow: var(--shadow-soft); transition: border-color 0.2s; }
.search-box:focus-within { border-color: oklch(0.78 0.17 55 / 0.6); }
.search-box .icon { width: 1.25rem; height: 1.25rem; color: var(--muted-foreground); }
.search-box input { flex: 1; background: transparent; outline: none; border: none; color: var(--foreground); font-size: 1rem; }
.search-box input::placeholder { color: var(--muted-foreground); }
.search-kbd { font-size: 0.625rem; font-weight: 600; padding: 0.25rem 0.625rem; border-radius: 0.375rem; background: var(--muted); color: var(--muted-foreground); border: 1px solid var(--border); white-space: nowrap; }
@media (max-width: 640px) { .search-kbd { display: none; } }

.recent-dropdown { position: absolute; left: 0; right: 0; top: 100%; margin-top: 0.5rem; z-index: 30; border-radius: var(--radius-2xl); background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-lift); overflow: hidden; }
.recent-head { padding: 0.5rem 1rem; font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted-foreground); border-bottom: 1px solid var(--border); }
.recent-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; transition: background 0.15s; }
.recent-row:hover { background: var(--secondary); }
.recent-row .recent-link { display: flex; flex: 1; align-items: center; gap: 0.75rem; min-width: 0; }
.recent-row .flag { font-size: 1.25rem; }
.recent-row .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-x { flex-shrink: 0; width: 1.75rem; height: 1.75rem; display: grid; place-content: center; border-radius: 9999px; color: var(--muted-foreground); transition: background 0.15s, color 0.15s; }
.recent-x:hover { background: var(--muted); color: var(--foreground); }
.recent-x .icon { width: 1rem; height: 1rem; }

.features { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; max-width: 48rem; align-items: center; }
.feature { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--muted-foreground); }
.feature .icon { width: 1rem; height: 1rem; color: var(--accent); }

/* ---------- Country grid ---------- */
.section { max-width: 72rem; margin: 0 auto; padding: 2rem 1.5rem 4rem; position: relative; }
@media (min-width: 640px) { .section { padding: 3rem 1.5rem 6rem; } }
.section-title { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
@media (min-width: 640px) { .section-title { font-size: 3rem; } }
.section-sub { font-size: 0.875rem; color: var(--muted-foreground); margin-top: 0.25rem; max-width: 28rem; }
.section-head { margin-bottom: 1.25rem; }
@media (min-width: 640px) { .section-head { margin-bottom: 2rem; } }

.country-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
@media (min-width: 640px) { .country-grid { gap: 0.75rem; } }

.country-card {
  position: relative; border-radius: var(--radius-2xl); background: var(--gradient-card); padding: 0.5rem;
  border: 1px solid var(--border); box-shadow: var(--shadow-soft);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; overflow: hidden; text-align: center; width: 100%;
}
.country-card:hover { border-color: oklch(0.78 0.17 55 / 0.4); box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.country-card .cc-inner { display: flex; flex-direction: column; align-items: center; gap: 0.375rem; }
.country-card img { height: 3rem; width: 3rem; flex-shrink: 0; border-radius: var(--radius-xl); object-fit: cover; border: 1px solid var(--border); background: var(--muted); }
.country-card .cc-name { font-weight: 600; font-size: 0.6875rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.country-card .cc-region { font-size: 0.5625rem; color: var(--muted-foreground); margin-top: 0.125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.country-card .cc-count { margin-top: 0.25rem; display: inline-flex; align-items: center; gap: 0.25rem; border-radius: 9999px; background: oklch(0.78 0.17 55 / 0.1); color: var(--primary); padding: 0.0625rem 0.375rem; font-size: 0.5625rem; font-weight: 600; border: 1px solid oklch(0.78 0.17 55 / 0.2); }

.empty { border-radius: var(--radius-2xl); border: 1px dashed var(--border); padding: 3rem; text-align: center; color: var(--muted-foreground); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: oklch(0.27 0.005 90 / 0.4); margin-top: auto; }
.footer-inner { max-width: 72rem; margin: 0 auto; padding: 2rem 1.5rem; }
.footer-row { display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.75rem; color: var(--muted-foreground); text-align: center; }
@media (min-width: 640px) { .footer-row { flex-direction: row; align-items: center; justify-content: space-between; } }

/* ---------- Detail page ---------- */
.detail-hero { position: relative; }
.detail-hero-inner { position: relative; max-width: 72rem; margin: 0 auto; padding: 3.5rem 1rem 1.5rem; }
@media (min-width: 640px) { .detail-hero-inner { padding: 3.5rem 1.5rem 1.5rem; } }
.back-link { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--muted-foreground); margin-bottom: 1rem; transition: color 0.15s; }
.back-link:hover { color: var(--foreground); }
.detail-region { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted-foreground); }
.detail-title-row { margin-top: 0.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.detail-title { font-size: 1.5rem; font-weight: 600; line-height: 1.2; }
@media (min-width: 640px) { .detail-title { font-size: 2.25rem; } }
.detail-sub { margin-top: 0.5rem; font-size: 0.875rem; color: var(--muted-foreground); max-width: 36rem; }
@media (min-width: 640px) { .detail-sub { font-size: 1rem; } }
.detail-actions { margin-top: 0.75rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; width: 100%; }

.chip-soft {
  display: inline-flex; align-items: center; gap: 0.375rem; border-radius: 9999px;
  background: var(--card); padding: 0.375rem 0.875rem; font-size: 0.75rem; font-weight: 600;
  color: var(--foreground); border: 1px solid var(--border); transition: border-color 0.15s; flex-shrink: 0;
}
.chip-soft:hover { border-color: oklch(0.78 0.17 55 / 0.4); }
.chip-soft .icon { width: 0.875rem; height: 0.875rem; }
.chip-soft.accent-chip { background: oklch(0.74 0.18 45 / 0.1); color: var(--accent); border-color: oklch(0.74 0.18 45 / 0.25); padding: 0.5rem 0.875rem; }
.chip-soft.accent-chip .icon { color: var(--accent); }

.emergency-btn { display: inline-flex; align-items: center; gap: 0.5rem; border-radius: 9999px; background: rgba(255,255,255,0.1); backdrop-filter: blur(20px); padding: 0.375rem 0.75rem; font-size: 0.75rem; font-weight: 600; color: #fff; border: 1px solid rgba(255,255,255,0.25); transition: background 0.15s; }
.emergency-btn:hover { background: rgba(255,255,255,0.2); }
.emergency-btn .icon { width: 1rem; height: 1rem; color: #f87171; }

/* category chips */
.chips-bar { display: flex; gap: 0.5rem; overflow-x: auto; margin-bottom: 1.5rem; padding: 0.5rem 0; border-top: 1px solid oklch(1 0 0 / 0.06); border-bottom: 1px solid oklch(1 0 0 / 0.06); align-items: center; scroll-behavior: smooth; max-width: 100%; }
.chips-wrap { max-width: 72rem; width: 100%; margin: 0 auto; padding: 0.5rem 1rem 0; }
@media (min-width: 640px) { .chips-wrap { padding: 0.5rem 1.5rem 0; } }

.cat-search { flex-shrink: 0; display: inline-flex; align-items: center; border-radius: 9999px; border: 1px solid var(--border); background: var(--card); height: 2.25rem; overflow: hidden; transition: width 0.3s ease, padding 0.3s ease, gap 0.3s ease; width: 2.25rem; padding: 0; gap: 0; justify-content: center; cursor: pointer; }
.cat-search.open { border-color: oklch(0.78 0.17 55 / 0.4); width: 14rem; padding-left: 0.75rem; padding-right: 0.5rem; gap: 0.5rem; justify-content: flex-start; cursor: text; }
@media (min-width: 640px) { .cat-search.open { width: 16rem; } }
.cat-search .icon { width: 1rem; height: 1rem; flex-shrink: 0; color: var(--foreground); }
.cat-search.open .icon { color: var(--muted-foreground); }
.cat-search input { background: transparent; outline: none; border: none; font-size: 0.875rem; color: var(--foreground); flex: 1; min-width: 0; width: 0; opacity: 0; pointer-events: none; }
.cat-search input::placeholder { color: var(--muted-foreground); }
.cat-search.open input { opacity: 1; pointer-events: auto; width: auto; }
.cat-search .clear-x { flex-shrink: 0; color: var(--muted-foreground); display: none; }
.cat-search.open .clear-x { display: inline-flex; }
.cat-search .clear-x .icon { width: 0.875rem; height: 0.875rem; }

.chip {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 0.5rem; border-radius: 9999px;
  padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 500; transition: all 0.2s;
  border: 1px solid var(--border); background: var(--card); color: var(--foreground); white-space: nowrap;
}
.chip:hover { border-color: oklch(0.78 0.17 55 / 0.4); }
.chip.active { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); box-shadow: var(--shadow-soft); }
.chip .icon { width: 1rem; height: 1rem; }
.chip .chip-count { font-size: 0.75rem; color: var(--muted-foreground); }
.chip.active .chip-count { color: oklch(0.18 0.01 90 / 0.7); }

/* app groups */
.app-section { max-width: 72rem; width: 100%; margin: 0 auto; padding: 0 1rem 2.5rem; }
@media (min-width: 640px) { .app-section { padding: 0 1.5rem 2.5rem; } }
.app-groups { display: flex; flex-direction: column; gap: 3rem; }
.group-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.25rem; }
@media (min-width: 640px) { .group-head { gap: 0.75rem; } }
.group-head .icon { width: 1.25rem; height: 1.25rem; color: var(--accent); flex-shrink: 0; }
.group-head h2 { font-size: 1.25rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 640px) { .group-head h2 { font-size: 1.5rem; } }
.group-head .group-count { font-size: 0.875rem; color: var(--muted-foreground); flex-shrink: 0; }

.app-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
@media (min-width: 640px) { .app-grid { gap: 0.75rem; } }
@media (min-width: 768px) { .app-grid { gap: 1rem; } }

.app-card {
  position: relative; border-radius: var(--radius-2xl); background: var(--gradient-card); padding: 0.625rem;
  border: 1px solid var(--border); box-shadow: var(--shadow-soft); transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; overflow: visible; min-width: 0;
}
@media (min-width: 640px) { .app-card { padding: 0.75rem; } }
@media (min-width: 768px) { .app-card { padding: 1.25rem; } }
.app-card:not(.bulk):not(.editing):hover { border-color: oklch(0.78 0.17 55 / 0.4); box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.app-card.bulk { cursor: pointer; }
.app-card.editing { animation: ios-jiggle 0.3s ease-in-out infinite; cursor: default; }

.app-top { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; text-align: center; min-width: 0; }
@media (min-width: 768px) { .app-top { flex-direction: row; align-items: flex-start; gap: 0.75rem; text-align: left; padding-right: 4rem; } }
.logo-slot { display: inline-flex; flex-shrink: 0; }
.app-logo { height: 2.5rem; width: 2.5rem; border-radius: var(--radius-xl); object-fit: cover; border: 1px solid var(--border); background: var(--muted); flex-shrink: 0; }
@media (min-width: 640px) { .app-logo { height: 3rem; width: 3rem; } }
.app-logo-fallback { display: flex; align-items: center; justify-content: center; color: var(--primary-foreground); font-weight: 600; font-size: 1.125rem; background: var(--gradient-hero); }
.app-info { flex: 1; min-width: 0; width: 100%; }
.app-name { font-weight: 600; font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 640px) { .app-name { font-size: 0.875rem; } }
@media (min-width: 768px) { .app-name { font-size: 1rem; } }
.app-cat { font-size: 0.625rem; color: var(--muted-foreground); margin-top: 0.125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 768px) { .app-cat { font-size: 0.75rem; margin-top: 0.25rem; } }
.app-desc { display: none; font-size: 0.875rem; color: var(--muted-foreground); margin-top: 1rem; line-height: 1.5; }
@media (min-width: 768px) { .app-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } }
.app-btns { margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.375rem; min-width: 0; }
@media (min-width: 768px) { .app-btns { margin-top: 1.25rem; flex-direction: row; gap: 0.5rem; } }
.store-btn { min-width: 0; flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem; border-radius: var(--radius-lg); padding: 0.375rem 0.5rem; font-size: 0.6875rem; font-weight: 500; transition: opacity 0.15s; }
@media (min-width: 768px) { .store-btn { border-radius: var(--radius-xl); padding: 0.625rem 0.75rem; font-size: 0.875rem; gap: 0.375rem; } }
.store-btn:hover { opacity: 0.9; }
.store-btn.ios { background: var(--foreground); color: var(--background); }
.store-btn.android { background: var(--accent); color: var(--accent-foreground); }
.store-btn .icon { width: 0.875rem; height: 0.875rem; flex-shrink: 0; }
@media (min-width: 768px) { .store-btn .icon { width: 1rem; height: 1rem; } }
.store-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.users-badge { display: none; position: absolute; top: 0.75rem; right: 0.75rem; align-items: center; gap: 0.25rem; border-radius: 9999px; background: oklch(0.78 0.17 55 / 0.1); color: var(--primary); padding: 0.25rem 0.625rem; font-size: 0.6875rem; font-weight: 600; border: 1px solid oklch(0.78 0.17 55 / 0.2); backdrop-filter: blur(4px); }
@media (min-width: 768px) { .app-card:not(.bulk):not(.editing) .users-badge.show { display: inline-flex; } }
.users-badge .icon { width: 0.75rem; height: 0.75rem; }

.status-badge { position: absolute; top: 0.5rem; right: 0.5rem; z-index: 10; border-radius: 9999px; padding: 0.125rem 0.5rem; font-size: 0.625rem; font-weight: 700; border: 1px solid; }
.status-badge.installed { background: oklch(0.7 0.15 155 / 0.15); color: oklch(0.7 0.15 155); border-color: oklch(0.7 0.15 155 / 0.3); }
.status-badge.update { background: oklch(0.8 0.15 80 / 0.15); color: oklch(0.8 0.15 80); border-color: oklch(0.8 0.15 80 / 0.3); }

.bulk-check { position: absolute; top: 0.375rem; right: 0.375rem; z-index: 10; width: 1.25rem; height: 1.25rem; border-radius: 9999px; display: grid; place-content: center; border: 2px solid var(--border); background: var(--background); }
.bulk-check.checked { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.bulk-check .icon { width: 0.75rem; height: 0.75rem; }

.remove-x { position: absolute; top: -0.375rem; right: -0.375rem; z-index: 20; width: 1.25rem; height: 1.25rem; display: flex; align-items: center; justify-content: center; border-radius: 9999px; background: #3f3f46; color: #fff; border: 2px solid var(--background); box-shadow: 0 1px 2px rgba(0,0,0,0.3); transition: background 0.15s; }
.remove-x:hover { background: #dc2626; }
.remove-x .icon { width: 0.75rem; height: 0.75rem; stroke-width: 3; }

.selected-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1.25rem; }
.selected-head h2 { font-size: 1.125rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 640px) { .selected-head h2 { font-size: 1.25rem; } }

/* bottom bar */
.bulk-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; border-top: 1px solid var(--border); background: oklch(0.27 0.005 90 / 0.95); backdrop-filter: blur(12px); padding: 0.75rem 1rem; padding-bottom: max(0.75rem, env(safe-area-inset-bottom)); }
.bulk-bar-inner { max-width: 72rem; margin: 0 auto; display: flex; gap: 0.5rem; width: 100%; }
.bulk-bar button { flex: 1; min-width: 0; border-radius: var(--radius-xl); padding: 0.75rem; font-size: 0.875rem; font-weight: 600; border: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; transition: background 0.15s; }
.bulk-bar button:hover { background: var(--secondary); }
.bulk-bar button:disabled { opacity: 0.4; pointer-events: none; }
.bulk-bar button.primary { font-weight: 700; background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.bulk-bar button.primary:hover { opacity: 0.9; background: var(--primary); }
.bulk-bar button .icon { width: 1.25rem; height: 1.25rem; }
.has-bottombar { padding-bottom: calc(4.5rem + env(safe-area-inset-bottom)); }

/* ---------- Modals ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,0.6); padding: 0; }
@media (min-width: 640px) { .overlay.center { align-items: center; padding: 1rem; } }
.overlay.info { z-index: 110; }
.overlay.share { z-index: 120; }

.sheet { width: 100%; max-width: 440px; background: #18181b; color: #fff; border-radius: 40px 40px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1); display: flex; flex-direction: column; position: relative; overflow: hidden; }
.sheet-glow { pointer-events: none; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 10rem; height: 10rem; background: oklch(0.7 0.2 45 / 0.15); filter: blur(70px); }
.sheet-grip { width: 3rem; height: 0.375rem; background: #3f3f46; border-radius: 9999px; margin: 0.75rem auto 0.25rem; }
.sheet-head { padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; position: relative; }
.sheet-head .left { display: flex; align-items: center; gap: 0.75rem; }
.sheet-head .ic { width: 2.5rem; height: 2.5rem; background: oklch(0.7 0.2 45 / 0.1); border-radius: 1rem; display: flex; align-items: center; justify-content: center; border: 1px solid oklch(0.7 0.2 45 / 0.2); }
.sheet-head .ic .icon { width: 1.25rem; height: 1.25rem; color: #f97316; }
.sheet-head h3 { font-size: 1.125rem; font-weight: 700; }
.sheet-close { width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center; border-radius: 9999px; background: rgba(63,63,70,0.7); color: #a1a1aa; }
.sheet-close:hover { color: #fff; }
.sheet-close .icon { width: 1rem; height: 1rem; }
.sheet-tabs { padding: 0 1.25rem 0.75rem; display: flex; gap: 0.5rem; }
.sheet-tab { flex: 1; border-radius: 0.75rem; padding: 0.5rem; font-size: 0.75rem; font-weight: 600; background: #27272a; color: #a1a1aa; }
.sheet-tab.active { background: #f97316; color: #fff; }
.sheet-body { padding: 0 1.25rem 2rem; overflow-y: auto; max-height: 65vh; }

.emerg-hero { display: block; position: relative; overflow: hidden; border-radius: 1.5rem; background: rgba(39,39,42,0.5); border: 1px solid rgba(255,255,255,0.05); padding: 1.25rem; transition: transform 0.1s; margin-bottom: 0.75rem; }
.emerg-hero:active { transform: scale(0.98); }
.emerg-hero .row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.emerg-hero .lbl { color: #a1a1aa; font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 0.25rem; }
.emerg-hero .num { color: #fff; font-size: 2.25rem; font-weight: 800; letter-spacing: -0.02em; }
.emerg-hero .call { flex-shrink: 0; width: 3.5rem; height: 3.5rem; background: #10b981; border-radius: 9999px; display: flex; align-items: center; justify-content: center; }
.emerg-hero .call .icon { width: 1.5rem; height: 1.5rem; color: #fff; fill: #fff; }
.emerg-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.emerg-cell { background: rgba(39,39,42,0.4); border: 1px solid rgba(255,255,255,0.05); border-radius: 1rem; padding: 1rem; display: flex; flex-direction: column; justify-content: space-between; height: 8rem; transition: transform 0.1s; }
.emerg-cell:active { transform: scale(0.98); }
.emerg-cell .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.emerg-cell .lbl { color: #71717a; font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emerg-cell .top .icon { width: 1rem; height: 1rem; color: #52525b; flex-shrink: 0; }
.emerg-cell .bot { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.5rem; }
.emerg-cell .num { color: #fff; font-size: 1.5rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emerg-cell .call { flex-shrink: 0; width: 2.25rem; height: 2.25rem; background: oklch(0.7 0.15 155 / 0.15); border-radius: 0.75rem; display: flex; align-items: center; justify-content: center; color: #34d399; }
.emerg-cell .call .icon { width: 1rem; height: 1rem; fill: currentColor; }
.emerg-none { padding: 0 0.25rem 2rem; font-size: 0.875rem; color: #a1a1aa; }

.consulate-search { display: flex; align-items: center; gap: 0.5rem; border-radius: 0.75rem; background: rgba(39,39,42,0.6); padding: 0.5rem 0.75rem; border: 1px solid rgba(255,255,255,0.1); margin-bottom: 0.75rem; }
.consulate-search .icon { width: 1rem; height: 1rem; color: #71717a; flex-shrink: 0; }
.consulate-search input { flex: 1; background: transparent; outline: none; border: none; font-size: 0.875rem; color: #fff; }
.consulate-search input::placeholder { color: #71717a; }
.consulate-list { display: flex; flex-direction: column; gap: 0.5rem; }
.consulate-row { display: block; border-radius: 1rem; background: rgba(39,39,42,0.4); border: 1px solid rgba(255,255,255,0.05); padding: 1rem; transition: transform 0.1s; }
.consulate-row:active { transform: scale(0.98); }
.consulate-row .row { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.consulate-row .cname { font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.consulate-row .csub { font-size: 0.75rem; color: #a1a1aa; margin-top: 0.125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.consulate-row .cphone { font-size: 1.125rem; font-weight: 700; color: #34d399; margin-top: 0.5rem; }
.consulate-row .call { flex-shrink: 0; width: 2.5rem; height: 2.5rem; background: oklch(0.7 0.15 155 / 0.15); border-radius: 0.75rem; display: flex; align-items: center; justify-content: center; color: #34d399; }
.consulate-row .call .icon { width: 1rem; height: 1rem; fill: currentColor; }
.consulate-empty { font-size: 0.875rem; color: #71717a; text-align: center; padding: 1.5rem 0; }

/* Practical info modal */
.info-card { width: 100%; max-width: 28rem; max-height: min(28rem, calc(100dvh - 5.5rem)); overflow: hidden; display: flex; flex-direction: column; border-radius: 28px 28px 0 0; background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); box-shadow: var(--shadow-lift); }
@media (min-width: 640px) { .info-card { border-radius: 1rem; max-height: 80vh; } }
.info-grip { width: 3rem; height: 0.375rem; background: var(--border); border-radius: 9999px; margin: 0.75rem auto 0.25rem; }
@media (min-width: 640px) { .info-grip { display: none; } }
.info-head { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; border-bottom: 1px solid var(--border); padding: 0.75rem 1rem; }
@media (min-width: 640px) { .info-head { padding: 1rem 1.25rem; } }
.info-head .title { font-size: 0.875rem; font-weight: 600; }
.info-close { width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center; border-radius: 9999px; background: var(--secondary); color: var(--muted-foreground); flex-shrink: 0; }
.info-close:hover { color: var(--foreground); }
.info-close .icon { width: 1rem; height: 1rem; }
.info-list { min-height: 0; flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }
@media (min-width: 640px) { .info-list { padding: 1.25rem; } }
.info-item { display: flex; gap: 0.75rem; }
.info-num { flex-shrink: 0; width: 1.5rem; height: 1.5rem; border-radius: 9999px; background: oklch(0.74 0.18 45 / 0.15); color: var(--accent); font-size: 0.75rem; font-weight: 700; display: grid; place-content: center; }
.info-item .it-title { font-weight: 600; font-size: 0.875rem; }
.info-item .it-body { font-size: 0.875rem; color: var(--muted-foreground); margin-top: 0.125rem; line-height: 1.5; }

/* Share modal */
.share-card { width: 100%; max-width: 24rem; border-radius: 1.5rem; background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); box-shadow: var(--shadow-lift); padding: 1.25rem; }
.share-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.share-head h3 { font-weight: 600; font-size: 1.125rem; }
.share-head .sub { font-size: 0.875rem; color: var(--muted-foreground); margin-top: 0.125rem; }
.share-close { color: var(--muted-foreground); }
.share-close:hover { color: var(--foreground); }
.share-close .icon { width: 1.25rem; height: 1.25rem; }
.share-app { font-size: 0.875rem; font-weight: 500; margin-bottom: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-qr { display: flex; justify-content: center; margin-bottom: 1rem; }
.share-qr img { border-radius: 0.75rem; border: 1px solid var(--border); background: #fff; padding: 0.5rem; }
.share-btns { display: flex; gap: 0.5rem; }
.share-btns button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; border-radius: 0.75rem; padding: 0.625rem; font-size: 0.875rem; font-weight: 500; transition: opacity 0.15s; }
.share-btns button:hover { opacity: 0.9; }
.share-btns .primary { background: var(--primary); color: var(--primary-foreground); }
.share-btns .secondary { background: var(--secondary); color: var(--secondary-foreground); }
.share-btns .icon { width: 1rem; height: 1rem; }

/* ---------- Page transition (iOS push/pop) ---------- */
.page { position: relative; }
.page.push-in { animation: ios-push-in 0.38s cubic-bezier(0.25,0.46,0.45,0.94) both; }
.page.pop-in { animation: ios-pop-in 0.34s cubic-bezier(0.25,0.46,0.45,0.94) both; }
.page-leaving { position: absolute; top: 0; left: 0; right: 0; z-index: 1; pointer-events: none; }
.page-leaving.push-out { animation: ios-push-out 0.38s cubic-bezier(0.25,0.46,0.45,0.94) both; }
.page-leaving.pop-out { animation: ios-pop-out 0.34s cubic-bezier(0.25,0.46,0.45,0.94) both; box-shadow: -4px 0 24px rgba(0,0,0,0.28); }
.page.push-in, .page.pop-in { z-index: 2; }
.page.push-in { box-shadow: -4px 0 24px rgba(0,0,0,0.28); }
#view { position: relative; overflow-x: clip; flex: 1; display: flex; flex-direction: column; }

@keyframes ios-push-in  { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes ios-push-out { from { transform: translateX(0); } to { transform: translateX(-28%); } }
@keyframes ios-pop-in   { from { transform: translateX(-28%); } to { transform: translateX(0); } }
@keyframes ios-pop-out  { from { transform: translateX(0); } to { transform: translateX(100%); } }
@keyframes ios-jiggle { 0%,100% { transform: rotate(-1deg); } 50% { transform: rotate(1deg); } }

@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes overlay-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes sheet-out { from { transform: translateY(0); } to { transform: translateY(100%); } }
@keyframes dropdown-in { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes dropdown-out { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-8px) scale(0.98); } }

.anim-overlay-in { animation: overlay-in 0.2s ease both; }
.anim-overlay-out { animation: overlay-out 0.2s ease both; }
.anim-sheet-in { animation: sheet-in 0.32s cubic-bezier(0.25,0.46,0.45,0.94) both; }
.anim-sheet-out { animation: sheet-out 0.26s ease both; }
.anim-dropdown-in { animation: dropdown-in 0.18s ease both; }
.anim-dropdown-out { animation: dropdown-out 0.18s ease both; }

@media (prefers-reduced-motion: reduce) {
  .page, .page-leaving { animation: none !important; }
}

[dir="rtl"] .toolbar { text-align: right; }
