:root {
    color-scheme: dark;
    --page: #0b1117;
    --sidebar: #0f171f;
    --surface: #121c25;
    --surface-raised: #17232d;
    --surface-soft: #1c2a34;
    --line: #263642;
    --line-strong: #344754;
    --ink: #edf4f6;
    --muted: #96a8b2;
    --faint: #637681;
    --subtext: var(--muted);
    --bg: var(--page);
    --surface2: var(--line);
    --accent: #9de8c9;
    --accent-strong: #59c9a0;
    --accent-wash: rgba(107, 217, 173, .12);
    --blue: #8db9ff;
    --green: #78d7a5;
    --red: #ff8f9b;
    --yellow: #f3c978;
    --mauve: #c4a6ff;
    --peach: #ffb48c;
    --radius: 18px;
    --radius-sm: 11px;
    --shadow: 0 20px 60px rgba(0, 0, 0, .24);
    --ease: 180ms cubic-bezier(.2, .8, .2, 1);
}

[data-theme="light"] {
    color-scheme: light;
    --page: #f3f6f4;
    --sidebar: #f8faf9;
    --surface: #fff;
    --surface-raised: #f7faf8;
    --surface-soft: #edf3f0;
    --line: #dce7e1;
    --line-strong: #c7d7ce;
    --ink: #17251f;
    --muted: #60766b;
    --faint: #8ca096;
    --subtext: var(--muted);
    --bg: var(--page);
    --surface2: var(--line);
    --accent: #117a5b;
    --accent-strong: #0d674c;
    --accent-wash: rgba(17, 122, 91, .09);
    --blue: #286dc6;
    --green: #158153;
    --red: #c54554;
    --yellow: #956d14;
    --mauve: #7552bd;
    --peach: #bc5e2f;
    --shadow: 0 18px 48px rgba(37, 67, 52, .09);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: var(--page);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    transition: background-color var(--ease), color var(--ease);
}
body::before {
    position: fixed;
    z-index: -1;
    inset: 0;
    background:
        radial-gradient(ellipse at 78% 0%, rgba(89, 201, 160, .08), transparent 34%),
        radial-gradient(ellipse at 0% 82%, rgba(91, 132, 198, .06), transparent 28%);
    content: "";
    pointer-events: none;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 72%, transparent);
    outline-offset: 3px;
}
a { color: inherit; }
.material-icons-round { font-size: 20px; line-height: 1; }
.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;
}

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    z-index: 30;
    inset: 0 auto 0 0;
    display: flex;
    width: 248px;
    flex-direction: column;
    padding: 28px 18px 20px;
    border-right: 1px solid var(--line);
    background: color-mix(in srgb, var(--sidebar) 94%, transparent);
    backdrop-filter: blur(20px);
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 0 10px 28px;
    text-decoration: none;
}
.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
    border-radius: 13px;
    background: linear-gradient(145deg, var(--accent-wash), rgba(141, 185, 255, .08));
    color: var(--accent);
}
.brand-mark .material-icons-round { font-size: 21px; }
.brand-copy { display: grid; gap: 1px; min-width: 0; }
.brand-name { color: var(--ink); font-size: 15px; font-weight: 700; letter-spacing: -.035em; }
.brand-caption { color: var(--faint); font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.side-label {
    padding: 0 12px;
    margin: 0 0 9px;
    color: var(--faint);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.side-nav { display: grid; gap: 5px; }
.nav-link {
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 550;
    text-decoration: none;
    transition: color var(--ease), background var(--ease), border-color var(--ease), transform var(--ease);
}
.nav-link .material-icons-round { color: var(--faint); font-size: 19px; transition: color var(--ease); }
.nav-link:hover { transform: translateX(2px); background: var(--surface-raised); color: var(--ink); }
.nav-link:hover .material-icons-round { color: var(--accent); }
.nav-link.active { border-color: color-mix(in srgb, var(--accent) 15%, transparent); background: var(--accent-wash); color: var(--accent); }
.nav-link.active .material-icons-round { color: var(--accent); }
.engine-control,
.region-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface-raised) 76%, transparent);
}
.region-copy { display: flex; min-width: 0; align-items: center; gap: 10px; }
.region-copy > .material-icons-round { color: var(--accent); font-size: 19px; }
.region-copy strong { display: block; color: var(--ink); font-size: 12px; font-weight: 650; }
.region-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.region-select-wrap { position: relative; display: block; flex: 0 1 290px; min-width: 0; }
.region-select {
    width: 100%;
    min-width: 0;
    appearance: none;
    padding: 10px 36px 10px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface-raised);
    color: var(--ink);
    font-size: 11px;
    cursor: pointer;
    outline: none;
}
.region-select:focus { border-color: var(--accent); }
.region-select:disabled { opacity: .62; cursor: wait; }
.region-select-wrap > .material-icons-round {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 18px;
    pointer-events: none;
}
.sidebar-bottom { display: grid; gap: 16px; margin-top: auto; }
.connection-dot, .live-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 13%, transparent); }
.theme-row { display: flex; align-items: center; justify-content: space-between; padding: 0 10px; color: var(--muted); font-size: 12px; }
.theme-row .theme-label { display: flex; align-items: center; gap: 9px; }
.theme-row .material-icons-round { color: var(--faint); font-size: 18px; }

