:root {
    --bg: #0b1020;
    --bg-soft: #121a31;
    --panel: rgba(18, 26, 49, 0.75);
    --panel-strong: rgba(20, 30, 58, 0.95);
    --line: rgba(255, 255, 255, 0.08);
    --text: #e5ecff;
    --muted: #98a5c7;
    --primary: #7c3aed;
    --primary-2: #22c55e;
    --danger: #f43f5e;
    --warning: #fb923c;
    --shadow: 0 20px 60px rgba(2, 6, 23, 0.45);
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 10% 20%, rgba(124, 58, 237, 0.32), transparent 25%),
        radial-gradient(circle at 90% 0%, rgba(34, 197, 94, 0.18), transparent 24%),
        linear-gradient(180deg, #08101f 0%, #0d1325 100%);
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.site-shell,
.admin-shell {
    width: min(1280px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 24px 0 36px;
}

.topbar,
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #8b5cf6 0%, #22c55e 100%);
    box-shadow: var(--shadow);
    overflow: hidden;
    color: #fff;
    font-weight: 800;
    flex-shrink: 0;
}

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

.brand-mark--image {
    background: transparent;
    box-shadow: none;
}

.brand-mark--image img {
    object-fit: contain;
}

.topbar-actions,
.form-row,
.actions-cell,
.section-title-row,
.card-top,
.card-meta,
.sidebar-footer,
.checkbox-row { display: flex; align-items: center; gap: 12px; }

.ghost-btn,
.primary-btn,
.table-link,
.table-danger {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 11px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s ease;
}

.ghost-btn {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
}

.ghost-btn:hover,
.table-link:hover {
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.primary-btn {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 14px 30px rgba(79, 70, 229, 0.25);
}

.primary-btn:hover { transform: translateY(-1px); }
.full-width { width: 100%; }

.notice {
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid transparent;
}
.notice-success { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.25); }
.notice-error { background: rgba(244, 63, 94, 0.12); border-color: rgba(244, 63, 94, 0.25); }

.hero {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;
    gap: 24px;
    padding: 34px;
    border-radius: 30px;
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.eyebrow {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.14);
    color: #c5b4ff;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero h1,
.login-copy h1,
.admin-header h1 {
    margin: 14px 0 10px;
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 1.05;
}

.hero-subtitle,
.hero-note,
.section-head p,
.login-copy p,
.admin-header p,
.cell-subtitle { color: var(--muted); }
.hero-subtitle { font-size: 1.1rem; max-width: 720px; }
.hero-note { max-width: 720px; }

.search-wrap {
    margin-top: 26px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    width: min(680px, 100%);
}

.search-wrap svg { width: 20px; height: 20px; fill: var(--muted); }
.search-wrap input {
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    width: 100%;
}
.search-wrap input::placeholder { color: #7683a5; }

.hero-panel {
    display: grid;
    gap: 12px;
}

.metric-card,
.stat-box,
.panel-card,
.login-panel,
.link-card,
.category-nav,
.admin-sidebar {
    border: 1px solid var(--line);
    background: var(--panel);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.metric-card,
.stat-box {
    padding: 20px;
    border-radius: 22px;
}
.metric-card span,
.stat-box span { color: var(--muted); font-size: 14px; }
.metric-card strong,
.stat-box strong { display: block; margin-top: 12px; font-size: 1.8rem; }

.front-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    margin-top: 24px;
}

.front-sidebar {
    position: sticky;
    top: 24px;
    display: grid;
    gap: 16px;
}

.front-sidebar-card,
.front-category-sidebar {
    border: 1px solid var(--line);
    background: var(--panel);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    border-radius: 24px;
}

.front-sidebar-card {
    padding: 20px;
}

.sidebar-kicker {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.14);
    color: #c5b4ff;
    font-size: 12px;
    letter-spacing: 0.08em;
}

.front-sidebar-card h2 {
    margin: 0 0 12px;
    font-size: 1.25rem;
}

.front-sidebar-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.front-category-sidebar {
    padding: 10px;
    display: grid;
    gap: 8px;
}

.front-category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    color: var(--muted);
    border: 1px solid transparent;
    transition: 0.2s ease;
}

.front-category-link-main {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.front-category-link:hover,
.front-category-link.is-active {
    color: var(--text);
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
    transform: translateX(2px);
}

.front-category-count {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 700;
}

.front-main {
    min-width: 0;
}

.category-nav {
    margin: 0 0 24px;
    padding: 12px;
    border-radius: 20px;
    display: none;
    flex-wrap: wrap;
    gap: 12px;
}
.category-nav a {
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    color: var(--muted);
}
.category-nav a:hover { color: var(--text); background: rgba(255,255,255,0.08); }

.content-grid { display: grid; gap: 24px; }
.category-section {
    padding: 28px;
    border-radius: 28px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--line);
}
.section-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}
.section-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    display: inline-block;
    box-shadow: 0 0 0 6px rgba(255,255,255,0.03);
}
.section-head h2 { margin: 0; font-size: 1.45rem; }
.pill,
.badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.pill { background: rgba(255,255,255,0.06); color: var(--muted); }
.badge { background: rgba(124, 58, 237, 0.16); color: #c8b8ff; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
}
.link-card {
    display: block;
    padding: 18px;
    border-radius: 22px;
    min-height: 190px;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.link-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.06);
}
.icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(124,58,237,0.2), rgba(34,197,94,0.16));
    font-size: 22px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.manual-icon,
