:root {
    color-scheme: light;
    --bg: #ffffff;
    --bg-end: #ffffff;
    --surface: #f6f8fa;
    --surface-soft: #ffffff;
    --surface-overlay: rgba(246, 248, 250, 0.96);
    --text: #1f2328;
    --muted: #57606a;
    --line: #a8b6ad;
    --teal: #1a7f37;
    --teal-strong: #116329;
    --teal-soft: #dafbe1;
    --amber: #bc4c00;
    --amber-soft: #fff1e5;
    --danger: #cf222e;
    --danger-soft: #ffebe9;
    --on-accent: #ffffff;
    --badge-bg: #24292f;
    --badge-text: #ffffff;
    --provider-dark: #24292f;
    --provider-facebook: #0969da;
    --focus-ring: rgba(26, 127, 55, 0.32);
    --surface-shadow: rgba(31, 35, 40, 0.14);
    --backdrop: rgba(31, 35, 40, 0.32);
    --image-start: #dafbe1;
    --image-end: #fff1e5;
    --glow-one: rgba(63, 185, 80, 0.16);
    --glow-two: rgba(26, 127, 55, 0.1);
    --shadow: 0 22px 56px rgba(31, 35, 40, 0.14);
}

:root[data-theme="forest-dark"] {
    color-scheme: dark;
    --bg: #0d1117;
    --bg-end: #0d1117;
    --surface: #161b22;
    --surface-soft: #21262d;
    --surface-overlay: rgba(22, 27, 34, 0.96);
    --text: #e6edf3;
    --muted: #8b949e;
    --line: #30363d;
    --teal: #3fb950;
    --teal-strong: #7ee787;
    --teal-soft: #173b25;
    --amber: #d29922;
    --amber-soft: rgba(210, 153, 34, 0.16);
    --danger: #f85149;
    --danger-soft: rgba(248, 81, 73, 0.14);
    --on-accent: #0d1117;
    --badge-bg: #30363d;
    --badge-text: #e6edf3;
    --provider-dark: #21262d;
    --provider-facebook: #2f81f7;
    --focus-ring: rgba(63, 185, 80, 0.38);
    --surface-shadow: rgba(0, 0, 0, 0.34);
    --backdrop: rgba(1, 4, 9, 0.64);
    --image-start: #173b25;
    --image-end: #2d2518;
    --glow-one: rgba(63, 185, 80, 0.18);
    --glow-two: rgba(126, 231, 135, 0.08);
    --shadow: 0 22px 56px rgba(0, 0, 0, 0.34);
}

:root[data-theme="github-light"] {
    color-scheme: light;
    --bg: #ffffff;
    --bg-end: #ffffff;
    --surface: #f6f8fa;
    --surface-soft: #ffffff;
    --surface-overlay: rgba(255, 255, 255, 0.96);
    --text: #1f2328;
    --muted: #57606a;
    --line: #d0d7de;
    --teal: #1a7f37;
    --teal-strong: #116329;
    --teal-soft: #dafbe1;
    --amber: #bc4c00;
    --amber-soft: #fff1e5;
    --danger: #cf222e;
    --danger-soft: #ffebe9;
    --on-accent: #ffffff;
    --badge-bg: #24292f;
    --badge-text: #ffffff;
    --provider-dark: #24292f;
    --provider-facebook: #0969da;
    --focus-ring: rgba(26, 127, 55, 0.32);
    --surface-shadow: rgba(31, 35, 40, 0.1);
    --backdrop: rgba(31, 35, 40, 0.32);
    --image-start: #dafbe1;
    --image-end: #fff1e5;
    --glow-one: transparent;
    --glow-two: transparent;
    --shadow: 0 8px 24px rgba(140, 149, 159, 0.2);
}

:root[data-theme="one-dark-light"] { --bg:#f8fafc;--bg-end:#f8fafc;--surface:#eef1f6;--surface-soft:#fff;--surface-overlay:rgba(255,255,255,.96);--text:#242933;--muted:#586174;--line:#b9c0cc;--teal:#3f6fd9;--teal-strong:#315ab7;--teal-soft:#dfe8ff;--amber:#aa6700;--amber-soft:#fff3d9;--danger:#c13b4a;--danger-soft:#ffe7ea;--on-accent:#fff;--glow-one:rgba(82,139,255,.16);--glow-two:rgba(152,195,121,.13) }
:root[data-theme="one-dark-dark"] { --bg:#282c34;--bg-end:#282c34;--surface:#30343d;--surface-soft:#3a3f4b;--surface-overlay:rgba(48,52,61,.96);--text:#abb2bf;--muted:#8b93a1;--line:#4c5360;--teal:#61afef;--teal-strong:#8fc7f6;--teal-soft:#213e5a;--amber:#e5c07b;--amber-soft:rgba(229,192,123,.16);--danger:#e06c75;--danger-soft:rgba(224,108,117,.16);--on-accent:#282c34;--glow-one:rgba(97,175,239,.17);--glow-two:rgba(152,195,121,.13) }
:root[data-theme="academic-paper-light"] { --bg:#f8f5ee;--bg-end:#f8f5ee;--surface:#f1ede3;--surface-soft:#fffdf8;--surface-overlay:rgba(255,253,248,.96);--text:#303735;--muted:#69716d;--line:#cfc5b3;--teal:#3d7770;--teal-strong:#305c57;--teal-soft:#dceee8;--amber:#9a6a2d;--amber-soft:#fff0d7;--danger:#b54b45;--danger-soft:#fce7e3;--glow-one:rgba(61,119,112,.14);--glow-two:rgba(180,138,78,.13) }
:root[data-theme="academic-paper-dark"] { --bg:#252826;--bg-end:#252826;--surface:#30332f;--surface-soft:#3a3e39;--surface-overlay:rgba(48,51,47,.96);--text:#e8e3d8;--muted:#b8b3a8;--line:#575b55;--teal:#8ccbc0;--teal-strong:#b3e0d8;--teal-soft:#24433d;--amber:#e0b56d;--amber-soft:rgba(224,181,109,.16);--danger:#e28a82;--danger-soft:rgba(226,138,130,.16);--on-accent:#252826;--glow-one:rgba(140,203,192,.15);--glow-two:rgba(224,181,109,.12) }
:root[data-theme="executive-ledger-light"] { --bg:#f6f8fb;--bg-end:#f6f8fb;--surface:#edf1f6;--surface-soft:#fff;--surface-overlay:rgba(255,255,255,.96);--text:#202e3d;--muted:#5d6b7a;--line:#bbc6d3;--teal:#265d8c;--teal-strong:#173b5c;--teal-soft:#dfebf6;--amber:#a46e21;--amber-soft:#fff3dd;--danger:#b8414b;--danger-soft:#fbe8e9;--glow-one:rgba(38,93,140,.15);--glow-two:rgba(184,134,66,.13) }
:root[data-theme="executive-ledger-dark"] { --bg:#172232;--bg-end:#172232;--surface:#202d3e;--surface-soft:#2a394b;--surface-overlay:rgba(32,45,62,.96);--text:#e5edf5;--muted:#aab7c5;--line:#46566b;--teal:#69a6d3;--teal-strong:#a6d2f1;--teal-soft:#213f59;--amber:#e1b766;--amber-soft:rgba(225,183,102,.16);--danger:#e58b91;--danger-soft:rgba(229,139,145,.16);--on-accent:#172232;--glow-one:rgba(105,166,211,.15);--glow-two:rgba(225,183,102,.12) }
:root[data-theme="classroom-studio-light"] { --bg:#fff8ed;--bg-end:#fff8ed;--surface:#fff1dc;--surface-soft:#fffdf8;--surface-overlay:rgba(255,253,248,.96);--text:#334e68;--muted:#66798d;--line:#d9c6aa;--teal:#7955aa;--teal-strong:#60438a;--teal-soft:#eee4fa;--amber:#c66b28;--amber-soft:#fff0de;--danger:#c84f54;--danger-soft:#fde8e7;--glow-one:rgba(121,85,170,.15);--glow-two:rgba(232,125,62,.14) }
:root[data-theme="classroom-studio-dark"] { --bg:#2b2a38;--bg-end:#2b2a38;--surface:#373547;--surface-soft:#444153;--surface-overlay:rgba(55,53,71,.96);--text:#f3edee;--muted:#c1bac2;--line:#5d596f;--teal:#bc9be3;--teal-strong:#d9c2f5;--teal-soft:#4a3c60;--amber:#f0a461;--amber-soft:rgba(240,164,97,.16);--danger:#f09091;--danger-soft:rgba(240,144,145,.16);--on-accent:#2b2a38;--glow-one:rgba(188,155,227,.16);--glow-two:rgba(240,164,97,.13) }

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at top left, var(--glow-one), transparent 30%),
        radial-gradient(circle at 92% 82%, var(--glow-two), transparent 26%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-end) 100%);
    font-family: "Aptos", "Segoe UI", "Avenir Next", sans-serif;
    font-size: 16px;
    line-height: 1.42;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
textarea {
    font: inherit;
}

button {
    min-height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: 14px;
    color: var(--on-accent);
    background: var(--teal);
    cursor: pointer;
    font-weight: 700;
}

button:hover {
    filter: brightness(0.96);
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

button.ghost {
    border: 1px solid var(--line);
    color: var(--text);
    background: var(--surface);
}

input,
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    outline: 0;
    color: var(--text);
    background: var(--surface);
}

input:focus,
textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-soft);
}

.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;
}

.page-shell {
    position: relative;
    z-index: 2;
    width: min(1356px, calc(100% - 40px));
    margin: 0 auto;
    padding: 34px 0 54px;
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-bottom: 22px;
}

.brand-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.theme-toggle,
.account-settings-button,
.logout-icon-button,
.refresh-dashboard-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    border-radius: 50%;
}

.logout-icon-button {
    display: none;
    color: var(--danger);
}

.account-settings-button {
    display: none;
}

.refresh-dashboard-button {
    display: none;
}

.dashboard-active .logout-icon-button,
.dashboard-active .account-settings-button,
.dashboard-active .refresh-dashboard-button {
    display: inline-flex;
}

.logout-icon-button:hover {
    border-color: var(--danger);
    color: var(--danger);
}

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

.account-settings-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

.refresh-dashboard-button.loading svg {
    animation: refresh-dashboard-spin 700ms linear infinite;
}

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

.theme-toggle-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand-icon {
    display: block;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    object-fit: cover;
}

.brand-header strong,
.brand-header span {
    display: block;
}

.brand-header strong {
    font-family: "Aptos Display", "Aptos", "Segoe UI", sans-serif;
    font-size: 20px;
    font-weight: 700;
}

.brand-header span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 16px;
}

.hero {
    max-width: 760px;
    margin: 28px 0;
}

.hero h1 {
    margin: 0 0 14px;
    font-family: "Aptos Display", "Aptos", "Segoe UI", sans-serif;
    font-size: clamp(2.2rem, 4vw, 3.6rem);
    line-height: 1.05;
}

.hero-copy,
.dashboard-copy,
.auth-hint,
.status,
.link-meta,
.link-summary,
.link-tags,
.link-note {
    color: var(--muted);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--teal-strong);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}

