/* Mintro by HaZix. System fonts only. Logical properties so Arabic (RTL) just works. */
:root {
  color-scheme: light dark;
  /* HaZix palette: gradient #22d3ee > #3b82f6 > #a855f7; the darker --grad keeps white text at >= 5:1 on every stop */
  --accent: #3b82f6;          /* solid accent for focus rings, borders, spinner */
  --accent-ink: #1d4ed8;      /* accent used as text (6.7:1 on white) */
  --grad: linear-gradient(135deg, #0e7490, #2563eb, #7e22ce);
  --grad-bright: linear-gradient(135deg, #22d3ee, #3b82f6, #a855f7);
  --zg: linear-gradient(135deg, #2563eb, #9333ea);
  --bg: #f3f6fc;
  --surface: #ffffff;
  --surface-2: #e9eefb;
  --text: #0f1630;
  --muted: #56607e;
  --border: #dfe6f5;
  --danger: #c0262d;
  --seg-on: #ffffff;
  --card: #3b82f6;
  --card-ink: #1d4ed8;
  --card-fill: var(--grad);
  --card-strip: var(--grad-bright);
  --shadow: 0 1px 2px rgba(15, 22, 48, .06), 0 10px 28px -10px rgba(37, 99, 235, .28);
  --radius: 20px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, "Noto Sans", "Noto Sans Arabic", "Geeza Pro", "Noto Sans Hebrew", "Noto Sans Thai", "Thonburi", "Noto Sans Devanagari", "Noto Sans Bengali",
    "PingFang SC", "Hiragino Sans", "Apple SD Gothic Neo", "Noto Sans CJK SC", "Microsoft YaHei", "Malgun Gothic", "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #60a5fa;
    --accent-ink: #93c5fd;
    --zg: linear-gradient(135deg, #60a5fa, #c084fc);
    --bg: #0b1020;
    --surface: #131a33;
    --surface-2: #1b2447;
    --text: #eef2ff;
    --muted: #a1abc9;
    --border: #263058;
    --danger: #ff7b80;
    --seg-on: #2b3a6e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 14px 34px -10px rgba(0, 0, 0, .65);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--text);
  font: 16px/1.45 var(--font);
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
/* Scripts with tall marks (Thai, Devanagari, Bengali) need more line height; their letters must not be spaced out or upper-cased. */
:root:is(:lang(th), :lang(hi), :lang(bn)) body { line-height: 1.6; }
:root:is(:lang(th), :lang(hi), :lang(bn), :lang(ja), :lang(ko), :lang(zh), :lang(ar), :lang(fa), :lang(ur), :lang(he)) .group-title { letter-spacing: 0; text-transform: none; font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); font-size: 14px; }
.grow { flex: 1; min-width: 0; }
.ico { display: inline-flex; width: 22px; height: 22px; flex: none; }
.ico svg { width: 100%; height: 100%; }
:root[dir="rtl"] .flip svg { transform: scaleX(-1); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }

/* layout */
#app { max-width: 560px; margin: 0 auto; }
.screen {
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  animation: rise .22s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } * { transition: none !important; } }

/* brand header */
.top { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 18px; }
.brand { display: flex; align-items: center; gap: 12px; direction: ltr; } /* the brand is Latin text: mark, then name, in both languages */
.mark { display: inline-flex; flex: none; filter: drop-shadow(0 4px 8px rgba(59, 130, 246, .3)); }
.mark svg { width: 100%; height: 100%; }
.brand-text { line-height: 1.05; }
.brand-name { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.brand-by { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: .02em; direction: ltr; unicode-bidi: isolate; }
.zg { color: var(--accent-ink); font-weight: 800; }
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .zg { background: var(--zg); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
}
:root[dir="rtl"] .brand-name { letter-spacing: 0; }

/* sub-page bar */
.bar { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; min-height: 48px; }
.bar-title { flex: 1; margin: 0; font-size: 20px; font-weight: 700; text-align: center; }
.bar-spacer { width: 44px; flex: none; }

/* buttons */
.icon-btn {
  width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); border-radius: 14px; color: var(--text);
}
.icon-btn.sm { width: 44px; height: 44px; border-color: transparent; background: transparent; color: var(--muted); }
.btn {
  min-width: 0; text-align: center; line-height: 1.25; overflow-wrap: break-word;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border-radius: 14px; border: 1px solid transparent;
  font-weight: 700; font-size: 16px; text-decoration: none; transition: transform .1s, filter .15s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 8px 18px -8px rgba(37, 99, 235, .8); }
.btn.ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn.link { background: transparent; color: var(--accent-ink); min-height: 44px; }
.btn.danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.btn.sm { min-height: 44px; padding: 8px 14px; font-size: 15px; border-radius: 12px; }
.btn.lg { min-height: 54px; font-size: 17px; border-radius: 16px; padding-inline: 22px; }
.btn:disabled { opacity: .6; cursor: default; }

/* avatar */
.avatar {
  width: 56px; height: 56px; flex: none; border-radius: 50%; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card-fill); color: #fff; font-weight: 700; font-size: 20px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.sq { border-radius: 22%; box-shadow: 0 0 0 1px var(--border); } /* a white logo square keeps a visible edge on a white card */
.avatar.sm { width: 44px; height: 44px; font-size: 16px; }
.avatar.lg { width: 96px; height: 96px; font-size: 34px; }

/* card previews, look like a physical card */
.cards { display: grid; gap: 16px; padding-bottom: 96px; }
.pcard {
  position: relative; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--border); overflow: hidden;
}
.pcard-strip { height: 8px; background: var(--card-strip); }
.pcard-main {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 18px 16px 12px; border: 0; background: none;
  text-align: start; position: relative;
}
.pcard-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pcard-name { font-size: 19px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.pcard-job { color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.pcard-company { font-size: 14px; font-weight: 600; margin-top: 2px; overflow-wrap: anywhere; }
.chip {
  flex: none; align-self: flex-start; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--card) 14%, transparent); color: var(--card-ink); max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (prefers-color-scheme: dark) { .chip { color: color-mix(in srgb, var(--card) 40%, #fff); } }
.pcard-actions { display: flex; gap: 10px; padding: 4px 16px 16px; }
.pcard-actions .btn { flex: 1 1 0; padding-inline: 10px; gap: 6px; } /* equal halves: long words (Bearbeiten, Показать) need the room */

.fab-wrap {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 5; pointer-events: none;
  padding: 24px 16px calc(16px + env(safe-area-inset-bottom)); display: flex; justify-content: center;
  background: linear-gradient(to top, var(--bg) 40%, transparent);
}
.fab { pointer-events: auto; box-shadow: 0 14px 28px -10px rgba(37, 99, 235, .9); min-width: 200px; }

/* empty state */
.empty { text-align: center; padding: 18px 8px 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.empty h2 { margin: 18px 0 4px; font-size: 24px; letter-spacing: -.01em; }
.empty p { margin: 0 0 20px; color: var(--muted); max-width: 32ch; }
.empty-art { position: relative; width: 240px; height: 150px; margin-top: 12px; }
.ghost-card {
  position: absolute; inset-inline: 0; margin: auto; height: 112px; border-radius: 18px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.ghost-card.g2 { width: 76%; top: 0; opacity: .5; }
.ghost-card.g1 { width: 88%; top: 14px; opacity: .8; }
.ghost-card.g0 { width: 100%; top: 30px; display: flex; align-items: center; gap: 14px; padding: 0 18px; border-top: 8px solid var(--card); }
.ghost-lines { display: flex; flex-direction: column; gap: 9px; flex: 1; }
.ghost-lines i { display: block; height: 9px; border-radius: 5px; background: var(--surface-2); }
.ghost-lines i:first-child { width: 80%; background: color-mix(in srgb, var(--text) 18%, transparent); }
.ghost-lines i:last-child { width: 55%; }

/* forms */
.form { display: grid; gap: 18px; }
.group { display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.form .group { margin-bottom: 0; }
.group-title { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.field { display: grid; gap: 6px; min-width: 0; }
.lbl { font-size: 14px; font-weight: 600; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px; border: 1.5px solid var(--border);
  background: var(--bg); font-size: 16px; /* 16px keeps iOS from zooming on focus */ appearance: none; -webkit-appearance: none;
}
textarea.input { resize: vertical; min-height: 84px; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
input[dir="ltr"], textarea[dir="ltr"] { text-align: start; } /* an LTR field starts at its own left edge, also inside an RTL page: numbers and links read left to right */
:root[dir="rtl"] input[dir="ltr"] { text-align: end; }
.sel {
  width: auto; flex: none; max-width: 118px; padding-inline-end: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
:root[dir="rtl"] .sel { background-position: 17px 55%, 12px 55%; }
.rows { display: grid; gap: 8px; }
.row-edit { display: flex; gap: 6px; align-items: center; }
.add-row { justify-self: start; }
.form-actions { display: grid; gap: 12px; }
.photo-box { display: flex; align-items: center; gap: 16px; justify-content: center; padding: 6px 0 2px; flex-wrap: wrap; }
.photo-pick { position: relative; border: 0; background: none; padding: 0; border-radius: 50%; }
.photo-pick.sq { border-radius: 22%; }
.shape-row { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: -6px; }
.shape-row .lbl { flex: none; }
.shape-seg { flex: 1 1 220px; max-width: 300px; }
.shape-seg .seg-btn { font-size: 14px; padding-inline: 6px; }
.photo-pick .avatar { box-shadow: 0 8px 20px -8px var(--card); }
.photo-badge {
  position: absolute; inset-inline-end: -2px; bottom: -2px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--bg); color: var(--accent-ink); display: flex; align-items: center; justify-content: center;
}
.photo-badge .ico { width: 18px; height: 18px; }
.photo-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.photo-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches { display: flex; flex-wrap: wrap; gap: 12px; padding: 4px 2px; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--muted) 55%, transparent); padding: 0; }
.swatch.on { box-shadow: 0 0 0 3px var(--text); }
.swatch.hz { background: var(--grad-bright); }

/* segmented control */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 16px; background: var(--surface-2); }
.seg-btn { min-height: 44px; min-width: 0; padding: 6px 8px; line-height: 1.2; overflow-wrap: break-word; border: 0; background: transparent; border-radius: 12px; font-weight: 700; color: var(--muted); }
.seg-btn.on { background: var(--seg-on); color: var(--text); box-shadow: 0 2px 8px rgba(21, 20, 43, .14); }

/* QR screen */
.qr-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.qr-who { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.qr-who .chip { max-width: 100%; }
.qr-who strong { font-size: 19px; overflow-wrap: anywhere; }
.qr-card {
  background: #fff; border-radius: 28px; padding: 14px; box-shadow: var(--shadow); border: 1px solid var(--border);
  border-top: 8px solid var(--card); margin-bottom: 16px;
}
.qr-box { width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; color: #0f1630; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr-error { margin: 0; padding: 16px; text-align: center; font-size: 15px; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid #dfe6f5; border-top-color: #3b82f6; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.qr-screen .seg { margin-bottom: 12px; }
.note { margin: 0 0 10px; color: var(--muted); text-align: center; font-size: 14.5px; }
.warn { margin: 0 0 12px; padding: 10px 14px; border-radius: 14px; font-size: 14px; background: color-mix(in srgb, #f59e0b 16%, var(--surface)); border: 1px solid color-mix(in srgb, #f59e0b 45%, transparent); }
.qr-url { margin: 0 0 12px; text-align: center; color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.qr-url:empty { display: none; }
.qr-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.qr-actions:empty { display: none; }
.qr-actions .btn { flex: 1; min-width: 140px; }
.hint { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 18px 0 0; color: var(--muted); font-size: 14px; text-align: center; }
.hint .ico { width: 18px; height: 18px; }

/* settings */
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.backup-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.backup-row .grow { display: flex; flex-direction: column; min-width: 120px; }
.about .brand { margin: 4px 0; }
.about p { margin: 0; }
.about-title { margin: 0; font-size: 20px; font-weight: 800; }
.about-tag { font-weight: 700; line-height: 1.4; }
.about-list { margin: 0; padding-inline-start: 22px; color: var(--muted); font-size: 14.5px; display: grid; gap: 6px; }
.about-sub { margin: 6px 0 0; font-size: 16px; font-weight: 800; }
.about-foot { padding-top: 10px; border-top: 1px solid var(--border); font-size: 14px; }
.about-foot a { color: var(--accent-ink); font-weight: 700; text-decoration: none; }
.about-ver { font-size: 13px; }

/* language list (Settings) */
.lang-picker { display: grid; gap: 10px; }
.lang-list { position: relative; display: grid; gap: 4px; max-height: 320px; overflow-y: auto; overscroll-behavior: contain; padding: 4px; border-radius: 16px; background: var(--surface-2); }
.lang-item {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 12px;
  background: transparent; text-align: start; color: var(--text); font-size: 16px; font-weight: 600;
}
.lang-item.on { background: var(--seg-on); box-shadow: 0 2px 8px rgba(21, 20, 43, .14); }
.lang-item.on::after { content: "\2713"; order: 3; color: var(--accent-ink); font-weight: 800; }
.lang-native { min-width: 0; overflow-wrap: anywhere; }
.lang-en { margin-inline-start: auto; font-size: 13px; font-weight: 500; color: var(--muted); }
.lang-none { margin: 0; text-align: center; }

/* toast */
#toast {
  position: fixed; inset-inline: 16px; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60; margin-inline: auto; width: fit-content; max-width: min(92vw, 460px);
  padding: 12px 18px; border-radius: 14px; background: #0f1630; color: #fff; font-size: 15px; font-weight: 600; text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: none; }
@media (prefers-color-scheme: dark) { #toast { background: #eef2ff; color: #0f1630; } }


/* share row (QR screen) */
.share-block { margin: 14px 0 0; display: grid; gap: 10px; }
.share-title { margin: 6px 0 0; font-size: 13px; font-weight: 700; color: var(--muted); text-align: center; }
.share-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sbtn {
  overflow-wrap: break-word; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 64px; padding: 8px 6px;
  border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; line-height: 1.2; text-decoration: none; text-align: center;
}
.sbtn:active { transform: scale(.97); }
.sbtn .ico { color: var(--accent-ink); }
.sbtn:disabled { opacity: .6; cursor: default; }
.download-btn { width: 100%; }

/* portfolio / files */
.file-hint { margin: 0; }
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.file-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); }
.file-ico { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-ink); }
.file-main { display: grid; gap: 4px; min-width: 0; }
.file-main .input { min-height: 44px; padding: 8px 12px; font-weight: 600; }
.file-meta { font-size: 12.5px; color: var(--muted); }
.file-progress { grid-column: 1 / -1; display: grid; gap: 4px; }
.file-progress progress { width: 100%; height: 8px; border-radius: 4px; accent-color: var(--accent); }
.files { display: grid; gap: 12px; }
.file-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.file-err { margin: 0; color: var(--danger); font-size: 14px; }

.qr-urlrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.qr-urlrow:empty { display: none; }
.qr-urlrow .qr-url { margin: 0; text-align: start; flex: 1; min-width: 0; }
.file-row.send { grid-template-columns: auto 1fr auto; }
.file-act { display: inline-flex; }
.file-name { overflow-wrap: anywhere; }

.limit-note { pointer-events: auto; margin: 0; padding: 8px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: 14px; text-align: center; max-width: 420px; }
.fab-wrap { flex-direction: column; align-items: center; gap: 10px; }
.btn:disabled { filter: grayscale(.6); }
.update-bar {
  position: fixed; inset-inline: 12px; top: calc(10px + env(safe-area-inset-top)); z-index: 30; margin-inline: auto; max-width: 460px; min-height: 48px;
  border: 0; border-radius: 14px; background: var(--grad); color: #fff; font-weight: 700; font-size: 15px; box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}

/* Apple Wallet (decision 16): black like Apple's own "Add to Apple Wallet" button */
.btn.wallet-btn { width: 100%; background: #000; color: #fff; border-color: #000; }
@media (prefers-color-scheme: dark) { .btn.wallet-btn { border-color: #3a3a3c; } }

/* phone rows: [type] [country] [number] (decision 18). Two lines on a phone, one line from 480px. */
.phone-edit { display: grid; gap: 4px; }
.phone-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "type . rm" "cc num num"; gap: 6px; align-items: center; }
.phone-row .sel { grid-area: type; }
.phone-row .cc-btn { grid-area: cc; }
.phone-row .num { grid-area: num; min-width: 0; }
.phone-row .icon-btn { grid-area: rm; }
@media (min-width: 480px) {
  .phone-row { grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "type cc num rm"; }
}
.phone-hint { margin: 0; font-size: 13px; color: var(--danger); }
.phone-hint[hidden] { display: none; }
.cc-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 8px 10px; border-radius: 14px; border: 1.5px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit; font-size: 16px; font-weight: 600; unicode-bidi: isolate; white-space: nowrap;
}
.cc-btn:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.cc-flag { font-size: 22px; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.cc-code, .cc-dial { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.cc-caret { width: 7px; height: 7px; margin-inline-start: 2px; border-inline-end: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); flex: none; }

/* country picker: a full-screen sheet on a phone, a centred sheet on a wider screen */
body.modal-open { overflow: hidden; }
.cc-overlay { position: fixed; inset: 0; z-index: 30; display: flex; align-items: stretch; justify-content: center; background: rgba(8, 12, 28, .55); }
.cc-sheet {
  display: flex; flex-direction: column; width: 100%; max-width: 520px; min-height: 0; background: var(--bg);
  padding: env(safe-area-inset-top) 12px env(safe-area-inset-bottom);
}
@media (min-width: 560px) {
  .cc-overlay { align-items: center; padding: 24px; }
  .cc-sheet { max-height: min(720px, 100%); border-radius: 22px; box-shadow: var(--shadow); }
}
.cc-bar { padding-inline: 0; }
.cc-search { padding: 4px 0 8px; }
.cc-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; align-content: start; gap: 2px; padding-bottom: 12px; }
.cc-head { margin: 10px 4px 2px; font-size: 13px; font-weight: 700; color: var(--muted); }
.cc-item, .cc-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 12px; border: 0; border-radius: 12px;
  background: transparent; color: var(--text); font: inherit; font-size: 16px; font-weight: 600; text-align: start;
}
.cc-row { border: 1.5px solid var(--border); background: var(--bg); }
.cc-item.on { background: var(--seg-on); box-shadow: 0 2px 8px rgba(21, 20, 43, .14); }
.cc-item:active, .cc-row:active { transform: scale(.99); }
.cc-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cc-dial { flex: none; font-size: 15px; font-weight: 500; color: var(--muted); }
.cc-none { margin: 0; text-align: center; padding: 18px 0; }
.cc-setting { display: grid; gap: 8px; justify-items: start; }
.cc-setting .cc-row { width: 100%; }
.cc-setting p { margin: 0; }

/* photo crop screen: dark, full screen; the picture moves under a fixed frame */
.crop-overlay {
  position: fixed; inset: 0; z-index: 40; display: flex; justify-content: center; background: #070b17; color: #eef2ff; color-scheme: dark;
  --bg: #0b1020; --surface: #1b2447; --surface-2: #1b2447; --text: #eef2ff; --muted: #a1abc9; --border: #33407a; --seg-on: #34457e;
  --accent: #60a5fa; --accent-ink: #93c5fd;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.crop-col { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 560px; min-height: 0; padding: 0 12px 12px; }
.crop-bar { display: flex; align-items: center; gap: 8px; min-height: 60px; flex: none; }
.crop-bar .bar-title { font-size: 18px; min-width: 0; overflow-wrap: anywhere; }
.crop-bar .btn { flex: none; min-width: 84px; }
.crop-stage {
  position: relative; flex: 1 1 0; min-height: 180px; overflow: hidden; border-radius: 16px; background: #0e1428;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: grab;
}
.crop-stage:active { cursor: grabbing; }
.crop-stage:focus-visible { outline-offset: -3px; }
.crop-img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; will-change: transform; pointer-events: none; -webkit-user-drag: none; }
.crop-img.anim { transition: transform .18s ease-out; }
.crop-paper { position: absolute; background: #fff; border-radius: 50%; pointer-events: none; } /* what stays empty around a small picture is saved white */
.crop-frame {
  position: absolute; box-sizing: border-box; border: 2px solid rgba(255, 255, 255, .95); border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 100vmax rgba(7, 11, 23, .62);
}
.crop-frame.sq, .crop-paper.sq { border-radius: 22%; }
.crop-hint { margin: 0; flex: none; text-align: center; font-size: 14px; color: var(--muted); }
.crop-shape { flex: none; }
.crop-zoom { display: flex; align-items: center; gap: 8px; flex: none; }
.crop-range { flex: 1; min-width: 0; height: 44px; margin: 0; accent-color: var(--accent); background: transparent; }
.crop-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: none; }
.crop-actions .btn { min-width: 0; }
@media (max-height: 560px) { .crop-hint { display: none; } .crop-bar { min-height: 52px; } }