.letter-icon {
    line-height: 1;
}
.letter-icon {
    font-size: 20px;
    font-weight: 800;
    color: #f8fafc;
    text-transform: uppercase;
}
.favicon-img {
    width: 28px;
    height: 28px;
    display: block;
    object-fit: contain;
    border-radius: 8px;
}
.card-body h3 { margin: 18px 0 10px; font-size: 1.08rem; }
.card-body p { margin: 0; color: var(--muted); line-height: 1.6; min-height: 50px; }
.card-meta {
    margin-top: 18px;
    justify-content: space-between;
    color: #b8c3e1;
    font-size: 13px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    padding: 28px 2px 8px;
    font-size: 14px;
}

.admin-body { background: linear-gradient(180deg, #0a1020, #0b1224); }
.admin-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
}

.admin-shell.auth-layout {
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    min-height: 100vh;
}

.admin-shell.auth-layout > 
.panel-card h3,
.panel-toolbar h3 {
    margin: 0;
    line-height: 1.3;
}

.manager-form-card,
.panel-card-spacious {
    padding: 22px 24px;
}

.panel-toolbar-compact {
    margin-bottom: 14px;
}

.panel-toolbar-compact > div:first-child {
    display: flex;
    align-items: center;
    min-height: 38px;
}

.panel-card-spacious .admin-filter-bar,
.manager-form-card .admin-form {
    margin-top: 0;
}

.compact-login-panel {
    min-height: min(calc(100vh - 48px), 540px);
    grid-template-columns: minmax(280px, 1fr) minmax(340px, 420px);
    gap: clamp(24px, 4vw, 48px);
    padding: 34px;
}

.compact-login-panel .login-copy {
    display: grid;
    align-content: center;
    gap: 18px;
    min-height: 100%;
}

.compact-login-panel .login-copy h1 {
    margin: 0;
    font-size: clamp(2.5rem, 5vw, 4.25rem);
}

.compact-login-panel .login-copy::after {
    content: '';
    width: 136px;
    height: 136px;
    border-radius: 30px;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.22), transparent 42%),
        linear-gradient(135deg, rgba(124, 58, 237, 0.96), rgba(79, 70, 229, 0.72));
    box-shadow: 0 22px 50px rgba(79, 70, 229, 0.22);
}

.compact-login-panel .admin-form {
    width: min(100%, 400px);
    justify-self: end;
}
.login-panel {
    grid-column: 1 / -1;
}
.admin-sidebar {
    position: sticky;
    top: 24px;
    align-self: start;
    padding: 22px;
    border-radius: 26px;
}
.admin-nav {
    display: grid;
    gap: 8px;
    margin: 22px 0;
}
.admin-nav a {
    padding: 12px 14px;
    border-radius: 14px;
    color: var(--muted);
}
.admin-nav a.active,
.admin-nav a:hover {
    background: rgba(255,255,255,0.07);
    color: var(--text);
}
.admin-main { min-width: 0; }
.stats-grid,
.panel-grid {
    display: grid;
    gap: 18px;
    margin-bottom: 18px;
}
.stats-grid { grid-template-columns: repeat(4, 1fr); }
.two-col { grid-template-columns: 420px 1fr; }
.two-col-wide { grid-template-columns: 460px 1fr; }
.panel-card {
    padding: 24px;
    border-radius: 24px;
}
.panel-card h3 { margin-top: 0; }
.clean-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.8;
}