.auth-card,
#appCard {
    border: 1px solid var(--line);
    border-radius: 30px;
    background: var(--surface-overlay);
    box-shadow: var(--shadow);
}

.auth-card {
    max-width: 560px;
    padding: 24px;
}

.mobile-download-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    max-width: 680px;
    margin-top: 18px;
    padding: 20px 24px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface-overlay);
    box-shadow: var(--shadow);
}

.mobile-download-card h2 {
    margin: 0 0 5px;
    font-size: 19px;
}

.mobile-download-card p:not(.eyebrow) {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.mobile-download-card .eyebrow {
    margin-bottom: 5px;
    font-size: 11px;
}

.store-links {
    display: flex;
    flex: 0 0 auto;
    gap: 9px;
}

.store-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 142px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    color: var(--text);
    background: var(--surface);
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.store-link:hover {
    border-color: var(--teal);
    background: var(--teal-soft);
    transform: translateY(-1px);
}

.store-link svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.store-link span {
    display: grid;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.1;
}

.store-link small {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .04em;
}

.card-header h2 {
    margin: 0 0 8px;
    font-size: 22px;
}

.card-header p {
    margin: 0 0 18px;
    color: var(--muted);
}

.stack {
    display: grid;
    gap: 12px;
}

.social-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    border: 1px solid transparent;
    font-size: 16px;
}

.social-button.dev {
    background: var(--teal);
}

.social-button.google {
    border-color: #dadce0;
    color: #3c4043;
    background: #ffffff;
}

.social-button.facebook {
    border-color: #075fc7;
    color: #ffffff;
    background: linear-gradient(135deg, #1877f2 0%, #0969da 100%);
    box-shadow: 0 8px 18px rgba(24, 119, 242, 0.24);
}

.provider-icon {
    display: block;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
}

.social-button.facebook .provider-icon {
    width: 18px;
    color: #ffffff;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.18));
}

:root[data-theme="forest-dark"] .social-button.google {
    border-color: #57606a;
    color: #3c4043;
    background: #ffffff;
}

:root[data-color-mode="dark"] .social-button.google { border-color:#57606a;color:#3c4043;background:#fff; }

.divider {
    margin: 16px 0;
    color: var(--muted);
    text-align: center;
}

.auth-hint {
    margin: 0;
    font-size: 16px;
}

body:not(.dashboard-active) .page-shell {
    display: grid;
    grid-template-columns: minmax(0, 560px);
    justify-content: center;
    align-content: center;
    min-height: 100vh;
    padding-block: 34px;
}

body:not(.dashboard-active) .brand-header {
    position: fixed;
    top: 24px;
    left: max(20px, calc((100vw - 1356px) / 2));
    width: auto;
    margin: 0;
}

body:not(.dashboard-active) .brand-header-actions {
    position: fixed;
    top: 26px;
    right: max(20px, calc((100vw - 1356px) / 2));
}

body:not(.dashboard-active) .theme-toggle {
    display: none;
}

body:not(.dashboard-active) .hero {
    max-width: 560px;
    margin: 0 0 24px;
    text-align: center;
}

body:not(.dashboard-active) .hero h1 {
    font-size: clamp(2.3rem, 4.5vw, 3.5rem);
}

body:not(.dashboard-active) .auth-card {
    max-width: 560px;
    padding: 30px;
    text-align: center;
}

body:not(.dashboard-active) .card-header p {
    max-width: 430px;
    margin-inline: auto;
}

.dashboard-active .hero {
    display: none;
}

.dashboard-active #appCard {
    padding: 30px 36px 36px;
}

.workspace-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.workspace-header h2 {
    margin: 0 0 5px;
    font-family: "Aptos Display", "Aptos", "Segoe UI", sans-serif;
    font-size: 26px;
    line-height: 1.2;
}

.dashboard-copy {
    margin: 0;
}

.library-count {
    min-width: 156px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: var(--surface-soft);
    box-shadow: 0 12px 28px var(--surface-shadow);
    text-align: center;
}

.library-count > span {
    display: block;
}

.library-count-score {
    position: relative;
    display: grid !important;
    min-height: 58px;
    margin-top: 7px;
    overflow: hidden;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    perspective: 500px;
}

.library-count-score::before {
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    z-index: 2;
    height: 1px;
    background: var(--line);
    content: "";
    opacity: 0.72;
    pointer-events: none;
}

.library-count-score::after {
    position: absolute;
    inset: 0 0 50%;
    z-index: 1;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent);
    content: "";
    opacity: 0;
    pointer-events: none;
}