.main-shell { min-height: 100vh; margin-left: 248px; }
.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 clamp(24px, 4vw, 56px);
    border-bottom: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
    background: color-mix(in srgb, var(--page) 88%, transparent);
    backdrop-filter: blur(18px);
}
.crumbs { display: flex; align-items: center; gap: 9px; color: var(--faint); font-size: 12px; }
.crumbs strong { color: var(--ink); font-weight: 600; }
.crumbs .material-icons-round { font-size: 15px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-hint { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.topbar-hint .material-icons-round { font-size: 16px; }
.topbar-link {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    color: var(--muted);
    text-decoration: none;
    transition: border-color var(--ease), color var(--ease), background var(--ease);
}
.topbar-link:hover { border-color: var(--line-strong); background: var(--surface-raised); color: var(--accent); }
.profile-chip { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface-soft); color: var(--accent); font-size: 11px; font-weight: 700; }
.dashboard-main { width: min(1220px, 100%); padding: 42px clamp(24px, 4vw, 56px) 72px; margin: 0 auto; }
.welcome-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 4px 0 27px; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.welcome-copy h1 { max-width: 750px; margin: 0; color: var(--ink); font-size: clamp(30px, 4vw, 45px); font-weight: 630; letter-spacing: -.055em; line-height: 1.08; }
.welcome-copy p:last-child { margin: 13px 0 0; color: var(--muted); font-size: 14px; }
.welcome-badge { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--muted); font-size: 11px; white-space: nowrap; }
.welcome-badge .material-icons-round { color: var(--accent); font-size: 18px; }
.search-panel {
    position: relative;
    padding: clamp(19px, 3vw, 28px);
    border: 1px solid var(--line);
    border-radius: 21px;
    background: linear-gradient(112deg, color-mix(in srgb, var(--surface) 94%, var(--accent) 6%), var(--surface));
    box-shadow: var(--shadow);
}
.search-panel::after { position: absolute; top: 0; right: 6%; width: 22%; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 75%, transparent), transparent); content: ""; }
.search-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.search-heading strong { color: var(--ink); font-size: 12px; font-weight: 650; }
.search-heading span { color: var(--faint); font-size: 10px; }
.search-wrap { position: relative; display: flex; align-items: center; gap: 12px; }
.search-field-icon { position: absolute; left: 17px; z-index: 1; color: var(--faint); font-size: 20px; pointer-events: none; }
.search-bar {
    width: 100%;
    min-width: 0;
    height: 58px;
    padding: 0 110px 0 51px;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    background: var(--page);
    color: var(--ink);
    font-size: 14px;
    outline: none;
    transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}