.admin-form {
    display: grid;
    gap: 16px;
}
.admin-form label { display: grid; gap: 8px; }
.admin-form span { color: #c8d3f0; font-size: 14px; }
.admin-form input,
.admin-form textarea,
.admin-form select {
    width: 100%;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: var(--text);
    outline: none;
}
.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus,
.search-wrap:focus-within {
    border-color: rgba(124, 58, 237, 0.55);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.admin-form select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 48px;
    background-image:
        linear-gradient(45deg, transparent 50%, #c8d3f0 50%),
        linear-gradient(135deg, #c8d3f0 50%, transparent 50%),
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.03));
    background-position:
        calc(100% - 22px) calc(50% - 3px),
        calc(100% - 16px) calc(50% - 3px),
        0 0;
    background-size: 6px 6px, 6px 6px, 100% 100%;
    background-repeat: no-repeat;
}
.admin-form select option {
    color: #e5ecff;
    background: #131b33;
}
.admin-form select option[disabled],
.admin-form select option[value=""] {
    color: #8ea0c7;
}
.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.form-actions .ghost-btn,
.form-actions .primary-btn,
.form-actions .secondary-btn {
    width: auto;
}
.checkbox-row {
    align-self: end;
    height: 100%;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}
.checkbox-row input { width: auto; }
.table-wrap { overflow: auto; }


.admin-table {
    width: 100%;
}

.admin-table th {
    white-space: nowrap;
}

.narrow-cell {
    white-space: nowrap;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.table-actions-stack {
    flex-direction: column;
    align-items: flex-start;
}

.table-actions-stack .inline-form,
.table-actions-stack .table-link {
    width: 100%;
}

.table-actions-stack .small-btn,
.table-actions-stack .table-link.small-btn,
.table-actions-stack .table-danger.small-btn {
    width: 100%;
    justify-content: center;
}

.table-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: #dce6ff;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}

.badge-muted {
    color: #bfcbe6;
}

.badge-accent {
    background: rgba(139, 92, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.28);
    color: #ddd6fe;
}

.category-name-cell .cell-title,
.site-col .cell-title {
    font-size: 15px;
    font-weight: 700;
}

.category-name-cell .cell-subtitle,
.category-path-cell,
.site-col .cell-subtitle {
    line-height: 1.6;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.category-name-cell {
    min-width: 210px;
}

.description-cell {
    min-width: 260px;
    line-height: 1.7;
}

.categories-table th:nth-child(1),
.categories-table td:nth-child(1) {
    width: 56px;
}

.categories-table th:nth-child(3),
.categories-table td:nth-child(3) {
    width: 120px;
}

.categories-table th:nth-child(5),
.categories-table td:nth-child(5) {
    width: 84px;
}

.categories-table th:nth-child(6),
.categories-table td:nth-child(6) {
    width: 148px;
}

.links-table th:nth-child(1),
.links-table td:nth-child(1) {
    width: 56px;
}

.links-table th:nth-child(2),
.links-table td:nth-child(2) {
    min-width: 310px;
}

.links-table th:nth-child(3),
.links-table td:nth-child(3) {
    min-width: 210px;
}

.links-table th:nth-child(4),
.links-table td:nth-child(4) {
    width: 140px;
}

.links-table th:nth-child(5),
.links-table td:nth-child(5),
.links-table th:nth-child(6),
.links-table td:nth-child(6) {
    width: 78px;
}

.links-table th:nth-child(7),
.links-table td:nth-child(7) {
    width: 138px;
}

.site-col .cell-subtitle {
    max-width: 100%;
}

.table-site-cell {
    align-items: flex-start;
}

.table-site-cell > div:last-child {
    min-width: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}
th, td {
    text-align: left;
    padding: 14px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    vertical-align: top;
}
th { color: #cbd5e1; font-size: 14px; }
td { color: var(--muted); }
.cell-title { color: var(--text); margin-bottom: 6px; }
.table-link,
.table-danger {
    background: transparent;
    padding: 8px 12px;
    font-size: 13px;
}
.table-link { color: #c8b8ff; }
.table-danger {
    color: #ff9aae;
    border-color: rgba(244,63,94,0.22);
}

.panel-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.panel-tip {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}
.table-site-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}
.table-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    flex: 0 0 42px;
}
.table-muted {
    color: var(--muted);
    font-size: 13px;
}
.inline-form {
    display: inline-flex;
}
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    font-weight: 600;
}
.secondary-btn.small-btn,
.table-link.small-btn,
.table-danger.small-btn {
    min-height: 0;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 12px;
}
.secondary-btn:hover {
    background: rgba(255,255,255,0.08);
}
.form-hint {
    margin-top: -6px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.login-panel {
    width: min(980px, 100%);
    min-height: min(calc(100vh - 48px), 760px);
    margin: 0 auto;
    border-radius: 30px;
    padding: 28px;
    display: grid;
    grid-template-columns: minmax(320px, 1.1fr) minmax(320px, 0.9fr);
    gap: 28px;
    align-items: center;
}
.login-copy,
.login-tip {
    padding: 10px 0;
}
.login-tip {
    margin-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    color: var(--muted);
    line-height: 1.8;
}
.account-card { max-width: 100%; }
.account-stack {
    grid-template-columns: 1fr;
    max-width: 920px;
}
.account-stack .panel-card {
    padding: 26px 28px;
}
.account-security-form .form-row {
    grid-template-columns: 1fr;
}
.account-security-form .guard-preview {
    align-items: start;
}
.account-security-form .form-actions-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.hidden-by-search { display: none !important; }

.manager-stack {
    display: grid;
    gap: 18px;
}

.admin-overview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-overview-grid-links {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-stat-box {
    padding: 18px 20px;
    border-radius: 20px;
}

.compact-stat-box strong {
    margin-top: 10px;
    font-size: 1.6rem;
}

.manager-form-card,
.panel-card-spacious {
    padding: 26px 28px;
}

.panel-toolbar-compact {
    margin-bottom: 20px;
}

.admin-form-grid {
    gap: 18px;
}

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

.form-grid-compact label:last-child input[type="number"] {
    max-width: 180px;
}

.checkbox-row-inline {
    min-height: 50px;
}

.status-pills,
.toolbar-actions-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: #cfd8ef;
    font-size: 13px;
}

.table-wrap-spacious {
    margin-top: 4px;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 18px;
    background: rgba(255,255,255,0.02);
}

.table-wrap-spacious table {
    min-width: 860px;
}

.table-wrap-spacious th,
.table-wrap-spacious td {
    padding: 16px 14px;
}

.table-wrap-spacious tbody tr:hover {
    background: rgba(255,255,255,0.025);
}


.table-wrap-spacious td.actions-cell {
    display: table-cell;
}


.table-wrap-spacious .cell-subtitle {
    word-break: break-all;
}


/* Link table layout refinement */
.links-table {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
}

.links-table th:nth-child(1),
.links-table td:nth-child(1) {
    width: 5%;
}

.links-table th:nth-child(2),
.links-table td:nth-child(2) {
    width: 30%;
}

.links-table th:nth-child(3),
.links-table td:nth-child(3) {
    width: 21%;
}

.links-table th:nth-child(4),
.links-table td:nth-child(4) {
    width: 10%;
    text-align: center;
}

.links-table th:nth-child(5),
.links-table td:nth-child(5) {
    width: 7%;
    text-align: center;
}

.links-table th:nth-child(6),
.links-table td:nth-child(6) {
    width: 5%;
    text-align: center;
}

.links-table th:nth-child(7),
.links-table td:nth-child(7) {
    width: 22%;
}

.links-table td {
    vertical-align: top;
}

.links-table .table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.links-table .table-actions-stack {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.links-table .table-actions-stack .inline-form,
.links-table .table-actions-stack .table-link {
    width: auto;
    flex: 0 0 auto;
}

.links-table .table-actions-stack .small-btn,
.links-table .table-actions-stack .table-link.small-btn,
.links-table .table-actions-stack .table-danger.small-btn {
    width: auto;
    min-width: 0;
    padding: 7px 12px;
    min-height: 40px;
    font-size: 14px;
    justify-content: center;
    white-space: nowrap;
}

.links-table .status-col,
.links-table .narrow-cell {
    white-space: nowrap;
}

.links-table .site-col,
.links-table .category-col {
    min-width: 0;
}

.links-table .table-badge {
    min-width: 0;
    padding-inline: 14px;
}

.links-table .cell-title,
.links-table .cell-subtitle,
.links-table .category-path-cell {
    overflow-wrap: anywhere;
    word-break: break-word;
}
@media (max-width: 1080px) {
    .hero,
    .login-panel,
    .admin-shell,
    .two-col,
    .two-col-wide,
    .stats-grid,
    .front-layout,
    .admin-overview-grid,
    .admin-overview-grid-links,
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
    .admin-sidebar,
    .front-sidebar { position: static; }
    .front-sidebar-card,
    .front-category-sidebar { display: none; }
    .category-nav { display: flex; }
}

@media (max-width: 720px) {
    .site-shell,
    .admin-shell { width: min(100vw - 20px, 100%); }
    .hero,
    .category-section,
    .panel-card,
    .admin-sidebar,
    .login-panel,
    .front-sidebar-card,
    .front-category-sidebar { padding: 20px; }
    .topbar,
    .section-head,
    .footer,
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .topbar-actions,
    .form-row,
    .actions-cell,
    .form-actions,
    .toolbar-actions-wrap { flex-wrap: wrap; }
    .card-grid { grid-template-columns: 1fr; }
    .front-category-link { padding: 11px 12px; }
}

.front-topbar {
    margin-bottom: 20px;
}

.compact-hero {
    padding: 30px;
    grid-template-columns: 1.45fr 0.75fr;
}

.compact-hero-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-hero-panel .metric-card {
    min-width: 0;
    padding: 18px;
}

.front-category-group {
    display: grid;
    gap: 8px;
}

.front-category-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px 8px;
    color: #dbe4ff;
}

.front-category-link-root {
    font-weight: 700;
}

.front-category-children {
    display: grid;
    gap: 6px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    margin-left: 10px;
}

.front-category-link-child {
    padding: 10px 12px;
    font-size: 14px;
}

.small-dot {
    width: 8px;
    height: 8px;
    box-shadow: none;
}

.section-parent-badge {
    display: inline-flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #b8c3e1;
    font-size: 12px;
    letter-spacing: 0.04em;
}

.category-section.is-subsection {
    padding-top: 24px;
}

.compact-card-grid,
.card-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.compact-link-card,
.link-card {
    padding: 16px;
    min-height: 162px;
    border-radius: 20px;
}

.compact-icon-wrap,
.icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 20px;
}

.favicon-img {
    width: 24px;
    height: 24px;
}

.link-card .card-body h3 {
    margin: 14px 0 8px;
    font-size: 1rem;
}

.link-card .card-body p {
    min-height: 42px;
    font-size: 14px;
    line-height: 1.55;
}

.link-card .card-meta {
    margin-top: 14px;
    padding-top: 10px;
}

.compact-footer {
    justify-content: flex-start;
}


.checkbox-row-block {
    justify-content: flex-start;
    align-self: stretch;
}

.guard-preview {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

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

.guard-preview code {
    overflow-wrap: anywhere;
    color: #dbe4ff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (max-width: 1080px) {
    .compact-hero,
    .compact-hero-panel,
    .compact-login-panel {
        grid-template-columns: 1fr;
    }

    .compact-login-panel {
        min-height: auto;
        padding: 24px;
    }

    .compact-login-panel .admin-form {
        width: 100%;
        justify-self: stretch;
    }

    .compact-login-panel .login-copy::after {
        width: 110px;
        height: 110px;
    }

    .front-category-children {
        padding-left: 0;
        margin-left: 0;
        border-left: 0;
    }
}

@media (max-width: 720px) {
    .compact-hero {
        padding: 20px;
    }

    .compact-card-grid,
    .card-grid {
        grid-template-columns: 1fr;
    }

    .front-category-heading {
        padding-left: 0;
        padding-right: 0;
    }
}

/* ===== Frontend refinement: collapsible sidebar + denser cards ===== */
.refined-hero {
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.75fr);
    gap: 22px;
    padding: 26px 28px;
    align-items: stretch;
}

.refined-hero .hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.refined-hero h1 {
    margin: 12px 0 8px;
    font-size: clamp(2.4rem, 4vw, 4.1rem);
}

.refined-hero .hero-subtitle {
    margin: 0;
    font-size: 1.02rem;
}

.refined-hero .hero-note {
    margin: 12px 0 0;
    max-width: 680px;
    line-height: 1.7;
}

.hero-search-wrap {
    margin-top: 22px;
    width: min(860px, 100%);
}

.refined-hero-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: center;
    gap: 12px;
}

.compact-metric-card {
    min-height: 112px;
    padding: 16px 18px;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(11, 24, 48, 0.82), rgba(9, 18, 37, 0.94));
}