.library-count-score strong {
    position: relative;
    z-index: 3;
    display: inline-block;
    color: var(--text);
    font-family: "Aptos Display", "Aptos", "Segoe UI", sans-serif;
    font-size: 2.35rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    line-height: 1;
    transform-origin: center;
}

.library-count-label {
    color: var(--teal-strong);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.library-count.count-up .library-count-score strong {
    animation: count-fold-up 520ms cubic-bezier(0.16, 1, 0.3, 1);
}

.library-count.count-down .library-count-score strong {
    animation: count-fold-down 460ms cubic-bezier(0.16, 1, 0.3, 1);
}

.library-count.count-up .library-count-score::after,
.library-count.count-down .library-count-score::after {
    animation: count-panel-flash 520ms cubic-bezier(0.16, 1, 0.3, 1);
}

.dashboard-actions {
    display: flex;
    gap: 8px;
}

.capture-panel,
.library-shell {
    border: 1px solid var(--line);
    background: var(--surface);
}

.capture-panel {
    max-width: 820px;
    margin: 22px auto 0;
    padding: 0;
    overflow: hidden;
    border-radius: 24px;
    background:
        linear-gradient(145deg, var(--surface-soft), var(--surface));
    box-shadow: 0 18px 42px var(--surface-shadow);
}

.capture-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
}

.capture-header h3 {
    margin: 0 0 4px;
    font-family: "Aptos Display", "Aptos", "Segoe UI", sans-serif;
    font-size: 20px;
}

.capture-header p {
    max-width: 62ch;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.capture-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--teal);
    border-radius: 14px;
    color: var(--teal-strong);
    background: var(--teal-soft);
}

.capture-mark svg,
.capture-input-shell svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.capture-panel .stack {
    gap: 16px;
    padding: 20px 22px 22px;
}

.capture-field {
    display: grid;
    gap: 7px;
}

.capture-field-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.capture-field-heading small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.capture-input-shell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 56px;
    padding-inline: 15px;
    border: 1px solid var(--line);
    border-radius: 17px;
    color: var(--teal-strong);
    background: var(--surface-soft);
}

.capture-input-shell:focus-within {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-soft);
}

.capture-input-shell input {
    min-width: 0;
    padding: 14px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.capture-input-shell input:focus {
    box-shadow: none;
}

.capture-optional-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 13px;
}

.capture-taxonomy {
    display: grid;
    align-content: start;
    gap: 12px;
}

.capture-subcategory-field {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition:
        max-height 260ms cubic-bezier(0.16, 1, 0.3, 1),
        opacity 180ms ease-out,
        transform 260ms cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0s linear 260ms;
}

.capture-subcategory-field.is-visible {
    /* Allow the input and its dynamic suggestion list to remain visible. */
    max-height: 420px;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
}

.capture-taxonomy-status {
    display: flex;
    gap: 8px;
    align-items: center;
    min-height: 38px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 12px;
    line-height: 1.45;
}

.capture-taxonomy-status::before {
    content: "+";
    display: grid;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 7px;
    color: var(--on-accent);
    background: var(--teal);
    font-size: 15px;
    font-weight: 800;
}

.capture-taxonomy-status.ready {
    border-color: var(--teal);
    color: var(--teal-strong);
    background: var(--teal-soft);
    font-weight: 700;
}

.capture-taxonomy-status.ready::before {
    content: "✓";
}

.capture-suggestions {
    display: grid;
    gap: 6px;
    margin-top: 2px;
    max-height: 220px;
    overflow-y: scroll;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-color: var(--teal) var(--surface-soft);
    scrollbar-width: thin;
}

.capture-suggestions::-webkit-scrollbar {
    width: 8px;
}

.capture-suggestions::-webkit-scrollbar-track {
    border-radius: 999px;
    background: var(--surface-soft);
}

.capture-suggestions::-webkit-scrollbar-thumb {
    border: 2px solid var(--surface-soft);
    border-radius: 999px;
    background: var(--teal);
}

.capture-suggestion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    background: var(--surface-soft);
    text-align: left;
}

.capture-suggestion:hover,
.capture-suggestion:focus-visible {
    border-color: var(--teal);
    color: var(--teal-strong);
    background: var(--teal-soft);
}

.capture-suggestion strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font-size: 15px;
    line-height: 1.3;
    font-weight: 700;
}

.capture-suggestion small,
.capture-suggestion-empty {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.capture-suggestion-empty {
    margin: 0;
    padding: 2px 1px;
}

.capture-panel textarea {
    min-height: 58px;
    line-height: 1.45;
    resize: vertical;
}

.capture-submit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-top: 2px;
}

.capture-assurance {
    color: var(--muted);
    font-size: 13px;
}

.capture-submit-row button {
    min-width: 158px;
}

.capture-panel.is-saving input,
.capture-panel.is-saving textarea {
    opacity: 0.68;
}

.save-link-progress {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 13px 14px;
    border: 1px solid var(--teal);
    border-radius: 15px;
    background: var(--teal-soft);
    animation: save-progress-enter 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.save-link-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--line);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: save-spinner 760ms linear infinite;
}

.save-link-progress-copy {
    display: grid;
    gap: 2px;
}

.save-link-progress-copy strong {
    color: var(--teal-strong);
    font-size: 14px;
}

.save-link-progress-copy > span {
    color: var(--muted);
    font-size: 13px;
}

.section-heading,
.search-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.section-heading {
    margin-bottom: 16px;
}

.section-heading h3,
.search-heading h3 {
    margin: 0;
    font-family: "Aptos Display", "Aptos", "Segoe UI", sans-serif;
}

.section-heading h3 {
    font-size: 19px;
}

.compact-button {
    min-height: 36px;
}

.library-shell {
    margin-top: 24px;
    padding: 24px;
    border-radius: 24px;
}

.search-heading {
    margin-bottom: 16px;
}

.search-heading h3 {
    font-size: 20px;
}

.search-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.link-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-soft);
    transition:
        border-color 180ms ease,
        background-color 180ms ease,
        box-shadow 180ms ease,
        transform 180ms ease;
}

.link-search:focus-within {
    border-color: var(--teal);
    background: var(--surface);
    box-shadow:
        0 0 0 3px var(--focus-ring),
        0 8px 20px var(--surface-shadow);
}

