@charset "UTF-8";

@font-face {
    font-family: "FramePics Yokelvision";
    src: url("../fonts/Yokelvision.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "FramePics Boldline";
    src: url("../fonts/1FTV-VIP-Boldline.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "FramePics Boldline 2";
    src: url("../fonts/1FTV-VIP-Boldline-2.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #eef3f8;
    --surface: #ffffff;
    --surface-muted: #f6f9fc;
    --text: #172333;
    --muted: #637083;
    --border: #dce5ef;
    --primary: #256fd9;
    --primary-strong: #1858b5;
    --success: #12996a;
    --warning: #dd7b14;
    --danger: #d33242;
    --shadow: 0 10px 28px rgba(28, 48, 76, 0.08);
    --radius: 8px;
    --header-height: 64px;
    --tabbar-height: 72px;
    --font-base: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
    --font-title: "FramePics Yokelvision", var(--font-base);
    --font-heading: "FramePics Boldline", var(--font-base);
    --font-size-title: 24px;
    --font-size-heading: 16px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    width: 100%;
    min-height: 100%;
    scroll-behavior: smooth;
    background: var(--bg);
}

body {
    width: 100%;
    min-width: 0;
    min-height: 100%;
    margin: 0;
    color: var(--text);
    font-family: var(--font-base);
    font-size: 15px;
    line-height: 1.45;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.72), rgba(238,243,248,0.92) 260px),
        var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

button {
    min-height: 42px;
    border: 0;
    border-radius: var(--radius);
    padding: 9px 16px;
    color: #fff;
    background: var(--primary);
    box-shadow: 0 6px 16px rgba(37, 111, 217, 0.18);
    font-size: var(--font-size-heading);
    font-weight: 650;
    cursor: pointer;
    transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}

button,
#downloadBtn,
#resultPreview a,
.button-like {
    font-family: var(--font-heading);
    font-size: var(--font-size-heading);
}

button:hover {
    background: var(--primary-strong);
    box-shadow: 0 8px 18px rgba(24, 88, 181, 0.2);
}

button:active {
    transform: translateY(1px);
}

input[type="number"],
select,
textarea {
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    outline: none;
}

input[type="number"],
select {
    padding: 7px 10px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 111, 217, 0.14);
}

.font-picker-native {
    position: absolute !important;
    width: 1px !important;
    min-width: 0 !important;
    height: 1px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.font-picker {
    position: relative;
    width: 100%;
    min-width: 0;
    font-family: var(--font-base);
}

.font-picker-button {
    width: 100%;
    min-height: 58px;
    padding: 8px 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
    font-family: var(--font-base);
    font-size: 15px;
    font-weight: 750;
    text-align: left;
}

.font-picker-button:hover,
.font-picker-button:focus-visible {
    color: var(--text);
    background: #f8fbff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 111, 217, 0.14);
}

.font-picker-current {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.font-picker-current strong,
.font-picker-current em {
    min-width: 0;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.font-picker-current strong {
    color: #2f3d52;
    font-size: 15px;
    line-height: 1.15;
}

.font-picker-current em {
    color: #111827;
    font-size: 20px;
    font-style: normal;
    line-height: 1.1;
}

.font-picker-chevron {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-right: 2px solid #66758a;
    border-bottom: 2px solid #66758a;
    transform: rotate(45deg);
    transition: transform .16s ease;
}

.font-picker.is-open .font-picker-chevron {
    transform: rotate(225deg);
}

.font-picker-list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 10040;
    max-height: min(330px, 56vh);
    padding: 7px;
    display: none;
    gap: 5px;
    overflow: auto;
    background: rgba(255,255,255,.98);
    border: 1px solid rgba(210, 222, 236, .95);
    border-radius: 12px;
    box-shadow: 0 18px 42px rgba(18, 37, 63, .18);
}

.font-picker.is-open .font-picker-list {
    display: grid;
}

.font-picker-option {
    width: 100%;
    min-height: 58px;
    padding: 8px 10px;
    display: grid;
    gap: 2px;
    color: var(--text);
    background: transparent;
    border: 0;
    border-radius: 9px;
    box-shadow: none;
    text-align: left;
}

.font-picker-option:hover,
.font-picker-option:focus-visible,
.font-picker-option.is-selected {
    color: var(--primary);
    background: #edf5ff;
    box-shadow: none;
}

.font-picker-option-name,
.font-picker-option-sample {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.font-picker-option-name {
    font-size: 14px;
    line-height: 1.15;
}

.font-picker-option-sample {
    font-size: 22px;
    line-height: 1.1;
}

h3,
h4 {
    margin: 0 0 12px;
    color: #172b44;
    font-weight: 750;
    font-size: var(--font-size-heading);
    line-height: 1.2;
    letter-spacing: 0;
}

h1,
h2,
h3,
h4,
.frame-category-title,
.overview-block-title h2,
.overview-section-heading h2,
.frame-share-header h3,
.trend-header h3,
.overview-use-header h3,
.overview-list-header h3 {
    font-family: var(--font-heading);
}

h3 {
    font-size: var(--font-size-heading);
}

h4 {
    font-size: var(--font-size-heading);
}

hr {
    margin: 18px 0;
    border: 0;
    border-top: 1px solid var(--border);
}

form {
    margin: 0 0 14px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.header-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: calc(var(--header-height) + env(safe-area-inset-top));
    padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background:
        linear-gradient(90deg, rgba(255,255,255,.82), rgba(246,250,252,.68)),
        url('../img/header-bg.gif') center / cover;
    border-bottom: 1px solid rgba(214, 225, 238, .9);
    box-shadow: 0 4px 18px rgba(30, 54, 83, .06);
    backdrop-filter: blur(14px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.header-logo {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    background: #fff;
    object-fit: contain;
    box-shadow: 0 1px 6px rgba(23, 35, 51, .08);
    flex: 0 0 auto;
}

.header-title {
    min-width: 0;
    color: #1f5f9f;
    font-family: var(--font-title);
    font-size: var(--font-size-title);
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.convert-guide-trigger {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(245, 158, 11, .38);
    border-radius: 50%;
    color: #a15b06;
    background: linear-gradient(180deg, #fff7e6, #fff);
    box-shadow: 0 7px 18px rgba(161, 91, 6, .12);
}

.convert-guide-trigger span[aria-hidden="true"] {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    line-height: 1;
}

.convert-guide-trigger:hover {
    border-color: rgba(245, 158, 11, .72);
    color: #8a4700;
    transform: translateY(-1px);
}

.header-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

.header-menu a,
.header-menu button {
    min-height: 40px;
    border-radius: var(--radius);
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--primary);
    background: rgba(255,255,255,.86);
    border: 1px solid rgba(212, 224, 238, .8);
    font-family: var(--font-heading);
    font-size: var(--font-size-heading);
    font-weight: 700;
    text-decoration: none;
    box-shadow: none;
}

.header-trend {
    color: var(--warning) !important;
    background: #fff7ed !important;
    border-color: #fed7aa !important;
    cursor: pointer;
}

.header-usage-alert {
    color: #fff !important;
    background: linear-gradient(180deg, #f04444, #c7192e) !important;
    border-color: rgba(255, 169, 169, .8) !important;
    box-shadow: 0 8px 18px rgba(207, 24, 44, .22), inset 0 1px 0 rgba(255,255,255,.28) !important;
    animation: headerUsagePulse 1.15s ease-in-out infinite;
}

.header-usage-alert span {
    width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    color: #c7192e;
    background: #fff;
    font-family: var(--font-heading);
    line-height: 1;
}

.header-usage-alert.is-hidden {
    display: none !important;
}

@keyframes headerUsagePulse {
    0%, 100% {
        transform: translateY(0);
        filter: brightness(1);
    }
    50% {
        transform: translateY(-3px);
        filter: brightness(1.08);
    }
}

.header-utility-menu {
    position: relative;
}

.header-utility-toggle {
    color: #1f5f9f !important;
    background: #f7fbff !important;
    border-color: #cfe1ff !important;
    cursor: pointer;
}

.header-utility-toggle > svg:first-child,
.header-utility-submenu svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-utility-chevron {
    width: 15px !important;
    height: 15px !important;
    transition: transform .18s ease;
}

.header-utility-menu:hover .header-utility-chevron,
.header-utility-menu:focus-within .header-utility-chevron,
.header-utility-menu.is-open .header-utility-chevron {
    transform: rotate(180deg);
}

.header-utility-submenu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1001;
    width: min(280px, calc(100vw - 32px));
    padding: 8px;
    display: grid;
    gap: 5px;
    background: rgba(255,255,255,.97);
    border: 1px solid rgba(210, 222, 236, .85);
    border-radius: 12px;
    box-shadow: 0 18px 44px rgba(22, 39, 66, .18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .18s ease, transform .18s ease;
    backdrop-filter: blur(14px);
}

.header-utility-submenu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -12px;
    height: 12px;
}

.header-utility-menu:hover .header-utility-submenu,
.header-utility-menu:focus-within .header-utility-submenu,
.header-utility-menu.is-open .header-utility-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-utility-submenu a,
.header-utility-submenu button {
    width: 100%;
    min-height: 42px;
    padding: 9px 10px;
    justify-content: flex-start;
    gap: 9px;
    color: #21466f !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 9px;
    box-shadow: none !important;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.header-utility-submenu a:hover,
.header-utility-submenu a:focus-visible,
.header-utility-submenu button:hover,
.header-utility-submenu button:focus-visible {
    color: var(--primary) !important;
    background: #edf5ff !important;
}

.header-backhome {
    margin-left: 0;
}

.header-home-link {
    color: #2367c9 !important;
    background: #f0f7ff !important;
    border-color: #cfe1ff !important;
}

.header-home-link:hover,
.header-home-link:focus-visible {
    background: #e8f2ff !important;
    border-color: #9dc2ff !important;
}

.header-home-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-home-roof {
    stroke: #256fd9;
}

.header-home-body {
    fill: #eaf4ff;
    stroke: #1a75bb;
}

.header-home-door {
    fill: #fff2d7;
    stroke: #f59e0b;
}

.header-home-sun {
    fill: #f59e0b;
    stroke: #f59e0b;
}

.header-account-link {
    color: #1f5f9f !important;
    background: #fff !important;
    border-color: #cfe1ff !important;
}

.header-account-link > svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-account-link.is-logged-in {
    padding: 6px 10px 6px 7px;
    gap: 8px;
}

.header-avatar {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, #256fd9, #13a67a);
    font-family: var(--font-base);
    font-size: 14px;
    font-weight: 800;
}

.header-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.header-account-name {
    max-width: 120px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-quick-logout {
    width: 42px;
    padding: 8px !important;
    color: #c3343f !important;
    background: #fff5f5 !important;
    border-color: #ffd0d5 !important;
    cursor: pointer;
}

.header-quick-logout svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-quick-logout:hover,
.header-quick-logout:focus-visible {
    color: #a82432 !important;
    background: #ffe9ec !important;
    border-color: #ffadb7 !important;
}

.account-modal {
    position: fixed;
    inset: 0;
    z-index: 100130;
    padding: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(12, 23, 38, .48);
}

.account-modal.is-open {
    display: flex;
}

.account-dialog {
    width: min(94vw, 460px);
    max-height: 92vh;
    padding: 18px;
    overflow: auto;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 18px 48px rgba(10, 24, 43, .24);
}

.auth-required-modal {
    position: fixed;
    inset: 0;
    z-index: 100120;
    padding: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(12, 23, 38, .44);
}

.auth-required-modal.is-open {
    display: flex;
}

.auth-required-dialog {
    position: relative;
    width: min(92vw, 420px);
    padding: 28px 24px 24px;
    display: grid;
    justify-items: center;
    gap: 12px;
    border: 1px solid rgba(210, 224, 242, .9);
    border-radius: 18px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 22px 60px rgba(10, 24, 43, .24);
    text-align: center;
}

.auth-required-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    min-height: 38px;
    padding: 0;
    display: grid;
    place-items: center;
    color: #65748a;
    background: #f2f6fb;
    box-shadow: none;
}

.auth-required-close svg,
.auth-required-register svg,
.auth-required-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-required-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: #256fd9;
    background: #eaf3ff;
}

.auth-required-icon svg {
    width: 30px;
    height: 30px;
}

.auth-required-dialog h3 {
    margin: 2px 0 0;
    color: #172238;
    font-size: 1.25rem;
}

.auth-required-dialog p {
    margin: 0;
    color: #647184;
    line-height: 1.55;
}

.auth-required-register {
    width: auto;
    min-height: 44px;
    margin-top: 2px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

[data-auth-required] {
    cursor: pointer;
}

.file-picker[data-auth-required],
button[data-auth-required],
.overview-frame-card[data-auth-required] {
    box-shadow: inset 0 0 0 1px rgba(37, 111, 217, .05);
}

.account-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.account-header h3 {
    margin-bottom: 3px;
}

.account-header span {
    color: var(--muted);
    font-size: .92rem;
}

.account-close {
    width: 38px;
    min-height: 38px;
    padding: 0;
    display: grid;
    place-items: center;
    color: #66758a;
    background: #f3f6fa;
    box-shadow: none;
    font-size: 1.45rem;
}

.account-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.account-tabs button {
    color: #245fae;
    background: #f4f8ff;
    border: 1px solid #d4e4fb;
    box-shadow: none;
}

.account-tabs button.is-active {
    color: #fff;
    background: var(--primary);
}

.account-panel form {
    display: grid;
    gap: 10px;
}

.account-panel label {
    display: grid;
    gap: 5px;
    color: #31425a;
    font-weight: 750;
}

.account-panel input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 11px;
}

.account-message {
    margin: 0 0 12px;
    padding: 9px 10px;
    border-radius: var(--radius);
    color: #0f6b4d;
    background: #eafaf3;
    border: 1px solid #bfead8;
    font-weight: 700;
}

.account-message.is-error {
    color: #a82432;
    background: #fff0f2;
    border-color: #ffd0d6;
}

.account-divider {
    margin: 12px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: .86rem;
    font-weight: 800;
}

.account-divider::before,
.account-divider::after {
    content: "";
    height: 1px;
    flex: 1 1 auto;
    background: var(--border);
}

.google-login-slot {
    min-height: 42px;
    display: grid;
    justify-items: center;
}

.profile-main {
    width: min(100%, 1240px);
    margin: 0 auto;
    padding: 18px;
    display: grid;
    gap: 16px;
}

.profile-alert {
    padding: 10px 12px;
    border-radius: var(--radius);
    color: #0f6b4d;
    background: #eafaf3;
    border: 1px solid #bfead8;
    font-weight: 750;
}

.profile-alert.error {
    color: #a82432;
    background: #fff0f2;
    border-color: #ffd0d6;
}

.profile-alert.is-hiding {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .2s ease, transform .2s ease;
}

.profile-hero {
    padding: 18px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
}

.profile-avatar-large {
    width: 82px;
    height: 82px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, #256fd9, #13a67a);
    font-size: 34px;
    font-weight: 850;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-hero h1 {
    margin: 0 0 4px;
    font-family: var(--font-heading);
    font-size: 1.45rem;
}

.profile-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin: 0 0 4px;
}

.profile-name-row h1 {
    margin: 0;
}

.profile-name-row .profile-package-badge {
    padding: 4px 10px;
    border: 1px solid rgba(210, 42, 42, .28);
    border-radius: 999px;
    color: #d22a2a;
    background: #fff1f1;
    font-size: .86rem;
    font-weight: 850;
    line-height: 1.2;
}

.profile-hero p,
.profile-hero span,
.profile-section-head p {
    margin: 0;
    color: var(--muted);
}

.profile-logout-form {
    margin: 0;
}

.profile-tabs {
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-tabs a {
    min-height: 42px;
    padding: 9px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #245fae;
    background: #f5f9ff;
    border: 1px solid rgba(37, 111, 217, .18);
    border-radius: var(--radius);
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 850;
}

.profile-tabs a.is-active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.profile-tab-panel[hidden] {
    display: none !important;
}

.profile-account-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.profile-card,
.profile-frames-section {
    padding: 18px;
}

.profile-card h2,
.profile-frames-section h2 {
    margin: 0 0 12px;
    font-family: var(--font-heading);
    font-size: 1.08rem;
}

.profile-card form,
.profile-frame-form {
    display: grid;
    gap: 10px;
}

.profile-inline-upload {
    grid-template-columns: minmax(170px, 1fr) minmax(150px, .8fr) minmax(190px, 1fr) 86px auto;
    align-items: end;
}

.profile-card label,
.profile-frame-form label {
    display: grid;
    gap: 5px;
    color: #31425a;
    font-weight: 750;
}

.profile-card input,
.profile-card textarea,
.profile-frame-form input,
.profile-frame-form textarea,
.profile-frame-form select {
    width: 100%;
    padding: 9px 11px;
}

.profile-section-head {
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.profile-section-head > span {
    color: #245fae;
    font-weight: 850;
}

.profile-frame-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.profile-frame-card {
    min-width: 0;
    padding: 10px;
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
    grid-template-areas:
        "thumb content"
        "actions content";
    align-items: start;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
}

.profile-frame-card.is-focused {
    border-color: rgba(37, 111, 217, .72);
    background: #f3f8ff;
    box-shadow: 0 0 0 3px rgba(37, 111, 217, .16), 0 18px 36px rgba(18, 35, 57, .12);
}

.profile-frame-content {
    grid-area: content;
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 8px;
}

.profile-frame-thumb {
    grid-area: thumb;
    position: relative;
    aspect-ratio: 1 / 1;
    border: 1px solid #d9e3ee;
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
}

.profile-frame-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.profile-detail-open {
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.profile-detail-open:hover,
.profile-detail-open:focus-visible {
    border-color: rgba(37, 111, 217, .48);
    box-shadow: 0 12px 26px rgba(18, 35, 57, .12);
    outline: none;
    transform: translateY(-1px);
}

.profile-frame-thumb .profile-use-badge,
.profile-frame-thumb .profile-download-badge,
.profile-frame-thumb > span:not(.profile-download-badge):not(.profile-use-badge) {
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 3px 6px;
    border-radius: 999px;
    color: #fff;
    background: rgba(18, 35, 57, .72);
    font-size: 11px;
    font-weight: 850;
}

.profile-frame-thumb .profile-download-badge {
    left: auto;
    right: 6px;
}

.profile-frame-meta {
    display: grid;
    align-content: start;
    gap: 5px;
}

.profile-frame-meta strong,
.profile-frame-meta small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-frame-meta small,
.profile-stat-row span {
    color: var(--muted);
}

.profile-stat-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-copy-link,
.profile-share-link,
.profile-download-link,
.profile-edit-actions button {
    min-height: 32px;
    padding: 6px 9px;
    font-size: .84rem;
}

.profile-share-link {
    color: #245fae;
    background: #edf5ff;
    box-shadow: none;
}

.profile-download-link {
    width: 34px;
    min-width: 34px;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(26, 176, 119, .22);
    border-radius: var(--radius);
    color: #0f7b59;
    background: #eafaf3;
    text-decoration: none;
    box-shadow: none;
}

.profile-download-link:hover {
    color: #fff;
    background: var(--success);
}

.profile-download-link svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.profile-delete-form {
    display: none;
}

.profile-danger {
    width: 100%;
    background: var(--danger);
}

.profile-frame-form {
    margin-top: -2px;
    gap: 7px;
}

.profile-frame-form label {
    gap: 4px;
    font-size: .92rem;
}

.profile-frame-form input,
.profile-frame-form textarea,
.profile-frame-form select {
    min-height: 36px;
    padding: 7px 9px;
    font-size: .92rem;
}

.profile-frame-form textarea {
    min-height: 58px;
}

.profile-edit-actions {
    grid-area: actions;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-self: start;
}

.profile-frame-file-picker {
    position: relative;
    min-height: 44px;
    padding: 7px 10px;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px !important;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: #31425a;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
}

.profile-frame-file-picker:hover,
.profile-frame-file-picker:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 111, 217, .12);
}

.profile-frame-file-picker input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.profile-frame-file-picker > span {
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.1;
}

.profile-frame-file-picker > strong {
    min-width: 0;
    overflow: hidden;
    color: #245fae;
    font-size: .92rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-frame-file-preview {
    position: relative;
    width: 78px;
    height: 78px;
    padding: 4px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}

.profile-frame-file-preview[hidden] {
    display: none !important;
}

.profile-frame-file-preview img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
}

.profile-frame-file-preview span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.profile-qr-thumb {
    background:
        linear-gradient(90deg, rgba(37,111,217,.08) 1px, transparent 1px),
        linear-gradient(rgba(37,111,217,.08) 1px, transparent 1px),
        #fff;
    background-size: 20px 20px;
}

.profile-detail-lock {
    overflow: hidden;
}

.profile-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    padding: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(12, 22, 36, .52);
    backdrop-filter: blur(6px);
}

.profile-detail-modal.is-open {
    display: flex;
}

.profile-detail-dialog {
    position: relative;
    width: min(820px, 100%);
    max-height: min(720px, calc(100vh - 40px));
    padding: 16px;
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    gap: 18px;
    overflow: auto;
    border: 1px solid rgba(217, 227, 238, .95);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(18, 35, 57, .28);
}

.profile-detail-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 34px;
    min-height: 34px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    background: #fff;
    box-shadow: none;
}

.profile-detail-media {
    position: relative;
    min-height: 260px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        linear-gradient(90deg, rgba(37,111,217,.06) 1px, transparent 1px),
        linear-gradient(rgba(37,111,217,.06) 1px, transparent 1px),
        #fff;
    background-size: 18px 18px;
}

.profile-detail-media img {
    width: 100%;
    height: 100%;
    max-height: 340px;
    display: block;
    object-fit: contain;
}

.profile-detail-media span {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 4px 8px;
    border-radius: 999px;
    color: #fff;
    background: rgba(18, 35, 57, .76);
    font-size: .78rem;
    font-weight: 850;
}

.profile-detail-body {
    min-width: 0;
    padding: 8px 34px 8px 0;
    display: grid;
    align-content: start;
    gap: 12px;
}

.profile-detail-body > p:first-child {
    margin: 0;
    color: #245fae;
    font-size: .82rem;
    font-weight: 850;
    text-transform: uppercase;
}

.profile-detail-body h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.32rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.profile-detail-body > p:not(:first-child) {
    margin: 0;
    color: var(--muted);
    font-weight: 750;
}

.profile-detail-created {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
}

.profile-detail-created span,
.profile-detail-note span,
.profile-detail-stat span,
.profile-detail-stat small {
    color: var(--muted);
}

.profile-detail-created strong {
    color: var(--text);
    font-size: .96rem;
    text-align: right;
}

.profile-detail-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.profile-detail-stat {
    min-width: 0;
    padding: 12px;
    display: grid;
    gap: 3px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}

.profile-detail-stat strong {
    color: var(--text);
    font-size: 1.45rem;
    line-height: 1;
}

.profile-detail-stat span,
.profile-detail-stat small {
    min-width: 0;
    font-size: .82rem;
    line-height: 1.2;
}

.profile-detail-note {
    padding: 12px;
    display: grid;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
}

.profile-detail-note span {
    font-size: .82rem;
    font-weight: 850;
}

.profile-detail-note p {
    margin: 0;
    max-height: 120px;
    overflow: auto;
    color: var(--text);
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.profile-empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 28px;
    color: var(--muted);
    text-align: center;
    font-weight: 750;
}

.profile-pagination {
    margin-top: 14px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.profile-pagination a {
    min-width: 36px;
    min-height: 36px;
    padding: 7px 10px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: #245fae;
    background: #fff;
    text-decoration: none;
    font-weight: 850;
}

.profile-pagination a.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.container {
    width: min(100%, 1520px);
    min-height: calc(100vh - var(--header-height));
    margin: 0 auto;
    padding: 18px;
    display: grid;
    grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
    align-items: start;
    gap: 16px;
}

.home-workspace {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(480px, 1.16fr) minmax(380px, .84fr);
    align-items: start;
    gap: 16px;
}

.app-panel,
.left,
.right,
.resize-panel,
.cartoon-panel {
    border: 1px solid rgba(217, 228, 240, .94);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.left,
.right,
.resize-panel {
    width: auto;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 18px;
}

.left {
    grid-column: 1;
    position: relative;
    top: auto;
    max-height: none;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.recommended-frame-strip {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 122px;
    padding: 10px 12px;
    overflow: hidden;
    background:
        radial-gradient(circle at 8% 20%, rgba(255, 216, 142, .24), transparent 32%),
        linear-gradient(135deg, rgba(255,255,255,.78), rgba(239,246,255,.66));
}

.recommended-frame-copy h3 {
    margin: 0;
    color: #1858b5;
    font-size: calc(var(--font-size-heading) + 3px);
    line-height: 1.18;
}

.recommended-frame-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(76px, 1fr));
    align-items: center;
    gap: 10px;
}

.recommended-frame-list .frame-item {
    min-height: 0;
    padding: 4px;
}

.recommended-frame-list .frame-thumb {
    border-radius: 8px;
}

.right {
    grid-column: 1;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    background:
        linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.68)),
        url('../img/center-bg.jpg') center / cover;
}

.resize-panel {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.cartoon-panel {
    width: 100%;
    min-width: 0;
    margin: 18px 0 0;
    padding: 16px;
    background: #fffaf3;
    box-shadow: none;
    border-color: #f4dfc5;
}

.cartoon-panel h3 {
    color: var(--warning);
}

#photoUploadForm,
#frameUploadForm,
#resizeUploadForm,
#cartoonUploadForm {
    display: grid;
    gap: 10px;
}

.cartoon-controls,
.cartoon-field {
    display: grid;
    gap: 6px;
}

.cartoon-output-grid {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 10px;
    align-items: end;
}

.cartoon-style-options {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.cartoon-style-options legend {
    grid-column: 1 / -1;
    margin: 0 0 2px;
    color: #405168;
    font-size: .86rem;
    font-weight: 750;
}

.cartoon-style-options label {
    position: relative;
    min-width: 0;
    cursor: pointer;
}

.cartoon-style-options input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cartoon-style-options span {
    min-height: 40px;
    border: 1px solid #dce7f4;
    border-radius: 8px;
    display: grid;
    place-items: center;
    padding: 8px 6px;
    background: #fff;
    color: #31435b;
    font-size: .92rem;
    font-weight: 800;
    text-align: center;
    transition: border-color .16s ease, box-shadow .16s ease, color .16s ease, background .16s ease;
}

.cartoon-style-options input:checked + span {
    border-color: var(--primary);
    background: #eef5ff;
    color: var(--primary);
    box-shadow: 0 0 0 3px rgba(58, 112, 215, .13);
}

.cartoon-style-options input:focus-visible + span {
    outline: 2px solid rgba(58, 112, 215, .55);
    outline-offset: 2px;
}

.cartoon-field > span {
    color: #405168;
    font-size: .86rem;
    font-weight: 750;
}

.cartoon-field > span b {
    float: right;
    color: var(--primary);
    font-weight: 800;
}

.cartoon-field select,
.cartoon-field input[type="number"] {
    width: 100%;
}

.cartoon-field input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
}

.cartoon-field input[type="range"]:disabled {
    cursor: not-allowed;
    opacity: .52;
}

.cartoon-note {
    display: block;
    color: #8a6f4d;
    font-size: .86rem;
    line-height: 1.45;
}

.frame-section-head {
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.frame-section-head h3 {
    margin: 0;
}

.frame-section-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.frame-refresh-button,
.frame-overview-button {
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: #eef5ff;
    border: 1px solid rgba(37, 111, 217, .18);
    border-radius: 999px;
    box-shadow: none;
    text-decoration: none;
}

.frame-refresh-button:hover,
.frame-overview-button:hover {
    color: #fff;
    background: var(--primary);
}

.frame-refresh-button svg,
.frame-overview-button svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.file-picker {
    position: relative;
    min-height: 46px;
    width: 100%;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    cursor: pointer;
    overflow: hidden;
}

.file-picker:hover {
    border-color: #b8c9dd;
}

.file-picker:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 111, 217, 0.14);
}

.file-picker input[type="file"] {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-picker input[type="file"]:disabled {
    cursor: wait;
}

.file-picker:has(input[type="file"]:disabled) {
    opacity: .72;
    cursor: wait;
}

.file-picker-icon {
    width: 42px;
    min-height: 44px;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: #edf5ff;
    border-right: 1px solid var(--border);
}

.file-picker-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.file-picker-text {
    min-width: 0;
    padding-right: 12px;
    color: #314156;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-progress-card {
    width: 100%;
    margin: 10px 0 8px;
    padding: 10px 12px;
    display: grid;
    gap: 8px;
    border: 1px solid rgba(37, 111, 217, .22);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #f8fbff, #eef5ff);
    box-shadow: 0 10px 24px rgba(30, 80, 160, .1);
}

.upload-progress-card[hidden] {
    display: none;
}

.upload-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #17365e;
    font-size: .9rem;
}

.upload-progress-head strong,
.upload-progress-head span {
    min-width: 0;
    font-weight: 900;
}

.upload-progress-head strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-progress-head span {
    flex: 0 0 auto;
    color: var(--primary);
}

.upload-progress-track {
    position: relative;
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #dce9f8;
}

.upload-progress-track i {
    width: 4%;
    height: 100%;
    display: block;
    border-radius: inherit;
    background: linear-gradient(90deg, #256fd9, #49a1ff);
    transition: width .18s ease;
}

.upload-progress-card small {
    color: #657489;
    font-size: .82rem;
    line-height: 1.35;
}

.upload-progress-card.is-indeterminate .upload-progress-track i {
    width: 42%;
    animation: uploadProgressPulse 1.05s ease-in-out infinite;
}

.upload-progress-card.is-complete {
    border-color: rgba(40, 167, 69, .28);
    background: linear-gradient(180deg, #f7fff9, #edf9f0);
}

.upload-progress-card.is-complete .upload-progress-head span {
    color: var(--success);
}

.upload-progress-card.is-complete .upload-progress-track i {
    background: linear-gradient(90deg, #28a745, #6fd987);
}

.upload-progress-card.is-error {
    border-color: rgba(211, 63, 73, .3);
    background: #fff7f7;
}

.upload-progress-card.is-error .upload-progress-head span {
    color: var(--danger);
}

.upload-progress-card.is-error .upload-progress-track i {
    background: linear-gradient(90deg, #d33f49, #ff7a83);
}

@keyframes uploadProgressPulse {
    0% {
        transform: translateX(-110%);
    }
    100% {
        transform: translateX(260%);
    }
}

.frame-upload-choice-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 66px;
    gap: 10px;
    align-items: center;
}

.camera-file-input {
    position: fixed;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.upload-action-row,
.frame-share-upload-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}

.mobile-camera-button {
    display: none;
}

.mobile-camera-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.frame-upload-preview {
    width: 66px;
    height: 66px;
    padding: 4px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 4px 12px rgba(36, 58, 86, .08);
}

.frame-upload-preview[hidden] {
    display: none !important;
}

.frame-upload-preview img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
}

#resizeUploadForm {
    grid-template-columns: 1fr;
    align-items: stretch;
}

.resize-presets,
.resize-field {
    display: grid;
    gap: 6px;
}

.resize-presets label,
.resize-field > span {
    color: #405168;
    font-size: .86rem;
    font-weight: 750;
}

.resize-presets select,
.resize-field select {
    width: 100%;
}

.resize-dimensions {
    display: grid;
    grid-template-columns: minmax(68px, .9fr) 14px minmax(68px, .9fr) minmax(68px, .8fr) minmax(72px, .8fr) auto;
    align-items: center;
    gap: 8px;
}

.resize-dimensions input,
.resize-dimensions select,
.resize-output-settings input,
.resize-output-settings select {
    min-width: 0;
}

.resize-dimensions span,
.resize-dimensions label {
    color: var(--muted);
    font-size: .92rem;
    font-weight: 700;
    white-space: nowrap;
}

#resizeUploadForm button {
    margin: 0;
}

.resize-output-settings {
    display: grid;
    grid-template-columns: minmax(150px, .92fr) minmax(170px, 1.08fr);
    align-items: end;
    gap: 10px;
}

.resize-quality-field span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.resize-quality-field b {
    color: var(--primary);
    font-weight: 800;
}

#resizeQuality {
    width: 100%;
    accent-color: var(--primary);
}

#resizeQuality:disabled {
    cursor: not-allowed;
    opacity: .52;
}

.resize-note {
    display: block;
    margin: 0;
    color: #7a8695;
    font-size: .86rem;
    line-height: 1.45;
}

#resizeWidth,
#resizeHeight,
#resizeDpi {
    width: 100% !important;
}

#frameLibrary {
    --frame-card-size: 112px;
    min-height: 0;
    margin-top: 6px;
    padding: 12px;
    max-height: calc((var(--frame-card-size) + 10px) * 6 + 90px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.frame-category-title {
    margin: 14px 0 8px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1f5b9f;
    font-size: var(--font-size-heading);
    font-weight: 800;
    background: linear-gradient(90deg, #edf5ff, #f7fbff);
    border: 1px solid rgba(37, 111, 217, .12);
    border-radius: var(--radius);
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.frame-category:first-child .frame-category-title {
    margin-top: 0;
}

.frame-category-title svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.frame-category-title a,
.frame-category-title span {
    min-width: 0;
    color: inherit;
    text-decoration: none;
    transition: color .18s ease, transform .18s ease;
}

.frame-category-title a:hover,
.frame-category-title a:focus-visible {
    color: #174a88;
    text-decoration: none;
    transform: translateX(2px);
}

.frame-category-title:has(a:hover),
.frame-category-title:has(a:focus-visible) {
    background: linear-gradient(90deg, #e7f1ff, #f6fbff);
    border-color: rgba(37, 111, 217, .22);
    box-shadow: 0 5px 14px rgba(31, 91, 159, .08);
}

.frame-category {
    margin-bottom: 14px;
}

.frame-carousel {
    position: relative;
}

.frame-grid {
    display: grid;
    grid-template-rows: repeat(2, auto);
    grid-template-columns: repeat(4, calc((100% - 30px) / 4));
    grid-auto-columns: calc((100% - 30px) / 4);
    gap: 10px;
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(37, 111, 217, .35) transparent;
}

.frame-grid::-webkit-scrollbar {
    height: 6px;
}

.frame-grid::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(37, 111, 217, .35);
}

.frame-carousel-arrow {
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    position: absolute;
    top: calc(50% - 17px);
    z-index: 4;
    display: none;
    place-items: center;
    color: var(--primary);
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(37, 111, 217, .2);
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(27, 57, 96, .16);
}

.frame-carousel.has-overflow .frame-carousel-arrow {
    display: grid;
}

.frame-carousel-prev {
    left: -8px;
}

.frame-carousel-next {
    right: -8px;
}

.frame-carousel-arrow svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.frame-carousel-arrow:disabled {
    opacity: .35;
    cursor: default;
    transform: none;
}

.frame-item {
    position: relative;
    min-width: 0;
    scroll-snap-align: start;
}

.frame-thumb-shell {
    position: relative;
    aspect-ratio: 1 / 1;
}

.frame-thumb {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    display: block;
    object-fit: contain;
    border: 1px solid #d9e3ee;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 4px 12px rgba(36, 58, 86, .08);
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.frame-creator-name {
    max-width: 100%;
    min-height: 18px;
    margin-top: 4px;
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.frame-use-count {
    position: absolute;
    left: 6px;
    bottom: 6px;
    z-index: 2;
    max-width: calc(100% - 46px);
    padding: 3px 6px;
    border-radius: 999px;
    color: #fff;
    background: rgba(18, 35, 57, .72);
    font-size: 10px;
    font-weight: 850;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.frame-hover-name {
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    z-index: 3;
    padding: 4px 6px;
    border-radius: 999px;
    color: #fff;
    background: rgba(30, 95, 174, .9);
    box-shadow: 0 4px 12px rgba(18, 35, 57, .16);
    font-size: 10px;
    font-weight: 850;
    line-height: 1.15;
    text-align: center;
    opacity: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: translateY(-4px);
    transition: opacity .16s ease, transform .16s ease;
    pointer-events: none;
}

.frame-thumb-shell:hover .frame-hover-name,
.frame-item:focus-within .frame-hover-name {
    opacity: 1;
    transform: translateY(0);
}

.frame-thumb:hover,
.frame-thumb.active {
    border-color: var(--primary);
    box-shadow: 0 8px 18px rgba(37, 111, 217, .16);
    transform: translateY(-1px);
}

.frame-thumb.active {
    outline: 3px solid rgba(37, 111, 217, .28);
    outline-offset: 2px;
}

.frame-hover-zoom {
    position: fixed;
    z-index: 90000;
    aspect-ratio: 1 / 1;
    padding: 10px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(37, 111, 217, .28);
    border-radius: var(--radius);
    background:
        linear-gradient(45deg, rgba(226, 235, 247, .5) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(226, 235, 247, .5) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(226, 235, 247, .5) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(226, 235, 247, .5) 75%),
        #fff;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    background-size: 20px 20px;
    box-shadow: 0 18px 42px rgba(10, 24, 43, .22);
    opacity: 0;
    pointer-events: none;
    transform: scale(.92);
    transform-origin: center;
    transition: opacity .14s ease, transform .14s ease;
}

.frame-hover-zoom.is-visible {
    opacity: 1;
    transform: scale(1);
}

.frame-hover-zoom img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.frame-hover-zoom-label {
    max-width: calc(100% - 18px);
    padding: 4px 8px;
    position: absolute;
    left: 9px;
    right: 9px;
    bottom: 9px;
    border-radius: 999px;
    color: #fff;
    background: rgba(18, 35, 57, .74);
    font-size: 11px;
    font-weight: 850;
    line-height: 1.1;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.frame-share-button {
    width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    position: absolute;
    right: 6px;
    bottom: 6px;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: rgba(255,255,255,.95);
    border: 1px solid rgba(37, 111, 217, .18);
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(34, 44, 58, .14);
}

.frame-share-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.frame-share-button.is-copied {
    color: #fff;
    background: var(--success);
}

.copy-frame-toast {
    min-width: min(280px, calc(100vw - 20px));
    max-width: min(320px, calc(100vw - 20px));
    padding: 9px 12px;
    position: fixed;
    z-index: 100004;
    pointer-events: none;
    border: 1px solid rgba(18, 153, 106, .24);
    border-radius: var(--radius);
    color: #0f6548;
    background: #ecfff7;
    box-shadow: 0 12px 30px rgba(20, 70, 54, .18);
    font-size: .88rem;
    font-weight: 750;
    line-height: 1.35;
    opacity: 0;
    transform: translateY(4px) scale(.98);
    transition: opacity .16s ease, transform .16s ease;
}

.copy-frame-toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.frame-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.95);
    color: var(--danger);
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(34, 44, 58, .14);
    cursor: pointer;
}

#photoPreview,
#resizePreview,
#cartoonPreview,
#resultPreview {
    width: 100%;
}

#resizePreview {
    min-height: 0;
    margin: 10px 0 12px !important;
    position: relative;
}

#cartoonPreview {
    min-height: 0;
    margin: 10px 0 0;
}

#photoPreview {
    min-height: 0;
    margin: 10px 0 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#photoPreview img,
#resizePreview img,
#cartoonPreview img,
#resultPreview img {
    max-width: 100%;
    height: auto;
    margin-top: 8px;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 8px 24px rgba(30, 80, 160, 0.12);
}

#resultPreview img {
    width: auto;
    max-width: min(92%, 620px);
    max-height: min(66vh, 620px);
    object-fit: contain;
    border-radius: var(--radius) !important;
}

#photoPreview img {
    width: 82px !important;
    max-width: 82px !important;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 14px !important;
    cursor: zoom-in;
    position: relative;
    z-index: 2;
    transition: transform .18s ease, box-shadow .18s ease;
    transform-origin: left center;
}