.compact-metric-card span {
    font-size: 13px;
}

.compact-metric-card strong {
    margin-top: 10px;
    font-size: clamp(1.65rem, 2vw, 2.2rem);
    line-height: 1;
}

.front-sidebar-card {
    padding: 16px 18px;
}

.front-sidebar-card h2 {
    margin: 0 0 8px;
    font-size: 1.08rem;
}

.front-sidebar-card p {
    font-size: 14px;
    line-height: 1.65;
}

.front-category-sidebar {
    padding: 10px;
    gap: 10px;
}

.front-category-group {
    padding: 2px;
    border-radius: 18px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
}

.front-category-group-head {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.front-category-link-root,
.front-category-heading {
    flex: 1 1 auto;
    min-width: 0;
}

.front-category-link-root,
.front-category-heading,
.front-category-link-child {
    border-radius: 14px;
}

.front-category-link-root {
    font-weight: 700;
}

.front-category-link.is-root-active {
    color: var(--text);
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.08);
}

.front-category-toggle {
    width: 42px;
    flex: 0 0 42px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s ease;
}

.front-category-toggle:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.12);
}

.front-category-toggle-icon {
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    transition: transform 0.2s ease;
}

.front-category-group.is-open .front-category-toggle-icon {
    transform: rotate(225deg) translateY(-1px);
}