.link-search-icon {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    color: var(--teal-strong);
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.link-search input {
    position: relative;
    z-index: 1;
    min-width: 0;
    min-height: 50px;
    padding: 0;
    border: 0;
    color: var(--teal-strong);
    background: transparent;
    box-shadow: none;
    caret-color: var(--teal);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 20px;
}

.link-search input:focus {
    box-shadow: none;
}

.search-typewriter {
    position: absolute;
    left: 44px;
    top: 50%;
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 20px;
    pointer-events: none;
    transform: translateY(-50%);
    transition: opacity 120ms ease;
}

.search-typewriter strong {
    margin-left: 0;
    color: var(--teal-strong);
    font-size: 16px;
    font-style: italic;
    font-weight: 700;
}

.search-typewriter i {
    width: 2px;
    height: 17px;
    margin-left: 3px;
    border-radius: 999px;
    background: var(--teal);
    animation: search-caret-blink 850ms steps(1, end) infinite;
}

.link-search:focus-within .search-typewriter,
.link-search input:not(:placeholder-shown) + .search-typewriter {
    opacity: 0;
}

@keyframes search-caret-blink {
    50% {
        opacity: 0;
    }
}

.filter-stack {
    display: grid;
    gap: 16px;
    padding: 22px 0;
}

.filter-group {
    display: grid;
    gap: 10px;
}

.filter-group > span {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
}

.category-summary {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding-bottom: 8px;
    overflow-x: scroll;
    scrollbar-color: var(--teal) var(--surface-soft);
    scrollbar-width: thin;
}

.category-summary > * {
    flex: 0 0 auto;
}

.category-summary::-webkit-scrollbar {
    height: 8px;
}

.category-summary::-webkit-scrollbar-track {
    border-radius: 999px;
    background: var(--surface-soft);
}

.category-summary::-webkit-scrollbar-thumb {
    border: 2px solid var(--surface-soft);
    border-radius: 999px;
    background: var(--teal);
}

.link-view-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.link-view-controls > span {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.link-view-buttons {
    display: flex;
    gap: 5px;
    overflow-x: auto;
}

.link-view-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--teal-strong);
    background: var(--surface);
    box-shadow: none;
}

.link-view-icon {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.link-view-button:hover {
    border-color: var(--line);
    color: var(--text);
    background: var(--surface-soft);
}

.link-view-button.active {
    border-color: var(--teal);
    color: var(--on-accent);
    background: var(--teal);
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    background: var(--surface);
    font-size: 14px;
    font-weight: 600;
}

.filter-pill span {
    color: var(--muted);
    font-size: 13px;
}

.filter-pill.active {
    border-color: var(--teal);
    color: var(--on-accent);
    background: var(--teal);
}

.filter-pill.active span {
    color: var(--on-accent);
    opacity: 0.78;
}

.filter-pill.more {
    border-style: dashed;
    border-color: var(--teal);
    color: var(--teal-strong);
    background: transparent;
}

.filter-pill.more:hover {
    background: var(--teal-soft);
}

.status-toast {
    position: fixed;
    right: max(20px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 50;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    width: min(430px, calc(100% - 32px));
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    color: var(--text);
    background: var(--surface-overlay);
    box-shadow: 0 18px 48px var(--surface-shadow);
    backdrop-filter: blur(12px);
    animation: status-toast-enter 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.status-toast.success {
    border-color: var(--teal);
}

.status-toast.error {
    border-color: var(--danger);
}

.status-toast-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--teal-strong);
    background: var(--teal-soft);
}

.status-toast.error .status-toast-icon {
    color: var(--danger);
    background: var(--danger-soft);
}

.status-toast-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
}

.status-icon-error,
.status-toast.error .status-icon-success {
    display: none;
}

.status-toast.error .status-icon-error {
    display: block;
}

.status-toast-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.status-toast-copy strong {
    font-size: 15px;
}

.status-toast-copy > span {
    color: var(--muted);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.status-toast.error .status-toast-copy strong,
.status-toast.error .status-toast-copy > span {
    color: var(--danger);
}

.status-toast-close {
    display: grid;
    place-items: center;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--muted);
    background: transparent;
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
}

.status-toast-close:hover {
    border-color: var(--line);
    color: var(--text);
    background: var(--surface);
}

.links-grid {
    display: grid;
    gap: 16px;
}

