:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-hover: #f1f5f9;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;
    --success: #16a34a;
    --success-soft: #f0fdf4;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --violet: #7c3aed;
    --violet-soft: #f5f3ff;
    --sidebar: #111827;
    --sidebar-soft: #1f2937;
    --sidebar-text: #d1d5db;
    --shadow: 0 12px 35px rgba(15, 23, 42, .06);
    --radius: 18px;
    --radius-small: 11px;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f172a;
    --surface: #172033;
    --surface-soft: #1e293b;
    --surface-hover: #263349;
    --text: #f8fafc;
    --muted: #9ca3af;
    --border: #334155;
    --primary-soft: #172554;
    --success-soft: #052e16;
    --warning-soft: #422006;
    --danger-soft: #450a0a;
    --violet-soft: #2e1065;
    --shadow: 0 12px 35px rgba(0, 0, 0, .18);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.55;
}

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

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

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

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    display: flex;
    width: 280px;
    flex-direction: column;
    padding: 28px 20px 22px;
    overflow-y: auto;
    color: var(--sidebar-text);
    background: var(--sidebar);
}

.brand,
.auth-brand,
.mobile-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    min-height: 54px;
    padding: 0 10px 26px;
    color: #fff;
}

.brand strong,
.auth-brand strong {
    display: block;
    font-size: 16px;
}

.brand small,
.auth-brand small {
    display: block;
    margin-top: 1px;
    color: #94a3b8;
    font-size: 12px;
}

.brand-mark {
    display: inline-grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(145deg, #3b82f6, #1d4ed8);
    box-shadow: 0 8px 20px rgba(37, 99, 235, .35);
    font-weight: 800;
}

.brand-mark-large {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    font-size: 20px;
}

.nav-list {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 7px;
}

.nav-item {
    display: flex;
    min-height: 48px;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--sidebar-text);
    font-weight: 600;
    transition: background .18s ease, color .18s ease;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, .07);
}

.nav-item.active {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 8px 18px rgba(37, 99, 235, .28);
}

.nav-icon {
    display: inline-grid;
    width: 25px;
    place-items: center;
    font-size: 18px;
    font-weight: 800;
}

.nav-badge {
    min-width: 22px;
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 99px;
    color: #fff;
    background: var(--danger);
    font-size: 11px;
    text-align: center;
}

.sidebar-footer {
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 14px;
}

.user-card strong,
.user-card small {
    display: block;
}

.user-card strong {
    color: #fff;
}

.user-card small {
    color: #94a3b8;
    font-size: 12px;
}

.user-avatar {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 50%;
    color: #bfdbfe;
    background: var(--sidebar-soft);
    font-weight: 800;
}

.content-shell {
    min-height: 100vh;
    margin-left: 280px;
    padding: 0 36px 24px;
}