.front-category-children {
    overflow: hidden;
    max-height: 520px;
    opacity: 1;
    margin-top: 8px;
    padding: 2px 0 2px 12px;
    display: grid;
    gap: 6px;
    border-left: 1px solid rgba(255,255,255,0.08);
    margin-left: 10px;
    transition: max-height 0.25s ease, opacity 0.2s ease, margin-top 0.2s ease, padding-top 0.2s ease, padding-bottom 0.2s ease;
}

.front-category-group:not(.is-open) .front-category-children {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.category-section {
    padding: 22px 22px 18px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255,255,255,0.042), rgba(255,255,255,0.026));
}

.refined-section-head {
    align-items: flex-start;
    margin-bottom: 16px;
}

.refined-section-head > div {
    min-width: 0;
}

.refined-section-head p {
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.65;
}

.refined-pill {
    align-self: flex-start;
    padding: 7px 12px;
    white-space: nowrap;
    background: rgba(255,255,255,0.05);
    color: #c8d3f0;
    border: 1px solid rgba(255,255,255,0.08);
}

.section-parent-badge {
    margin-bottom: 8px;
}

.compact-card-grid,
.card-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
}

.compact-link-card,
.link-card {
    display: flex;
    flex-direction: column;
    min-height: 92px;
    padding: 12px 12px 10px;
    border-radius: 18px;
    box-shadow: none;
}