.links-grid[data-view="grid"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.links-grid[data-view="compact"] {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

/* Feed cards keep a consistent frame while showing the full API-backed detail set. */
.links-grid[data-view="current"] .link-body {
    align-content: start;
}

.links-grid[data-view="current"] .link-card {
    height: 286px;
}

.links-grid[data-view="current"] .link-summary,
.links-grid[data-view="current"] .link-tags {
    overflow: hidden;
}

.links-grid[data-view="current"] .link-summary {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 14px;
    line-height: 1.35;
}

.links-grid[data-view="current"] .link-status,
.links-grid[data-view="current"] .link-ai-summary,
.links-grid[data-view="current"] .link-note {
    display: none;
}

.links-grid[data-view="current"] .link-tags {
    max-height: 29px;
    flex-wrap: nowrap;
}

.links-grid[data-view="grid"] .link-card,
.links-grid[data-view="compact"] .link-card {
    display: block;
    height: auto;
    min-width: 0;
}

.links-grid[data-view="grid"] .link-visual,
.links-grid[data-view="compact"] .link-visual {
    height: 118px;
    min-height: 0;
    padding: 0;
}

.links-grid[data-view="compact"] .link-visual {
    height: 82px;
}

.links-grid[data-view="grid"] .link-image,
.links-grid[data-view="compact"] .link-image {
    min-height: 0;
    border-radius: 0;
}

.links-grid[data-view="grid"] .source-badge,
.links-grid[data-view="compact"] .source-badge {
    left: 20px;
    bottom: 10px;
}

.links-grid[data-view="grid"] .link-body {
    align-content: start;
    padding: 14px;
}

.links-grid[data-view="compact"] .link-body {
    align-content: start;
    padding: 11px;
}

.links-grid[data-view="grid"] .link-meta,
.links-grid[data-view="compact"] .link-meta {
    font-size: 12px;
}

.links-grid[data-view="grid"] .link-category,
.links-grid[data-view="compact"] .link-category {
    max-width: 100%;
    overflow: hidden;
    padding: 5px 8px;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.links-grid[data-view="grid"] .link-title,
.links-grid[data-view="compact"] .link-title {
    display: -webkit-box;
    min-height: 38px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 16px;
}

.links-grid[data-view="compact"] .link-title {
    min-height: 34px;
    font-size: 14px;
}

.links-grid[data-view="grid"] .link-status,
.links-grid[data-view="grid"] .link-summary {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 13px;
}

.links-grid[data-view="grid"] .link-status,
.links-grid[data-view="grid"] .link-ai-summary,
.links-grid[data-view="grid"] .link-note {
    display: none;
}

.links-grid[data-view="compact"] .link-summary,
.links-grid[data-view="compact"] .link-note {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    font-size: 12px;
    line-height: 1.3;
}

.links-grid[data-view="compact"] .link-status,
.links-grid[data-view="compact"] .link-ai-summary,
.links-grid[data-view="compact"] .link-note {
    display: none;
}

.links-grid[data-view="compact"] .link-tags {
    max-height: 52px;
    overflow: hidden;
}

.links-grid[data-view="grid"] .link-tags {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: normal;
}

.links-grid[data-view="grid"] .link-actions,
.links-grid[data-view="compact"] .link-actions {
    gap: 5px;
}

.links-grid[data-view="grid"] .link-action-link,
.links-grid[data-view="grid"] .link-action-button,
.links-grid[data-view="grid"] .link-delete-button,
.links-grid[data-view="compact"] .link-action-link,
.links-grid[data-view="compact"] .link-action-button,
.links-grid[data-view="compact"] .link-delete-button {
    min-height: 31px;
    padding: 0 8px;
    border-radius: 9px;
    font-size: 11px;
}

.links-grid[data-view="grid"] .link-icon-action,
.links-grid[data-view="compact"] .link-icon-action,
.links-grid[data-view="table"] .link-icon-action {
    width: 32px;
    padding: 0;
}

.links-grid[data-view="list"] .link-card {
    grid-template-columns: 126px minmax(0, 1fr);
    min-height: 118px;
}

.links-grid[data-view="list"] .link-visual {
    padding: 10px 0 10px 10px;
}

.links-grid[data-view="list"] .link-image {
    min-height: 98px;
    border-radius: 14px;
}

.links-grid[data-view="list"] .source-badge {
    left: 18px;
    bottom: 18px;
}

.links-grid[data-view="list"] .link-body {
    grid-template-columns: minmax(170px, 1fr) minmax(180px, 1.2fr) auto;
    gap: 5px 16px;
    align-items: start;
    padding: 12px 16px;
}

.links-grid[data-view="list"] .link-meta,
.links-grid[data-view="list"] .link-title {
    grid-column: 1;
}

.links-grid[data-view="list"] .link-category,
.links-grid[data-view="list"] .link-summary,
.links-grid[data-view="list"] .link-product-meta,
.links-grid[data-view="list"] .link-tags {
    grid-column: 2;
}

.links-grid[data-view="list"] .link-summary,
.links-grid[data-view="list"] .link-ai-summary {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.links-grid[data-view="list"] .link-status,
.links-grid[data-view="list"] .link-ai-summary,
.links-grid[data-view="list"] .link-note {
    display: none;
}

.links-grid[data-view="list"] .link-tags {
    max-height: 28px;
    overflow: hidden;
    flex-wrap: nowrap;
}

.links-grid[data-view="list"] .link-actions {
    grid-column: 3;
    grid-row: 1 / span 4;
    align-self: center;
    justify-content: flex-end;
    max-width: 270px;
}

.links-grid[data-view="table"] {
    gap: 10px;
}

.links-grid[data-view="table"] .link-card {
    grid-template-columns: 88px minmax(0, 1fr);
    min-height: 84px;
    border-radius: 14px;
}

.links-grid[data-view="table"] .link-visual {
    padding: 8px 0 8px 8px;
}

.links-grid[data-view="table"] .link-image {
    min-height: 66px;
    border-radius: 10px;
}

.links-grid[data-view="table"] .source-badge {
    left: 14px;
    bottom: 14px;
    min-width: 30px;
    min-height: 22px;
    padding: 0 7px;
    font-size: 11px;
}

.links-grid[data-view="table"] .link-body {
    grid-template-columns: minmax(180px, 1.1fr) minmax(160px, 1fr) auto;
    gap: 4px 16px;
    align-items: start;
    padding: 9px 12px;
}

.links-grid[data-view="table"] .link-meta,
.links-grid[data-view="table"] .link-title {
    grid-column: 1;
}

.links-grid[data-view="table"] .link-category,
.links-grid[data-view="table"] .link-summary,
.links-grid[data-view="table"] .link-tags {
    grid-column: 2;
    margin: 0;
}

.links-grid[data-view="table"] .link-summary,
.links-grid[data-view="table"] .link-ai-summary {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    margin: 0;
    font-size: 12px;
    line-height: 1.3;
}

.links-grid[data-view="table"] .link-status,
.links-grid[data-view="table"] .link-ai-summary,
.links-grid[data-view="table"] .link-product-meta,
.links-grid[data-view="table"] .link-note {
    display: none;
}

.links-grid[data-view="table"] .link-tags {
    max-height: 26px;
    overflow: hidden;
    flex-wrap: nowrap;
}

.links-grid[data-view="table"] .link-actions {
    grid-column: 3;
    grid-row: 1 / span 3;
    align-self: center;
    justify-content: flex-end;
}

.links-grid[data-view="table"] .link-action-link,
.links-grid[data-view="table"] .link-action-button,
.links-grid[data-view="table"] .link-delete-button {
    min-height: 30px;
    padding: 0 8px;
    border-radius: 9px;
    font-size: 11px;
}

.links-grid > .card {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 20px;
    color: var(--muted);
    background: var(--surface-soft);
    text-align: center;
}

.link-card {
    display: grid;
    grid-template-columns: 198px minmax(0, 1fr);
    height: 218px;
    min-height: 0;
    column-gap: 8px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--line) 88%, var(--text));
    border-radius: 22px;
    background: var(--surface-soft);
    box-shadow: 0 2px 5px color-mix(in srgb, var(--surface-shadow) 38%, transparent), 0 12px 26px color-mix(in srgb, var(--surface-shadow) 62%, transparent);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.link-card:hover,
.link-card:focus-within {
    border-color: color-mix(in srgb, var(--teal) 45%, var(--line));
    box-shadow: 0 5px 10px color-mix(in srgb, var(--surface-shadow) 42%, transparent), 0 18px 34px color-mix(in srgb, var(--surface-shadow) 68%, transparent);
    transform: translateY(-2px);
}

.link-visual {
    position: relative;
    min-height: 100%;
    padding: 0;
}

.link-image {
    width: 100%;
    height: 100%;
    min-height: 122px;
    border-radius: 0;
    object-fit: cover;
    background:
        radial-gradient(circle at 22% 22%, var(--surface-overlay), transparent 28%),
        linear-gradient(135deg, var(--image-start), var(--image-end));
}

.link-preview-image {
    position: relative;
    z-index: 1;
}

.link-image-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.source-badge {
    position: absolute;
    left: 14px;
    bottom: 14px;
    display: inline-flex;
    min-width: 38px;
    min-height: 28px;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border-radius: 999px;
    color: var(--badge-text);
    background: var(--badge-bg);
    font-size: 13px;
    font-weight: 700;
}

.link-body {
    display: grid;
    align-content: center;
    padding: 18px 20px;
    overflow: hidden;
}

.link-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
    font-size: 14px;
}

.link-category {
    width: fit-content;
    max-width: 100%;
    margin-bottom: 8px;
    overflow: hidden;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--teal-strong);
    background: var(--teal-soft);
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-category.is-polling { display: inline-flex; align-items: center; gap: 7px; }
.category-spinner { width: 12px; height: 12px; border: 2px solid color-mix(in srgb, var(--teal) 28%, transparent); border-top-color: var(--teal); border-radius: 50%; animation: linkrepo-spin 700ms linear infinite; }
.link-action-button.is-starred { color: #d29922; background: color-mix(in srgb, #d29922 14%, transparent); }
@keyframes linkrepo-spin { to { transform: rotate(360deg); } }

.link-title {
    display: -webkit-box;
    margin: 0 0 12px;
    overflow: hidden;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.editable-link-field {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    min-height: 40px;
    padding: 3px 42px 3px 6px;
    border-radius: 10px;
    transition: background-color 160ms ease, box-shadow 160ms ease;
}

.editable-link-field:hover,
.editable-link-field:focus-within {
    background: var(--teal-soft);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--teal) 18%, transparent);
}

.editable-link-field .link-title,
.editable-link-field .link-summary {
    flex: 1;
    min-width: 0;
}

.edit-link-field,
.inline-link-confirm,
.inline-link-cancel {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    line-height: 1;
}

.edit-link-field {
    width: 36px;
    height: 36px;
    position: absolute;
    top: 50%;
    right: 4px;
    margin: 0;
    color: var(--muted);
    background: transparent;
    opacity: 1;
    transform: translateY(-50%);
    z-index: 1;
}

.edit-link-field .link-action-icon { width: 18px; height: 18px; stroke-width: 2.2; }
.edit-link-field .link-action-icon { display: block; overflow: visible; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }

.editable-link-field:hover .edit-link-field,
.editable-link-field:focus-within .edit-link-field {
    opacity: 1;
}

.edit-link-field:hover,
.edit-link-field:focus-visible {
    color: var(--teal-strong);
    background: var(--teal-soft);
    outline: none;
}

.inline-link-editor {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 9px;
}

.inline-title-editor {
    width: 100%;
    display: block;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.inline-link-input {
    width: 100%;
    min-width: 0;
    min-height: 72px;
    max-height: 124px;
    padding: 10px 11px;
    border: 1px solid var(--teal-strong);
    border-radius: 6px;
    color: var(--text);
    background: var(--surface);
    font: inherit;
    line-height: 1.35;
    resize: vertical;
}

.inline-link-confirm {
    width: 32px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--teal-strong);
    border-radius: 6px;
    color: white;
    background: var(--teal);
    font-size: 14px;
    font-weight: 700;
}

.inline-link-confirm:hover,
.inline-link-confirm:focus-visible {
    background: var(--teal-strong);
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.inline-link-cancel {
    width: 32px;
    height: 24px;
    padding: 0;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
    font-size: 14px;
    font-weight: 600;
}

.inline-link-cancel:hover,
.inline-link-cancel:focus-visible {
    border-color: var(--muted);
    background: var(--surface);
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.inline-title-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
}

.inline-title-actions .link-action-icon {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.3;
}

/* Match GitHub's compact PR-title editor: a green confirmation action and a
   neutral cancel action that does not imply deleting the title. */
:root[data-theme="github-light"] .inline-title-editor {
    border: 1px solid #d0d7de;
    background: #f6f8fa;
}

:root[data-theme="github-light"] .inline-link-input {
    border-color: #0969da;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.15);
}

:root[data-theme="github-light"] .inline-link-confirm {
    background: #1f883d;
    border-color: rgba(27, 31, 36, 0.15);
}

:root[data-theme="github-light"] .inline-link-confirm:hover,
:root[data-theme="github-light"] .inline-link-confirm:focus-visible {
    background: #1a7f37;
    outline: 2px solid #0969da;
    outline-offset: 2px;
}

:root[data-theme="github-light"] .inline-link-cancel {
    color: #57606a;
    border-color: #d0d7de;
    background: #ffffff;
}

:root[data-theme="github-light"] .inline-link-cancel:hover,
:root[data-theme="github-light"] .inline-link-cancel:focus-visible {
    color: #1f2328;
    border-color: #8c959f;
    background: #f6f8fa;
    outline: 2px solid #0969da;
    outline-offset: 2px;
}


.link-status,
.link-summary,
.link-ai-summary,
.link-product-meta,
.link-tags,
.link-note {
    margin: 0 0 5px;
    font-size: 15px;
}

.link-status {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
    margin-bottom: 7px;
}

.link-summary,
.link-ai-summary {
    color: var(--muted);
    line-height: 1.4;
}

.link-ai-summary {
    padding-left: 9px;
    border-left: 3px solid var(--teal);
    font-size: 13px;
}

.link-ai-summary strong,
.link-note strong {
    color: var(--teal-strong);
}

.link-status-label {
    color: var(--teal-strong);
    font-weight: 600;
}

.link-status.pending .link-status-label {
    color: var(--amber);
}

.link-product-meta {
    color: var(--teal-strong);
    font-size: 14px;
    font-weight: 700;
}

.link-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.link-tags span {
    max-width: 100%;
    padding: 4px 8px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-status.failed .link-status-label {
    color: var(--danger);
}

.link-status-detail {
    color: var(--muted);
}

.link-note {
    width: fit-content;
    padding: 6px 9px;
    border-radius: 10px;
    background: var(--teal-soft);
}

.link-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.link-action-link,
.link-action-button,
.link-delete-button {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.link-icon-action {
    width: 38px;
    padding: 0;
    transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.link-icon-action:hover {
    filter: none;
    transform: translateY(-2px);
    box-shadow: 0 7px 16px var(--surface-shadow);
}

.link-action-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.link-action-link {
    color: var(--on-accent);
    background: var(--teal);
}

.link-action-button {
    border: 1px solid var(--line);
    color: var(--text);
    background: var(--surface);
}

.link-retry-button {
    color: var(--teal);
    background: var(--teal-soft);
}

.link-delete-button {
    color: var(--danger);
    background: var(--danger-soft);
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.filter-dialog {
    width: min(620px, calc(100% - 32px));
    max-height: min(700px, calc(100vh - 32px));
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 26px;
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 28px 80px var(--surface-shadow);
}

.filter-dialog[open] {
    animation: move-dialog-enter 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.filter-dialog::backdrop {
    background: var(--backdrop);
    backdrop-filter: blur(4px);
}

.theme-dialog { width:min(520px,calc(100% - 24px)); max-height:calc(100vh - 24px); padding:0; border:1px solid var(--line); border-radius:24px; color:var(--text); background:var(--surface-soft); box-shadow:var(--shadow); }
.theme-dialog::backdrop { background:var(--backdrop); backdrop-filter:blur(4px); }
.theme-dialog[open] { animation:move-dialog-enter 180ms cubic-bezier(.16,1,.3,1); }
.theme-dialog-shell { padding:24px; }
.theme-dialog-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:18px; }
.theme-dialog-header h3 { margin:3px 0 5px; font-size:24px; }
.theme-dialog-header p { margin:0; color:var(--muted); }
.theme-mode-buttons { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:12px; }
.theme-mode-buttons button { color:var(--muted); background:var(--surface); border:1px solid var(--line); }
.theme-mode-buttons button.active { color:var(--on-accent); border-color:var(--teal); background:var(--teal); }
.theme-options { display:grid; gap:9px; }
.theme-option { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:13px; min-height:72px; padding:11px; border:1px solid var(--line); color:var(--text); background:var(--surface); text-align:left; }
.theme-option:hover { border-color:var(--teal); background:var(--teal-soft); }
.theme-option.active { border-color:var(--teal); background:var(--teal-soft); }
.theme-option strong,.theme-option small { display:block; }.theme-option small { margin-top:2px; color:var(--muted); font-weight:500; }.theme-option b { color:var(--teal-strong); opacity:0; }.theme-option.active b { opacity:1; }
.theme-swatches { display:flex; overflow:hidden; border:1px solid var(--line); border-radius:10px; }.theme-swatches i { display:block; width:11px; height:36px; background:#1a7f37; }.theme-swatches i:nth-child(2){background:#dafbe1}.theme-swatches i:nth-child(3){background:#57606a}.theme-swatches i:nth-child(4){background:#fff}
.theme-option.one-dark .theme-swatches i:nth-child(1){background:#528bff}.theme-option.one-dark .theme-swatches i:nth-child(2){background:#282c34}.theme-option.one-dark .theme-swatches i:nth-child(3){background:#98c379}.theme-option.one-dark .theme-swatches i:nth-child(4){background:#abb2bf}
.theme-option.academic-paper .theme-swatches i:nth-child(1){background:#305c57}.theme-option.academic-paper .theme-swatches i:nth-child(2){background:#f8f5ee}.theme-option.academic-paper .theme-swatches i:nth-child(3){background:#b48a4e}.theme-option.academic-paper .theme-swatches i:nth-child(4){background:#3e4543}
.theme-option.executive-ledger .theme-swatches i:nth-child(1){background:#173b5c}.theme-option.executive-ledger .theme-swatches i:nth-child(2){background:#f6f8fb}.theme-option.executive-ledger .theme-swatches i:nth-child(3){background:#b88642}.theme-option.executive-ledger .theme-swatches i:nth-child(4){background:#27364a}
.theme-option.classroom-studio .theme-swatches i:nth-child(1){background:#6d4c9b}.theme-option.classroom-studio .theme-swatches i:nth-child(2){background:#fff8ed}.theme-option.classroom-studio .theme-swatches i:nth-child(3){background:#e87d3e}.theme-option.classroom-studio .theme-swatches i:nth-child(4){background:#334e68}
.theme-option.github-light .theme-swatches i:nth-child(1){background:#1a7f37}.theme-option.github-light .theme-swatches i:nth-child(2){background:#dafbe1}.theme-option.github-light .theme-swatches i:nth-child(3){background:#57606a}.theme-option.github-light .theme-swatches i:nth-child(4){background:#fff}
.theme-option.forest-dark .theme-swatches i:nth-child(1){background:#3fb950}.theme-option.forest-dark .theme-swatches i:nth-child(2){background:#0d1117}.theme-option.forest-dark .theme-swatches i:nth-child(3){background:#8b949e}.theme-option.forest-dark .theme-swatches i:nth-child(4){background:#161b22}

.filter-dialog-shell {
    display: grid;
}

.filter-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 26px 18px;
    border-bottom: 1px solid var(--line);
}

.filter-dialog-header h3 {
    margin: 3px 0 5px;
    font-size: 22px;
}

.filter-dialog-header p {
    margin: 0;
    color: var(--muted);
}

.icon-close-button {
    display: inline-grid;
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
}

.icon-close-button svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.filter-dialog-context {
    color: var(--teal-strong) !important;
    font-size: 13px;
    font-weight: 700;
}

.filter-dialog-body {
    padding: 20px 26px 26px;
}

.drawer-list {
    display: grid;
    gap: 8px;
    max-height: min(360px, calc(100vh - 250px));
    margin-top: 16px;
    padding-right: 4px;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    scrollbar-color: var(--teal) var(--surface-soft);
    scrollbar-width: thin;
}

.drawer-list::-webkit-scrollbar {
    width: 8px;
}

.drawer-list::-webkit-scrollbar-track {
    border-radius: 999px;
    background: var(--surface-soft);
}

.drawer-list::-webkit-scrollbar-thumb {
    border: 2px solid var(--surface-soft);
    border-radius: 999px;
    background: var(--teal);
}

.drawer-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    color: var(--text);
    background: var(--surface);
    text-align: left;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

.drawer-option-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.drawer-option-row .drawer-option {
    min-width: 0;
}

.drawer-option-actions {
    display: flex;
    gap: 6px;
}

.drawer-option-action {
    display: inline-grid;
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--line);
    color: var(--muted);
    background: var(--surface-soft);
}

.drawer-option-action:hover {
    border-color: var(--teal);
    color: var(--teal-strong);
    background: var(--teal-soft);
}

.drawer-option-action.danger:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 10%, var(--surface));
}

.drawer-option:hover {
    background: var(--teal-soft);
}

.drawer-option strong {
    color: var(--muted);
    font-size: 14px;
}

.drawer-empty {
    color: var(--muted);
    text-align: center;
}

.move-link-dialog {
    width: min(760px, calc(100% - 32px));
    max-height: min(760px, calc(100vh - 32px));
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 26px;
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 28px 80px var(--surface-shadow);
}

.move-link-dialog[open] {
    animation: move-dialog-enter 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.move-link-dialog::backdrop {
    background: var(--backdrop);
    backdrop-filter: blur(4px);
}

.confirmation-dialog {
    width: min(500px, calc(100% - 32px));
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 28px 80px var(--surface-shadow);
}

.confirmation-dialog[open] {
    animation: move-dialog-enter 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.confirmation-dialog::backdrop {
    background: var(--backdrop);
    backdrop-filter: blur(4px);
}

.confirmation-form {
    display: grid;
}

.taxonomy-rename-field {
    display: grid;
    gap: 8px;
    margin: 20px 24px;
}

.taxonomy-rename-field label {
    font-size: 13px;
    font-weight: 700;
}

.taxonomy-dialog-context {
    color: var(--teal-strong) !important;
}

.taxonomy-dialog.delete-mode .taxonomy-dialog-context {
    color: var(--danger) !important;
}

.confirmation-header {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 24px 18px;
    border-bottom: 1px solid var(--line);
}

.confirmation-header h3 {
    margin: 3px 0 6px;
    font-size: 22px;
}

.confirmation-header p {
    margin: 0;
    color: var(--muted);
}

.confirmation-context {
    color: var(--danger) !important;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.confirmation-preview {
    display: grid;
    gap: 3px;
    margin: 20px 24px;
    padding: 14px 15px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-soft);
}

.confirmation-preview strong,
.confirmation-preview span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.confirmation-preview span {
    color: var(--muted);
    font-size: 14px;
}

.confirmation-status {
    margin: -4px 24px 18px;
    color: var(--danger);
    font-size: 14px;
}

.confirmation-status:empty {
    display: none;
}

.confirmation-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px 22px;
    border-top: 1px solid var(--line);
}

.confirmation-actions.single-dialog-action,
.move-dialog-actions.single-dialog-action {
    display: grid;
    grid-template-columns: 1fr;
}

.danger-button {
    color: #ffffff;
    background: var(--danger);
}

.move-link-form {
    display: grid;
    max-height: min(760px, calc(100vh - 32px));
}

.move-dialog-header,
.move-dialog-actions,
.move-picker-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.move-dialog-header {
    gap: 24px;
    padding: 24px 26px 18px;
    border-bottom: 1px solid var(--line);
}

.move-dialog-header h3 {
    margin: 3px 0 5px;
    font-size: 22px;
}

.move-dialog-header p,
.move-link-preview span,
.move-link-preview small,
.move-picker-heading small,
.move-dialog-status {
    color: var(--muted);
}

.move-dialog-header p {
    margin: 0;
}

.move-dialog-context {
    font-size: 13px;
    font-weight: 700;
}

.move-link-preview {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin: 18px 26px 0;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-soft);
}

.move-link-preview span,
.move-link-preview small {
    font-size: 13px;
}

.move-link-preview strong,
.move-link-preview small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.move-picker-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 330px;
    padding: 18px 26px;
}

.move-picker-column {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
}

.move-picker-column:first-child {
    padding-right: 18px;
    border-right: 1px solid var(--line);
}

.move-picker-column:last-child {
    padding-left: 18px;
}

.move-picker-heading span {
    font-weight: 700;
}

.move-picker-heading small {
    max-width: 52%;
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.move-option-list {
    display: grid;
    align-content: start;
    gap: 7px;
    min-height: 190px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-color: var(--teal) var(--surface-soft);
    scrollbar-width: thin;
}

.move-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    color: var(--text);
    background: var(--surface-soft);
    text-align: left;
}

.move-option:hover {
    border-color: var(--teal);
    background: var(--teal-soft);
}

.move-option[aria-selected="true"] {
    border-color: var(--teal);
    color: var(--on-accent);
    background: var(--teal);
}

.move-option.move-option-create {
    grid-template-columns: auto minmax(0, 1fr) auto;
    border-color: var(--teal);
    color: var(--teal-strong);
    background: var(--teal-soft);
}

.move-option-create-icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 10px;
    color: var(--on-accent);
    background: var(--teal);
    font-size: 20px;
    font-weight: 700;
}

.move-option-create-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.move-option-create-copy strong,
.move-option-create-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.move-option-create-copy small {
    color: var(--text);
    font-size: 13px;
    opacity: 1;
}

.move-option span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.move-option small {
    color: inherit;
    opacity: 0.72;
}

.move-option-empty {
    margin: 16px 4px;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

.move-dialog-status {
    min-height: 22px;
    margin: 0;
    padding: 0 26px 16px;
    font-size: 14px;
}

.move-dialog-status.error {
    color: var(--danger);
}

.move-dialog-actions {
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 26px 22px;
    border-top: 1px solid var(--line);
}

@keyframes move-dialog-enter {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }
}

@keyframes status-toast-enter {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
        filter: blur(4px);
    }
}

@keyframes count-fold-up {
    0% {
        opacity: 0.34;
        transform: translateY(9px) rotateX(-72deg) scale(0.94);
        filter: blur(3px);
    }
    62% {
        transform: translateY(-2px) rotateX(7deg) scale(1.04);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0) scale(1);
        filter: blur(0);
    }
}

@keyframes count-fold-down {
    0% {
        opacity: 0.34;
        transform: translateY(-9px) rotateX(72deg) scale(0.94);
        filter: blur(3px);
    }
    62% {
        transform: translateY(2px) rotateX(-7deg) scale(1.03);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0) scale(1);
        filter: blur(0);
    }
}

@keyframes count-panel-flash {
    0% {
        opacity: 0;
    }

    @keyframes save-progress-enter {
        from {
            opacity: 0;
            transform: translateY(6px);
        }
    }

    @keyframes save-spinner {
        to {
            transform: rotate(360deg);
        }
    }
    42% {
        opacity: 0.72;
    }
    100% {
        opacity: 0;
    }
}

.pagination-button {
    min-width: 100px;
}

.page-indicator {
    min-width: 110px;
    color: var(--muted);
    font-size: 15px;
    font-weight: 700;
    text-align: center;
}

.background-blur {
    position: fixed;
    z-index: 1;
    width: 340px;
    height: 340px;
    border-radius: 999px;
    filter: blur(90px);
    opacity: 0.5;
}

.blur-one {
    top: -60px;
    right: -40px;
    background: var(--glow-one);
}

.blur-two {
    bottom: 10%;
    left: -50px;
    background: var(--amber-soft);
}

.hidden {
    display: none !important;
}

@media (max-width: 760px) {
    .page-shell {
        width: min(100% - 20px, 680px);
        padding-top: 22px;
    }

    body:not(.dashboard-active) .page-shell {
        width: min(100% - 28px, 560px);
        padding-top: 110px;
    }

    body:not(.dashboard-active) .brand-header {
        top: 18px;
        left: 14px;
    }

    body:not(.dashboard-active) .brand-header-actions {
        top: 20px;
        right: 14px;
    }

    body:not(.dashboard-active) .brand-header span {
        display: none;
    }

    body:not(.dashboard-active) .auth-card {
        padding: 24px 18px;
        border-radius: 24px;
    }

    .mobile-download-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 15px;
        padding: 18px;
        border-radius: 22px;
    }

    .store-links {
        width: 100%;
    }

    .store-link {
        flex: 1;
        min-width: 0;
    }

    .dashboard-active #appCard {
        padding: 18px;
        border-radius: 22px;
    }

    .workspace-header {
        grid-template-columns: 1fr auto;
    }

    .workspace-header > div:first-child {
        grid-column: 1 / -1;
    }

    .library-count {
        justify-self: end;
    }

    .library-shell {
        padding: 16px;
    }

    .capture-optional-grid {
        grid-template-columns: 1fr;
    }

    .link-card {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 178px;
    }

    .links-grid[data-view="current"] .link-card {
        height: auto;
        min-height: 178px;
    }

    .link-view-controls {
        align-items: flex-start;
        flex-direction: column;
    }

    .link-view-buttons {
        width: 100%;
        padding-bottom: 3px;
    }

    .links-grid[data-view="grid"],
    .links-grid[data-view="compact"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .links-grid[data-view="list"] .link-card,
    .links-grid[data-view="table"] .link-card {
        grid-template-columns: 82px minmax(0, 1fr);
    }

    .links-grid[data-view="list"] .link-body,
    .links-grid[data-view="table"] .link-body {
        display: grid;
        grid-template-columns: 1fr;
    }

    .links-grid[data-view="list"] .link-meta,
    .links-grid[data-view="list"] .link-title,
    .links-grid[data-view="list"] .link-category,
    .links-grid[data-view="list"] .link-summary,
    .links-grid[data-view="list"] .link-product-meta,
    .links-grid[data-view="list"] .link-tags,
    .links-grid[data-view="list"] .link-actions,
    .links-grid[data-view="table"] .link-meta,
    .links-grid[data-view="table"] .link-title,
    .links-grid[data-view="table"] .link-category,
    .links-grid[data-view="table"] .link-summary,
    .links-grid[data-view="table"] .link-product-meta,
    .links-grid[data-view="table"] .link-tags,
    .links-grid[data-view="table"] .link-actions {
        grid-column: 1;
        grid-row: auto;
    }

    .links-grid[data-view="list"] .link-actions,
    .links-grid[data-view="table"] .link-actions {
        justify-content: flex-start;
        max-width: 100%;
    }

    .filter-dialog,
    .move-link-dialog,
    .move-link-form {
        max-height: calc(100vh - 20px);
    }

    .move-dialog-header {
        align-items: flex-start;
    }

    .move-link-preview {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .move-picker-grid {
        grid-template-columns: 1fr;
        min-height: 0;
        overflow-y: auto;
    }

    .move-picker-column:first-child {
        padding: 0 0 18px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .move-picker-column:last-child {
        padding: 18px 0 0;
    }

    .move-option-list {
        max-height: 180px;
    }

    .link-visual {
        min-height: 150px;
        padding: 14px 14px 0;
    }

    .source-badge {
        bottom: 14px;
    }
}

@media (max-width: 480px) {
    .capture-header {
        grid-template-columns: auto minmax(0, 1fr);
        padding-inline: 16px;
    }

    .capture-header .compact-button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .capture-panel .stack {
        padding-inline: 16px;
    }

    .capture-submit-row {
        align-items: stretch;
        flex-direction: column;
    }

    .capture-submit-row button {
        width: 100%;
    }

    .status-toast {
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        width: calc(100% - 24px);
    }

    .confirmation-header,
    .confirmation-actions,
    .filter-dialog-header,
    .filter-dialog-body {
        padding-inline: 18px;
    }

    .confirmation-preview {
        margin-inline: 18px;
    }

    .confirmation-status {
        margin-inline: 18px;
    }

    .confirmation-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .workspace-header {
        grid-template-columns: 1fr;
    }

    .dashboard-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .search-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .search-tools {
        width: 100%;
        align-items: flex-start;
        flex-direction: column;
    }

    .pagination-bar {
        flex-wrap: wrap;
    }

    .links-grid[data-view="grid"],
    .links-grid[data-view="compact"] {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .filter-dialog[open],
    .move-link-dialog[open],
    .confirmation-dialog[open],
    .status-toast,
    .library-count.count-up .library-count-score strong,
    .library-count.count-down .library-count-score strong,
    .library-count.count-up .library-count-score::after,
    .library-count.count-down .library-count-score::after,
    .save-link-progress,
    .search-typewriter i {
        animation: none;
    }

    .link-search {
        transition: none;
    }

    .capture-subcategory-field {
        transition: none;
    }

    .link-search:focus-within {
        transform: none;
    }

    .save-link-spinner {
        animation-duration: 1.5s;
    }
}
