:root {
    --bg: #f7f9fc;
    --text: #111827;
    --muted: #6b7280;
    --border: rgba(0,0,0,0.08);
    --icon-a: rgba(25,118,210,.14);
    --icon-b: rgba(25,118,210,.07);
    --stroke: #1f48a8;
}
.dark-mode {
    --bg: #0f172a;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --border: rgba(255,255,255,0.12);
    --icon-a: rgba(96,165,250,.22);
    --icon-b: rgba(25,118,210,.16);
    --stroke: #9cc3ff;
}
*, *::before, *::after { box-sizing: border-box; }
html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
}
body {
    position: fixed;
    inset: 0;
    height: 100dvh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    display: grid;
    place-items: center;
    padding: 12px;
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-right: calc(12px + env(safe-area-inset-right));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    padding-left: calc(12px + env(safe-area-inset-left));
    line-height: 1.45;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
.wrap {
    width: min(92vw, 520px);
    margin: 0 auto;
    gap: 12px;
    text-align: center;
    display: grid;
}
.ico {
    margin: 0 auto;
    display: grid;
    place-items: center;
    background: none;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
}
.ico svg {
    width: clamp(44px, 12vw, 72px);
    height: clamp(44px, 12vw, 72px);
}
.msg {
    line-height: 1.22;
    font-weight: 800;
    letter-spacing: -.01em;
    font-size: clamp(0.95rem, 0.9rem + 1.6vw, 1.45rem);
}
.hint {
    color: var(--muted);
    font-size: clamp(.86rem, .84rem + .5vw, .98rem);
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}
.error-toggle {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: none;
    border: none;
    transition: transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1); /* Sekinroq va silliqroq */
}
.error-toggle svg {
    width: clamp(20px, 5vw, 24px);
    height: clamp(20px, 5vw, 24px);
    fill: none;
    stroke: var(--stroke);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.error-toggle.active svg {
    transform: rotate(90deg);
}
.error-toggle:hover svg {
    stroke: var(--text);
}
.error-details {
    display: block;
    color: var(--muted);
    font-size: clamp(0.86rem, 0.84rem + 0.5vw, .98rem);
    margin-top: 8px;
    text-align: left;
    white-space: pre-wrap;
    background: var(--icon-b);
    padding: 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
    position: relative;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.8s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1), padding 0.8s cubic-bezier(0.25, 0.1, 0.25, 1); /* Sekinroq va silliqroq */
}
.error-details.visible {
    max-height: 300px; /* Ko‘proq joy uchun balandlik oshirildi */
    opacity: 1;
    padding: 10px;
}
.close-button {
    position: absolute;
    top: 5px;
    right: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.close-button svg {
    width: 16px;
    height: 16px;
    stroke: var(--muted);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.close-button:hover svg {
    stroke: var(--text);
}
@media (max-width: 380px) {
    .wrap { gap: 10px; }
    .msg { font-size: clamp(0.92rem, 0.88rem + 1.8vw, 1.3rem); }
    .hint { font-size: clamp(0.84rem, 0.82rem + 0.6vw, 0.95rem); }
    .error-toggle svg { width: clamp(18px, 4.5vw, 22px); height: clamp(18px, 4.5vw, 22px); }
    .error-details { font-size: clamp(0.82rem, 0.8rem + 0.5vw, 0.92rem); }
}
@media (max-height: 480px) and (orientation: landscape) {
    body { padding-top: 8px; padding-bottom: 8px; }
    .wrap { gap: 8px; }
    .ico svg { width: clamp(40px, 10vh, 56px); height: clamp(40px, 10vh, 56px); }
    .msg { font-size: clamp(0.9rem, 1.4vh, 1.2rem); }
    .hint { font-size: clamp(0.82rem, 1.2vh, 0.95rem); }
    .error-toggle svg { width: clamp(16px, 3vh, 20px); height: clamp(16px, 3vh, 20px); }
    .error-details { font-size: clamp(0.8rem, 1.1vh, 0.9rem); }
}
.large-font,
.large-font h1,
.large-font .error-message,
.large-font .alert,
.large-font .modal-title,
.large-font .modal-body {
    font-size: 1.5em !important;
}
.large-font .msg {
    font-size: 1.8em !important;
}
.large-font .hint {
    font-size: 1.8rem !important;
}
.large-font .error-toggle svg {
    width: clamp(24px, 6vw, 28px) !important;
    height: clamp(24px, 6vw, 28px) !important;
}
.large-font .error-details {
    font-size: 1.5em !important;
}
.large-font .close-button svg {
    width: 24px !important;
    height: 24px !important;
}