.compact-link-card .card-top,
.link-card .card-top {
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.compact-icon-wrap,
.icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 17px;
}

.favicon-img {
    width: 20px;
    height: 20px;
}

.manual-icon,
.letter-icon {
    font-size: 16px;
}

.link-card .card-body h3 {
    margin: 10px 0 4px;
    font-size: 15px;
    line-height: 1.35;
}

.link-card .card-body p {
    min-height: 0;
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: #9ba8c8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-card .card-meta {
    margin-top: auto;
    padding-top: 8px;
    font-size: 11px;
    color: #9fb0d3;
}

.badge {
    padding: 6px 10px;
    font-size: 11px;
}

@media (max-width: 1080px) {
    .refined-hero,
    .refined-hero-panel {
        grid-template-columns: 1fr;
    }

    .refined-hero-panel {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .refined-hero {
        padding: 20px;
    }

    .refined-hero-panel {
        grid-template-columns: 1fr;
    }

    .compact-card-grid,
    .card-grid {
        grid-template-columns: 1fr;
    }

    .front-category-group-head {
        gap: 6px;
    }

    .front-category-toggle {
        width: 40px;
        flex-basis: 40px;
    }

    .refined-pill {
        margin-top: 4px;
    }
}

/* ===== Admin list filters, sorting, pagination ===== */
.admin-filter-bar {
    display: grid;
    grid-template-columns: minmax(240px, 1.45fr) repeat(3, minmax(160px, 0.95fr));
    gap: 12px;
    margin-bottom: 18px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}

.admin-filter-bar.admin-filter-bar-links {
    grid-template-columns: minmax(260px, 1.55fr) repeat(4, minmax(150px, 0.92fr));
}


.admin-filter-bar input,
.admin-filter-bar select {
    width: 100%;
    min-height: 52px;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.admin-filter-bar input::placeholder {
    color: #8ea0c7;
}

.admin-filter-bar select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 46px;
    background-image:
        linear-gradient(45deg, transparent 50%, #c8d3f0 50%),
        linear-gradient(135deg, #c8d3f0 50%, transparent 50%),
        linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.04));
    background-position:
        calc(100% - 22px) calc(50% - 3px),
        calc(100% - 16px) calc(50% - 3px),
        0 0;
    background-size: 6px 6px, 6px 6px, 100% 100%;
    background-repeat: no-repeat;
}

.admin-filter-bar select option {
    color: #e5ecff;
    background: #131b33;
}

.admin-filter-bar input:focus,
.admin-filter-bar select:focus {
    border-color: rgba(124, 58, 237, 0.55);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.filter-field label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #c8d3f0;
    font-size: 13px;
}

.filter-inline-tip {
    font-size: 12px;
    color: #8ea0c7;
    font-weight: 400;
}

.filter-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 2px;
}

.filter-actions .secondary-btn,
.filter-actions .ghost-btn {
    min-height: 46px;
    padding-inline: 18px;
    white-space: nowrap;
}

.filter-field {
    display: grid;
    gap: 8px;
}


.filter-field-search {
    min-width: 0;
}

.filter-actions .secondary-btn,
.filter-actions .ghost-btn {
    min-width: 116px;
}