#photoPreview img:hover {
    z-index: 80;
    transform: scale(2.35);
    box-shadow: 0 18px 42px rgba(15, 32, 54, .28);
}

.resize-preview-card {
    position: relative;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid rgba(220, 229, 239, .96);
    border-radius: var(--radius);
    background: #f8fbff;
    box-shadow: 0 8px 20px rgba(30, 80, 160, .08);
}

.cartoon-preview-card {
    background: #fffdf8;
    border-color: rgba(244, 223, 197, .96);
}

.resize-preview-thumb {
    width: 76px;
    height: 58px;
    overflow: hidden;
    border-radius: 7px;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(220, 229, 239, .9);
}

#resizePreview .resize-preview-thumb img,
#cartoonPreview .resize-preview-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    object-fit: cover;
    border-radius: 7px !important;
    box-shadow: none;
}

.resize-preview-meta {
    min-width: 0;
    display: grid;
    gap: 2px;
    color: #5e6c7e;
    font-size: .86rem;
    line-height: 1.32;
}

.resize-preview-meta strong {
    color: #25364c;
    font-size: .94rem;
    font-weight: 800;
}

.resize-preview-meta span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resize-hover-preview {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    z-index: 90;
    width: min(340px, calc(100vw - 48px));
    padding: 8px;
    border: 1px solid rgba(185, 202, 222, .95);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 18px 42px rgba(15, 32, 54, .24);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(4px) scale(.98);
    transform-origin: bottom right;
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}

