/* ════════════════════════════════════════════
   TOKENS
════════════════════════════════════════════ */
:root {
    --bg: #07070d;
    --surface: #0f0f18;
    --surface2: #181826;
    --surface3: #20202e;
    --border: #252535;
    --border-hi: rgba(79, 255, 176, 0.3);
    --accent: #4fffb0;
    --accent2: #7b6fff;
    --accent-dim: rgba(79, 255, 176, 0.10);
    --accent2-dim: rgba(123, 111, 255, 0.10);
    --text: #e2e2ee;
    --text-muted: #64647a;
    --text-dim: #33334a;
    --danger: #ff4f6a;
    --danger-dim: rgba(255, 79, 106, 0.12);
    --warn: #ffb84f;
    --mono: 'JetBrains Mono', monospace;
    --sans: 'Syne', sans-serif;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--mono);
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 14px;
}

/* Grid background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(79, 255, 176, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 255, 176, 0.025) 1px, transparent 1px);
    background-size: 44px 44px;
    pointer-events: none;
    z-index: 0;
}

/* Ambient glow */
body::after {
    content: '';
    position: fixed;
    top: -300px;
    left: 50%;
    transform: translateX(-50%);
    width: min(900px, 120vw);
    height: 700px;
    background: radial-gradient(ellipse, rgba(79, 255, 176, 0.055) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* ════════════════════════════════════════════
   HEADER
════════════════════════════════════════════ */
header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(7, 7, 13, 0.88);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(14px, 4vw, 40px);
    height: 54px;
    gap: 10px;
}

.logo {
    font-family: var(--sans);
    font-weight: 800;
    font-size: clamp(0.95rem, 2.5vw, 1.25rem);
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.logo .br {
    color: var(--accent);
}

.logo .dot {
    color: var(--accent2);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.api-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-dim);
    flex-shrink: 0;
    transition: background 0.3s;
}

.status-dot.ok {
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
    animation: pulse 2.5s infinite;
}

.status-dot.err {
    background: var(--danger);
}

.status-dot.busy {
    background: var(--warn);
    animation: pulse 0.8s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0.35
    }
}

.btn-settings {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.btn-settings:hover {
    color: var(--text);
    border-color: var(--text-dim);
}

.btn-settings.open {
    color: var(--accent);
    border-color: var(--border-hi);
    background: var(--accent-dim);
}

/* ════════════════════════════════════════════
   SETTINGS DRAWER
════════════════════════════════════════════ */
.settings-drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 54px;
    z-index: 40;
    overflow: hidden;
    height: 0vh;
    width: 100vw;
    transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-drawer.open {
    height: 100vh;
}

.close-config {
    flex-grow: 1;
    background-color: #07070d50;
}

.settings-inner {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 18px clamp(14px, 4vw, 40px);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-inner label {
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.settings-field {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex: 1;
    min-width: 160px;
    flex-wrap: wrap;
}

.s-input-wrap {
    display: flex;
    flex-grow: 1;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.s-input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 255, 176, 0.07);
}

.s-input-wrap input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.78rem;
    padding: 8px 12px;
    min-width: 0;
}

.s-input-wrap input::placeholder {
    color: var(--text-dim);
}

.settings-hint {
    font-size: 0.6rem;
    color: var(--text-dim);
    margin-top: 2px;
}

.settings-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    letter-spacing: normal;
    text-transform: none;
    color: var(--text);
    cursor: pointer;
    user-select: none;
}

.settings-checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    cursor: pointer;
    position: relative;
    transition: background 0.2s, border-color 0.2s;
}

.settings-checkbox-label input[type="checkbox"]:hover {
    border-color: var(--accent);
}

.settings-checkbox-label input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.settings-checkbox-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid var(--bg);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.settings-checkbox-label input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 255, 176, 0.15);
}

/* ════════════════════════════════════════════
   MAIN
════════════════════════════════════════════ */
main {
    position: relative;
    z-index: 10;
    max-width: 1140px;
    margin: 0 auto;
    padding: clamp(24px, 5vw, 52px) clamp(14px, 4vw, 32px) 100px;
}

.hero {
    text-align: center;
    margin-bottom: clamp(28px, 5vw, 52px);
}

.hero h1 {
    font-family: var(--sans);
    font-weight: 800;
    font-size: clamp(1.9rem, 6vw, 4rem);
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: 10px;
}