.pagination-bar {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.pagination-summary {
    color: var(--muted);
    font-size: 13px;
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-page,
.pagination-btn {
    min-width: 40px;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination-page:hover,
.pagination-btn:hover {
    background: rgba(255,255,255,0.07);
}

.pagination-page.is-active {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    border-color: transparent;
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.22);
}

.pagination-ellipsis {
    color: var(--muted);
    padding: 0 4px;
}

.table-empty {
    text-align: center;
    color: var(--muted);
    padding: 24px 12px;
}

@media (max-width: 1280px) {
    .admin-filter-bar,
    .admin-filter-bar.admin-filter-bar-links {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .admin-filter-bar,
    .admin-filter-bar.admin-filter-bar-links {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-actions .secondary-btn,
    .filter-actions .ghost-btn {
        width: 100%;
        min-width: 0;
    }

    .pagination-bar {
        align-items: flex-start;
    }
}


.account-card input[readonly] {
    cursor: default;
    opacity: 0.92;
}

.copy-trigger {
    min-width: 108px;
}


/* Stronger polish after removing helper texts */
.admin-shell.auth-layout {
    padding: 32px 20px;
}

.compact-login-panel.compact-login-panel--simple {
    width: min(540px, 100%);
    min-height: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 32px 34px 28px;
    border-radius: 28px;
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.34);
}

.compact-login-panel--simple .login-copy {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 10px;
    padding: 4px 0 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.compact-login-panel--simple .login-copy h1 {
    font-size: clamp(2.4rem, 6vw, 3.6rem);
    letter-spacing: -0.04em;
}

.compact-login-panel--simple .login-copy::after {
    display: none;
}

.login-copy-accent {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
}

.login-copy-accent span {
    display: block;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.96), rgba(79, 70, 229, 0.76));
    box-shadow: 0 10px 22px rgba(79, 70, 229, 0.2);
}

.login-copy-accent span:nth-child(1) { width: 44px; height: 8px; opacity: 0.95; }
.login-copy-accent span:nth-child(2) { width: 20px; height: 8px; opacity: 0.8; }
.login-copy-accent span:nth-child(3) { width: 8px; height: 8px; opacity: 0.65; }

.compact-login-panel--simple .admin-auth-form {
    width: 100%;
    justify-self: stretch;
    gap: 12px;
}

.auth-form-heading {
    display: grid;
    gap: 4px;
    margin-bottom: 2px;
}

.auth-form-heading strong {
    font-size: 1rem;
    color: var(--text);
}

.auth-form-heading span {
    font-size: 13px;
    color: var(--muted);
}


.compact-login-panel--simple .admin-auth-form label:first-of-type {
    margin-top: 2px;
}

.compact-login-panel--simple .primary-btn,
.compact-login-panel--simple .ghost-btn {
    min-height: 48px;
}

.panel-card-spacious,
.manager-form-card,
.account-stack .panel-card {
    padding: 22px 24px;
}

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

.panel-toolbar-compact > div:first-child {
    display: grid;
    align-content: start;
    min-height: auto;
}

.section-title {
    position: relative;
    padding-left: 14px;
    font-size: 1.1rem;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    width: 4px;
    height: calc(100% - 8px);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.98), rgba(79, 70, 229, 0.78));
}

.status-pills {
    gap: 8px;
}

.status-pill {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
}

.admin-filter-bar {
    margin-top: 0;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.account-stack {
    gap: 16px;
    max-width: 860px;
}

.account-stack .panel-card + .panel-card {
    margin-top: 0;
}

.guard-preview {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
}

.guard-preview code {
    display: block;
    margin-top: 8px;
    line-height: 1.7;
    word-break: break-all;
}

.form-actions-inline {
    margin-top: 12px;
}

@media (max-width: 860px) {
    .compact-login-panel.compact-login-panel--simple {
        padding: 28px 22px 24px;
        width: min(100%, 460px);
    }

    .panel-toolbar-compact {
        flex-direction: column;
        align-items: stretch;
    }
}


/* ===== Settings note card + front sidebar note ===== */
.settings-stack {
    gap: 16px;
}

.settings-form {
    gap: 16px;
}

.settings-card {
    display: grid;
    gap: 12px;
}

.settings-card-compact {
    gap: 12px;
}

.settings-section-head {
    margin-bottom: 0;
}

.settings-section-head--simple {
    align-items: center;
    min-height: 0;
}

.settings-grid-tight {
    gap: 12px;
}

.settings-grid-tight--compact {
    gap: 12px;
}

.note-setting-toprow {
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(240px, 420px);
    gap: 12px;
    align-items: end;
    justify-content: start;
}

.note-setting-toprow--compact {
    grid-template-columns: minmax(180px, 220px) minmax(240px, 420px);
}

.checkbox-toggle-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 10px 14px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}