.resize-preview-card:hover .resize-hover-preview,
.resize-preview-card:focus-within .resize-hover-preview {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

#resizePreview .resize-hover-preview img,
#cartoonPreview .resize-hover-preview img {
    display: block;
    width: 100%;
    max-height: 340px;
    margin: 0;
    object-fit: contain;
    border-radius: 6px !important;
    box-shadow: none;
}

#resultPreview {
    min-height: 0;
    flex: 0 0 auto;
    display: grid;
    align-content: start;
    justify-items: center;
    gap: 10px;
    margin-top: 12px;
}

.result-figure {
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin: 0;
}

#resultPreview .result-figure img {
    display: block;
    margin: 0 auto;
}

.protected-result-preview {
    user-select: none;
    -webkit-user-drag: none;
}

.protected-result-preview.is-loading {
    min-width: min(92vw, 360px);
    min-height: 220px;
    background: linear-gradient(135deg, #f7faff, #edf4ff);
}

.result-preview-loading {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    padding: 8px 12px;
    border-radius: 999px;
    color: #365675;
    background: rgba(255, 255, 255, .86);
    border: 1px solid rgba(211, 224, 240, .9);
    font-weight: 800;
    white-space: nowrap;
    pointer-events: none;
}

.result-figure.has-visual-watermark-fallback::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 140%;
    height: 72px;
    transform: translate(-50%, -50%) rotate(-45deg);
    background: rgba(255, 255, 255, .26) var(--preview-watermark-logo) center / 54px 54px repeat-x;
    opacity: .32;
    pointer-events: none;
}

.result-caption {
    margin-top: 9px;
    color: #475569;
    font-size: .94rem;
}

.result-title {
    margin-bottom: 8px;
    color: #3f4f63;
    font-weight: 700;
}

.result-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    min-width: min(100%, 460px);
}

.result-meta-item {
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid rgba(220, 229, 239, .94);
    border-radius: 7px;
    background: #f8fbff;
    text-align: left;
}

.result-meta-item span,
.result-meta-item strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-meta-item span {
    color: #7b8797;
    font-size: .76rem;
    font-weight: 750;
}

.result-meta-item strong {
    margin-top: 2px;
    color: #1f3148;
    font-size: .88rem;
    font-weight: 800;
}

.result-actions {
    width: min(100%, 560px);
    margin: 4px auto 0;
    padding: 10px;
    border: 1px solid rgba(220, 229, 239, .94);
    border-radius: 8px;
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 8px;
    background: rgba(248, 251, 255, .94);
    box-shadow: 0 8px 20px rgba(30, 80, 160, .07);
}

.result-format-field {
    min-width: 112px;
    display: grid;
    gap: 4px;
    text-align: left;
}

.result-format-field span {
    color: #7b8797;
    font-size: .74rem;
    font-weight: 800;
}

.result-format-select {
    min-height: 40px;
    width: 100%;
    border-radius: 7px;
    font-weight: 750;
}

.result-icon-button {
    width: 42px;
    height: 42px;
    min-height: 42px;
    flex: 0 0 42px;
    padding: 0;
    border: 1px solid #dce7f4;
    display: inline-grid;
    place-items: center;
    color: var(--primary);
    background: #fff;
    box-shadow: none;
}

.result-icon-button:hover {
    color: #fff;
    border-color: var(--primary);
}

.result-icon-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.result-download-button {
    min-width: 128px;
    min-height: 42px;
    flex: 0 1 190px;
    padding: 10px 16px;
    background: var(--success);
}

#downloadBtn,
#resultPreview a {
    min-height: 42px;
    margin: 14px auto 0;
    border-radius: var(--radius);
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--success);
    font-size: var(--font-size-heading);
    font-weight: 750;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(18, 153, 106, .18);
}

#framePreviewPopup {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255,255,255,.96);
    box-shadow: var(--shadow);
    transition: opacity .17s;
}

#framePreviewPopup img {
    display: block;
    max-width: 340px;
    max-height: 340px;
}

#inlineCropPanel {
    z-index: 120;
    max-width: none;
    padding: 16px;
    position: relative;
}

#inlineCropPanel .crop-stage {
    width: min(100%, 420px) !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    min-height: 220px;
    max-height: min(70vh, 420px);
    margin: auto;
    background: #f7f9fd;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

#avatarToCropInline,
#selectedFrameInline,
#avatarToCrop,
#selectedFrame {
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
    left: 0;
    top: 0;
    position: absolute;
}

#selectedFrameInline,
#selectedFrame {
    z-index: 2;
    pointer-events: none;
}

#avatarToCropInline,
#avatarToCrop {
    z-index: 1;
}

.crop-ratio-list {
    margin: 0 0 8px;
    padding: 0 2px 2px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-height: 76px;
    overflow: auto;
}

#inlineCropPanel label,
#cropModal label {
    min-height: 32px;
    margin: 0;
    padding: 5px 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--muted);
    font-weight: 650;
    font-size: .92rem;
}

#cropModal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    padding: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(12, 23, 38, 0.42);
    animation: fadeIn .2s ease;
}

#cropModal > div {
    width: min(94vw, 760px);
    max-height: calc(100dvh - 20px);
    padding: 14px 16px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 18px 48px rgba(10, 24, 43, .22);
}

#cropModal h4 {
    margin-bottom: 2px;
}

.crop-stage {
    width: min(100%, 560px) !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    margin: auto;
    overflow: hidden;
    border-radius: var(--radius);
    background: #f7f9fd;
}

#cropModal .crop-stage {
    width: min(100%, clamp(280px, calc(100dvh - 275px), 560px)) !important;
    flex: 0 0 auto;
}

#inlineCropPanel .crop-stage {
    width: min(100%, 420px) !important;
}

.crop-tool-row,
.crop-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.crop-tool-row {
    margin-top: 2px;
}

.crop-tool-row button {
    min-height: 34px;
    padding: 6px 10px;
    color: var(--primary);
    background: #eef5ff;
    box-shadow: none;
}

.crop-tool-row button:hover {
    color: #fff;
    background: var(--primary);
}

.crop-actions {
    margin: 2px 0 0;
}

.crop-actions button {
    min-height: 38px;
    padding: 8px 14px;
}

.crop-help-text {
    margin-top: 0;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.3;
    text-align: center;
}

.cropper-container {
    touch-action: none;
}

.cropper-view-box {
    outline: 2px solid rgba(37, 111, 217, .95) !important;
    outline-color: rgba(37, 111, 217, .95) !important;
}

.cropper-face {
    background: rgba(37, 111, 217, .08);
}

.cropper-dashed {
    border-color: rgba(255, 255, 255, .75) !important;
}

.cropper-line {
    background-color: rgba(37, 111, 217, .85) !important;
    opacity: 1 !important;
}

.cropper-point {
    width: 14px !important;
    height: 14px !important;
    border: 2px solid var(--primary);
    border-radius: 999px;
    background-color: #fff !important;
    opacity: 1 !important;
}

.cropper-point.point-se {
    width: 18px !important;
    height: 18px !important;
}

.frame-share-modal {
    position: fixed;
    inset: 0;
    z-index: 100001;
    padding: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(12, 23, 38, .46);
}

.frame-share-modal.is-open {
    display: flex;
}

.frame-share-dialog {
    width: min(92vw, 420px);
    max-height: calc(100dvh - 36px);
    padding: 16px;
    overflow: auto;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 18px 48px rgba(10, 24, 43, .22);
}

.frame-share-header {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.frame-share-header h3 {
    margin: 0;
    font-size: 1.05rem;
}

.frame-share-close {
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: #eef4fb;
    box-shadow: none;
    font-size: 1.4rem;
}

#frameShareImage {
    width: min(100%, 280px);
    aspect-ratio: 1 / 1;
    margin: 0 auto 10px;
    display: block;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 8px 22px rgba(30, 80, 160, .12);
}

.frame-modal-frame-name {
    max-width: min(100%, 280px);
    margin: 0 auto 8px;
    display: block;
    color: #1e5fae;
    font-weight: 850;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#frameShareHint {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: .92rem;
    text-align: center;
}

#frameShareNote {
    margin: 0 0 6px;
    color: #111827;
    font-size: .84rem;
    font-style: italic;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
    word-break: break-word;
}

.frame-share-link-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px 40px;
    gap: 8px;
}

#frameShareLink {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 10px;
    color: var(--text);
    background: #f7f9fd;
}

.frame-share-link-row button {
    width: 40px;
    min-height: 40px;
    padding: 0;
    display: grid;
    place-items: center;
}

.frame-share-link-row button.is-copied {
    background: var(--success);
}

.frame-share-link-row svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#frameShareUploadFocus {
    width: 100%;
    margin-top: 10px;
}

.trend-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    padding: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(12, 23, 38, .46);
}

.trend-modal.is-open {
    display: flex;
}

.trend-dialog {
    width: min(94vw, 860px);
    max-height: 90vh;
    padding: 18px;
    overflow: auto;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 18px 48px rgba(10, 24, 43, .22);
}

.trend-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.trend-header h3 {
    margin: 0;
}

.trend-close {
    width: 40px;
    min-height: 40px;
    padding: 0;
    display: grid;
    place-items: center;
    background: #f3f6fa;
    color: #637083;
    box-shadow: none;
    font-size: 1.45rem;
}

.trend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.trend-item {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    background: var(--surface-muted);
    color: var(--text);
    box-shadow: none;
    cursor: pointer;
    text-align: left;
}

.trend-item:focus-visible {
    outline: 3px solid rgba(37, 111, 217, .25);
    outline-offset: 2px;
}

.trend-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: block;
    object-fit: contain;
    border: 1px solid #d9e3ee;
    border-radius: var(--radius);
    background: #fff;
}

.trend-share-button {
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    position: absolute;
    right: 14px;
    bottom: 72px;
    z-index: 2;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: rgba(255,255,255,.95);
    border: 1px solid rgba(37, 111, 217, .18);
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(34, 44, 58, .14);
}