.search-bar::placeholder { color: var(--faint); }
.search-bar:focus { border-color: color-mix(in srgb, var(--accent) 70%, var(--line-strong)); box-shadow: 0 0 0 4px var(--accent-wash); }
.search-go {
    position: absolute;
    right: 7px;
    display: inline-flex;
    min-width: 94px;
    height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #0d2019;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--ease), background var(--ease), box-shadow var(--ease);
}
.search-go:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--accent) 86%, white); box-shadow: 0 5px 16px color-mix(in srgb, var(--accent) 20%, transparent); }
[data-theme="light"] .search-go { background: #2d9878; }
[data-theme="light"] .search-go:hover { background: #39a685; }
.search-go .material-icons-round { font-size: 17px; }
.search-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; color: var(--faint); font-size: 10px; }
.suggestions {
    position: absolute;
    z-index: 50;
    top: calc(100% + 7px);
    right: 0;
    left: 0;
    display: none;
    max-height: 300px;
    overflow-y: auto;
    padding: 5px;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.suggestions.open { display: block; }
.sug-item { display: flex; width: 100%; align-items: center; gap: 11px; padding: 11px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.sug-item:hover, .sug-item.active { background: var(--surface-soft); }
.sug-item .material-icons-round { color: var(--muted); font-size: 17px; }
.sug-item span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adsbygoogle { display: block; min-height: 0; margin: 18px 0 26px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--surface) 75%, transparent); }

.content-section { margin-top: 40px; scroll-margin-top: 88px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-title { margin: 0; color: var(--ink); font-size: 18px; font-weight: 630; letter-spacing: -.035em; }
.section-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.section-action { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; text-decoration: none; }
.section-action:hover { color: var(--accent); }
.section-action .material-icons-round { font-size: 16px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.quick-card {
    position: relative;
    display: grid;
    min-height: 90px;
    grid-template-columns: 39px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: center;
    align-items: center;
    column-gap: 12px;
    padding: 17px 42px 17px 15px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface);
    text-align: left;
    cursor: pointer;
    transition: transform var(--ease), border-color var(--ease), background var(--ease), box-shadow var(--ease);
}
.quick-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--surface-raised); box-shadow: 0 12px 25px rgba(0, 0, 0, .12); }
.quick-card > img { grid-row: 1 / 3; width: 38px; height: 38px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); object-fit: contain; }
.quick-card .qc-title { overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.quick-card .qc-url { overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.quick-card .qc-star, .quick-card .qc-close { position: absolute; top: 10px; display: none; width: 25px; height: 25px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-raised); color: var(--muted); cursor: pointer; }
.quick-card .qc-star { right: 39px; }
.quick-card .qc-close { right: 9px; }
.quick-card:hover .qc-star, .quick-card:hover .qc-close, .quick-card:focus-within .qc-star, .quick-card:focus-within .qc-close { display: flex; }
.quick-card .qc-star:hover { color: var(--yellow); }
.quick-card .qc-close:hover { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); color: var(--red); }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.panel-header {
    display: flex;
    width: 100%;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 17px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 12px;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
    transition: background var(--ease);
}
.panel-header:hover { background: var(--surface-raised); }
.panel-header-label { display: flex; align-items: center; gap: 10px; }
.panel-header-label > .material-icons-round { color: var(--accent); font-size: 18px; }
.panel-header > .material-icons-round { color: var(--faint); font-size: 18px; transition: transform var(--ease); }
.panel.open .panel-header > .material-icons-round { transform: rotate(180deg); }
.panel-body { max-height: 0; overflow: hidden; padding: 0 17px; transition: max-height 260ms ease, padding 260ms ease; }
.panel.open .panel-body { max-height: 6000px; padding: 0 17px 17px; }
.field { margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 600; }
.field input[type="text"], .field input[type="email"], .field input[type="color"], .list-search, .insert-script-textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: var(--page);
    color: var(--ink);
    font-size: 12px;
    outline: none;
    transition: border-color var(--ease), box-shadow var(--ease);
}
.field input[type="text"]:focus, .field input[type="email"]:focus, .list-search:focus, .insert-script-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.field input[type="file"] { max-width: 100%; color: var(--muted); font-size: 11px; }
.field input[type="color"] { height: 40px; padding: 4px; cursor: pointer; }
.toggle-row { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 12px; }
.toggle-row:last-child { border-bottom: 0; }
.toggle {
    position: relative;
    display: inline-flex;
    width: 40px;
    height: 23px;
    flex: 0 0 auto;
    align-items: center;
    padding: 3px;
    border: 1px solid var(--line-strong);
    border-radius: 99px;
    background: var(--surface-soft);
    cursor: pointer;
    transition: background var(--ease), border-color var(--ease);
}
.toggle::after { width: 15px; height: 15px; border-radius: 50%; background: var(--muted); content: ""; transition: transform var(--ease), background var(--ease); }
.toggle.on { border-color: var(--accent); background: var(--accent); }
.toggle.on::after { transform: translateX(17px); background: #102019; }
.pill-group { display: flex; flex-wrap: wrap; gap: 7px; }
.pill { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-raised); color: var(--muted); font-size: 11px; font-weight: 550; cursor: pointer; transition: background var(--ease), color var(--ease), border-color var(--ease); }
.pill:hover { border-color: var(--line-strong); color: var(--ink); }
.pill.active { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-wash); color: var(--accent); }
.btn { display: inline-flex; min-height: 36px; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; border: 1px solid transparent; border-radius: 9px; font-size: 11px; font-weight: 650; cursor: pointer; transition: transform var(--ease), background var(--ease), border-color var(--ease), color var(--ease); }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #0d2019; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, white); }
.btn-danger { background: var(--red); color: #2c0b10; }
.btn-danger:hover { background: color-mix(in srgb, var(--red) 86%, white); }
.btn-outline { border-color: var(--line-strong); background: transparent; color: var(--muted); }
.btn-outline:hover { border-color: var(--line-strong); background: var(--surface-raised); color: var(--ink); }
.confirm-btn.confirming { border-color: color-mix(in srgb, var(--red) 50%, transparent); background: color-mix(in srgb, var(--red) 14%, var(--surface)); color: var(--red); }
.insert-script-textarea { min-height: 120px; margin-bottom: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; resize: vertical; }

.history-panel { overflow: hidden; }
.history-panel .panel-header { min-height: 64px; }
.history-panel .panel-body { padding-right: 20px; padding-left: 20px; }
.list-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--page); }
.list-tab { min-height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer; transition: background var(--ease), color var(--ease); }
.list-tab:hover { color: var(--ink); }
.list-tab.active { background: var(--surface-raised); color: var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.list-search { margin-bottom: 6px; }
.list-item { display: flex; min-height: 51px; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .li-title { min-width: 0; flex: 1; overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.list-item .li-title:hover { color: var(--accent); }
.list-item .li-url { max-width: 34%; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.list-item .li-del { display: grid; width: 29px; height: 29px; flex: 0 0 auto; place-items: center; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--faint); cursor: pointer; transition: border-color var(--ease), color var(--ease), background var(--ease); }
.list-item .li-del:hover { border-color: color-mix(in srgb, var(--red) 30%, transparent); background: color-mix(in srgb, var(--red) 10%, transparent); color: var(--red); }
.empty-state { padding: 25px 14px; color: var(--muted); font-size: 12px; text-align: center; }
.footer { padding: 38px 0 0; color: var(--faint); font-size: 10px; text-align: center; }

#toast-container { position: fixed; z-index: 99999; right: 22px; bottom: 22px; display: flex; flex-direction: column-reverse; gap: 8px; }
.toast { display: flex; max-width: min(380px, calc(100vw - 32px)); align-items: center; gap: 10px; padding: 12px 15px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-raised); box-shadow: var(--shadow); color: var(--ink); font-size: 12px; animation: toastIn .22s ease-out; }
.toast.out { animation: toastOut .2s ease-in forwards; }
.toast .t-icon { flex: 0 0 auto; font-size: 17px; }
.toast.success .t-icon { color: var(--green); }
.toast.error .t-icon { color: var(--red); }
.toast.warning .t-icon { color: var(--yellow); }
.toast.info .t-icon { color: var(--blue); }
.toast-link { color: var(--blue); font-weight: 650; text-decoration: underline; white-space: nowrap; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

@media (max-width: 1080px) {
    .sidebar { width: 218px; padding-right: 14px; padding-left: 14px; }
    .main-shell { margin-left: 218px; }
    .quick-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}
@media (max-width: 780px) {
    .sidebar { position: relative; inset: auto; display: grid; width: auto; min-height: 0; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 12px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
    .brand { grid-column: 1; padding: 0; }
    .sidebar > .side-label { display: none; }
    .side-nav { grid-column: 1 / -1; display: flex; gap: 5px; overflow-x: auto; }
    .nav-link { min-height: 36px; flex: 0 0 auto; gap: 7px; padding: 0 10px; font-size: 10px; }
    .nav-link .material-icons-round { font-size: 16px; }
    .sidebar-bottom { display: contents; }
    .theme-row { grid-column: 2; grid-row: 1; align-self: center; padding: 0; }
    .theme-row > span:first-child { display: none; }
    .main-shell { margin-left: 0; }
    .topbar { min-height: 54px; padding-right: 20px; padding-left: 20px; }
    .dashboard-main { padding: 32px 20px 56px; }
    .content-section { margin-top: 32px; }
    .engine-control, .region-control { align-items: stretch; flex-direction: column; gap: 12px; }
    .region-select-wrap { flex-basis: auto; width: 100%; }
}
@media (max-width: 560px) {
    .topbar-hint { display: none; }
    .welcome-row { align-items: flex-start; flex-direction: column; gap: 16px; margin-bottom: 21px; }
    .welcome-copy h1 { font-size: clamp(29px, 9vw, 38px); }
    .welcome-copy p:last-child { max-width: 330px; font-size: 12px; }
    .welcome-badge { padding: 8px 10px; font-size: 10px; }
    .search-panel { padding: 16px; border-radius: 16px; }
    .search-bar { height: 52px; padding-right: 86px; padding-left: 43px; font-size: 12px; }
    .search-field-icon { left: 13px; font-size: 18px; }
    .search-go { min-width: 72px; height: 40px; gap: 5px; font-size: 10px; }
    .search-go .material-icons-round { font-size: 15px; }
    .search-heading span { display: none; }
    .search-foot { font-size: 9px; }
    .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .quick-card { min-height: 76px; grid-template-columns: 32px minmax(0, 1fr); column-gap: 8px; padding: 12px 28px 12px 10px; border-radius: 12px; }
    .quick-card > img { width: 31px; height: 31px; border-radius: 9px; }
    .quick-card .qc-title { font-size: 10px; }
    .quick-card .qc-url { font-size: 9px; }
    .quick-card .qc-star, .quick-card .qc-close { top: 6px; width: 20px; height: 20px; }
    .quick-card .qc-star { right: 28px; }
    .quick-card .qc-close { right: 5px; }
    .settings-grid { grid-template-columns: 1fr; gap: 9px; }
    .section-heading { align-items: flex-start; }
    .section-title { font-size: 16px; }
    .list-item { gap: 8px; }
    .list-item .li-url { max-width: 28%; }
    .history-panel .panel-body { padding-right: 13px; padding-left: 13px; }
    #toast-container { right: 12px; bottom: 12px; left: 12px; align-items: flex-end; }
    .toast { max-width: 100%; }
}
@media (hover: none) {
    .quick-card .qc-star, .quick-card .qc-close { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
