        /* ── METRICS ────────────────────────────── */
        .metrics {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            border: 1px solid var(--border);
            border-radius: 8px;
            overflow: hidden;
            margin-bottom: 20px;
        }

        .metric {
            padding: 18px 20px;
            background: var(--surface);
            border-right: 1px solid var(--border);
        }

        .metric:last-child {
            border-right: none
        }

        .metric-val {
            font-family: 'Geist Mono', monospace;
            font-size: 1.4286rem;
            font-weight: 500;
            color: var(--text);
            letter-spacing: -.02em;
        }

        .metric-lbl {
            font-size: 0.7857rem;
            color: var(--text2);
            margin-top: 3px
        }

        /* ── BLOCK ──────────────────────────────── */
        .block {
            border: 1px solid var(--border);
            border-radius: 8px;
            overflow: hidden;
            margin-bottom: 14px;
        }

        .block-head {
            padding: 11px 18px;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: var(--surface);
        }

        .block-title {
            font-size: 0.7857rem;
            font-weight: 500;
            color: var(--text2);
            letter-spacing: .07em;
            text-transform: uppercase;
        }

        .block-body {
            padding: 18px;
            background: var(--bg)
        }

        /* ── FORM ───────────────────────────────── */
        .field {
            margin-bottom: 14px
        }

        .field:last-child {
            margin-bottom: 0
        }

        .field-label {
            display: block;
            font-size: 0.7857rem;
            color: var(--text2);
            margin-bottom: 6px;
            letter-spacing: .04em;
        }

        input[type=text],
        input[type=password],
        input[type=datetime-local],
        select,
        textarea {
            width: 100%;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 6px;
            color: var(--text);
            font-family: 'Geist', sans-serif;
            font-size: 0.9286rem;
            padding: 9px 12px;
            outline: none;
            transition: border-color .15s;
            -webkit-appearance: none;
            appearance: none;
        }

        input:focus,
        select:focus,
        textarea:focus {
            border-color: var(--border2)
        }

        input::placeholder,
        textarea::placeholder {
            color: var(--text3)
        }

        textarea {
            resize: vertical;
            min-height: 90px;
            line-height: 1.6
        }

        select {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 10px center;
            padding-right: 30px
        }

        select option {
            background: var(--surface)
        }

        .mono {
            font-family: 'Geist Mono', monospace;
            font-size: 0.8571rem
        }

        .hindi {
            font-size: 1.0714rem;
            line-height: 1.75
        }

        .hint {
            font-size: 0.7857rem;
            color: var(--text3);
            margin-top: 5px
        }

        .flex-between {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 6px
        }

        /* ── LANG PILLS ─────────────────────────── */
        .lang-pills {
            display: inline-flex;
            border: 1px solid var(--border);
            border-radius: 5px;
            overflow: hidden;
        }

        .lang-pill {
            padding: 4px 14px;
            font-size: 0.7857rem;
            cursor: pointer;
            color: var(--text2);
            background: transparent;
            border: none;
            font-family: 'Geist', sans-serif;
            transition: all .15s;
        }

        .lang-pill+.lang-pill {
            border-left: 1px solid var(--border)
        }

        .lang-pill.active {
            background: var(--surface2);
            color: var(--text)
        }

        /* ── COST STRIP ─────────────────────────── */
        .cost-strip {
            display: flex;
            flex-wrap: wrap;
            gap: 12px 20px;
            padding: 10px 14px;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 6px;
            margin-top: 12px;
        }

        .ci {
            font-size: 0.7857rem;
            color: var(--text2)
        }

        .ci strong {
            color: var(--text);
            font-weight: 500;
            font-family: 'Geist Mono', monospace
        }

        /* ── ROW ITEMS ──────────────────────────── */
        .row-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 0;
            border-bottom: 1px solid var(--border);
            gap: 16px;
        }

        .row-item:last-child {
            border-bottom: none;
            padding-bottom: 0
        }

        .row-item:first-child {
            padding-top: 0
        }

        .row-label {
            font-size: 0.9286rem;
            color: var(--text)
        }

        .row-sub {
            font-size: 0.7857rem;
            color: var(--text2);
            margin-top: 2px
        }

        .row-right {
            flex-shrink: 0
        }

        /* ── TOGGLE ─────────────────────────────── */
        .toggle {
            position: relative;
            width: 36px;
            height: 20px;
            flex-shrink: 0
        }

        .toggle input {
            opacity: 0;
            width: 0;
            height: 0;
            position: absolute
        }

        .tog-track {
            position: absolute;
            inset: 0;
            background: var(--surface2);
            border: 1px solid var(--border);
            border-radius: 20px;
            cursor: pointer
        }

        .tog-thumb {
            position: absolute;
            width: 12px;
            height: 12px;
            background: var(--text3);
            border-radius: 50%;
            top: 3px;
            left: 3px;
            transition: transform .2s, background .2s;
            pointer-events: none
        }

        .toggle input:checked~.tog-track {
            border-color: var(--border2)
        }

        .toggle input:checked~.tog-track .tog-thumb {
            transform: translateX(16px);
            background: var(--text)
        }

        /* ── BUTTON ─────────────────────────────── */
        .btn {
            width: 100%;
            padding: 10px 20px;
            background: var(--text);
            color: var(--bg);
            border: none;
            border-radius: 6px;
            font-family: 'Geist', sans-serif;
            font-size: 0.9286rem;
            font-weight: 500;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: opacity .15s;
            letter-spacing: .01em;
        }

        .btn:hover {
            opacity: .88
        }

        .btn:active {
            opacity: .75
        }

        .btn:disabled {
            opacity: .25;
            cursor: not-allowed
        }

        /* ── PROGRESS ───────────────────────────── */
        .prog-wrap {
            margin-top: 14px;
            display: none
        }

        .prog-wrap.show {
            display: block
        }

        .prog-track {
            height: 1px;
            background: var(--surface2);
            margin-bottom: 8px;
            overflow: hidden
        }

        .prog-fill {
            height: 100%;
            background: var(--text);
            width: 0%;
            transition: width .3s ease
        }

        .prog-lbl {
            font-size: 0.7857rem;
            color: var(--text2);
            font-family: 'Geist Mono', monospace
        }

        /* ── LOG ─────────────────────────────────── */
        .log {
            margin-top: 12px;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 6px;
            padding: 12px 14px;
            max-height: 150px;
            overflow-y: auto;
            display: none;
            -webkit-overflow-scrolling: touch;
        }

        .log.show {
            display: block
        }

        .log-line {
            font-size: 0.7857rem;
            padding: 2px 0;
            color: var(--text2);
            font-family: 'Geist Mono', monospace;
            border-bottom: 1px solid var(--border);
        }

        .log-line:last-child {
            border-bottom: none
        }

        .log-line.ok {
            color: var(--success)
        }

        .log-line.err {
            color: var(--error)
        }

        /* ── BADGE ──────────────────────────────── */
        .badge {
            font-size: 0.7143rem;
            padding: 2px 8px;
            border-radius: 4px;
            font-weight: 500;
            font-family: 'Geist Mono', monospace;
            background: rgba(62, 207, 142, .08);
            color: var(--success);
            border: 1px solid rgba(62, 207, 142, .15);
            white-space: nowrap;
        }

        /* ── HISTORY ─────────────────────────────── */
        .hist-row {
            padding: 14px 18px;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 14px;
        }

        .hist-row:last-child {
            border-bottom: none
        }

        .hist-msg {
            font-size: 0.9286rem;
            color: var(--text);
            margin-bottom: 3px;
            line-height: 1.5
        }

        .hist-meta {
            font-size: 0.7857rem;
            color: var(--text2);
            font-family: 'Geist Mono', monospace
        }

        .empty {
            padding: 40px 20px;
            text-align: center;
            color: var(--text3);
            font-size: 0.9286rem
        }

        /* ── TABS (content sections) ────────────── */
        .tab-section {
            display: none !important;
            position: absolute;
            inset: 0;
            overflow-y: auto;
            padding: 40px 48px 60px;
            -webkit-overflow-scrolling: touch;
        }

        @media (max-width: 599px) {
            .tab-section {
                position: relative;
                height: auto;
                overflow-y: visible;
            }
        }

        .tab-section.active {
            display: block !important;
        }

        /* ── CONTACTS TABLE ─────────────────────── */
        .table-wrap {
            overflow-x: auto;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--surface);
            -webkit-overflow-scrolling: touch;
        }

        .table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.9286rem;
            text-align: left;
        }

        .table th, .table td {
            padding: 12px 16px;
            border-bottom: 1px solid var(--border);
            white-space: nowrap;
        }

        .table th {
            font-weight: 500;
            color: var(--text2);
            background: var(--surface2);
            text-transform: uppercase;
            font-size: 0.7857rem;
            letter-spacing: .05em;
        }

        .table tr:last-child td {
            border-bottom: none;
        }

        .table tr:hover td {
            background: var(--surface2);
        }

        .checkbox {
            width: 16px;
            height: 16px;
            accent-color: var(--text);
            cursor: pointer;
        }

        .controls-row {
            display: flex;
            gap: 10px;
            margin-bottom: 14px;
            flex-wrap: wrap;
        }

        .controls-row > * {
            flex: 1;
            min-width: 150px;
        }

        .btn-secondary {
            background: var(--surface2);
            color: var(--text);
            border: 1px solid var(--border);
        }

        .btn-secondary:hover {
            background: var(--border);
        }

        .btn-danger {
            background: rgba(248, 113, 113, 0.1);
            color: var(--error);
            border: 1px solid rgba(248, 113, 113, 0.2);
        }

        .btn-danger:hover {
            background: rgba(248, 113, 113, 0.2);
        }

        .btn-sm {
            padding: 8px 14px;
            font-size: 0.8571rem;
            width: auto;
        }

        .file-drop {
            display: block;
            border: 1px dashed var(--border2);
            border-radius: 8px;
            padding: 30px 20px;
            text-align: center;
            background: var(--surface);
            transition: border-color 0.2s;
            cursor: pointer;
        }

        .file-drop:hover, .file-drop.dragover {
            border-color: var(--text3);
        }

        .file-drop input {
            display: none;
        }

        .file-drop p {
            color: var(--text2);
            font-size: 0.9286rem;
            margin-bottom: 4px;
        }

        /* ── RESPONSIVE OVERRIDES ───────────────── */
        @media(max-width: 599px) {
            #tab-contacts .table th:nth-child(4),
            #tab-contacts .table td:nth-child(4) {
                display: none;
            }
            input[type=text], input[type=password], select, textarea {
                font-size: 16px !important;
            }
            .btn {
                min-height: 44px;
            }
            .metric-val {
                font-size: 1.1rem !important;
            }
            .metric {
                padding: 10px 5px !important;
            }
            .block-body {
                padding: 12px !important;
            }
            .block-head {
                padding: 10px 12px !important;
            }
            #fab-settings {
                bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 10px) !important;
            }
            #theme-pop {
                bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 60px) !important;
            }
        }