.trend-use-count {
    position: absolute;
    left: 14px;
    bottom: 72px;
    z-index: 2;
    max-width: calc(100% - 58px);
    padding: 3px 6px;
    border-radius: 999px;
    color: #fff !important;
    background: rgba(18, 35, 57, .72);
    font-size: 10px !important;
    font-weight: 850;
    line-height: 1;
    pointer-events: none;
}

.trend-item .trend-frame-name {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    z-index: 4;
    margin: 0;
    padding: 4px 7px;
    border-radius: 999px;
    color: #fff;
    background: rgba(30, 95, 174, .92);
    box-shadow: 0 4px 12px rgba(18, 35, 57, .16);
    font-size: 10px;
    font-weight: 850;
    line-height: 1.15;
    text-align: center;
    opacity: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: translateY(-4px);
    transition: opacity .16s ease, transform .16s ease;
    pointer-events: none;
}

.trend-item:hover .trend-frame-name,
.trend-item:focus-visible .trend-frame-name {
    opacity: 1;
    transform: translateY(0);
}

.trend-share-button:hover,
.trend-share-button.is-copied {
    color: #fff;
    background: var(--success);
}

.trend-share-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.trend-item strong,
.trend-item span {
    display: block;
    min-width: 0;
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trend-empty {
    grid-column: 1 / -1;
    min-height: 120px;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-weight: 700;
}

.trend-item strong {
    color: #1e5fae;
    font-size: .9rem;
}

.trend-item span {
    color: var(--muted);
    font-size: .82rem;
}

.trend-pagination {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.trend-pagination button {
    min-height: 36px;
    padding: 7px 12px;
}

.trend-pagination span {
    color: var(--muted);
    font-weight: 750;
}

.home-welcome-modal {
    position: fixed;
    inset: 0;
    z-index: 220;
    padding: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10, 18, 31, .52);
    backdrop-filter: blur(5px);
}

.home-welcome-modal.is-open {
    display: flex;
}

.home-welcome-dialog {
    position: relative;
    width: min(66vw, 1100px);
    max-width: calc(100vw - 28px);
    max-height: calc(100dvh - 28px);
    display: grid;
    justify-items: center;
    gap: 14px;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.home-welcome-media {
    width: 100%;
    display: grid;
    place-items: center;
}

.home-welcome-media img,
.home-welcome-media video {
    width: 100%;
    max-height: min(74dvh, 720px);
    display: block;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 26px 90px rgba(0, 0, 0, .32);
}

.home-welcome-close {
    position: absolute;
    z-index: 2;
    top: -12px;
    right: -12px;
    width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    display: grid;
    place-items: center;
    color: #39506d;
    background: rgba(255, 255, 255, .92);
    border: 0;
    border-radius: 50%;
    box-shadow: 0 12px 28px rgba(17, 32, 52, .24);
}

.home-welcome-close svg,
.home-welcome-enter svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.home-welcome-enter {
    min-height: 44px;
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    background: linear-gradient(135deg, #256fd9, #1ab077);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 18px 40px rgba(37, 111, 217, .28);
    font-family: var(--font-heading);
    font-weight: 850;
}

.home-logo-strip {
    width: min(100%, 1840px);
    margin: 0 auto;
    padding: 0 24px 12px;
}

.home-logo-strip-inner {
    position: relative;
    min-height: 92px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid rgba(139, 192, 230, .72);
    border-radius: var(--radius);
    background: linear-gradient(135deg, #0f78ba, #1e9ad0);
    box-shadow: 0 8px 22px rgba(28, 48, 76, .08);
}

.home-logo-strip-inner.has-bg {
    background-image: linear-gradient(135deg, rgba(15, 120, 186, .72), rgba(30, 154, 208, .68)), var(--logo-strip-bg);
    background-position: center;
    background-size: cover;
}

.home-logo-strip-inner::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(15, 120, 186, .88), transparent 14%, transparent 86%, rgba(15, 120, 186, .88));
}

.home-logo-strip-track {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 44px;
    width: max-content;
    min-width: 200%;
    padding: 16px 44px;
    animation: homeLogoMarquee var(--logo-strip-speed, 36s) linear infinite;
    will-change: transform;
}

.home-logo-strip-inner:hover .home-logo-strip-track {
    animation-play-state: paused;
}

.home-logo-strip-item {
    flex: 0 0 auto;
    min-width: 96px;
    height: 58px;
    display: grid;
    place-items: center;
}

.home-logo-strip-item img {
    max-width: 132px;
    max-height: 58px;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .12));
}

@keyframes homeLogoMarquee {
    from {
        transform: translateX(-50%);
    }
    to {
        transform: translateX(0);
    }
}

.site-footer {
    width: min(100%, 1840px);
    margin: 0 auto;
    padding: 0 24px 22px;
}

.site-footer-inner {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(255, 255, 255, .72);
    box-shadow: 0 6px 18px rgba(28, 48, 76, 0.05);
}

.site-footer-brand {
    min-width: 0;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.site-footer-logo {
    width: 42px;
    height: 42px;
    display: block;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(28, 48, 76, .08);
}

.site-footer-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.site-footer strong {
    color: #1e5fae;
    font-family: var(--font-heading);
    font-size: var(--font-size-heading);
    font-weight: 800;
}

.site-footer-copy span {
    color: var(--muted);
    font-size: .92rem;
}

.site-footer-actions {
    min-width: 0;
    display: grid;
    justify-items: end;
    gap: 8px;
}

.site-footer-main-nav {
    align-items: center;
}

.site-footer nav,
.site-footer-secondary-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.site-footer-secondary-row {
    width: 100%;
    align-items: center;
    justify-content: flex-end;
    gap: 8px 10px;
}

.site-footer-social {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

.site-footer-social-link {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: #256fd9;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transition: transform .18s ease, opacity .18s ease;
}

.site-footer-social-link:hover,
.site-footer-social-link:focus-visible {
    transform: translateY(-2px);
    opacity: .86;
    background: transparent;
    box-shadow: none;
    outline: none;
}

.site-footer-social-link svg,
.site-footer-social-link img {
    width: 26px;
    height: 26px;
    display: block;
    object-fit: contain;
}

.site-footer-social-link svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#uploadPanel.is-upload-target {
    border-color: rgba(245, 158, 11, .82);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, .14), var(--shadow);
}

.site-footer-link {
    min-height: 34px;
    padding: 7px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: var(--font-size-heading);
    background: #fff;
    box-shadow: none;
    font-weight: 700;
    text-decoration: none;
}

.site-footer-link svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.site-footer-link:hover,
.site-footer-link:focus-visible,
.footer-about-menu:hover > .site-footer-link,
.footer-about-menu:focus-within > .site-footer-link,
.footer-about-menu.is-open > .site-footer-link {
    border-color: rgba(37, 111, 217, .34);
    background: #edf5ff;
}

.footer-about-menu {
    position: relative;
}

.footer-menu-chevron {
    width: 15px !important;
    height: 15px !important;
    transition: transform .18s ease;
}

.footer-about-menu:hover .footer-menu-chevron,
.footer-about-menu:focus-within .footer-menu-chevron,
.footer-about-menu.is-open .footer-menu-chevron {
    transform: rotate(180deg);
}

.footer-about-submenu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    z-index: 1000;
    width: min(290px, calc(100vw - 32px));
    padding: 8px;
    display: grid;
    gap: 5px;
    background: rgba(255,255,255,.96);
    border-radius: 12px;
    box-shadow: 0 18px 44px rgba(22, 39, 66, .18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    backdrop-filter: blur(14px);
}

.footer-about-menu:hover .footer-about-submenu,
.footer-about-menu:focus-within .footer-about-submenu,
.footer-about-menu.is-open .footer-about-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.footer-about-submenu button {
    min-height: 42px;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    color: #21466f;
    background: transparent;
    border-radius: 9px;
    box-shadow: none;
    font-size: 16px;
    text-align: left;
}

.footer-about-submenu button:hover,
.footer-about-submenu button:focus-visible {
    color: var(--primary);
    background: #edf5ff;
}

.footer-about-submenu svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (min-width: 981px) {
    .site-footer-main-nav {
        flex-wrap: nowrap;
    }

    .site-footer-main-nav .site-footer-link {
        white-space: nowrap;
    }
}

.footer-info-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    padding: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(17, 28, 44, .46);
    backdrop-filter: blur(8px);
}

.footer-info-modal.is-open {
    display: flex;
}

.footer-info-dialog {
    position: relative;
    width: min(92vw, 560px);
    padding: 30px 32px 28px;
    color: #1b2d44;
    background:
        radial-gradient(circle at top left, rgba(37, 111, 217, .12), transparent 38%),
        #fff;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 28px 70px rgba(11, 28, 51, .24);
}

.footer-info-modal.is-contact .footer-info-dialog {
    width: min(94vw, 920px);
}

.footer-info-content {
    display: block;
}

.footer-info-modal.is-contact .footer-info-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, .9fr);
    gap: 20px;
    align-items: start;
}

.footer-contact-form {
    display: none;
    gap: 10px;
    padding: 14px;
    background: #f7fbff;
    border: 1px solid rgba(211, 224, 240, .96);
    border-radius: 14px;
}

.footer-info-modal.is-contact .footer-contact-form {
    display: grid;
}

.footer-contact-form h4,
.footer-contact-form label,
.footer-contact-form p {
    margin: 0;
}

.footer-contact-form h4 {
    color: #17365e;
    font-size: 17px;
}

.footer-contact-form label {
    display: grid;
    gap: 5px;
    color: #36506f;
    font-weight: 750;
    font-size: .92rem;
}

.footer-contact-form input,
.footer-contact-form textarea {
    width: 100%;
    min-height: 38px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: #1d2f47;
    background: #fff;
    font: inherit;
}

.footer-contact-form textarea {
    min-height: 104px;
    resize: vertical;
}

.footer-contact-form button {
    min-height: 40px;
    border-radius: 10px;
}

.footer-contact-status {
    padding: 9px 10px;
    border-radius: 10px;
    color: #1f5f9f;
    background: #edf5ff;
    font-size: .92rem;
    font-weight: 750;
}

.footer-contact-status.is-error {
    color: #a82432;
    background: #fff0f2;
}

.footer-contact-status.is-success {
    color: #0f6b4d;
    background: #eafaf3;
}

.footer-info-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    min-height: 36px;
    padding: 0;
    display: grid;
    place-items: center;
    color: #5f6d80;
    background: #f3f7fb;
    border-radius: 999px;
    box-shadow: none;
}

.footer-info-close:hover {
    color: #fff;
    background: var(--primary);
}

.footer-info-close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}

.footer-info-icon {
    width: 58px;
    height: 58px;
    margin: 0 0 16px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #256fd9, #1f9bcf);
    border-radius: 16px;
    box-shadow: 0 12px 24px rgba(37, 111, 217, .24);
}

.footer-info-icon svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.footer-info-dialog h3 {
    margin: 0 0 12px;
    color: #17365e;
    font-size: 22px;
}

.footer-info-body {
    display: grid;
    gap: 10px;
    color: #3b4d63;
    font-size: 15px;
    line-height: 1.62;
}

.footer-info-body p,
.footer-info-body ul,
.footer-info-body ol,
.footer-info-body h3,
.footer-info-body h4 {
    margin: 0;
}

.footer-info-body h3,
.footer-info-body h4 {
    color: #17365e;
    line-height: 1.28;
}

.footer-info-body h3 {
    font-size: 18px;
}

.footer-info-body h4 {
    font-size: 16px;
}

.footer-info-body ul,
.footer-info-body ol {
    padding-left: 18px;
}

.footer-info-body li + li {
    margin-top: 4px;
}

.footer-info-body a {
    color: var(--primary);
    font-weight: 750;
    text-decoration: none;
}

.footer-info-body a:hover {
    text-decoration: underline;
}

.footer-info-body small {
    color: #65758a;
}

.utility-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    padding: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(16, 28, 45, .52);
    backdrop-filter: blur(8px);
}

.profile-utilities-section {
    padding: 18px;
}

.profile-utility-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.profile-utility-card {
    min-width: 0;
    padding: 12px;
    display: grid;
    gap: 9px;
    border: 1px solid rgba(211, 224, 240, .95);
    border-radius: var(--radius);
    background: #f8fbff;
}

.profile-utility-card.is-empty {
    border-color: #ffd0d6;
    background: #fff6f7;
}

.profile-utility-card h3,
.profile-utility-card p,
.profile-utility-card dl {
    margin: 0;
}

.profile-utility-card h3 {
    font-family: var(--font-heading);
    font-size: .88rem;
    line-height: 1.24;
}

.profile-utility-card p {
    color: #245fae;
    font-weight: 850;
    font-size: .9rem;
}

.profile-utility-card dl {
    display: grid;
    gap: 7px;
}

.profile-utility-card dl div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #5f6d80;
    font-size: .84rem;
}

.profile-utility-card dd {
    margin: 0;
    color: #172b44;
    font-weight: 850;
}

.profile-utility-topup {
    margin-top: 16px;
    padding: 16px;
    display: grid;
    grid-template-columns: minmax(460px, .9fr) repeat(3, minmax(190px, 1fr));
    align-items: stretch;
    gap: 14px;
    border: 1px solid rgba(255, 184, 89, .55);
    border-radius: var(--radius);
    background: #fffaf0;
}

.profile-utility-notice {
    display: grid;
    align-content: start;
    gap: 10px;
}

.profile-utility-notice h3,
.profile-utility-notice p {
    margin: 0;
}

.profile-utility-notice h3 {
    font-family: var(--font-heading);
    font-size: 1.04rem;
}