.hero h1 .solid {
    color: var(--text);
}

.hero h1 .outline {
    color: transparent;
    -webkit-text-stroke: 1.5px var(--accent);
    display: block;
}

.hero p {
    font-size: clamp(0.62rem, 1.5vw, 0.76rem);
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ── Tabs ── */
.tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex: 1;
    min-width: fit-content;
    background: transparent;
    border: 1px solid transparent;
    padding: 9px 14px;
    font-family: var(--mono);
    font-size: clamp(0.58rem, 1.4vw, 0.7rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 7px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text);
    background: var(--surface2);
}

.tab-btn.active {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: rgba(79, 255, 176, 0.22);
}

.tab-icon {
    font-size: 0.82rem;
}

/* ── Panels ── */
.panel {
    display: none;
}

.panel.active {
    display: block;
    animation: fadeSlide 0.28s ease both;
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ════════════════════════════════════════════
   CARD
════════════════════════════════════════════ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
}

.card-dots {
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-dots span {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.dot-r {
    background: #ff5f57;
}

.dot-y {
    background: #febc2e;
}

.dot-g {
    background: #28c840;
}

.card-title {
    font-size: 0.62rem;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.card-body {
    padding: clamp(14px, 3vw, 22px);
}

/* ════════════════════════════════════════════
   FORM
════════════════════════════════════════════ */
.file-and-content {
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.file-and-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    border-color: rgba(79, 255, 176, 0.28);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.field-filler {
    position: absolute;
    top: 2px;
    left: 0;
    right: 0;
    height: 10px;
    background-color:var(--surface);
    border-radius: 12px 12px 0px 0px;
}

.field {
    margin-bottom: 16px;

}

.field-label-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.field-label {
    display: block;
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.field-label .req {
    color: var(--accent);
    margin-left: 2px;
}

.delete-file-field {
    display: block;
    font-size: 0.6rem;
    font-weight: bold;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-right: 6px;
    color: var(--accent2);
    margin-bottom: 6px;
}

.delete-file-field {
    all: unset;
    cursor: pointer;
    display: block;
    font-size: 0.6rem;
    font-weight: bold;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-right: 6px;
    color: var(--accent2);
    margin-bottom: 6px;
}

.delete-file-field:hover {
    color: var(--accent);
}

.input-wrap {
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 255, 176, 0.07);
}

.input-prefix {
    padding: 0 10px;
    font-size: 0.72rem;
    color: var(--text-muted);
    border-right: 1px solid var(--border);
    height: 40px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    background: var(--surface2);
    flex-shrink: 0;
}

input[type="text"] {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    user-select: text;
    font-family: var(--mono);
    font-size: 0.8rem;
    padding: 0 11px;
    height: 40px;
    min-width: 0;
}

input[type="text"]::placeholder {
    color: var(--text-dim);
}

.textarea-wrap {
    position: relative;
}

textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    user-select: text;
    font-family: var(--mono);
    font-size: 0.78rem;
    line-height: 1.65;
    padding: 13px;
    resize: vertical;
    min-height: 180px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea::placeholder {
    color: var(--text-dim);
}

textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 255, 176, 0.07);
}

.char-count {
    position: absolute;
    bottom: 9px;
    right: 11px;
    font-size: 0.58rem;
    color: var(--text-dim);
    pointer-events: none;
    letter-spacing: 0.04em;
}

/* Two-col grid for field pairs */
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

/* ════════════════════════════════════════════
   BUTTONS
════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.edit-btn {
    padding: 13px 18px;
    border: 1px solid var(--border);
    border-radius: 0px var(--radius-sm) var(--radius-sm) 0px;
}

.btn:disabled {
    opacity: 0.4;
    pointer-events: none;
}

.btn-first {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}

.btn-first:hover {
    background: var(--accent);
    color: #07070d;
    border-color: var(--accent);
    box-shadow: 0 0 18px rgba(79, 255, 176, 0.18);
}

.btn-primary {
    background: var(--accent);
    color: #07070d;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: transparent;
    color: var(--accent);
    box-shadow: 0 0 18px rgba(79, 255, 176, 0.18);
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
}

.btn-secondary:hover {
    color: var(--text);
    border-color: var(--text-dim);
}

.btn-ghost {
    background: transparent;
    color: var(--accent2);
    border-color: rgba(123, 111, 255, 0.28);
}

.btn-ghost:hover {
    background: var(--accent2-dim);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: rgba(255, 79, 106, 0.3);
}

.btn-danger:hover {
    background: var(--danger-dim);
}

.btn-sm {
    padding: 4px 11px;
    font-size: 0.6rem;
}

.btn-row {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    align-items: center;
}

.btn .spinner {
    width: 10px;
    height: 10px;
    border: 1.5px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ════════════════════════════════════════════
   SUCCESS BANNER
════════════════════════════════════════════ */
.success-banner {
    display: none;
    margin-top: 18px;
    background: rgba(79, 255, 176, 0.05);
    border: 1px solid rgba(79, 255, 176, 0.25);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    animation: fadeSlide 0.3s ease;
}

.success-banner.show {
    display: block;
}

.success-label {
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 9px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.share-url-box {
    display: flex;
    align-items: stretch;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.share-url-box .url-text {
    flex: 1;
    padding: 9px 12px;
    font-size: 0.72rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    align-self: center;
}

.share-url-box button {
    background: var(--surface2);
    border: none;
    border-left: 1px solid var(--border);
    padding: 9px 13px;
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.share-url-box button:hover {
    background: var(--accent-dim);
    color: var(--accent);
}

.share-url-box button.copied {
    color: var(--accent);
}

/* ════════════════════════════════════════════
   RETRIEVE RESULT
════════════════════════════════════════════ */
.retrieve-result {
    display: none;
    margin-top: 18px;
    animation: fadeSlide 0.3s ease;
}

.retrieve-result.show {
    display: block;
}

.result-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 9px;
    padding: 10px 13px;
    margin-bottom: 13px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.result-name {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.76rem;
    color: var(--accent);
}

.result-actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.result-info {
    width: 100%;
    display: flex;
    gap: 13px;
    flex-wrap: wrap;
    font-size: 0.6rem;
    color: var(--text-muted);
}

.result-content {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.result-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 13px;
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
    gap: 7px;
    flex-wrap: wrap;
}

.result-content-header span {
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
}

.result-text {
    padding: 16px;
    font-size: 0.76rem;
    line-height: 1.7;
    color: var(--text);
    user-select: all;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
}

summary {
    list-style: none;
}

summary::-webkit-details-marker {
    display: none;
}

/* ════════════════════════════════════════════
   BADGES
════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 0.56rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.badge-ok {
    background: rgba(79, 255, 176, 0.1);
    color: var(--accent);
}

.badge-code {
    background: var(--accent2-dim);
    color: var(--accent2);
}

.badge-deleted {
    background: var(--danger-dim);
    color: var(--danger);
}

/* ════════════════════════════════════════════
   BROWSE
════════════════════════════════════════════ */
.browse-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.browse-toolbar-left {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.section-label {
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.section-label::before {
    content: '// ';
    color: var(--accent);
    font-weight: 700;
}

.sort-select {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-family: var(--mono);
    font-size: 0.62rem;
    color: var(--text-muted);
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.sort-select:focus {
    border-color: var(--accent);
    color: var(--text);
}

.browse-grid {
    display: grid;
    gap: 13px;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 255px), 1fr));
}

.clip-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 15px;
    cursor: pointer;
    transition: all 0.22s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.clip-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    opacity: 0;
    transition: opacity 0.2s;
}

.clip-card:hover {
    border-color: rgba(79, 255, 176, 0.28);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.clip-card:hover::before {
    opacity: 1;
}

.clip-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 7px;
}

.clip-card-name {
    font-size: 0.78rem;
    color: var(--accent);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clip-card-badges {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.clip-card-preview {
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.clip-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 5px;
}

.clip-card-meta {
    font-size: 0.6rem;
    color: var(--text-dim);
}

.clip-card-del {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

.clip-card:hover .clip-card-del {
    opacity: 1;
}

/* ════════════════════════════════════════════
   EMPTY / NOT FOUND
════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 52px 20px;
    color: var(--text-dim);
}

.empty-state .big {
    font-size: 2.4rem;
    margin-bottom: 11px;
}

.empty-state p {
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    line-height: 1.65;
}

.not-found {
    margin-top: 18px;
    text-align: center;
    padding: 42px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.not-found .code {
    font-size: 2.3rem;
    color: var(--danger);
    margin-bottom: 8px;
}

.not-found p {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.65;
}

/* ════════════════════════════════════════════
   LOADING BAR
════════════════════════════════════════════ */
.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    z-index: 999;
    transition: width 0.3s ease;
    width: 0%;
    pointer-events: none;
}

/* ════════════════════════════════════════════
   TOAST
════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    top: 76px;
    right: 22px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 7px;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1)
}

.toast {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: min(320px, calc(100vw - 44px));
    backdrop-filter: blur(10px);
    animation: toastIn 0.3s ease both;
    transition: opacity 0.4s;
    pointer-events: auto;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(16px)
    }

    to {
        opacity: 1;
        transform: translateX(0)
    }
}

.toast-success {
    background: rgba(79, 255, 176, 0.13);
    border: 1px solid rgba(79, 255, 176, 0.35);
    color: var(--accent);
}

.toast-error {
    background: rgba(255, 79, 106, 0.13);
    border: 1px solid rgba(255, 79, 106, 0.35);
    color: var(--danger);
}

.toast-info {
    background: rgba(123, 111, 255, 0.13);
    border: 1px solid rgba(123, 111, 255, 0.35);
    color: var(--accent2);
}

/* ════════════════════════════════════════════
   MODAL
════════════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(7, 7, 13, 0.82);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(20px, 4vw, 28px);
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow);
    animation: fadeSlide 0.25s ease;
}

.modal h3 {
    font-family: var(--sans);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.modal p {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 22px;
}

.modal p code {
    background: var(--surface3);
    padding: 1px 6px;
    border-radius: 3px;
    color: var(--accent);
    font-size: 0.78rem;
}

.modal .btn-row {
    justify-content: flex-end;
}

/* ════════════════════════════════════════════
   FOOTER
════════════════════════════════════════════ */
footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 18px;
    border-top: 1px solid var(--border);
    font-size: 0.6rem;
    color: var(--text-dim);
    letter-spacing: 0.08em;
}

footer a {
    color: var(--accent2);
    text-decoration: none;
}

/* ════════════════════════════════════════════
   RESPONSIVE: TABLET (601–900px)
════════════════════════════════════════════ */
@media (max-width: 900px) {
    .field-row {
        grid-template-columns: 1fr;
    }

    .browse-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
    }
}

/* ════════════════════════════════════════════
   RESPONSIVE: SMALL / MOBILE LANDSCAPE (≤ 640px)
════════════════════════════════════════════ */
@media (max-width: 640px) {
    main {
        padding: 20px 12px 80px;
    }

    .hero h1 {
        font-size: clamp(1.6rem, 8vw, 2.4rem);
    }

    .hero {
        margin-bottom: 24px;
    }

    .tab-btn {
        padding: 8px 10px;
        gap: 4px;
    }

    .tab-icon {
        display: none;
    }

    .card-body {
        padding: 14px;
    }

    .btn-row {
        flex-direction: column;
    }

    .btn-row .btn {
        width: 100%;
        justify-content: center;
    }

    /* except inline action buttons */
    .result-actions .btn,
    .result-content-header .btn,
    .clip-card-del .btn {
        width: auto;
    }

    .browse-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .result-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .clip-card-del {
        opacity: 1;
    }
}

/* ════════════════════════════════════════════
   RESPONSIVE: PURE MOBILE (≤ 430px)
════════════════════════════════════════════ */
@media (max-width: 430px) {
    header {
        padding: 0 12px;
    }

    .api-badge .api-label {
        display: none;
    }
    
    .settings-field {
        gap: 10px;
        min-width: 100%;
    }

    .settings-field .btn-apply-config {
        display: flex;
        flex-grow: 1;
    }

    .settings-field .btn-apply-config > button {
        display: flex;
        justify-content: center;
        flex-grow: 1;
    }

    .share-url-box {
        flex-direction: column;
        align-items: stretch;
    }

    .share-url-box button {
        border-left: none;
        border-top: 1px solid var(--border);
        width: 100%;
        text-align: center;
    }

    .browse-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        padding: 18px;
    }

    .result-actions {
        gap: 5px;
    }
}

/* ════════════════════════════════════════════
   RESPONSIVE: LARGE DESKTOP (≥ 1400px)
════════════════════════════════════════════ */
@media (min-width: 1400px) {
    main {
        max-width: 1320px;
    }

    .browse-grid {
        grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    }
}