.checkbox-toggle-box--compact {
    min-height: 56px;
    padding: 10px 14px;
}

.checkbox-toggle-box--inline {
    gap: 10px;
}

.checkbox-toggle-copy {
    display: grid;
    gap: 2px;
}

.checkbox-toggle-copy strong {
    font-size: 14px;
    color: var(--text);
    line-height: 1.2;
    font-weight: 700;
}

.checkbox-toggle-copy small {
    color: var(--muted);
    line-height: 1.55;
    font-size: 13px;
}

.checkbox-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.checkbox-switch input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.checkbox-switch-ui {
    position: relative;
    display: inline-flex;
    width: 46px;
    height: 28px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.checkbox-switch-ui::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(240,244,255,0.96);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    transition: transform .2s ease;
}

.checkbox-switch input:checked + .checkbox-switch-ui {
    background: linear-gradient(90deg, rgba(124,58,237,0.85), rgba(99,102,241,0.88));
    border-color: rgba(124,58,237,0.4);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 0 0 4px rgba(124,58,237,0.08);
}

.checkbox-switch input:checked + .checkbox-switch-ui::after {
    transform: translateX(18px);
}

.checkbox-switch input:focus-visible + .checkbox-switch-ui {
    outline: 2px solid rgba(124,58,237,0.45);
    outline-offset: 2px;
}


.form-switch-box {
    width: min(320px, 100%);
    margin: 2px 0 4px;
}

.account-security-form .form-switch-box {
    width: min(360px, 100%);
}

.settings-submit-row {
    margin-top: 0;
}

.front-note-card {
    position: relative;
    display: grid;
    gap: 10px;
    padding: 16px 16px 14px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 24px;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.03);
}

.front-note-card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,0.025), transparent 32%);
}

.front-note-card.is-simple,
.front-note-card.is-moments {
    background:
        radial-gradient(circle at 0% 0%, rgba(124, 58, 237, 0.12), transparent 34%),
        radial-gradient(circle at 100% 18%, rgba(99, 102, 241, 0.10), transparent 32%),
        linear-gradient(180deg, rgba(18, 26, 49, 0.94), rgba(13, 21, 40, 0.98));
}

.front-note-card.is-moments {
    background:
        radial-gradient(circle at 0% 0%, rgba(124, 58, 237, 0.14), transparent 34%),
        radial-gradient(circle at 100% 20%, rgba(99, 102, 241, 0.10), transparent 30%),
        radial-gradient(circle at 50% 100%, rgba(124, 58, 237, 0.08), transparent 36%),
        linear-gradient(180deg, rgba(18, 26, 49, 0.94), rgba(13, 21, 40, 0.98));
}

.front-note-head,
.front-note-head-moments {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.front-note-style-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    color: #d9dbff;
    background: rgba(124, 58, 237, 0.14);
    border: 1px solid rgba(124, 58, 237, 0.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.front-note-card h3,
.front-note-body,
.front-note-footer {
    position: relative;
    z-index: 1;
}

.front-note-card h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.45;
    color: #eef2ff;
}

.front-note-body {
    margin: 0;
    color: #d7dff4;
    font-size: 14px;
    line-height: 1.8;
    white-space: normal;
    word-break: break-word;
}

.front-note-body-moments {
    position: relative;
    padding-left: 14px;
}

.front-note-body-moments::before {
    content: '“';
    position: absolute;
    left: 0;
    top: -5px;
    font-size: 24px;
    line-height: 1;
    color: rgba(167, 139, 250, 0.24);
}

.front-note-footer {
    color: #aeb8d8;
    font-size: 13px;
    line-height: 1.6;
}

@media (max-width: 980px) {
    .note-setting-toprow,
    .note-setting-toprow--compact {
        grid-template-columns: 1fr;
        justify-content: stretch;
    }
}

@media (max-width: 640px) {
    .checkbox-toggle-box,
    .checkbox-toggle-box--compact {
        align-items: flex-start;
        flex-direction: column;
    }

    .checkbox-toggle-control {
        width: 100%;
        justify-content: flex-start;
        padding: 0 14px;
    }
}

.site-icon-preview {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.48);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.brand-mark-preview {
    width: 44px;
    height: 44px;
}

.site-icon-preview-copy {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.login-brand-mark {
    margin: 8px 0 12px;
}

.login-brand-mark .brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    box-shadow: 0 16px 32px rgba(124, 58, 237, 0.26);
}


@media (max-width: 1280px) {
    .links-table th:last-child,
    .links-table td:last-child {
        width: 230px;
        min-width: 230px;
    }

    .links-table .table-actions,
    .links-table .table-actions-stack {
        flex-wrap: wrap;
    }
}