.profile-utility-plan-list [data-bill-upload-link] {
    width: 100%;
    min-height: 50px;
    align-self: center;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(180deg, #4d83e4 0%, #2f69d2 100%);
    border-radius: 10px;
    text-decoration: none;
    font-weight: 850;
    text-align: center;
    box-shadow: 0 7px 0 #1f54ac, 0 14px 24px rgba(37, 111, 217, .22);
    transform: translateY(0);
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.profile-utility-plan-list [data-bill-upload-link]:hover {
    filter: brightness(1.04);
    transform: translateY(-4px);
    box-shadow: 0 11px 0 #1f54ac, 0 18px 30px rgba(37, 111, 217, .28);
}

.profile-utility-plan-list [data-bill-upload-link]:active {
    transform: translateY(3px);
    box-shadow: 0 4px 0 #1f54ac, 0 8px 16px rgba(37, 111, 217, .2);
}

.profile-utility-plan-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.profile-utility-plan-option {
    min-width: 0;
    min-height: 76px;
    padding: 9px 10px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(211, 224, 240, .95);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.profile-utility-plan-option:hover {
    border-color: rgba(72, 127, 216, .42);
    box-shadow: 0 6px 14px rgba(42, 93, 155, .08);
}

.profile-utility-plan-option:has(input:checked),
.profile-utility-plan-option.is-selected {
    border-color: rgba(230, 172, 39, .72);
    background: linear-gradient(180deg, #fff9df, #fff4c4);
    box-shadow: 0 8px 18px rgba(204, 144, 23, .12);
}

.profile-utility-plan-option input {
    width: 18px;
    height: 18px;
}

.profile-utility-plan-option > span {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.profile-utility-plan-option strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-utility-plan-meta {
    min-width: 0;
    display: grid;
    gap: 1px;
    color: var(--muted);
    font-weight: 750;
    line-height: 1.25;
}

.profile-utility-plan-price,
.profile-utility-plan-detail {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-utility-qr-card {
    position: relative;
    min-width: 0;
    height: 100%;
    padding: 12px;
    display: grid;
    align-content: start;
    justify-items: center;
    gap: 9px;
    background: #fff;
    border: 1px solid rgba(211, 224, 240, .95);
    border-radius: 12px;
}

.profile-utility-qr-card.has-bg {
    overflow: hidden;
    background-image: var(--utility-card-bg);
    background-size: cover;
    background-position: center;
}

.profile-utility-qr-card.has-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(1.5px);
    z-index: 0;
}

.profile-utility-qr-card > * {
    position: relative;
    z-index: 1;
}

.profile-plan-qr {
    width: 100%;
    display: grid;
    justify-items: center;
    gap: 7px;
}

.profile-plan-qr strong {
    color: #172b44;
    font-size: .95rem;
}

.profile-utility-qr-card h4 {
    margin: 0;
    color: #24415f;
    font-size: .94rem;
    text-align: center;
}

.profile-utility-qr-card img {
    width: min(100%, 190px);
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 8px;
}

.profile-utility-qr-card span {
    color: var(--muted);
    font-weight: 750;
}

@media (max-width: 1120px) {
    .profile-utility-topup {
        grid-template-columns: 1fr;
    }
}

.user-notification-toasts {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 120000;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 36px));
}

.user-notification-toast {
    min-height: 72px;
    padding: 12px 40px 12px 14px;
    position: relative;
    display: grid;
    gap: 3px;
    color: #17365e;
    text-align: left;
    background: #fff;
    border: 1px solid rgba(37, 111, 217, .22);
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(22, 39, 66, .18);
}

.user-notification-toast strong {
    font-size: .98rem;
}

.user-notification-toast span {
    color: #5f6d80;
    font-size: .9rem;
}

.user-notification-toast i {
    position: absolute;
    top: 8px;
    right: 12px;
    color: #76849a;
    font-style: normal;
    font-size: 18px;
}

.utility-bill-main {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 18px;
}

.utility-bill-card {
    padding: 22px;
    display: grid;
    gap: 16px;
}

.utility-bill-head h1,
.utility-bill-head p {
    margin: 0;
}

.utility-bill-head h1 {
    font-family: var(--font-heading);
}

.utility-bill-head p {
    margin-top: 6px;
    color: var(--muted);
}

.utility-bill-form {
    display: grid;
    gap: 12px;
}

.utility-bill-form label {
    min-width: 0;
    display: grid;
    gap: 6px;
    color: #36506f;
    font-weight: 750;
}

.utility-bill-form input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
}

.utility-bill-form button {
    width: max-content;
    min-height: 42px;
    padding-inline: 16px;
    justify-self: center;
}

@media (max-width: 980px) {
    .footer-info-modal.is-contact .footer-info-content,
    .profile-utility-topup {
        grid-template-columns: 1fr;
    }

    .profile-utility-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .site-footer-inner {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .site-footer-actions {
        width: 100%;
    }

    .site-footer-social {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 560px) {
    .profile-utility-grid {
        grid-template-columns: 1fr;
    }

    .profile-utility-plan-list {
        grid-template-columns: 1fr;
    }
}

.utility-modal.is-open {
    display: flex;
}

.utility-dialog {
    width: min(96vw, 1040px);
    max-height: 92vh;
    padding: 18px;
    overflow: auto;
    color: #1f2f46;
    background: #fff;
    border: 1px solid rgba(215, 226, 239, .92);
    border-radius: 14px;
    box-shadow: 0 28px 80px rgba(12, 30, 54, .28);
}

.utility-dialog-wide {
    width: min(96vw, 1240px);
}

.utility-header {
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.utility-header h3 {
    margin: 0 0 4px;
    color: #17365e;
    font-size: 22px;
}

.utility-title-row {
    margin-bottom: 4px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.utility-title-row h3 {
    margin-bottom: 0;
}

.utility-guide-trigger {
    width: 30px;
    min-height: 30px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(245, 158, 11, .42);
    border-radius: 50%;
    color: #9a5708;
    background: linear-gradient(180deg, #fff7e6, #fff);
    box-shadow: 0 7px 18px rgba(161, 91, 6, .12);
}

.utility-guide-trigger span[aria-hidden="true"] {
    font-family: var(--font-heading);
    font-size: 1rem;
    line-height: 1;
}

.utility-guide-trigger:hover,
.utility-guide-trigger:focus-visible {
    color: #fff;
    background: #f59e0b;
    border-color: #f59e0b;
}

.utility-header span {
    color: var(--muted);
    font-size: .92rem;
}

.utility-header-actions {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.utility-close,
.utility-reset {
    width: 40px;
    min-height: 40px;
    padding: 0;
    display: grid;
    place-items: center;
    color: #64748b;
    background: #f3f7fb;
    box-shadow: none;
}

.utility-reset {
    color: var(--primary);
    background: #eef6ff;
    border: 1px solid #cfe1ff;
}

.utility-close:hover {
    color: #fff;
    background: var(--primary);
}

.utility-reset:hover,
.utility-reset:focus-visible {
    color: #fff;
    background: var(--success);
    border-color: var(--success);
}

.utility-close svg,
.utility-reset svg,
.utility-icon-button svg,
.gif-action-grid svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.utility-guide-modal {
    position: fixed;
    inset: 0;
    z-index: 100002;
    display: none;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(7px);
}

.utility-guide-modal.is-open {
    display: grid;
}

.utility-guide-dialog {
    position: relative;
    width: min(820px, calc(100vw - 28px));
    max-height: calc(100vh - 36px);
    overflow: auto;
    padding: 24px;
    color: #1f2f46;
    border: 1px solid rgba(214, 226, 241, .96);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .24);
}

.utility-guide-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    min-height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 12px;
    color: #6b7484;
    background: #f2f6fb;
    box-shadow: none;
}

.utility-guide-close:hover,
.utility-guide-close:focus-visible {
    color: #fff;
    background: var(--primary);
}

.utility-guide-close svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
}

.utility-guide-kicker,
.utility-guide-dialog h3,
.utility-guide-dialog h4,
.utility-guide-intro,
.utility-guide-card p,
.utility-guide-best ul {
    margin: 0;
}

.utility-guide-kicker {
    color: #256fd9;
    font-weight: 850;
}

.utility-guide-dialog h3 {
    margin-top: 5px;
    padding-right: 46px;
    color: #172238;
    font-family: var(--font-heading);
    font-size: clamp(1.25rem, 2.2vw, 1.72rem);
    line-height: 1.18;
}

.utility-guide-intro {
    margin-top: 10px;
    color: #66758a;
    line-height: 1.55;
}

.utility-guide-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.utility-guide-card {
    min-width: 0;
    display: grid;
    gap: 7px;
    padding: 14px;
    border: 1px solid #dce7f3;
    border-radius: 14px;
    background: #f8fbff;
}

.utility-guide-card.is-best {
    border-color: #f4c46a;
    background: #fffaf0;
}

.utility-guide-card span {
    width: max-content;
    max-width: 100%;
    padding: 5px 9px;
    border-radius: 999px;
    color: #225cae;
    background: #eaf2ff;
    font-weight: 900;
}

.utility-guide-card h4,
.utility-guide-best h4 {
    color: #1f2a3d;
    font-size: 1rem;
}

.utility-guide-card p,
.utility-guide-best li {
    color: #64748b;
    line-height: 1.5;
}

.utility-guide-best {
    margin-top: 14px;
    padding: 15px;
    border: 1px solid #f0d49b;
    border-radius: 14px;
    background: linear-gradient(180deg, #fff9eb, #fff);
}

.utility-guide-best ul {
    margin-top: 9px;
    padding-left: 20px;
}

.utility-grid {
    display: grid;
    grid-template-columns: minmax(250px, .82fr) minmax(280px, 1fr) minmax(320px, 1.12fr);
    gap: 14px;
    align-items: stretch;
}

.utility-tool-panel,
.utility-preview-panel {
    min-width: 0;
    border: 1px solid #dce6f2;
    border-radius: var(--radius);
    padding: 14px;
    background: #fbfdff;
}

.utility-tool-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.utility-preview-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.utility-preview-panel h4,
.utility-panel-title-row h4 {
    margin: 0;
    color: #20324a;
    font-size: 1rem;
}

.utility-panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.utility-panel-title-row span,
.utility-meta-line {
    color: var(--muted);
    font-size: .86rem;
    font-weight: 750;
}

.utility-file-picker {
    margin: 0;
}

.utility-option-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}

.utility-option-grid label,
.utility-eraser-tools label {
    margin: 0;
    color: #3a4b62;
    font-weight: 800;
}

.utility-option-grid select,
.utility-option-grid input[type="range"] {
    width: 100%;
    margin-top: 6px;
}

.utility-primary,
.utility-success,
.utility-secondary,
.utility-small-button,
.utility-download-link {
    min-height: 42px;
    padding: 10px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-family: var(--font-heading);
    font-size: var(--font-size-heading);
    font-weight: 800;
    text-decoration: none;
}

.utility-primary {
    width: 100%;
}

.utility-success {
    color: #fff;
    background: var(--success);
    box-shadow: 0 10px 22px rgba(46, 150, 96, .18);
}

.utility-secondary {
    color: var(--primary);
    background: #eef6ff;
    border: 1px solid #cfe1ff;
    box-shadow: none;
}

.utility-success:disabled,
.utility-secondary:disabled,
.utility-download-link.is-disabled {
    pointer-events: none;
    opacity: .55;
}

.utility-progress {
    display: grid;
    gap: 8px;
}

.utility-status {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #2f4a6b;
    font-weight: 800;
}

.utility-status i {
    width: 28px;
    height: 8px;
    display: inline-block;
    background: radial-gradient(circle, currentColor 45%, transparent 50%) 0 50% / 8px 8px repeat-x;
    animation: utilityThinking 1s linear infinite;
    opacity: .65;
}

@keyframes utilityThinking {
    from { background-position-x: 0; }
    to { background-position-x: 8px; }
}

.utility-progress-track {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8eef7;
}

.utility-progress-track span {
    width: 0;
    height: 100%;
    display: block;
    border-radius: inherit;
    background: linear-gradient(90deg, #256fd9, #2ebf91);
    transition: width .22s ease;
}

.utility-canvas-box,
.utility-image-box {
    position: relative;
    min-height: 340px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid #dce6f2;
    border-radius: var(--radius);
    background: #f7faff;
}

.utility-preview-watermarked::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 142%;
    height: 72px;
    transform: translate(-50%, -50%) rotate(-45deg);
    background: rgba(255, 255, 255, .24) var(--preview-watermark-logo) center / 54px 54px repeat-x;
    opacity: .34;
    pointer-events: none;
    z-index: 2;
}

.utility-transparent-box {
    background-color: #fff;
    background-image:
        linear-gradient(45deg, rgba(148, 163, 184, .16) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(148, 163, 184, .16) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, .16) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, .16) 75%);
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    background-size: 20px 20px;
}

.utility-canvas-box canvas {
    max-width: 100%;
    max-height: 520px;
    display: block;
    object-fit: contain;
    border-radius: 6px;
}

#bgUtilityResultCanvas {
    cursor: default;
    touch-action: none;
}

#bgUtilityResultCanvas.is-erasing {
    cursor: crosshair;
}

.utility-image-box img {
    max-width: 100%;
    max-height: 520px;
    display: none;
    object-fit: contain;
    border-radius: 6px;
}

.utility-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 16px;
    color: #7b8798;
    font-weight: 800;
    text-align: center;
}

.utility-eraser-tools {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: end;
}

.utility-icon-button {
    width: 44px;
    min-height: 44px;
    padding: 0;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: #eef6ff;
    border: 1px solid #cfe1ff;
    box-shadow: none;
}

.utility-icon-button.is-active {
    color: #fff;
    background: var(--warning);
    border-color: var(--warning);
}

.utility-small-button {
    min-height: 38px;
    padding: 8px 10px;
    color: #2d4a70;
    background: #f2f6fb;
    box-shadow: none;
}

.utility-hint {
    margin: 0;
    color: #7a6a53;
    font-size: .9rem;
    line-height: 1.45;
}

.utility-download-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.gif-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.gif-action-grid button {
    min-height: 58px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--primary);
    background: #eef6ff;
    border: 1px solid #cfe1ff;
    box-shadow: none;
    font-size: .95rem;
}

.utility-download-link {
    width: 100%;
    margin-top: auto;
}

.qr-page {
    min-height: 100vh;
    background: #fffaf3;
}

.qr-main::before {
    content: "";
    position: absolute;
    top: -18vh;
    right: -18vw;
    z-index: -1;
    width: min(58vw, 860px);
    height: calc(100% + 18vh);
    pointer-events: none;
    background: rgba(255, 231, 165, .5);
    border-radius: 48% 0 0 55%;
}

.qr-main::after {
    content: "";
    position: absolute;
    right: 22vw;
    bottom: -18vh;
    z-index: -1;
    width: min(26vw, 380px);
    height: 64vh;
    pointer-events: none;
    background: rgba(255, 250, 243, .58);
    border-radius: 48% 52% 0 0;
}

.qr-main,
.qr-page .site-footer {
    position: relative;
    z-index: 1;
}

.qr-page .header-bar {
    z-index: 10020;
}

.qr-main {
    width: min(100%, 1480px);
    margin: 0 auto;
    padding: 28px 24px 46px;
    overflow: hidden;
    isolation: isolate;
}

.qr-page .site-footer {
    z-index: 2;
}

.qr-page .site-footer-inner {
    background-color: rgba(255, 255, 255, .72);
}

.qr-hero {
    display: grid;
    gap: 24px;
    justify-items: center;
}

.qr-hero h1 {
    margin: 0;
    color: #111827;
    font-family: var(--font-title);
    font-size: clamp(42px, 5vw, 72px);
    font-weight: 400;
    line-height: 1;
    text-align: center;
}

.qr-tabs {
    width: min(100%, 1440px);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.qr-tab {
    width: auto;
    min-height: 46px;
    padding: 9px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #273247;
    background: rgba(255,255,255,.94);
    border: 2px solid rgba(220, 229, 239, .95);
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(31, 41, 55, .12);
    font-size: 15px;
}

.qr-tab svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.qr-tab:hover,
.qr-tab.is-active {
    color: #df5038;
    background: #fff;
    border-color: #df5038;
    box-shadow: 0 4px 12px rgba(223, 80, 56, .16);
}

.qr-workspace {
    width: min(100%, 1120px);
    margin: 36px auto 0;
    display: grid;
    grid-template-columns: minmax(0, 660px) minmax(300px, 380px);
    align-items: start;
    justify-content: center;
    gap: 24px;
}

.qr-form-card,
.qr-output-card {
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 18px;
    box-shadow: 0 8px 26px rgba(31, 41, 55, .10);
}

.qr-form-card {
    padding: 30px;
    display: grid;
    gap: 18px;
}

.qr-panel {
    display: grid;
    gap: 14px;
}

.qr-panel[hidden] {
    display: none !important;
}

.convert-main {
    width: min(100%, 1840px);
    margin: 0 auto;
    padding: 24px 24px 34px;
}

.convert-workspace {
    display: grid;
    grid-template-columns: minmax(280px, .9fr) minmax(320px, 1fr) minmax(320px, 1fr);
    gap: 18px;
    align-items: stretch;
}

.convert-panel {
    min-width: 0;
    padding: 18px;
    display: grid;
    align-content: start;
    gap: 16px;
    border: 1px solid rgba(211, 224, 240, .95);
    border-radius: 16px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 8px 26px rgba(31, 41, 55, .08);
}

.convert-panel-head {
    min-width: 0;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 11px;
    align-items: center;
}

.convert-panel-head > span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: #256fd9;
    font-weight: 900;
}

.convert-panel-head h1,
.convert-panel-head h2,
.convert-panel-head p {
    margin: 0;
}

.convert-panel-head h1,
.convert-panel-head h2 {
    color: #172238;
    font-family: var(--font-heading);
    font-size: 1.22rem;
}

.convert-panel-head p {
    margin-top: 2px;
    color: #68768a;
    line-height: 1.45;
}

.convert-form,
.convert-control-grid {
    display: grid;
    gap: 13px;
}

.convert-file-meta {
    min-width: 0;
    padding: 12px;
    display: grid;
    gap: 3px;
    border: 1px dashed #c8d8ea;
    border-radius: 12px;
    background: #f8fbff;
}

.convert-file-meta strong,
.convert-file-meta span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.convert-file-meta span {
    color: #68768a;
}

.convert-control-grid label {
    display: grid;
    gap: 7px;
    color: #354158;
    font-weight: 760;
}

.convert-control-grid select,
.convert-control-grid input[type="range"] {
    width: 100%;
}

.convert-control-grid select {
    min-height: 44px;
    border: 1px solid #d9e0e8;
    border-radius: 10px;
    padding: 9px 12px;
    background: #fff;
    color: #273247;
    font-weight: 720;
}

.convert-control-grid b {
    float: right;
    color: #256fd9;
}

.pdf-converter-scan-field {
    min-height: 44px;
    padding: 10px 12px;
    display: flex !important;
    align-items: center;
    gap: 9px;
    border: 1px solid #d9e0e8;
    border-radius: 10px;
    background: #f8fbff;
}

.pdf-converter-scan-field[hidden] {
    display: none !important;
}

.pdf-converter-scan-field input {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    accent-color: #256fd9;
}

.pdf-converter-scan-field span {
    min-width: 0;
    color: #354158;
    font-weight: 800;
}

.convert-canvas-wrap {
    position: relative;
    min-height: 360px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid #dbe5f0;
    border-radius: 14px;
    background:
        linear-gradient(45deg, rgba(226, 232, 240, .42) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(226, 232, 240, .42) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(226, 232, 240, .42) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(226, 232, 240, .42) 75%);
    background-size: 22px 22px;
    background-position: 0 0, 0 11px, 11px -11px, -11px 0;
}

.convert-canvas-wrap canvas {
    width: auto;
    max-width: 100%;
    max-height: min(68vh, 740px);
    display: block;
    box-shadow: 0 12px 28px rgba(20, 38, 64, .15);
}

.convert-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #718096;
    font-weight: 820;
    background: rgba(248, 251, 255, .72);
}

.convert-action-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.convert-primary,
.convert-secondary {
    min-height: 42px;
    padding: 8px 10px;
    font-size: .92rem;
}

.convert-secondary {
    color: #245fae;
    background: #f4f8ff;
    border: 1px solid #d4e4fb;
    box-shadow: none;
}

.convert-primary:disabled,
.convert-secondary:disabled {
    cursor: not-allowed;
    opacity: .58;
}

.pdf-converter-workspace {
    grid-template-columns: minmax(280px, .9fr) minmax(340px, 1fr) minmax(340px, 1fr);
}

.pdf-converter-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.pdf-converter-meta-grid article {
    min-width: 0;
    padding: 11px 12px;
    display: grid;
    gap: 3px;
    border: 1px solid #dbe5f0;
    border-radius: 12px;
    background: #f8fbff;
}