.desktop-topbar {
    display: flex;
    height: 104px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.desktop-topbar h1 {
    margin: 2px 0 0;
    font-size: 24px;
    line-height: 1.2;
}

.eyebrow {
    margin: 0;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.notification-button {
    position: relative;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 13px;
    color: var(--text);
    background: var(--surface);
    font-weight: 800;
    box-shadow: var(--shadow);
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.notification-button::-webkit-details-marker {
    display: none;
}

.notification-button svg,
.mobile-notification-link svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.notification-button b {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 20px;
    padding: 1px 5px;
    border: 2px solid var(--bg);
    border-radius: 99px;
    color: #fff;
    background: var(--danger);
    font-size: 10px;
}

.notification-menu {
    position: relative;
    z-index: 70;
}

.notification-dropdown {
    position: absolute;
    z-index: 60;
    top: calc(100% + 10px);
    right: 0;
    width: min(390px, calc(100vw - 30px));
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
    box-shadow: 0 24px 65px rgba(15, 23, 42, .2);
    display: none;
}

.notification-menu[open] .notification-dropdown {
    display: block;
}

.notification-dropdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 16px;
    border-bottom: 1px solid var(--border);
}

.notification-dropdown-head > div {
    display: grid;
    gap: 2px;
}

.notification-dropdown-head span,
.notification-dropdown-item small {
    color: var(--muted);
    font-size: 10px;
}

.notification-dropdown-head button {
    padding: 0;
    border: 0;
    color: var(--primary);
    background: transparent;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.notification-dropdown-list {
    max-height: 410px;
    overflow-y: auto;
}

.notification-dropdown-item {
    margin: 0;
}

.notification-dropdown-item button {
    display: grid;
    width: 100%;
    gap: 4px;
    padding: 13px 16px;
    border: 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.notification-dropdown-item.is-unread button {
    background: var(--primary-soft);
}

.notification-dropdown-item button:hover {
    background: var(--surface-soft);
}

.notification-dropdown-item span {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.notification-dropdown-footer {
    display: block;
    padding: 12px 16px;
    color: var(--primary);
    text-align: center;
    font-size: 11px;
    font-weight: 800;
}

.notification-empty {
    margin: 0;
    padding: 26px 16px;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}

.mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-notification-link {
    position: relative;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: var(--text);
}

.mobile-notification-link b {
    position: absolute;
    top: 1px;
    right: 0;
    min-width: 17px;
    padding: 1px 4px;
    border-radius: 99px;
    color: #fff;
    background: var(--danger);
    font-size: 9px;
    text-align: center;
}

.notification-archive {
    overflow: hidden;
}

.notification-row {
    margin: 0;
    border-bottom: 1px solid var(--border);
}

.notification-row:last-child {
    border-bottom: 0;
}

.notification-row > button {
    display: grid;
    width: 100%;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 13px;
    align-items: center;
    padding: 16px 18px;
    border: 0;
    color: var(--text);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.notification-row.is-unread > button {
    background: var(--primary-soft);
}

.notification-row > button:hover {
    background: var(--surface-soft);
}

.notification-type {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 11px;
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 900;
}

.notification-danger {
    color: var(--danger);
    background: var(--danger-soft);
}

.notification-warning {
    color: var(--warning);
    background: var(--warning-soft);
}

.notification-copy {
    display: grid;
    gap: 3px;
}

.notification-copy > span,
.notification-copy small,
.notification-state {
    color: var(--muted);
    font-size: 11px;
}

.notification-state {
    font-weight: 800;
}

.mobile-header,
.sidebar-overlay {
    display: none;
}

.main-content {
    width: 100%;
    max-width: 1540px;
    min-height: calc(100vh - 175px);
    margin: 0 auto;
    padding: 30px 0 42px;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 24px;
}

.page-heading h2 {
    margin: 4px 0 5px;
    font-size: clamp(24px, 2.2vw, 34px);
    line-height: 1.18;
    letter-spacing: -.03em;
}

.page-heading p:not(.eyebrow) {
    max-width: 680px;
    margin: 0;
    color: var(--muted);
}

.quick-actions,
.form-actions,
.row-actions,
.card-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 700;
    line-height: 1.2;
    transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    color: #fff;
    background: var(--primary);
}

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

.button-secondary {
    border-color: var(--border);
    color: var(--text);
    background: var(--surface);
}

.button-secondary:hover,
.button-ghost:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.button-success {
    color: #fff;
    background: var(--success);
}

.button-ghost {
    border-color: transparent;
    color: var(--muted);
    background: transparent;
}

.sidebar .button-ghost {
    color: #cbd5e1;
}

.sidebar .button-ghost:hover {
    color: #fff;
    background: rgba(255, 255, 255, .07);
}

.button-danger-ghost {
    color: var(--danger);
    background: transparent;
}

.button-danger-ghost:hover {
    background: var(--danger-soft);
}

.button-small {
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 9px;
    font-size: 12px;
}

.button-large {
    min-height: 50px;
}

.button-block {
    width: 100%;
}

.panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.metric-card {
    position: relative;
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 14px;
    min-height: 145px;
    padding: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.metric-card::after {
    position: absolute;
    right: -22px;
    bottom: -32px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: currentColor;
    content: "";
    opacity: .05;
}

.metric-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 14px;
    font-size: 20px;
    font-weight: 900;
}

.metric-card.blue,
.metric-card.blue a {
    color: var(--primary);
}

.metric-card.blue .metric-icon {
    background: var(--primary-soft);
}

.metric-card.amber,
.metric-card.amber a {
    color: var(--warning);
}

.metric-card.amber .metric-icon {
    background: var(--warning-soft);
}

.metric-card.red,
.metric-card.red a {
    color: var(--danger);
}

.metric-card.red .metric-icon {
    background: var(--danger-soft);
}

.metric-card.violet,
.metric-card.violet a {
    color: var(--violet);
}

.metric-card.violet .metric-icon {
    background: var(--violet-soft);
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.metric-card strong {
    display: block;
    margin-top: 1px;
    color: var(--text);
    font-size: 30px;
    line-height: 1.1;
}

.metric-card a {
    grid-column: 1 / -1;
    align-self: end;
    font-size: 12px;
    font-weight: 800;
}

.attention-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding: 15px 18px;
    border: 1px solid #fecaca;
    border-radius: 14px;
    background: var(--danger-soft);
}

.attention-icon {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: var(--danger);
    font-weight: 900;
}

.attention-banner strong,
.attention-banner p {
    display: block;
}

.attention-banner p {
    margin: 1px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(330px, .8fr);
    gap: 20px;
}

.notification-target {
    scroll-margin-top: 28px;
}

.appointment-card.notification-target:target {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft), var(--shadow);
}

tr.notification-target:target td {
    background: var(--primary-soft);
}

.dashboard-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dashboard-column .panel {
    padding: 22px;
}

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

.panel-header h3 {
    margin: 2px 0 0;
    font-size: 18px;
}

.panel-header > a {
    font-size: 12px;
    font-weight: 800;
}

.item-list {
    display: flex;
    flex-direction: column;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 0;
    border-top: 1px solid var(--border);
}

.list-item:first-child {
    border-top: 0;
}

.list-item-main {
    min-width: 0;
    flex: 1;
}

.list-item-main strong,
.list-item-main span {
    display: block;
}

.list-item-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-item-main span {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 50%;
}

.status-dot.blue {
    background: var(--primary);
}

.status-dot.amber {
    background: var(--warning);
}

.split-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.split-list > div + div {
    padding-left: 22px;
    border-left: 1px solid var(--border);
}

.split-list h4 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 10px;
}

.split-list h4 span,
.count-pill {
    display: inline-grid;
    min-width: 25px;
    min-height: 25px;
    place-items: center;
    border-radius: 99px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 11px;
}

.compact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 0;
    border-top: 1px solid var(--border);
    color: var(--text);
    font-size: 13px;
}

.compact-item span {
    color: var(--muted);
    font-size: 11px;
}

.finance-summary-list {
    margin-bottom: 18px;
}

.finance-summary-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.finance-summary-list > div:first-child {
    border-top: 0;
}

.finance-summary-list span {
    color: var(--muted);
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.muted,
.block-muted {
    color: var(--muted);
}

.compact {
    margin: 0;
    font-size: 13px;
}

.block-muted {
    display: block;
    margin-top: 2px;
    font-size: 11px;
}

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

.mini-empty span {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 900;
}

.mini-empty p {
    margin: 8px 0 0;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.toolbar-wrap {
    align-items: flex-start;
}

.toolbar-sub {
    margin-top: -8px;
    margin-bottom: 18px;
}

.toolbar-sub .tabs {
    background: var(--surface);
    border-style: dashed;
}

/* Kişisel Panel — durum ve içerik kartları */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: var(--surface-soft, var(--surface));
    color: var(--text-muted, #6b7280);
    border: 1px solid var(--border);
}

.status-pill-watchlist,
.status-pill-to_read,
.status-pill-to_listen {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.25);
}

.status-pill-watching,
.status-pill-reading {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, 0.25);
}

.status-pill-watched,
.status-pill-read,
.status-pill-listened {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
    border-color: rgba(22, 163, 74, 0.25);
}

.rating-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.content-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.content-card:hover {
    border-color: var(--primary, #2563eb);
}

.content-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.content-card h3 {
    margin: 0;
    font-size: 17px;
}

.content-card footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 8px;
}

.content-card .row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin: -4px 0 16px;
}

.chip-label {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    margin-right: 4px;
    font-weight: 600;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 12px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.chip:hover {
    border-color: var(--primary, #2563eb);
}

.chip-active {
    background: var(--primary, #2563eb);
    color: #fff;
    border-color: var(--primary, #2563eb);
}

.status-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.contact-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.contact-card header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-card h3 {
    margin: 0;
    font-size: 17px;
}

.contact-card h3 a {
    color: var(--text);
    text-decoration: none;
}

.contact-card footer {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.contact-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary, #2563eb);
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.contact-avatar.large {
    width: 64px;
    height: 64px;
    font-size: 28px;
}

.contact-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
}

.contact-line span {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    font-weight: 600;
    min-width: 56px;
}

.contact-whatsapp {
    font-size: 12px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.15);
    color: #15803d;
    text-decoration: none;
}

.contact-note {
    margin: 0;
    color: var(--text-muted, #6b7280);
    font-size: 14px;
    border-top: 1px dashed var(--border);
    padding-top: 8px;
}

.contact-detail {
    padding: 20px;
}

.contact-detail header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.contact-detail-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 0 0 16px;
}

.contact-detail-list > div {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
}

.contact-detail-list dt {
    margin: 0;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
}

.contact-detail-list dd {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.reading-card-body {
    display: flex;
    gap: 12px;
}

.reading-cover {
    flex-shrink: 0;
    width: 70px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-soft, var(--surface));
    display: flex;
    align-items: center;
    justify-content: center;
}

.reading-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reading-cover-large {
    display: block;
    width: 160px;
    height: 230px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    background: var(--surface-soft, var(--surface));
}

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

.reading-meta,
.watch-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 12px 0;
}

.current-cover {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft, var(--surface));
}

.current-cover img {
    width: 90px;
    height: 130px;
    object-fit: cover;
    border-radius: 8px;
}

.playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.playlist-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.playlist-card header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.playlist-card h3 {
    margin: 0;
    font-size: 17px;
}

.playlist-card h3 a {
    color: var(--text);
    text-decoration: none;
}

.playlist-card footer {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.playlist-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0;
}

.playlist-stats > div {
    background: var(--surface-soft, var(--surface));
    border-radius: 10px;
    padding: 8px 12px;
}

.playlist-stats dt {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted, #6b7280);
}

.playlist-stats dd {
    margin: 0;
    font-weight: 700;
    font-size: 18px;
}

.playlist-show-layout {
    align-items: flex-start;
}

.playlist-item-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.playlist-item {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.playlist-item header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.playlist-item h4 {
    margin: 0;
    font-size: 15px;
}

.position-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 28px;
    padding: 0 10px;
    border-radius: 8px;
    background: var(--surface-soft, var(--surface));
    color: var(--text-muted, #6b7280);
    font-weight: 700;
    font-size: 13px;
}

.position-input {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}

.playlist-item footer {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.inline-edit {
    margin-top: 8px;
}

.inline-edit summary {
    cursor: pointer;
    font-size: 13px;
    color: var(--primary, #2563eb);
    font-weight: 600;
}

.inline-edit[open] summary {
    margin-bottom: 8px;
}

.inline-edit .playlist-item-edit {
    margin-top: 8px;
    padding: 12px;
    border: 1px dashed var(--border);
    border-radius: 12px;
}

.location-detail {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.location-detail > div {
    background: var(--surface-soft, var(--surface));
    padding: 10px 14px;
    border-radius: 10px;
}

.location-detail span {
    display: block;
    font-size: 12px;
    color: var(--text-muted, #6b7280);
}

.location-detail strong {
    display: block;
    font-size: 20px;
    margin-top: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.location-detail .button {
    grid-column: span 2;
    justify-self: start;
}

.location-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 4px;
}

.location-icon {
    display: inline-block;
    margin-right: 4px;
}

@media (max-width: 720px) {
    .contact-detail-list > div {
        grid-template-columns: 1fr;
    }
    .location-detail {
        grid-template-columns: 1fr;
    }
    .reading-card-body {
        flex-direction: column;
    }
    .reading-cover {
        width: 100%;
        height: 160px;
    }
}

.tabs {
    display: flex;
    max-width: 100%;
    gap: 5px;
    padding: 4px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
    scrollbar-width: thin;
}

.tabs a {
    flex: 0 0 auto;
    padding: 8px 13px;
    border-radius: 9px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

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

.search-form {
    display: flex;
    width: min(370px, 100%);
    gap: 8px;
}

.search-form input {
    min-width: 0;
    flex: 1;
}

.note-filter-form {
    width: min(760px, 100%);
    flex-wrap: wrap;
}

.note-filter-form select {
    width: 190px;
    flex: 0 0 190px;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: 0;
    color: var(--text);
    background: var(--surface);
    transition: border-color .15s ease, box-shadow .15s ease;
}

input,
select {
    min-height: 43px;
    padding: 9px 12px;
}

textarea {
    min-height: 105px;
    padding: 11px 12px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.table-panel {
    overflow: hidden;
}

.responsive-table {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 15px 17px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 11px;
    letter-spacing: .05em;
    text-transform: uppercase;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: var(--surface-soft);
}

.record-title {
    min-width: 190px;
    max-width: 390px;
}

.record-title strong,
.record-title span {
    display: block;
}

.record-title span {
    margin-top: 2px;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.date-range span {
    color: var(--muted);
}

.date-range b {
    color: var(--border);
}

.actions-column {
    width: 270px;
}

.row-actions {
    justify-content: flex-end;
}

.row-actions form,
.card-actions form {
    display: inline-flex;
    margin: 0;
}

.badge,
.type-label,
.template-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.badge {
    padding: 5px 9px;
}

.badge-info {
    color: var(--primary);
    background: var(--primary-soft);
}

.badge-warning {
    color: var(--warning);
    background: var(--warning-soft);
}

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

.badge-neutral {
    color: var(--muted);
    background: var(--surface-hover);
}

.type-label {
    padding: 5px 9px;
}

.type-receivable {
    color: var(--success);
    background: var(--success-soft);
}

.type-debt {
    color: var(--danger);
    background: var(--danger-soft);
}

.type-recurring_expense {
    color: var(--violet);
    background: var(--violet-soft);
}

.template-label {
    display: flex;
    margin-top: 5px;
    color: var(--muted);
}

.empty-state {
    display: flex;
    min-height: 310px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 40px 24px;
    color: var(--muted);
    text-align: center;
}

.empty-state > span:not(.empty-code) {
    display: grid;
    width: 55px;
    height: 55px;
    place-items: center;
    border-radius: 17px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 22px;
    font-weight: 900;
}

.empty-state h3,
.empty-state h2 {
    margin: 13px 0 4px;
    color: var(--text);
}

.empty-state p {
    max-width: 480px;
    margin: 0 0 18px;
}

.empty-state.large {
    min-height: 55vh;
}

.empty-code {
    color: var(--primary);
    font-size: 64px;
    font-weight: 900;
    letter-spacing: -.06em;
}

.debug-message {
    width: min(760px, 100%);
    padding: 14px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--danger);
    background: var(--surface-soft);
    text-align: left;
    white-space: pre-wrap;
}

.form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 22px;
    align-items: start;
}

.form-card {
    padding: 26px;
}

.form-section + .form-section {
    margin-top: 27px;
    padding-top: 27px;
    border-top: 1px solid var(--border);
}

.form-section-title {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.form-section-title > span {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 900;
}

.form-section-title h3 {
    margin: 0;
    font-size: 17px;
}

.form-section-title p {
    margin: 1px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.field {
    display: block;
    margin-bottom: 16px;
}

.field > span {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 750;
}

.field > span b {
    color: var(--danger);
}

.field small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
}

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

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

.form-actions {
    justify-content: flex-end;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.form-aside {
    position: sticky;
    top: 22px;
}

.tip-card {
    display: flex;
    gap: 12px;
    padding: 18px;
    border: 1px solid #bfdbfe;
    border-radius: 15px;
    background: var(--primary-soft);
}

.tip-card > span {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: var(--primary);
    font-weight: 900;
}

.tip-card strong {
    display: block;
}

.tip-card p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

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

.choice-card {
    position: relative;
    cursor: pointer;
}

.choice-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.choice-card > span {
    display: flex;
    min-height: 92px;
    justify-content: center;
    flex-direction: column;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.choice-card small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.choice-card input:checked + span {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}

.recurring-field[hidden] {
    display: none;
}

.appointment-list {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.appointment-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 17px;
    align-items: center;
    padding: 17px;
}

.appointment-date {
    display: grid;
    min-height: 72px;
    place-items: center;
    align-content: center;
    border-radius: 14px;
    color: var(--primary);
    background: var(--primary-soft);
}

.appointment-date strong {
    font-size: 25px;
    line-height: 1;
}

.appointment-date span {
    margin-top: 4px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .09em;
}

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

.appointment-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.appointment-title-row h3 {
    margin: 0;
    font-size: 17px;
}

.appointment-title-row p {
    max-width: 700px;
    margin: 2px 0 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.appointment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
}

.card-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 290px;
}

.mini-metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.mini-metric-grid article {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.mini-metric-grid span,
.mini-metric-grid strong {
    display: block;
}

.mini-metric-grid span {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.mini-metric-grid strong {
    font-size: 17px;
}

.mini-metric-grid em {
    font-style: normal;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

.calendar-panel {
    padding: 22px;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.calendar-toolbar h3 {
    min-width: 180px;
    margin: 0;
    text-align: center;
    text-transform: capitalize;
}

.calendar-toolbar .button {
    margin-left: auto;
}

.icon-button {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 11px;
    cursor: pointer;
    color: var(--text);
    background: var(--surface);
    font-size: 22px;
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

.calendar-weekdays span {
    padding: 10px;
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}

.calendar-grid {
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
}

.calendar-day {
    min-width: 0;
    min-height: 126px;
    padding: 8px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.calendar-day.muted-day {
    background: var(--surface-soft);
    opacity: .65;
}

.calendar-day.today {
    background: var(--primary-soft);
}

.calendar-day-number {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    margin-bottom: 5px;
    border-radius: 50%;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.calendar-day.today .calendar-day-number {
    color: #fff;
    background: var(--primary);
}

.calendar-event {
    display: block;
    margin-top: 4px;
    padding: 5px 6px;
    overflow: hidden;
    border-left: 3px solid var(--primary);
    border-radius: 5px;
    color: var(--text);
    background: var(--primary-soft);
    font-size: 10px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event.completed {
    border-left-color: var(--success);
    opacity: .7;
}

.calendar-event.cancelled {
    border-left-color: var(--danger);
    text-decoration: line-through;
    opacity: .6;
}

.flash-stack {
    position: fixed;
    z-index: 80;
    top: 18px;
    right: 22px;
    display: flex;
    width: min(420px, calc(100vw - 32px));
    flex-direction: column;
    gap: 8px;
}

.alert {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    font-size: 13px;
}

.alert > span {
    display: block;
}

.alert button {
    border: 0;
    cursor: pointer;
    color: inherit;
    background: transparent;
    font-size: 18px;
    line-height: 1;
}

.alert-error {
    border-color: #fecaca;
    color: var(--danger);
    background: var(--danger-soft);
}

.alert-success {
    border-color: #bbf7d0;
    color: var(--success);
    background: var(--success-soft);
}

.alert-info {
    border-color: #bfdbfe;
    color: var(--primary);
    background: var(--primary-soft);
}

.stack-form {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.auth-body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    background:
        radial-gradient(circle at 12% 16%, rgba(37, 99, 235, .16), transparent 27%),
        radial-gradient(circle at 88% 86%, rgba(124, 58, 237, .1), transparent 25%),
        var(--bg);
}

.auth-shell {
    display: grid;
    width: min(1100px, calc(100% - 40px));
    min-height: 650px;
    grid-template-columns: 1.05fr .95fr;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 26px;
    background: var(--surface);
    box-shadow: 0 25px 70px rgba(15, 23, 42, .15);
}

.auth-panel {
    display: flex;
    padding: 48px;
    flex-direction: column;
    color: #fff;
    background:
        linear-gradient(145deg, rgba(15, 23, 42, .94), rgba(29, 78, 216, .88)),
        #111827;
}

.auth-panel .auth-brand {
    color: #fff;
}

.auth-copy {
    max-width: 500px;
    margin: auto 0;
}

.auth-copy .eyebrow {
    color: #93c5fd;
}

.auth-copy h1 {
    margin: 10px 0 15px;
    font-size: clamp(36px, 4.6vw, 58px);
    line-height: 1.02;
    letter-spacing: -.055em;
}

.auth-copy p:not(.eyebrow) {
    max-width: 460px;
    color: #cbd5e1;
    font-size: 16px;
}

.auth-points {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.auth-points span {
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 99px;
    color: #dbeafe;
    background: rgba(255, 255, 255, .06);
    font-size: 11px;
    font-weight: 700;
}

.auth-form-panel {
    display: grid;
    padding: 45px;
    place-items: center;
}

.auth-form-card {
    width: min(420px, 100%);
}

.auth-form-card h1,
.auth-form-card h2 {
    margin: 5px 0 5px;
    letter-spacing: -.03em;
}

.auth-form-card > .muted {
    margin: 0 0 24px;
}

.auth-form-card .auth-brand {
    margin-bottom: 34px;
}

.auth-help {
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.install-shell {
    display: grid;
    width: min(540px, calc(100% - 32px));
    min-height: 100vh;
    padding: 40px 0;
    place-items: center;
}

.install-card {
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 19px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 11px;
}

@media (max-width: 1199px) {
    .sidebar {
        width: 236px;
        padding-inline: 14px;
    }

    .content-shell {
        margin-left: 236px;
        padding-inline: 24px;
    }

    .brand small,
    .nav-item {
        font-size: 13px;
    }

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

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

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

    .form-layout {
        grid-template-columns: 1fr;
    }

    .form-aside {
        position: static;
    }

    .appointment-card {
        grid-template-columns: 72px 1fr;
    }

    .card-actions {
        grid-column: 2;
        justify-content: flex-start;
        max-width: none;
    }
}

@media (max-width: 767px) {
    body.sidebar-open {
        overflow: hidden;
    }

    .mobile-header {
        position: sticky;
        z-index: 40;
        top: 0;
        display: flex;
        height: 68px;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        border-bottom: 1px solid var(--border);
        background: rgba(255, 255, 255, .94);
        backdrop-filter: blur(12px);
    }

    [data-theme="dark"] .mobile-header {
        background: rgba(15, 23, 42, .94);
    }

    .mobile-brand {
        color: var(--text);
        font-weight: 800;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 4px;
    }

    .menu-toggle span {
        width: 18px;
        height: 2px;
        border-radius: 2px;
        background: var(--text);
    }

    .sidebar {
        width: min(290px, 86vw);
        transform: translateX(-105%);
        transition: transform .22s ease;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        z-index: 45;
        inset: 0;
        display: block;
        visibility: hidden;
        background: rgba(15, 23, 42, .55);
        opacity: 0;
        transition: opacity .22s ease, visibility .22s ease;
    }

    body.sidebar-open .sidebar-overlay {
        visibility: visible;
        opacity: 1;
    }

    .content-shell {
        margin-left: 0;
        padding: 0 15px 20px;
    }

    .desktop-topbar {
        display: none;
    }

    .main-content {
        min-height: calc(100vh - 128px);
        padding: 22px 0 34px;
    }

    .page-heading {
        align-items: stretch;
        flex-direction: column;
        margin-bottom: 18px;
    }

    .quick-actions {
        width: 100%;
    }

    .quick-actions .button {
        flex: 1;
    }

    .notification-row > button {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .notification-state {
        display: none;
    }

    .metric-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .metric-card {
        min-height: 132px;
        grid-template-columns: 39px 1fr;
        gap: 10px;
        padding: 15px;
    }

    .metric-icon {
        width: 39px;
        height: 39px;
        border-radius: 11px;
    }

    .metric-card strong {
        font-size: 25px;
    }

    .dashboard-column .panel {
        padding: 17px;
    }

    .split-list,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .split-list > div + div {
        padding-top: 16px;
        padding-left: 0;
        border-top: 1px solid var(--border);
        border-left: 0;
    }

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

    .tabs,
    .search-form {
        width: 100%;
    }

    .note-filter-form select,
    .note-filter-form input,
    .note-filter-form .button {
        width: 100%;
        flex: 1 1 100%;
    }

    .responsive-table {
        overflow: visible;
    }

    table,
    tbody,
    tr,
    td {
        display: block;
        width: 100%;
    }

    thead {
        display: none;
    }

    tbody tr {
        padding: 14px;
        border-bottom: 1px solid var(--border);
    }

    tbody tr:last-child {
        border-bottom: 0;
    }

    td {
        display: grid;
        grid-template-columns: 105px minmax(0, 1fr);
        gap: 10px;
        padding: 8px 0;
        border: 0;
    }

    td::before {
        color: var(--muted);
        content: attr(data-label);
        font-size: 11px;
        font-weight: 800;
        letter-spacing: .03em;
        text-transform: uppercase;
    }

    .record-title {
        min-width: 0;
        max-width: none;
    }

    .row-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .row-actions .button {
        min-height: 32px;
    }

    .form-card {
        padding: 18px;
    }

    .form-grid,
    .form-grid.three,
    .choice-grid {
        grid-template-columns: 1fr;
    }

    .choice-card > span {
        min-height: 70px;
    }

    .appointment-card {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 12px;
        padding: 13px;
    }

    .appointment-date {
        min-height: 62px;
    }

    .appointment-title-row {
        flex-direction: column;
        gap: 7px;
    }

    .appointment-title-row p {
        white-space: normal;
    }

    .appointment-meta {
        gap: 7px 12px;
    }

    .card-actions {
        grid-column: 1 / -1;
        padding-top: 10px;
        border-top: 1px solid var(--border);
    }

    .mini-metric-grid {
        grid-template-columns: 1fr 1fr;
        gap: 9px;
    }

    .mini-metric-grid article:last-child {
        grid-column: 1 / -1;
    }

    .calendar-panel {
        padding: 12px;
        overflow-x: auto;
    }

    .calendar-toolbar,
    .calendar-weekdays,
    .calendar-grid {
        min-width: 690px;
    }

    .calendar-toolbar .button {
        margin-left: 0;
    }

    .calendar-day {
        min-height: 110px;
    }

    .flash-stack {
        top: 78px;
        right: 16px;
    }

    .app-footer {
        gap: 10px;
        flex-direction: column;
    }

    .auth-shell {
        width: min(520px, calc(100% - 24px));
        min-height: auto;
        grid-template-columns: 1fr;
        margin: 24px 0;
    }

    .auth-panel {
        display: none;
    }

    .auth-form-panel {
        padding: 32px 23px;
    }
}

@media (max-width: 430px) {
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .metric-card {
        min-height: 112px;
    }

    .mini-metric-grid {
        grid-template-columns: 1fr;
    }

    .mini-metric-grid article:last-child {
        grid-column: auto;
    }

    td {
        grid-template-columns: 85px minmax(0, 1fr);
    }

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

    .form-actions .button {
        width: 100%;
    }
}

.alert-warning {
    border-color: #fde68a;
    color: var(--warning);
    background: var(--warning-soft);
}

.alert a {
    margin-left: auto;
    font-weight: 800;
    white-space: nowrap;
}

.checkbox-field {
    display: flex;
    min-height: 43px;
    align-items: center;
    gap: 9px;
    margin-bottom: 14px;
    cursor: pointer;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.checkbox-field input {
    width: 18px;
    min-height: 18px;
    height: 18px;
    flex: 0 0 auto;
    accent-color: var(--primary);
}

.checkbox-field.align-end {
    align-self: end;
    padding-bottom: 5px;
}

.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
    margin-top: 8px;
}

.upload-zone {
    display: flex;
    min-height: 120px;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 2px dashed #93c5fd;
    border-radius: 15px;
    cursor: pointer;
    background: var(--primary-soft);
    text-align: center;
    transition: border-color .15s ease, background .15s ease;
}

.upload-zone:hover {
    border-color: var(--primary);
}

.upload-zone.large {
    min-height: 180px;
}

.upload-zone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.upload-zone strong,
.upload-zone small {
    display: block;
}

.upload-zone strong {
    color: var(--primary);
    font-size: 16px;
}

.upload-zone small {
    margin-top: 4px;
    color: var(--muted);
}

.selected-files {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.selected-files span {
    padding: 5px 9px;
    border-radius: 99px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 11px;
    font-weight: 700;
}

.note-editor {
    min-height: 300px;
    line-height: 1.7;
}

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

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

.note-card {
    position: relative;
    display: flex;
    min-height: 245px;
    flex-direction: column;
    padding: 20px;
    overflow: hidden;
}

.note-card.pinned {
    border-color: #93c5fd;
    box-shadow: 0 12px 35px rgba(37, 99, 235, .11);
}

.note-card.pinned::before {
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--primary);
    content: "";
}

.note-card-head,
.note-card-footer,
.media-meta,
.feed-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.note-card-head {
    color: var(--muted);
    font-size: 11px;
}

.note-pin {
    color: var(--primary);
    font-weight: 900;
    text-transform: uppercase;
}

.note-card h3 {
    margin: 16px 0 7px;
    font-size: 19px;
}

.note-card h3 a {
    color: var(--text);
}

.note-card > p {
    flex: 1;
    margin: 0 0 15px;
    color: var(--muted);
    font-size: 13px;
}

.note-card-footer {
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 11px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-list span {
    padding: 4px 8px;
    border-radius: 99px;
    color: var(--violet);
    background: var(--violet-soft);
    font-size: 10px;
    font-weight: 800;
}

.note-tag-filters {
    margin: -4px 0 22px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

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

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

.filter-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 99px;
    color: var(--text);
    background: var(--surface-soft);
    font-size: 11px;
    font-weight: 750;
}

.filter-chip b {
    min-width: 20px;
    padding: 1px 5px;
    border-radius: 99px;
    color: var(--muted);
    background: var(--surface);
    font-size: 9px;
    text-align: center;
}

.filter-chip.active {
    border-color: var(--primary);
    color: #fff;
    background: var(--primary);
}

.filter-chip.active b {
    color: var(--primary);
}

.filter-chip.clear {
    color: var(--danger);
}

.attachment-manager,
.note-gallery {
    margin-top: 20px;
    padding: 22px;
}

.attachment-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

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

.attachment-grid article,
.attachment-grid > a {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
}

.attachment-grid img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.attachment-grid form {
    padding: 8px;
}

.attachment-grid > a > span {
    display: block;
    padding: 8px 10px;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-detail {
    padding: clamp(22px, 4vw, 48px);
}

.note-detail .tag-list {
    margin-bottom: 24px;
}

.note-content {
    color: var(--text);
    font-size: 16px;
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.media-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.media-card {
    overflow: hidden;
}

.media-preview {
    position: relative;
    display: grid;
    min-height: 190px;
    place-items: center;
    overflow: hidden;
    color: var(--primary);
    background: var(--surface-soft);
    font-size: 34px;
    font-weight: 900;
}

.media-preview.video {
    color: var(--violet);
    background: var(--violet-soft);
}

.media-preview img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    transition: transform .2s ease;
}

.media-preview:hover img {
    transform: scale(1.025);
}

.media-preview b {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 7px;
    border-radius: 7px;
    color: #fff;
    background: rgba(15, 23, 42, .72);
    font-size: 9px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.media-card-body {
    padding: 15px;
}

.media-card-body h3 {
    margin: 0;
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-card-body h3 a {
    color: var(--text);
}

.media-card-body > p {
    margin: 3px 0 10px;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-meta {
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 10px;
}

.media-card .row-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
}

.storage-state {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 22px;
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 12px;
}

.storage-state span {
    color: var(--muted);
}

.storage-state.drive {
    border-color: #bbf7d0;
    background: var(--success-soft);
}

.storage-state.local {
    border-color: #bfdbfe;
    background: var(--primary-soft);
}

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

.storage-choice {
    position: relative;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 11px;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 13px;
    cursor: pointer;
    background: var(--surface);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.storage-choice:hover {
    transform: translateY(-1px);
    border-color: var(--primary);
}

.storage-choice:has(input:checked) {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.storage-choice.is-disabled {
    cursor: not-allowed;
    opacity: .58;
}

.storage-choice.is-disabled:hover {
    transform: none;
    border-color: var(--border);
}

.storage-choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.storage-choice-radio {
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
}

.storage-choice-radio::after {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    content: "";
    opacity: 0;
    transform: scale(.5);
    transition: opacity .15s ease, transform .15s ease;
}

.storage-choice:has(input:checked) .storage-choice-radio {
    border-color: var(--primary);
}

.storage-choice:has(input:checked) .storage-choice-radio::after {
    opacity: 1;
    transform: scale(1);
}

.storage-choice:has(input:focus-visible) {
    outline: 3px solid rgba(37, 99, 235, .18);
    outline-offset: 2px;
}

.storage-choice-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 10px;
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 900;
}

.storage-choice > span:last-child {
    display: grid;
    gap: 4px;
}

.storage-choice small {
    color: var(--muted);
    line-height: 1.45;
}

.chunk-upload-progress {
    display: grid;
    gap: 9px;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
}

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

.chunk-upload-progress-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    color: var(--muted);
    font-size: 12px;
}

.progress-track {
    height: 8px;
    overflow: hidden;
    border-radius: 99px;
    background: var(--border);
}

.progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
    transition: width .2s ease;
}

.media-filter-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.provider-tabs a {
    color: var(--muted);
    background: var(--surface-soft);
}

.media-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(290px, .55fr);
    gap: 20px;
    align-items: start;
}

.media-detail-preview {
    display: grid;
    min-height: 500px;
    padding: 18px;
    place-items: center;
    overflow: hidden;
    background: var(--surface-soft);
}

.media-detail-preview img,
.media-detail-preview video {
    display: block;
    max-width: 100%;
    max-height: 72vh;
    border-radius: 12px;
}

.media-placeholder {
    max-width: 390px;
    color: var(--muted);
    text-align: center;
}

.media-placeholder span {
    display: block;
    color: var(--primary);
    font-size: 60px;
}

.media-detail-info {
    padding: 22px;
}

.media-detail-info h3 {
    margin-top: 0;
}

.media-detail-info dl {
    margin: 0 0 20px;
}

.media-detail-info dl > div {
    display: grid;
    grid-template-columns: 95px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.media-detail-info dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.media-detail-info dd {
    margin: 0;
    font-size: 12px;
}

.break-all {
    word-break: break-all;
}

.media-description {
    margin-bottom: 18px;
}

.media-description p {
    color: var(--muted);
    font-size: 13px;
}

.feed-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feed-list {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.feed-item {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    min-height: 180px;
    overflow: hidden;
}

.feed-item.unread {
    border-left: 4px solid var(--primary);
}

.feed-image {
    display: block;
    min-height: 180px;
    background: var(--surface-soft);
}

.feed-image img {
    width: 100%;
    height: 100%;
    min-height: 180px;
    object-fit: cover;
}

.feed-item-main {
    min-width: 0;
    padding: 18px;
}

.feed-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.feed-item h3 {
    margin: 8px 0 0;
    font-size: 18px;
}

.feed-item h3 a {
    color: var(--text);
}

.feed-item-main > p {
    margin: 8px 0 12px;
    color: var(--muted);
    font-size: 13px;
}

.source-chip {
    display: inline-flex;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 99px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.source-youtube {
    color: var(--danger);
    background: var(--danger-soft);
}

.source-instagram {
    color: var(--violet);
    background: var(--violet-soft);
}

.source-tiktok {
    color: var(--text);
    background: var(--surface-hover);
}

.source-manual {
    color: var(--warning);
    background: var(--warning-soft);
}

.favorite-mark {
    padding: 5px 8px;
    border-radius: 99px;
    color: var(--warning);
    background: var(--warning-soft);
    font-size: 10px;
    font-weight: 900;
}

.feed-meta {
    justify-content: flex-start;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 10px;
}

.feed-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 13px;
}

.feed-actions form {
    display: inline-flex;
}

.feed-user-note {
    margin-top: 12px;
    padding: 9px 11px;
    border-left: 3px solid var(--warning);
    border-radius: 6px;
    color: var(--muted);
    background: var(--warning-soft);
    font-size: 12px;
}

.inline-note {
    position: relative;
}

.inline-note summary {
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    cursor: pointer;
    color: var(--text);
    background: var(--surface);
    font-size: 12px;
    font-weight: 700;
    list-style: none;
}

.inline-note[open] form {
    position: absolute;
    z-index: 15;
    right: 0;
    display: block;
    width: min(360px, 85vw);
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.inline-note textarea {
    margin-bottom: 8px;
}

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

.source-card {
    display: flex;
    min-height: 290px;
    flex-direction: column;
    padding: 19px;
}

.source-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.source-card h3 {
    margin: 16px 0 4px;
}

.source-card > p {
    margin: 0 0 14px;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0 0 14px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.source-stats div {
    text-align: center;
}

.source-stats dt {
    color: var(--muted);
    font-size: 9px;
    text-transform: uppercase;
}

.source-stats dd {
    margin: 2px 0 0;
    font-weight: 900;
}

.source-error {
    margin-bottom: 14px;
    padding: 9px;
    border-radius: 9px;
    color: var(--danger);
    background: var(--danger-soft);
    font-size: 11px;
}

.source-error strong,
.source-error span {
    display: block;
}

.source-success {
    margin: 0 0 14px !important;
    color: var(--success) !important;
    font-size: 11px !important;
}

.source-card .card-actions {
    margin-top: auto;
    justify-content: flex-start;
}

.source-field[hidden] {
    display: none;
}

.settings-grid-v2 {
    margin-bottom: 20px;
}

.settings-wide {
    margin-bottom: 20px;
}

.integration-heading,
.integration-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.drive-account-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
}

.drive-credentials-form {
    margin-bottom: 20px;
}

.drive-account-avatar {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--primary);
    font-size: 18px;
    font-weight: 800;
}

.drive-account-meta {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.drive-account-meta span,
.drive-account-meta small {
    color: var(--muted);
    font-size: 11px;
}

.drive-account-meta strong,
.drive-account-meta a {
    overflow-wrap: anywhere;
}

.drive-account-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.server-limits {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.server-limits span {
    padding: 5px 8px;
    border-radius: 7px;
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 10px;
}

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

.integration-card {
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
}

.integration-card-head {
    margin-bottom: 15px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 34px 0 18px;
}

.section-heading h2 {
    margin: 4px 0 0;
    font-size: 24px;
}

.v2-dashboard {
    margin-bottom: 20px;
}

.v2-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}

.v2-content-grid + .v2-summary-grid {
    margin-top: 20px;
}

.v2-summary-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 13px;
    padding: 18px;
}

.v2-card-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 14px;
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 900;
}

.v2-card-icon.media {
    color: var(--violet);
    background: var(--violet-soft);
}

.v2-card-icon.feeds {
    color: var(--success);
    background: var(--success-soft);
}

.v2-summary-card small,
.v2-summary-card strong,
.v2-summary-card p {
    display: block;
}

.v2-summary-card small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.v2-summary-card strong {
    margin-top: 2px;
    font-size: 18px;
}

.v2-summary-card p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.v2-summary-card > a {
    grid-column: 1 / -1;
    font-size: 11px;
    font-weight: 800;
}

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

.v2-list-panel {
    padding: 20px;
}

.link-item {
    color: var(--text);
}

.dashboard-media-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.dashboard-media-strip a {
    min-width: 0;
    color: var(--text);
    text-align: center;
}

.dashboard-media-strip img,
.dashboard-media-strip a > span {
    display: grid;
    width: 100%;
    aspect-ratio: 1;
    place-items: center;
    border-radius: 10px;
    background: var(--violet-soft);
    object-fit: cover;
    font-size: 22px;
}

.dashboard-media-strip small {
    display: block;
    margin-top: 5px;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feed-dashboard-panel {
    margin-top: 16px;
}

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

.dashboard-feed-grid a {
    display: block;
    min-width: 0;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    color: var(--text);
}

.dashboard-feed-grid strong,
.dashboard-feed-grid small {
    display: block;
}

.dashboard-feed-grid strong {
    margin: 5px 0 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-feed-grid small {
    color: var(--muted);
    font-size: 10px;
}

.dashboard-feed-errors {
    display: flex;
    gap: 7px;
    margin-top: 14px;
    padding: 10px;
    flex-direction: column;
    border-radius: 10px;
    color: var(--danger);
    background: var(--danger-soft);
    font-size: 11px;
}

@media (max-width: 1199px) {
    .note-grid,
    .media-grid,
    .source-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .media-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .notes-metrics,
    .media-metrics,
    .feed-metrics,
    .v2-summary-grid,
    .v2-content-grid,
    .social-token-grid {
        grid-template-columns: 1fr 1fr;
    }

    .note-grid,
    .media-grid,
    .source-grid {
        grid-template-columns: 1fr;
    }

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

    .feed-item {
        grid-template-columns: 1fr;
    }

    .feed-image,
    .feed-image img {
        min-height: 190px;
        max-height: 260px;
    }

    .media-detail-preview {
        min-height: 280px;
    }

    .storage-state,
    .integration-heading,
    .section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .drive-account-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .drive-account-actions {
        grid-column: 1 / -1;
        align-items: stretch;
        flex-direction: column;
    }

    .drive-account-actions .button {
        width: 100%;
    }

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

    .storage-choice-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 430px) {
    .notes-metrics,
    .media-metrics,
    .feed-metrics,
    .v2-summary-grid,
    .v2-content-grid,
    .social-token-grid {
        grid-template-columns: 1fr;
    }

    .attachment-grid,
    .attachment-grid.large {
        grid-template-columns: 1fr;
    }

    .dashboard-media-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .feed-actions form,
    .feed-actions .button,
    .feed-actions details {
        width: 100%;
    }
}

/* E-Posta */
.nav-group {
    margin: 0;
}

.nav-group > summary {
    width: 100%;
    cursor: pointer;
    list-style: none;
}

.nav-group > summary::-webkit-details-marker {
    display: none;
}

.nav-group > summary::after {
    margin-left: 2px;
    content: "›";
    font-size: 20px;
    line-height: 1;
    transform: rotate(90deg);
    transition: transform .18s ease;
}

.nav-group[open] > summary::after {
    transform: rotate(-90deg);
}

.nav-group > summary .nav-badge {
    margin-left: auto;
}

.nav-submenu {
    display: grid;
    gap: 3px;
    margin: 5px 0 3px 48px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, .14);
}

.nav-submenu a {
    padding: 7px 10px;
    border-radius: 9px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 650;
}

.nav-submenu a:hover,
.nav-submenu a.active {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.email-module-nav {
    display: flex;
    max-width: 100%;
    gap: 5px;
    margin-bottom: 20px;
    padding: 5px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
    scrollbar-width: thin;
}

.email-module-nav a {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.email-module-nav a:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.email-module-nav a.active {
    color: #fff;
    background: var(--primary);
}

.email-module-nav a span {
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 99px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 10px;
    text-align: center;
}

.email-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.email-toolbar {
    align-items: center;
}

.email-search-form {
    width: min(720px, 100%);
}

.email-search-form select {
    width: 185px;
    flex: 0 0 185px;
}

.email-list {
    padding: 0;
    overflow: hidden;
}

.email-list-item {
    display: grid;
    grid-template-columns: 48px minmax(260px, 1fr) minmax(135px, auto);
    gap: 12px 16px;
    align-items: center;
    padding: 17px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.email-list-item:last-child {
    border-bottom: 0;
}

.email-list-item:hover {
    background: var(--surface-soft);
}

.email-list-item.is-unread {
    box-shadow: inset 3px 0 var(--primary);
    background: var(--primary-soft);
}

.email-list-state {
    display: flex;
    align-items: center;
    gap: 9px;
}

.email-list-state form,
.email-row-actions form,
.email-detail-actions form,
.card-actions form {
    margin: 0;
}

.email-star {
    display: grid;
    width: 29px;
    height: 29px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 9px;
    color: #94a3b8;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
}

.email-star:hover,
.email-star.active {
    color: #d97706;
    background: var(--warning-soft);
}

.email-read-state,
.unread-dot,
.read-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #cbd5e1;
}

.email-list-item.is-unread .email-read-state,
.unread-dot {
    background: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.email-list-link {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(135px, .42fr) minmax(160px, .8fr) minmax(200px, 1fr);
    gap: 14px;
    align-items: center;
    color: var(--text);
}

.email-list-link > strong,
.email-subject,
.email-excerpt {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-list-item.is-unread .email-list-link > strong,
.email-list-item.is-unread .email-subject {
    font-weight: 800;
}

.email-subject {
    font-weight: 650;
}

.email-excerpt {
    color: var(--muted);
    font-size: 13px;
}

.email-list-meta {
    display: grid;
    justify-items: end;
    color: var(--muted);
    font-size: 11px;
}

.email-list-meta > span {
    padding: 2px 7px;
    border-radius: 99px;
    color: var(--violet);
    background: var(--violet-soft);
    font-weight: 750;
}

.email-list-meta time {
    color: var(--text);
    font-weight: 700;
}

.email-row-actions {
    display: flex;
    grid-column: 2 / -1;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.email-detail {
    padding: 24px;
}

.email-detail-head {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 13px;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.email-avatar,
.email-account-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 14px;
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 850;
}

.email-detail-head strong,
.email-detail-head span {
    display: block;
}

.email-detail-head span,
.email-detail-head time {
    color: var(--muted);
    font-size: 12px;
}

.email-address-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
    margin: 0;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.email-address-grid div {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
}

.email-address-grid dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.email-address-grid dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.email-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 0;
}

.email-body {
    min-height: 220px;
    padding: 24px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
}

.email-safe-html,
.email-text-body {
    overflow-wrap: anywhere;
}

.email-safe-html table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.email-safe-html td,
.email-safe-html th {
    padding: 7px;
    border: 1px solid var(--border);
}

.email-safe-html pre,
.email-text-body {
    white-space: pre-wrap;
}

.email-safe-html a {
    overflow-wrap: anywhere;
}

.email-text-version {
    margin-top: 22px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.email-text-version summary,
.email-raw-headers summary {
    color: var(--primary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
}

.email-text-version .email-text-body {
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
}

.email-attachments {
    margin-top: 20px;
}

.email-attachments h3 {
    margin: 0 0 10px;
}

.email-attachments > div {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.email-attachments a {
    display: block;
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    background: var(--surface);
}

.email-attachments a:hover {
    border-color: var(--primary);
}

.email-attachments strong,
.email-attachments span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-attachments span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.email-raw-headers {
    margin-top: 20px;
}

.email-raw-headers pre {
    max-height: 360px;
    margin: 12px 0 0;
    padding: 14px;
    overflow: auto;
    border-radius: 12px;
    color: var(--text);
    background: var(--surface-soft);
    font-size: 11px;
    white-space: pre-wrap;
}

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

.email-account-card {
    padding: 20px;
}

.email-account-card-head {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.email-account-card-head h3,
.email-account-card-head p {
    margin: 0;
}

.email-account-card-head p {
    color: var(--muted);
    font-size: 12px;
}

.email-account-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.email-account-card dl div {
    padding: 10px;
    border-radius: 10px;
    background: var(--surface-soft);
}

.email-account-card dt,
.email-account-card dd {
    margin: 0;
}

.email-account-card dt {
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
    text-transform: uppercase;
}

.email-account-card dd {
    margin-top: 2px;
    overflow-wrap: anywhere;
    font-size: 12px;
    font-weight: 650;
}

.email-account-card .card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 16px;
}

.email-account-form-layout {
    grid-template-columns: minmax(0, 1fr);
}

.email-account-form-layout .form-card {
    width: 100%;
}

.email-settings-card {
    max-width: 960px;
}

.smtp-settings-fields {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.smtp-settings-fields[hidden],
.smtp-credential-fields[hidden] {
    display: none;
}

.email-compose-card {
    min-width: 0;
}

.email-compose-editor {
    min-height: 320px;
    line-height: 1.7;
    resize: vertical;
}

.email-compose-card .alert-warning {
    margin-bottom: 20px;
}

.dashboard-email-summary {
    margin-top: 16px;
    padding: 20px;
}

.dashboard-email-list {
    display: grid;
}

.dashboard-email-list a {
    display: grid;
    grid-template-columns: 10px minmax(120px, .45fr) minmax(180px, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    color: var(--text);
}

.dashboard-email-list strong,
.dashboard-email-list > a > span:nth-child(3) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-email-list > a > span:nth-child(3),
.dashboard-email-list small {
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 1199px) {
    .email-list-item {
        grid-template-columns: 42px minmax(0, 1fr) auto;
    }

    .email-list-link {
        grid-template-columns: minmax(120px, .45fr) minmax(160px, 1fr);
    }

    .email-excerpt {
        display: none;
    }
}

@media (max-width: 767px) {
    .nav-submenu {
        margin-left: 43px;
    }

    .email-page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .email-page-heading .button {
        width: 100%;
    }

    .email-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .email-metrics article:last-child {
        grid-column: auto;
    }

    .email-search-form {
        flex-wrap: wrap;
    }

    .email-search-form select,
    .email-search-form input,
    .email-search-form .button {
        width: 100%;
        flex: 1 1 100%;
    }

    .email-list-item {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 9px 12px;
        padding: 15px;
    }

    .email-list-link {
        grid-template-columns: 1fr;
        gap: 1px;
    }

    .email-list-meta {
        grid-column: 2;
        grid-row: 2;
        justify-items: start;
        grid-template-columns: repeat(3, auto);
        gap: 7px;
        align-items: center;
    }

    .email-list-meta small {
        display: none;
    }

    .email-row-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .email-detail {
        padding: 16px;
    }

    .email-detail-head {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .email-detail-head time {
        grid-column: 2;
    }

    .email-address-grid {
        grid-template-columns: 1fr;
    }

    .email-body {
        padding: 16px;
    }

    .email-attachments > div,
    .email-account-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-email-list a {
        grid-template-columns: 10px minmax(0, 1fr) auto;
    }

    .dashboard-email-list > a > span:nth-child(3) {
        display: none;
    }
}

@media (max-width: 430px) {
    .email-metrics {
        grid-template-columns: 1fr;
    }

    .email-account-card-head {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .email-account-card-head .badge {
        grid-column: 2;
        justify-self: start;
    }

    .email-account-card dl {
        grid-template-columns: 1fr;
    }

    .email-detail-actions,
    .email-row-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .email-detail-actions form,
    .email-row-actions form,
    .email-detail-actions .button,
    .email-row-actions .button {
        width: 100%;
    }
}