.pdf-converter-meta-grid span {
    color: #68768a;
    font-size: .86rem;
    font-weight: 760;
}

.pdf-converter-meta-grid strong {
    color: #172238;
    font-size: 1.08rem;
}

.pdf-converter-page-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.pdf-converter-page-nav span {
    color: #354158;
    font-weight: 850;
    white-space: nowrap;
}

.pdf-converter-progress {
    display: grid;
    gap: 7px;
}

.pdf-converter-progress small {
    color: #52627a;
    font-weight: 760;
}

.pdf-converter-result-list {
    position: relative;
    min-height: 430px;
    max-height: min(70vh, 740px);
    overflow: auto;
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 10px;
    border: 1px solid #dbe5f0;
    border-radius: 14px;
    background: #f7faff;
}

.pdf-converter-result-empty {
    border-radius: inherit;
}

.pdf-converter-download-card,
.pdf-converter-image-card {
    min-width: 0;
    padding: 10px;
    display: grid;
    gap: 10px;
    align-items: center;
    border: 1px solid rgba(211, 224, 240, .95);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(31, 41, 55, .06);
}

.pdf-converter-download-card {
    grid-template-columns: 62px minmax(0, 1fr);
}

.pdf-converter-image-card {
    grid-template-columns: 96px minmax(0, 1fr);
    cursor: zoom-in;
}

.pdf-converter-image-card:focus-visible {
    outline: 3px solid rgba(37, 111, 217, .32);
    outline-offset: 2px;
}

.pdf-converter-image-card img {
    width: 96px;
    aspect-ratio: 1 / 1.25;
    object-fit: contain;
    border: 1px solid #dbe5f0;
    border-radius: 8px;
    background: #fff;
}

.pdf-converter-result-icon {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: #256fd9;
    font-weight: 900;
    letter-spacing: 0;
}

.pdf-converter-download-card strong,
.pdf-converter-image-card strong,
.pdf-converter-download-card small,
.pdf-converter-image-card small {
    min-width: 0;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-converter-download-card strong,
.pdf-converter-image-card strong {
    color: #172238;
    font-size: .94rem;
}

.pdf-converter-download-card small,
.pdf-converter-image-card small {
    margin-top: 3px;
    color: #68768a;
    font-weight: 760;
}

.pdf-converter-document-preview {
    min-width: 0;
    padding: 12px;
    display: grid;
    gap: 12px;
    border: 1px solid rgba(211, 224, 240, .95);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(31, 41, 55, .06);
}

.pdf-converter-document-preview-head {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pdf-converter-document-preview-head strong {
    min-width: 0;
    color: #172238;
    font-size: .95rem;
    font-weight: 900;
}

.pdf-converter-document-preview-head small {
    flex: 0 0 auto;
    color: #68768a;
    font-weight: 800;
}

.pdf-converter-document-preview-body {
    min-width: 0;
    display: grid;
    gap: 12px;
}

.pdf-converter-document-page {
    width: min(100%, 440px);
    position: relative;
    overflow: hidden;
    container-type: inline-size;
    margin: 0 auto;
    border: 1px solid #dbe5f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(20, 38, 64, .12);
}

.pdf-converter-preview-line {
    position: absolute;
    overflow: hidden;
    color: #111827;
    line-height: 1.15;
    letter-spacing: 0;
    white-space: pre-wrap;
}

.pdf-converter-document-image-page {
    width: min(100%, 440px);
    margin: 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid #dbe5f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(20, 38, 64, .12);
}

.pdf-converter-document-image-page img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: inherit;
}

.pdf-converter-table-preview {
    max-height: 420px;
    overflow: auto;
    border: 1px solid #dbe5f0;
    border-radius: 10px;
    background: #fff;
}

.pdf-converter-table-preview table {
    width: 100%;
    border-collapse: collapse;
    color: #172238;
    font-size: .86rem;
}

.pdf-converter-table-preview th,
.pdf-converter-table-preview td {
    padding: 9px 10px;
    border-bottom: 1px solid #e6edf5;
    text-align: left;
    vertical-align: top;
}

.pdf-converter-table-preview th {
    position: sticky;
    top: 0;
    background: #f4f8ff;
    font-weight: 900;
}

.pdf-converter-preview-note {
    margin: 0;
    color: #68768a;
    font-weight: 760;
}

.pdf-converter-image-zoom {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100060;
    width: min(420px, calc(100vw - 24px));
    max-height: min(76vh, 620px);
    padding: 10px;
    display: grid;
    gap: 8px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    border: 1px solid rgba(211, 224, 240, .98);
    border-radius: 14px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 24px 54px rgba(20, 38, 64, .24);
    transition: opacity .14s ease, transform .14s ease;
}

.pdf-converter-image-zoom.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.pdf-converter-image-zoom img {
    width: 100%;
    max-height: min(66vh, 540px);
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
}

.pdf-converter-image-zoom span {
    min-width: 0;
    overflow: hidden;
    color: #354158;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-converter-action-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, .7fr);
}

.design-frame-main {
    width: min(100%, 1840px);
    margin: 0 auto;
    padding: 24px 24px 34px;
}

.design-frame-workspace {
    display: grid;
    grid-template-columns: minmax(300px, .92fr) minmax(420px, 1fr) minmax(320px, .95fr);
    gap: 18px;
    align-items: start;
}

.design-frame-panel {
    min-width: 0;
    padding: 18px;
    display: grid;
    gap: 16px;
    border: 1px solid rgba(211, 224, 240, .95);
    border-radius: 16px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 8px 26px rgba(31, 41, 55, .08);
}

.design-frame-panel-head {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 11px;
    align-items: center;
}

.design-frame-panel-head > span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: #256fd9;
    font-weight: 900;
}

.design-frame-panel-head h1,
.design-frame-panel-head h2,
.design-frame-panel-head p {
    margin: 0;
}

.design-frame-panel-head h1,
.design-frame-panel-head h2,
.design-tool-title h2 {
    color: #172238;
    font-family: var(--font-heading);
}

.design-frame-panel-head h1,
.design-frame-panel-head h2 {
    font-size: 1.2rem;
}

.design-frame-panel-head p {
    margin-top: 2px;
    color: #68768a;
    line-height: 1.45;
}

.design-tool-section {
    min-width: 0;
    padding: 13px;
    display: grid;
    gap: 12px;
    border: 1px solid #dce6f2;
    border-radius: 14px;
    background: #f8fbff;
}

.design-tool-section.is-collapsed > :not(.design-tool-title) {
    display: none;
}

.design-tool-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.design-tool-title-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.design-tool-title h2 {
    margin: 0;
    font-size: 1rem;
}

.design-tool-title button,
.design-editor-toolbar button {
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid #d7e4f5;
    border-radius: 9px;
    color: #245fae;
    background: #fff;
    font-weight: 800;
}

.design-library-pager {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid #d7e4f5;
    border-radius: 9px;
    background: #fff;
}

.design-library-pager button {
    width: 26px;
    min-height: 24px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    color: #245fae;
    background: #edf5ff;
    box-shadow: none;
    font-size: 18px;
    line-height: 1;
}

.design-library-pager button:disabled {
    opacity: .42;
    cursor: not-allowed;
}

.design-library-pager span {
    min-width: 34px;
    color: #516179;
    font-size: .76rem;
    font-weight: 900;
    text-align: center;
}

.design-frame-library-grid,
.design-icon-library-grid,
.design-built-in-icons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.design-frame-library-grid {
    max-height: 520px;
    overflow: auto;
    padding-right: 3px;
}

.design-frame-template,
.design-icon-template,
.design-built-in-icon {
    min-width: 0;
    padding: 8px;
    display: grid;
    gap: 6px;
    border: 1px solid #d7e4f5;
    border-radius: 12px;
    background: #fff;
    color: #243349;
    font-weight: 800;
    text-align: center;
    cursor: pointer;
}

.design-frame-template img,
.design-icon-template img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 8px;
    background:
        linear-gradient(45deg, rgba(226, 232, 240, .45) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(226, 232, 240, .45) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(226, 232, 240, .45) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(226, 232, 240, .45) 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.design-frame-template span,
.design-icon-template span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #68768a;
    font-size: .74rem;
}

.design-built-in-icons {
    margin-top: -2px;
}

.design-built-in-icon svg {
    width: 36px;
    height: 36px;
    margin: 8px auto 2px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.design-text-tool label,
.design-font-field,
.design-control-grid label,
.design-save-fields label {
    display: grid;
    gap: 7px;
    color: #354158;
    font-weight: 760;
}

.design-text-tool textarea,
.design-save-fields textarea,
.design-save-fields input,
.design-control-grid select,
.design-control-grid input[type="color"] {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d9e0e8;
    border-radius: 10px;
    padding: 9px 12px;
    background: #fff;
    color: #273247;
    font: inherit;
    font-weight: 720;
}

.design-font-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.design-font-picker {
    position: relative;
    min-width: 0;
}

.design-font-picker-button {
    width: 100%;
    min-height: 42px;
    padding: 8px 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 18px;
    align-items: center;
    gap: 8px;
    border: 1px solid #d9e0e8;
    border-radius: 10px;
    background: #fff;
    color: #273247;
    cursor: pointer;
}

.design-font-picker-button::after {
    content: "";
    width: 9px;
    height: 9px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(45deg) translateY(-2px);
}

.design-font-picker-button span,
.design-font-picker-list button span {
    min-width: 0;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1rem;
    line-height: 1.2;
    letter-spacing: 0;
}

.design-font-picker-list {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 220px;
    padding: 6px;
    display: grid;
    gap: 4px;
    overflow: auto;
    border: 1px solid #d7e4f5;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(24, 48, 84, .18);
}

.design-font-picker-list[hidden] {
    display: none !important;
}

.design-font-picker-list button {
    min-width: 0;
    min-height: 34px;
    padding: 6px 9px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: #273247;
    text-align: left;
    cursor: pointer;
}

.design-font-picker-list button:hover,
.design-font-picker-list button:focus-visible,
.design-font-picker-list button.is-active {
    border-color: #c8dcfb;
    background: #f1f6ff;
}

.design-text-tool textarea,
.design-save-fields textarea {
    resize: vertical;
}

.design-control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.design-control-grid input[type="range"] {
    width: 100%;
}

.design-control-grid b {
    color: #256fd9;
}

.design-text-toggles,
.design-result-actions,
.design-editor-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.design-text-toggles label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #4b5870;
    font-weight: 760;
}

.design-frame-primary,
.design-frame-secondary {
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 10px;
    font-family: var(--font-heading);
    font-weight: 900;
    cursor: pointer;
}

.design-frame-primary {
    border: 0;
    color: #fff;
    background: #256fd9;
    box-shadow: 0 8px 18px rgba(37, 111, 217, .22);
}

.design-frame-secondary {
    border: 1px solid #d4e4fb;
    color: #245fae;
    background: #f4f8ff;
}

.design-frame-primary:disabled,
.design-frame-secondary:disabled,
.design-editor-toolbar button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.design-canvas-shell,
.design-result-wrap {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid #dbe5f0;
    border-radius: 14px;
    background:
        linear-gradient(45deg, rgba(226, 232, 240, .42) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(226, 232, 240, .42) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(226, 232, 240, .42) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(226, 232, 240, .42) 75%);
    background-size: 22px 22px;
    background-position: 0 0, 0 11px, 11px -11px, -11px 0;
}

.design-canvas-shell {
    min-height: 520px;
    touch-action: none;
}

.design-canvas-shell canvas,
.design-result-wrap canvas {
    width: min(100%, 620px);
    height: auto;
    display: block;
}

.design-canvas-shell canvas {
    cursor: grab;
}

.design-canvas-shell canvas.is-dragging {
    cursor: grabbing;
}

.design-result-wrap {
    min-height: 420px;
}

.design-empty-state {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #718096;
    font-weight: 820;
    background: rgba(248, 251, 255, .72);
}

.design-empty-state[hidden],
.design-empty[hidden] {
    display: none !important;
}

.design-save-fields {
    display: grid;
    gap: 11px;
}

.design-result-actions button {
    flex: 1 1 180px;
}

.design-empty {
    grid-column: 1 / -1;
    margin: 0;
    color: #718096;
    font-weight: 780;
}

.convert-guide-modal {
    position: fixed;
    inset: 0;
    z-index: 520;
    display: none;
    place-items: center;
    padding: 22px;
    background: rgba(15, 23, 42, .48);
    backdrop-filter: blur(7px);
}

.convert-guide-modal.is-open {
    display: grid;
}

.convert-guide-dialog {
    position: relative;
    width: min(780px, calc(100vw - 28px));
    max-height: calc(100vh - 36px);
    overflow: auto;
    padding: 26px;
    border: 1px solid rgba(210, 224, 241, .96);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .24);
}

.convert-guide-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 12px;
    color: #6b7484;
    background: #f2f6fb;
    box-shadow: none;
}

.convert-guide-close svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2.4;
    fill: none;
    stroke-linecap: round;
}

.convert-guide-kicker,
.convert-guide-dialog h2,
.convert-guide-intro,
.convert-guide-card h3,
.convert-guide-card p,
.convert-guide-best h3,
.convert-guide-best ul {
    margin: 0;
}

.convert-guide-kicker {
    color: #256fd9;
    font-weight: 850;
}

.convert-guide-dialog h2 {
    margin-top: 5px;
    padding-right: 46px;
    color: #172238;
    font-family: var(--font-heading);
    font-size: clamp(1.28rem, 2.4vw, 1.82rem);
    line-height: 1.16;
}

.convert-guide-intro {
    margin-top: 10px;
    color: #66758a;
    line-height: 1.55;
}

.convert-guide-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.convert-guide-card {
    min-width: 0;
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid #dce7f3;
    border-radius: 14px;
    background: #f8fbff;
}

.convert-guide-card span {
    width: max-content;
    max-width: 100%;
    padding: 5px 9px;
    border-radius: 999px;
    color: #225cae;
    background: #eaf2ff;
    font-weight: 900;
}

.convert-guide-card.is-best {
    border-color: #f4c46a;
    background: #fffaf0;
}

.convert-guide-card.is-good {
    border-color: #b8d5fb;
}

.convert-guide-card h3 {
    color: #1f2a3d;
    font-size: 1rem;
}

.convert-guide-card p {
    color: #64748b;
    line-height: 1.48;
}

.convert-guide-best {
    margin-top: 14px;
    padding: 15px;
    border: 1px solid #f0d49b;
    border-radius: 14px;
    background: linear-gradient(180deg, #fff9eb, #fff);
}

.convert-guide-best h3 {
    color: #172238;
    font-size: 1rem;
}

.convert-guide-best ul {
    margin-top: 9px;
    padding-left: 20px;
    color: #5f6f84;
    line-height: 1.55;
}

.qr-panel h2 {
    margin: 0 0 8px;
    color: #354158;
    font-size: 22px;
}

.qr-panel label,
.qr-radio-group legend {
    display: grid;
    gap: 7px;
    color: #354158;
    font-weight: 760;
}

.qr-panel input,
.qr-panel select,
.qr-panel textarea,
.qr-options input[type="text"],
.qr-options select,
.qr-options input[type="color"] {
    width: 100%;
    min-height: 46px;
    border: 1px solid #d9e0e8;
    border-radius: 7px;
    padding: 10px 12px;
    color: #273247;
    background: #fff;
    box-shadow: none;
}

.qr-panel textarea {
    min-height: 96px;
    resize: vertical;
}

.qr-panel input::placeholder,
.qr-panel textarea::placeholder {
    color: #9aa4b2;
}

.qr-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.qr-subnote {
    margin: 4px 0 -2px;
    color: #7a8494;
    font-style: italic;
    font-weight: 650;
}

.qr-radio-group {
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    border: 0;
}

.qr-radio-group legend {
    width: 100%;
    margin-bottom: 2px;
}

.qr-radio-group label,
.qr-check {
    display: inline-flex !important;
    grid-template-columns: none;
    align-items: center;
    gap: 8px;
    color: #4d5868;
    font-weight: 650;
}

.qr-radio-group input,
.qr-check input {
    width: 22px;
    height: 22px;
    min-height: 0;
    accent-color: #df5038;
}

.qr-options {
    padding: 16px;
    display: grid;
    gap: 14px;
    border-radius: 14px;
    background: linear-gradient(180deg, #f8fafc, #fff);
    border: 1px solid #edf2f7;
}

.qr-options-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.qr-options-title > div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.qr-options-title strong {
    color: #273247;
    font-family: var(--font-heading);
    font-size: 18px;
}

.qr-options-title span,
.qr-local-note {
    color: #748094;
    font-size: 13px;
    line-height: 1.45;
}

.qr-options-toggle {
    width: auto;
    min-height: 36px;
    padding: 7px 10px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    background: #edf5ff;
    border: 1px solid rgba(37, 111, 217, .18);
    border-radius: 999px;
    box-shadow: none;
    font-size: 14px;
}

.qr-options-toggle:hover,
.qr-options-toggle:focus-visible {
    color: #fff;
    background: var(--primary);
}

.qr-options-toggle svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    transition: transform .18s ease;
}

.qr-options.is-collapsed {
    gap: 0;
}

.qr-options.is-collapsed .qr-options-body {
    display: none;
}

.qr-options.is-collapsed .qr-options-toggle svg {
    transform: rotate(180deg);
}

.qr-options-body {
    display: grid;
    gap: 14px;
}

.qr-template-grid,
.qr-frame-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 9px;
}

.qr-template-option,
.qr-frame-option {
    cursor: pointer;
}

.qr-template-option input,
.qr-frame-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.qr-template-option span,
.qr-frame-option span {
    min-height: 74px;
    padding: 9px;
    display: grid;
    place-items: center;
    gap: 6px;
    color: #4d5868;
    border: 1px solid #dce5ef;
    border-radius: 10px;
    background: #fff;
    font-weight: 760;
    text-align: center;
    transition: border-color .16s ease, box-shadow .16s ease, color .16s ease;
}

.qr-template-option input:checked + span,
.qr-frame-option input:checked + span {
    color: #df5038;
    border-color: #df5038;
    box-shadow: 0 6px 16px rgba(223, 80, 56, .14);
}

.qr-style-sample {
    width: 34px;
    height: 34px;
    display: block;
    background:
        linear-gradient(#111827 0 0) 0 0 / 11px 11px,
        linear-gradient(#111827 0 0) 23px 0 / 11px 11px,
        linear-gradient(#111827 0 0) 0 23px / 11px 11px,
        linear-gradient(#111827 0 0) 16px 16px / 7px 7px,
        linear-gradient(#111827 0 0) 26px 22px / 8px 8px;
    background-repeat: no-repeat;
}

.qr-style-rounded {
    border-radius: 8px;
}

.qr-style-dots {
    background:
        radial-gradient(circle, #111827 65%, transparent 68%) 0 0 / 11px 11px,
        radial-gradient(circle, #111827 65%, transparent 68%) 23px 0 / 11px 11px,
        radial-gradient(circle, #111827 65%, transparent 68%) 0 23px / 11px 11px,
        radial-gradient(circle, #111827 65%, transparent 68%) 16px 16px / 7px 7px,
        radial-gradient(circle, #111827 65%, transparent 68%) 26px 22px / 8px 8px;
    background-repeat: no-repeat;
}

.qr-style-diamond {
    transform: rotate(45deg) scale(.84);
}

.qr-style-soft {
    opacity: .82;
    border-radius: 10px;
}

.qr-frame-sample {
    width: 42px;
    height: 30px;
    display: block;
    border: 3px solid #111827;
    border-radius: 5px;
    background: #fff;
    box-shadow: inset 0 0 0 8px rgba(17, 24, 39, .05);
}

.qr-frame-rounded {
    border-radius: 14px;
}

.qr-frame-double {
    border-style: double;
    border-width: 5px;
}

.qr-frame-dash {
    border-style: dashed;
}

.qr-frame-badge {
    border-color: #df5038;
    border-bottom-width: 7px;
    box-shadow: 0 5px 10px rgba(31, 41, 55, .16);
}

.qr-options-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.qr-caption-grid,
.qr-logo-grid,
.qr-bg-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 12px;
}

.qr-logo-grid,
.qr-bg-grid {
    grid-template-columns: 1.4fr 1fr auto;
    align-items: end;
}

.qr-options-grid label,
.qr-caption-grid label,
.qr-logo-grid label,
.qr-bg-grid label {
    display: grid;
    gap: 7px;
    color: #4d5868;
    font-weight: 700;
}

.qr-caption-check {
    align-self: end;
    min-height: 46px;
}

.qr-file-field {
    min-width: 0;
}

.qr-file-title {
    color: #4d5868;
    font-weight: 700;
}

.qr-file-picker {
    position: relative;
    min-width: 0;
    min-height: 46px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    overflow: hidden;
    color: #273247;
    background: #fff;
    border: 1px solid #d9e0e8;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.qr-file-picker:hover,
.qr-file-field:focus-within .qr-file-picker {
    border-color: rgba(37, 111, 217, .45);
    box-shadow: 0 8px 18px rgba(37, 111, 217, .12);
}

.qr-file-picker input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.qr-file-icon {
    width: 48px;
    height: 100%;
    min-height: 46px;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: #edf5ff;
    border-right: 1px solid #d9e0e8;
}

.qr-file-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.qr-file-text {
    min-width: 0;
    padding: 0 12px;
    color: #273247;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 760;
}

.qr-file-field.has-file .qr-file-picker {
    border-color: rgba(37, 111, 217, .34);
    background: #f8fbff;
}

.qr-file-field.has-file .qr-file-icon {
    color: #fff;
    background: var(--primary);
}

.qr-caption-grid .font-picker-list {
    left: auto;
    right: 0;
    width: min(370px, calc(100vw - 32px));
    max-height: min(390px, 62vh);
    padding: 10px;
    gap: 8px;
}

.qr-caption-grid .font-picker-option {
    min-height: 78px;
    padding: 11px 13px;
}

.qr-caption-grid .font-picker-option-name {
    font-size: 15px;
}

.qr-caption-grid .font-picker-option-sample {
    font-size: 30px;
}

.qr-logo-clear {
    min-height: 46px;
    padding: 9px 13px;
    color: #4d5868;
    background: #edf2f7;
    box-shadow: none;
}

.qr-logo-clear:hover {
    color: #fff;
    background: #df5038;
}

.qr-local-note {
    margin: -2px 0 0;
}

.qr-submit {
    width: fit-content;
    min-width: 210px;
    margin: 10px auto 0;
    color: #fff;
    background: #cbbdb9;
    border-radius: 999px;
    box-shadow: none;
}

.qr-submit:hover {
    background: #df5038;
}

.qr-error {
    margin: 0;
    padding: 10px 12px;
    color: #b42318;
    background: #fff1f1;
    border-radius: 8px;
    font-weight: 700;
}

.qr-output-card {
    padding: 18px;
    display: grid;
    gap: 14px;
}

.qr-canvas-wrap {
    min-height: 330px;
    padding: 14px;
    display: grid;
    place-items: center;
    background: #fff;
    border-radius: 14px;
}

.qr-placeholder {
    min-height: 286px;
    padding: 22px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    color: #7a8494;
    text-align: center;
    background:
        linear-gradient(90deg, rgba(37,111,217,.08) 1px, transparent 1px),
        linear-gradient(rgba(37,111,217,.08) 1px, transparent 1px),
        #f8fafc;
    background-size: 24px 24px;
    border: 1px dashed #cbd8e6;
    border-radius: 12px;
}

.qr-placeholder svg {
    width: 68px;
    height: 68px;
    color: #9fb1c6;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.qr-placeholder strong {
    color: #354158;
    font-family: var(--font-heading);
    font-size: 18px;
}

.qr-placeholder span {
    max-width: 260px;
    font-size: 14px;
}

#qrCanvas {
    width: min(100%, 320px);
    height: auto;
    display: block;
}

.qr-output-card:not(.is-ready) #qrCanvas,
.qr-output-card:not(.is-ready) .qr-output-actions,
.qr-output-card:not(.is-ready) #qrPayloadPreview {
    display: none;
}

.qr-output-card.is-ready .qr-placeholder {
    display: none;
}

.qr-output-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.qr-output-actions a,
.qr-output-actions button {
    min-height: 40px;
    padding: 9px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--primary);
    border-radius: var(--radius);
    font-family: var(--font-heading);
    font-size: 15px;
    text-align: center;
    text-decoration: none;
}

.qr-output-actions button {
    background: #354158;
}

.qr-output-actions .qr-save-profile {
    grid-column: 1 / -1;
    gap: 7px;
    background: #13a67a;
}

.qr-output-actions .qr-save-profile svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#qrPayloadPreview {
    min-height: 96px;
    padding: 10px;
    color: #4d5868;
    background: #f8fafc;
    font-size: 13px;
    resize: vertical;
}

.frame-overview-main {
    width: min(100%, 1480px);
    margin: 0 auto;
    padding: 18px 24px 30px;
}

.frame-overview-hero {
    min-height: 170px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        linear-gradient(120deg, rgba(37, 111, 217, .72), rgba(30, 95, 174, .56)),
        url('../img/center-bg.jpg') center / cover;
    color: #fff;
    box-shadow: var(--shadow);
}

.frame-overview-hero h1 {
    margin: 0 0 8px;
    font-family: var(--font-title);
    font-size: clamp(20px, 3vw, 3rem);
    font-weight: 400;
    line-height: 1.05;
}

.frame-overview-hero p {
    max-width: 660px;
    margin: 0;
    color: rgba(255,255,255,.88);
    font-size: 1.02rem;
}

.frame-overview-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(86px, 1fr));
    gap: 10px;
}

.frame-overview-stats div {
    min-width: 86px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: var(--radius);
    background: rgba(255,255,255,.12);
    text-align: center;
    backdrop-filter: blur(12px);
}

.frame-overview-stats strong,
.frame-overview-stats span {
    display: block;
}

.frame-overview-stats strong {
    font-size: 1.5rem;
}

.frame-overview-stats span {
    color: rgba(255,255,255,.78);
    font-size: .84rem;
    font-weight: 750;
}

.overview-feature-blocks {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.overview-feature-block,
.overview-category-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.overview-feature-block {
    padding: 14px;
}

.overview-feature-block header,
.overview-category-header,
.overview-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.overview-block-title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
}

.overview-block-title svg {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--primary);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.overview-block-title h2,
.overview-section-heading h2 {
    margin: 0;
    font-size: var(--font-size-heading);
}

.overview-view-more {
    min-height: 34px;
    padding: 7px 10px;
    color: var(--primary);
    background: #eef5ff;
    box-shadow: none;
    font-size: var(--font-size-heading);
}

.overview-view-more:hover {
    color: #fff;
    background: var(--primary);
}

.overview-mini-grid,
.overview-category-grid {
    display: grid;
    gap: 10px;
}

.overview-mini-grid {
    margin-top: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.overview-category-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.overview-frame-card {
    position: relative;
    min-width: 0;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
    color: var(--text);
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.overview-frame-card:hover,
.overview-frame-card:focus-visible {
    border-color: rgba(37, 111, 217, .42);
    box-shadow: 0 10px 22px rgba(37, 111, 217, .14);
    transform: translateY(-1px);
    outline: none;
}

.overview-frame-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: block;
    object-fit: contain;
    border: 1px solid #d9e3ee;
    border-radius: var(--radius);
    background: #fff;
}

.overview-use-count {
    position: absolute;
    left: 14px;
    bottom: 58px;
    z-index: 2;
    max-width: calc(100% - 58px);
    padding: 3px 6px;
    border-radius: 999px;
    color: #fff !important;
    background: rgba(18, 35, 57, .72);
    font-size: 10px !important;
    font-weight: 850;
    line-height: 1;
    pointer-events: none;
}

.overview-frame-card strong,
.overview-frame-card span {
    display: block;
    min-width: 0;
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.overview-frame-card strong {
    color: #1e5fae;
    font-size: .9rem;
}

.overview-frame-card span {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
}

.overview-frame-name {
    margin: 0 0 6px !important;
    color: #1e5fae !important;
    font-size: .86rem !important;
    font-weight: 850 !important;
    line-height: 1.15;
    text-align: center;
}

.overview-frame-card.is-compact .overview-frame-name {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    z-index: 4;
    margin: 0 !important;
    padding: 4px 6px;
    border-radius: 999px;
    color: #fff !important;
    background: rgba(30, 95, 174, .92);
    box-shadow: 0 4px 12px rgba(18, 35, 57, .16);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .16s ease, transform .16s ease;
}

.overview-frame-card.is-compact:hover .overview-frame-name,
.overview-frame-card.is-compact:focus-visible .overview-frame-name {
    opacity: 1;
    transform: translateY(0);
}

.overview-copy-frame {
    width: 31px;
    height: 31px;
    min-height: 31px;
    padding: 0;
    position: absolute;
    right: 13px;
    bottom: 58px;
    z-index: 3;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: rgba(255,255,255,.95);
    border: 1px solid rgba(37, 111, 217, .18);
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(34, 44, 58, .14);
}

.overview-copy-frame:hover,
.overview-copy-frame.is-copied {
    color: #fff;
    background: var(--success);
}

.overview-copy-frame svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.overview-categories {
    margin-top: 18px;
}

.overview-section-heading {
    margin-bottom: 12px;
}

.overview-section-heading p {
    margin: 4px 0 0;
    color: var(--muted);
}

.overview-category-page-label {
    color: var(--muted);
    font-weight: 800;
}

.overview-category-card {
    margin-bottom: 16px;
    padding: 14px;
    scroll-margin-top: calc(var(--header-height) + 18px);
}

.overview-category-header {
    margin-bottom: 12px;
    padding: 9px 10px;
    border: 1px solid rgba(37, 111, 217, .12);
    border-radius: var(--radius);
    background: linear-gradient(90deg, #edf5ff, #f7fbff);
}

.overview-category-header span {
    color: var(--muted);
    font-weight: 800;
}

.overview-category-pagination,
.overview-total-pagination {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.overview-category-pagination button,
.overview-total-pagination a {
    min-height: 36px;
    padding: 7px 12px;
    border-radius: var(--radius);
    font-family: var(--font-heading);
    font-size: var(--font-size-heading);
    font-weight: 800;
}

.overview-total-pagination a {
    min-width: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: #fff;
    border: 1px solid var(--border);
    text-decoration: none;
}

.overview-total-pagination a.active {
    color: #fff;
    background: var(--primary);
}

.overview-list-modal .trend-dialog {
    width: min(94vw, 980px);
}

.overview-use-modal {
    position: fixed;
    inset: 0;
    z-index: 100002;
    padding: 16px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(12, 23, 38, .46);
}

.overview-use-modal.is-open {
    display: flex;
}

.overview-use-dialog {
    width: min(96vw, 1280px);
    max-height: calc(100dvh - 32px);
    padding: 16px;
    overflow: auto;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 18px 48px rgba(10, 24, 43, .22);
}

.overview-use-header {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.overview-use-header h3 {
    margin: 0;
}

.overview-use-layout {
    display: grid;
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
    gap: 16px;
}

.overview-use-side {
    display: grid;
    align-content: start;
    gap: 10px;
}

#overviewSelectedFramePreview {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 8px 22px rgba(30, 80, 160, .12);
}

#overviewSelectedFrameName {
    max-width: 100%;
    color: #1e5fae;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overview-frame-note {
    margin: -2px 0 0;
    color: #111827;
    font-size: .84rem;
    font-style: italic;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
    word-break: break-word;
}

.overview-crop-side {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 560px);
    align-items: start;
    justify-content: center;
    gap: 16px;
}

.overview-crop-side.has-result {
    grid-template-columns: minmax(340px, 560px) minmax(240px, 340px);
    justify-content: start;
}

.overview-editor-pane {
    min-width: 0;
    display: grid;
    align-content: start;
    justify-items: center;
    gap: 8px;
}

.overview-editor-pane .crop-ratio-list {
    justify-content: center;
}

.overview-crop-stage {
    position: relative;
    width: min(100%, 520px) !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
}

#overviewAvatarToCrop,
#overviewFrameOverlay {
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
    position: absolute;
    left: 0;
    top: 0;
}

#overviewAvatarToCrop {
    z-index: 1;
}

#overviewFrameOverlay {
    z-index: 2;
    pointer-events: none;
}

#overviewResultPreview {
    margin-top: 0;
    min-width: 0;
    padding: 12px;
    display: grid;
    align-content: start;
    justify-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #f8fbff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

#overviewResultPreview:empty {
    display: none;
}

#overviewResultPreview img {
    width: 100%;
    max-width: 100%;
    max-height: min(52dvh, 430px);
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 8px 22px rgba(30, 80, 160, .12);
}

#overviewResultPreview a {
    min-height: 40px;
    padding: 9px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--success);
    border-radius: var(--radius);
    font-weight: 800;
    text-decoration: none;
}

.mobile-tabbar {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (min-width: 1241px) {
    .container {
        align-items: stretch;
    }

    .left,
    .home-workspace {
        height: 100%;
        align-self: stretch;
    }

    .home-workspace {
        grid-template-rows: auto minmax(0, 1fr);
        align-items: stretch;
    }

    .recommended-frame-strip {
        grid-row: 1;
    }

    .right,
    .resize-panel {
        grid-row: 2;
        height: 100%;
        min-height: 0;
    }

    .container:not(.has-recommended-frames) .right,
    .container:not(.has-recommended-frames) .resize-panel {
        grid-row: 1 / -1;
    }

}

@media (max-width: 1280px) {
    .design-frame-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .design-frame-library-grid {
        max-height: 420px;
    }

    .design-canvas-shell,
    .design-result-wrap {
        min-height: 420px;
    }
}

@media (max-width: 1240px) {
    .container {
        grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    }

    .home-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .recommended-frame-strip,
    .right,
    .resize-panel {
        grid-column: 1;
    }

}

@media (max-width: 860px) {
    :root {
        --header-height: 58px;
    }

    body {
        padding-bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom));
        overscroll-behavior-y: contain;
    }

    .header-bar {
        min-height: calc(var(--header-height) + env(safe-area-inset-top));
        padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
        gap: 10px;
    }

    .header-logo {
        width: 36px;
        height: 36px;
    }

    .header-title {
        max-width: 56vw;
        font-size: var(--font-size-title);
    }

    .header-menu {
        gap: 6px;
    }

    .header-menu a,
    .header-menu button {
        min-height: 36px;
        padding: 7px 9px;
        font-size: 14px;
    }

    .header-trend,
    .header-utility-toggle {
        width: 42px;
        padding-inline: 9px !important;
        gap: 0;
        font-size: 0 !important;
    }

    .header-trend svg {
        margin: 0 !important;
    }

    .header-utility-toggle > svg:first-child {
        width: 22px;
        height: 22px;
    }

    .header-utility-chevron {
        display: none;
    }

    .header-usage-alert {
        padding-inline: 9px !important;
        font-size: 12px !important;
    }

    .header-quick-logout {
        width: 36px;
        padding: 7px !important;
    }

    .header-backhome svg:not(.header-home-icon) {
        display: none;
    }

    .header-account-name {
        display: none;
    }

    .header-utility-submenu {
        right: -54px;
    }

    .header-utility-submenu a,
    .header-utility-submenu button {
        font-size: 15px;
    }

    .utility-modal {
        padding: 10px;
        align-items: flex-start;
    }

    .utility-dialog,
    .utility-dialog-wide {
        width: 100%;
        max-height: calc(100vh - 20px);
        padding: 14px;
    }

    .utility-guide-modal {
        padding: 12px;
    }

    .utility-guide-dialog {
        width: min(100%, calc(100vw - 18px));
        max-height: calc(100vh - 24px);
        padding: 20px 16px;
        border-radius: 16px;
    }

    .utility-guide-grid {
        grid-template-columns: 1fr;
    }

    .utility-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .utility-canvas-box,
    .utility-image-box {
        min-height: 260px;
    }

    .utility-canvas-box canvas,
    .utility-image-box img {
        max-height: 360px;
    }

    .utility-eraser-tools,
    .utility-download-row,
    .gif-action-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .container {
        width: 100%;
        min-height: auto;
        padding: 12px;
        display: block;
    }

    .home-workspace {
        display: block;
    }

    .recommended-frame-strip {
        display: block;
    }

    .recommended-frame-list {
        margin-top: 10px;
        grid-template-columns: repeat(5, minmax(76px, 1fr));
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .left,
    .right,
    .resize-panel,
    .cartoon-panel,
    #inlineCropPanel {
        width: 100%;
        margin: 0 0 12px;
        padding: 14px;
        position: relative;
        top: auto;
        max-height: none;
        overflow: visible;
    }

    .left,
    .right,
    .resize-panel,
    #inlineCropPanel,
    #frameLibrary {
        scroll-margin-top: calc(var(--header-height) + 16px);
    }

    #frameLibrary {
        max-height: none;
        padding: 10px;
    }

    .frame-grid {
        --frame-card-size: clamp(76px, 20vw, 104px);
        gap: 9px;
        grid-template-columns: repeat(4, calc((100% - 27px) / 4));
        grid-auto-columns: calc((100% - 27px) / 4);
    }

    .right {
        min-height: 280px;
    }

    #resultPreview {
        min-height: 0;
    }

    #resultPreview img {
        max-width: 100%;
        max-height: none;
    }

    .resize-dimensions {
        grid-template-columns: 1fr 1fr;
    }

    .resize-dimensions span,
    .resize-dimensions label {
        display: none;
    }

    .resize-dimensions select,
    .resize-dimensions input {
        width: 100%;
    }

    .resize-output-settings {
        grid-template-columns: 1fr;
    }

    .cartoon-output-grid {
        grid-template-columns: 1fr;
    }

    .cartoon-style-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .resize-hover-preview {
        left: 0;
        right: auto;
        transform-origin: bottom left;
    }

    .result-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-width: 0;
    }

    .result-actions {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .result-actions button {
        width: auto;
    }

    .result-format-field {
        flex: 1 1 110px;
    }

    .result-download-button {
        flex: 1 1 100%;
    }

    .crop-ratio-list {
        justify-content: flex-start;
        flex-wrap: nowrap;
        max-height: none;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #inlineCropPanel .crop-stage,
    #cropModal .crop-stage {
        width: min(100%, clamp(250px, calc(100dvh - 292px), 420px)) !important;
        min-height: 0;
        max-height: none;
    }

    #cropModal {
        padding: 8px;
        align-items: center;
    }

    #cropModal > div {
        width: 100%;
        max-height: calc(100dvh - 16px);
        padding: 12px;
        gap: 7px;
    }

    .crop-help-text {
        font-size: .82rem;
    }

    .site-footer {
        padding: 0 12px 18px;
    }

    .home-logo-strip {
        padding: 0 12px 10px;
    }

    .home-welcome-modal {
        padding: 12px;
    }

    .home-welcome-dialog {
        width: min(94vw, 760px);
    }

    .home-welcome-close {
        top: -8px;
        right: -8px;
    }

    .home-logo-strip-inner {
        min-height: 78px;
    }

    .home-logo-strip-track {
        gap: 28px;
        padding: 12px 28px;
    }

    .home-logo-strip-item {
        min-width: 78px;
        height: 48px;
    }

    .home-logo-strip-item img {
        max-width: 108px;
        max-height: 48px;
    }

    .site-footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-footer nav {
        width: 100%;
        justify-content: flex-start;
    }

    .site-footer-main-nav {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .site-footer-actions,
    .site-footer-secondary-row,
    .site-footer-social {
        width: 100%;
        justify-items: start;
        justify-content: flex-start;
    }

    .site-footer-secondary-row {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
    }

    .site-footer-secondary-row .footer-about-menu {
        min-width: 0;
        flex: 1 1 auto;
    }

    .site-footer-social {
        width: auto;
        min-width: 0;
        flex: 0 1 auto;
        flex-wrap: nowrap;
        overflow: hidden;
    }

    .site-footer-social-link {
        width: 26px;
        height: 26px;
        flex: 0 0 26px;
    }

    .site-footer-social-link svg,
    .site-footer-social-link img {
        width: 24px;
        height: 24px;
    }

    .upload-action-row,
    .frame-share-upload-row {
        grid-template-columns: minmax(0, 1fr) minmax(112px, auto);
        align-items: stretch;
    }

    .mobile-camera-button {
        min-height: 44px;
        padding-inline: 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        color: var(--primary);
        background: #edf5ff;
        border: 1px solid rgba(37, 111, 217, .22);
        border-radius: var(--radius);
        font-family: var(--font-heading);
        font-size: 14px;
        font-weight: 800;
        white-space: nowrap;
    }

    .footer-about-submenu {
        right: auto;
        left: 0;
    }

    .utility-bill-page .header-bar {
        padding-inline: 12px;
        gap: 10px;
    }

    .utility-bill-page .header-left {
        min-width: 0;
        flex: 1 1 auto;
    }

    .utility-bill-page .header-title {
        max-width: none;
        font-size: clamp(18px, 5vw, 22px);
    }

    .utility-bill-page .header-trend,
    .utility-bill-page .header-utility-menu,
    .utility-bill-page .header-account-link {
        display: none !important;
    }

    .utility-bill-page .header-backhome {
        display: inline-flex !important;
    }

    .utility-bill-page .header-menu {
        margin-left: auto;
        flex: 0 0 auto;
        gap: 0;
    }

    .utility-bill-page .header-backhome {
        padding-inline: 9px;
        font-size: 13px !important;
    }

    .utility-bill-page .utility-bill-main {
        width: 100%;
        padding: 14px;
    }

    .utility-bill-page .utility-bill-card {
        padding: 18px;
        overflow: hidden;
    }

    .utility-bill-page .utility-bill-form input[type="file"] {
        font-size: 14px;
    }

    .utility-bill-page .site-footer {
        padding-inline: 14px;
    }

    .utility-bill-page .site-footer-inner {
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
    }

    .utility-bill-page .site-footer-brand {
        width: 100%;
        grid-template-columns: 34px minmax(0, 1fr);
        justify-content: center;
        gap: 9px;
    }

    .utility-bill-page .site-footer-logo {
        width: 34px;
        height: 34px;
        border-radius: 8px;
    }

    .utility-bill-page .site-footer nav {
        display: none !important;
    }

    .utility-bill-page .site-footer-actions {
        width: 100%;
        justify-items: center;
    }

    .utility-bill-page .site-footer-social {
        width: auto;
        justify-content: center;
    }

    .qr-main {
        padding: 22px 14px 34px;
    }

    .qr-hero h1 {
        font-size: clamp(34px, 11vw, 52px);
    }

    .qr-tabs {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .qr-tab {
        flex: 0 0 auto;
        min-height: 42px;
        font-size: 14px;
    }

    .qr-workspace {
        grid-template-columns: 1fr;
        margin-top: 24px;
    }

    .convert-main {
        padding: 18px 14px 30px;
    }

    .convert-workspace {
        grid-template-columns: 1fr;
    }

    .convert-canvas-wrap {
        min-height: 300px;
    }

    .pdf-converter-result-list {
        min-height: 320px;
        max-height: 520px;
    }

    .qr-form-card {
        padding: 18px;
    }

    .qr-options-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .qr-template-grid,
    .qr-frame-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .qr-caption-grid,
    .qr-logo-grid,
    .qr-bg-grid {
        grid-template-columns: 1fr;
    }

    .qr-caption-grid .font-picker-list {
        left: 0;
        right: 0;
        width: 100%;
    }

    .trend-modal {
        padding: 12px;
        align-items: flex-start;
    }

    .trend-dialog {
        width: 100%;
        max-height: calc(100vh - 24px);
    }

    .trend-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .frame-overview-main {
        padding: 12px;
    }

    .frame-overview-hero,
    .overview-section-heading,
    .overview-feature-block header,
    .overview-category-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .frame-overview-stats {
        width: 100%;
    }

    .overview-feature-blocks {
        grid-template-columns: 1fr;
    }

    .overview-mini-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .overview-category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .overview-use-modal {
        padding: 10px;
        align-items: flex-start;
    }

    .overview-use-dialog {
        width: 100%;
        max-height: calc(100dvh - 20px);
        padding: 12px;
    }

    .overview-use-layout {
        grid-template-columns: 1fr;
    }

    .overview-crop-side,
    .overview-crop-side.has-result {
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    .overview-editor-pane {
        justify-items: center;
    }

    .overview-use-side {
        grid-template-columns: 120px minmax(0, 1fr);
        align-items: start;
    }

    #overviewSelectedFramePreview {
        grid-row: span 3;
    }

    .overview-crop-stage {
        width: min(100%, 420px) !important;
    }

    #overviewResultPreview {
        width: min(100%, 420px);
        justify-self: center;
    }

    .mobile-tabbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 250;
        min-height: calc(var(--tabbar-height) + env(safe-area-inset-bottom));
        padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        background: rgba(255,255,255,.94);
        border-top: 1px solid rgba(214, 225, 238, .95);
        box-shadow: 0 -10px 24px rgba(25, 41, 62, .12);
        backdrop-filter: blur(16px);
    }

    .mobile-tabbar a {
        min-width: 0;
        min-height: 54px;
        border-radius: var(--radius);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        color: var(--muted);
        font-family: var(--font-heading);
        font-size: 12px;
        font-weight: 750;
        line-height: 1;
        text-decoration: none;
    }

    .mobile-tabbar svg {
        width: 21px;
        height: 21px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .mobile-tabbar a.active {
        color: var(--primary);
        background: #edf5ff;
    }
}

@media (max-width: 920px) {
    .profile-account-grid,
    .profile-frame-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-frame-card {
        grid-template-columns: 150px minmax(0, 1fr);
        grid-template-areas:
            "thumb content"
            "actions content";
    }

    .profile-inline-upload {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .profile-main {
        padding: 12px;
        padding-bottom: calc(var(--tabbar-height) + 16px);
    }

    .profile-hero {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .profile-logout-form {
        grid-column: 1 / -1;
    }

    .profile-account-grid,
    .profile-frame-grid {
        grid-template-columns: 1fr;
    }

    .profile-frame-card {
        grid-template-columns: 1fr;
        grid-template-areas:
            "thumb"
            "actions"
            "content";
    }

    .profile-detail-modal {
        padding: 12px;
        align-items: flex-end;
    }

    .profile-detail-dialog {
        max-height: calc(100vh - 24px);
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .profile-detail-media {
        min-height: 220px;
    }

    .profile-detail-body {
        padding: 0;
    }

    .profile-detail-stats {
        grid-template-columns: 1fr;
    }

    .profile-inline-upload {
        grid-template-columns: 1fr;
    }

    .profile-section-head {
        display: grid;
    }
}

@media (max-width: 640px) {
    .design-frame-main {
        padding: 12px;
    }

    .design-frame-panel {
        padding: 14px;
    }

    .design-frame-library-grid,
    .design-icon-library-grid,
    .design-built-in-icons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .design-tool-title {
        align-items: flex-start;
    }

    .design-tool-title-actions {
        gap: 5px;
    }

    .design-library-pager {
        min-height: 32px;
    }

    .design-control-grid {
        grid-template-columns: 1fr;
    }

    .design-editor-toolbar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .design-canvas-shell,
    .design-result-wrap {
        min-height: 300px;
    }

    .convert-guide-trigger {
        width: 30px;
        height: 30px;
    }

    .convert-guide-modal {
        padding: 14px;
    }

    .convert-guide-dialog {
        width: min(100%, calc(100vw - 20px));
        max-height: calc(100vh - 24px);
        padding: 20px 16px;
        border-radius: 16px;
    }

    .convert-guide-grid {
        grid-template-columns: 1fr;
    }

    .convert-guide-dialog h2 {
        padding-right: 42px;
    }
}

@media (max-width: 460px) {
    body {
        font-size: 14px;
    }

    .header-title {
        max-width: 42vw;
    }

    .header-menu a,
    .header-menu button {
        padding: 7px 8px;
        font-size: 13px;
    }

    .header-usage-alert {
        max-width: 132px;
        line-height: 1.1;
    }

    .header-backhome {
        font-size: 0 !important;
        gap: 0;
    }

    .utility-bill-page .header-backhome {
        font-size: var(--font-size-heading) !important;
        gap: 6px;
    }

    .header-account-link {
        font-size: 0 !important;
        gap: 0;
    }

    .header-account-link .header-avatar,
    .header-account-link > svg {
        width: 22px;
        height: 22px;
    }

    .header-backhome svg {
        display: block;
        width: 20px;
        height: 20px;
        margin: 0 !important;
    }

    .container {
        padding: 10px;
    }

    .left,
    .right,
    .resize-panel,
    .cartoon-panel,
    #inlineCropPanel {
        padding: 12px;
    }

    .frame-grid {
        --frame-card-size: clamp(70px, 21vw, 96px);
        grid-template-columns: repeat(4, calc((100% - 24px) / 4));
        grid-auto-columns: calc((100% - 24px) / 4);
        gap: 8px;
    }

    .frame-overview-stats,
    .overview-mini-grid,
    .overview-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .overview-use-side {
        grid-template-columns: 1fr;
    }

    #overviewSelectedFramePreview {
        width: min(100%, 220px);
        margin: 0 auto;
    }

    button,
    #downloadBtn,
    #resultPreview a {
        width: 100%;
    }

    .site-footer-link {
        width: auto;
    }

    .site-footer-main-nav .site-footer-link {
        width: 100%;
        min-height: 40px;
        padding-inline: 6px;
        gap: 5px;
        font-size: 12px;
    }

    .footer-about-menu {
        width: auto;
    }

    .footer-about-menu > .site-footer-link {
        width: 100%;
        min-height: 40px;
        padding-inline: 8px;
        font-size: 13px;
    }

    .footer-about-submenu {
        left: 0;
        right: 0;
        width: 100%;
    }

    .footer-info-modal {
        padding: 12px;
    }

    .footer-info-dialog {
        padding: 26px 20px 22px;
        border-radius: 16px;
    }

    .qr-two-col,
    .qr-output-actions {
        grid-template-columns: 1fr;
    }

    .qr-submit,
    .qr-output-actions a,
    .qr-output-actions button {
        width: 100%;
    }

    .qr-options-toggle {
        width: auto;
    }

    .crop-tool-row button,
    .crop-actions button,
    .frame-refresh-button,
    .frame-overview-button {
        width: auto;
        flex: 1 1 auto;
    }

    .frame-refresh-button,
    .frame-overview-button {
        width: 38px;
        flex: 0 0 38px;
    }

    #photoUploadForm button,
    #frameUploadForm button,
    #cartoonUploadForm button {
        width: 100%;
    }

    .upload-action-row .mobile-camera-button,
    .frame-share-upload-row .mobile-camera-button {
        width: auto;
        min-width: 108px;
        padding-inline: 10px;
    }

    .convert-action-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .convert-action-row .convert-primary,
    .convert-action-row .convert-secondary {
        min-height: 38px;
        padding: 7px 6px;
        font-size: 12px;
    }

    .pdf-converter-page-nav {
        grid-template-columns: 1fr;
    }

    .pdf-converter-page-nav span {
        text-align: center;
    }

    .pdf-converter-meta-grid,
    .pdf-converter-action-row {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
