/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-tertiary: #252836;
    --bg-elevated: rgba(28, 31, 43, 0.98);
    --text-primary: #e4e6eb;
    --text-secondary: #b0b3b8;
    --text-muted: #8b91a3;
    --border-color: #2d3039;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --header-divider: rgba(57, 62, 80, 0.75);
    --surface-soft: rgba(42, 46, 62, 0.92);
    --surface-strong: rgba(38, 42, 57, 0.9);
    --surface-hover: rgba(53, 58, 76, 0.92);
    --modal-overlay: rgba(8, 10, 16, 0.78);
    
    /* Provider Colors */
    --openai: #10a37f;
    --anthropic: #d4a843;
    --google: #4285f4;
    --meta: #0668E1;
    --nvidia: #76B900;
    --mistral: #ff6c37;
    --deepseek: #4a90d9;
    --alibaba: #ff6a00;
    --bytedance: #111111;
    --other: #8b5cf6;
    
    /* UI Colors */
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #22c55e;
}

body[data-theme="light"] {
    --bg-primary: #eef3f9;
    --bg-secondary: #ffffff;
    --bg-tertiary: #dfe7f2;
    --bg-elevated: rgba(255, 255, 255, 0.98);
    --text-primary: #18212f;
    --text-secondary: #526173;
    --text-muted: #647286;
    --border-color: #d3dce8;
    --shadow: 0 16px 44px rgba(31, 53, 80, 0.12);
    --header-divider: rgba(187, 198, 214, 0.9);
    --surface-soft: rgba(247, 250, 253, 0.98);
    --surface-strong: rgba(245, 248, 252, 0.98);
    --surface-hover: rgba(233, 239, 247, 1);
    --modal-overlay: rgba(68, 82, 103, 0.28);
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg-primary);
}

body {
    font-family: 'Noto Sans Thai', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100svh;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    transition: background 0.25s ease, color 0.25s ease;
}

@supports (min-height: 100dvh) {
    body {
        min-height: 100dvh;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
}

/* ===== Header ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

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

.header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 32px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-left: 42px;
}

/* ===== Add Button ===== */
.btn-add {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--surface-soft);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: rgba(99, 102, 241, 0.45);
}

.btn-secondary.active {
    border-color: rgba(34, 197, 94, 0.55);
    color: #bbf7d0;
}

.theme-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 38px;
    flex-shrink: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.theme-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-toggle {
    --slide-ease: cubic-bezier(0.4, -0.3, 0.6, 1.3);
    --easing: var(--slide-ease);
    --speed: 0.5s;
    --width: 96px;
    --ar: 8 / 3;
    --ray: hsl(0 0% 100% / 0.5);
    --sun: hsl(47, 91%, 58%);
    --moon: hsl(212, 13%, 82%);
    --crater: hsl(221, 16%, 68%);
    --dark: 0;
    isolation: isolate;
    position: relative;
    display: block;
    width: var(--width);
    aspect-ratio: var(--ar);
    border-radius: 100vh;
    overflow: hidden;
    border: 0;
    outline-color: transparent;
    background: hsl(
        calc(204 + (var(--dark) * 25))
        calc((53 - (var(--dark) * 28)) * 1%)
        calc((47 - (var(--dark) * 31)) * 1%)
    );
    box-shadow:
        calc(var(--width) * 0) calc(var(--width) * 0.02) calc(var(--width) * 0.01) calc(var(--width) * -0.0025) hsl(210 10% 100% / 0.95),
        calc(var(--width) * 0) calc(var(--width) * -0.02) calc(var(--width) * 0.01) calc(var(--width) * -0.0025) hsl(210 10% 10% / 0.2),
        calc(var(--width) * 0) calc(var(--width) * 0.02) calc(var(--width) * 0.5) 0 hsl(210 10% 100% / 0.15);
    transition: background var(--speed) var(--easing), transform 0.2s ease;
}

.theme-switch:hover .theme-toggle {
    transform: translateY(-1px);
}

.theme-switch input:focus-visible + .theme-toggle {
    outline: 2px solid rgba(99, 102, 241, 0.45);
    outline-offset: 3px;
}

.theme-toggle::after {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow:
        calc(var(--width) * 0) calc(var(--width) * -0.025) calc(var(--width) * 0.025) 0 hsl(210 10% 10% / 0.15) inset,
        calc(var(--width) * 0) calc(var(--width) * 0.025) calc(var(--width) * 0.025) 0 hsl(210 10% 10% / 0.65) inset;
    border-radius: 100vh;
    pointer-events: none;
    z-index: 5;
}

.toggle__content {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 100vh;
    display: block;
    clip-path: inset(0 0 0 0 round 100vh);
    container-type: inline-size;
}

.toggle__backdrop {
    overflow: visible;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    transition: translate var(--speed) var(--easing);
    translate: 0 calc(var(--dark) * (100% - (3 / 8 * var(--width))));
}

.toggle__backdrop--ray .clouds path {
    fill: var(--ray);
}

.toggle__backdrop--clouds {
    z-index: 1;
}

.toggle__backdrop--stars {
    z-index: 0;
}

.stars path {
    transform-box: fill-box;
    transform-origin: 25% 50%;
    scale: calc(0.25 + (var(--dark) * 0.75));
    transition: scale var(--speed) calc(var(--speed) * 0.5) var(--easing);
}

.stars g {
    transform-box: fill-box;
    transform-origin: 50% 50%;
}

.stars g:nth-of-type(3),
.stars g:nth-of-type(9) {
    animation: twinkle 4s -2s infinite;
}

.stars g:nth-of-type(11) {
    animation: twinkle 6s -2s infinite;
}

.toggle__indicator-wrapper {
    position: absolute;
    inset: 0;
    z-index: 3;
}

.toggle__indicator {
    height: 100%;
    aspect-ratio: 1;
    border-radius: 0;
    display: grid;
    place-items: center;
    padding: 3%;
    transition: translate var(--speed) var(--slide-ease);
    translate: calc(var(--dark) * (100cqi - 100%)) 0;
}

.toggle__star {
    height: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    position: relative;
    transition: translate var(--speed) var(--easing);
    translate: calc((var(--dark) * -10%) + 5%) 0;
}

.toggle__star::before {
    content: "";
    z-index: -1;
    width: 356%;
    background:
        radial-gradient(hsl(0 0% 100% / 0.25) 40%, transparent 40.5%),
        radial-gradient(hsl(0 0% 100% / 0.25) 56%, transparent 56.5%)
        hsl(0 0% 100% / 0.25);
    border-radius: 50%;
    aspect-ratio: 1;
    position: absolute;
    top: 50%;
    left: 50%;
    transition: translate var(--speed) var(--easing);
    translate: calc((50 - (var(--dark) * 4)) * -1%) -50%;
}

.toggle__star::after {
    content: "";
    position: absolute;
    inset: 0;
    display: block;
    background: hsl(0 0% 0% / 0.5);
    filter: blur(4px);
    translate: 2% 4%;
    border-radius: 50%;
    z-index: -1;
}

.sun {
    background: var(--sun);
    position: absolute;
    inset: 0;
    border-radius: 50%;
    overflow: hidden;
    box-shadow:
        calc(var(--width) * 0.01) calc(var(--width) * 0.01) calc(var(--width) * 0.02) 0 hsl(210 10% 100% / 0.95) inset,
        calc(var(--width) * -0.01) calc(var(--width) * -0.01) calc(var(--width) * 0.02) 0 hsl(210 10% 20% / 0.5) inset;
}

.moon {
    position: absolute;
    inset: -1%;
    border-radius: 50%;
    background: var(--moon);
    transition: translate var(--speed) ease-in-out;
    translate: calc((100 - (var(--dark) * 100)) * 1%) 0%;
    box-shadow:
        calc(var(--width) * 0.01) calc(var(--width) * 0.01) calc(var(--width) * 0.02) 0 hsl(210 10% 100% / 0.95) inset,
        calc(var(--width) * -0.01) calc(var(--width) * -0.01) calc(var(--width) * 0.02) 0 hsl(210 10% 10% / 0.95) inset;
}

.moon__crater {
    position: absolute;
    background: var(--crater);
    border-radius: 50%;
    width: calc(var(--size, 10) * 1%);
    aspect-ratio: 1;
    left: calc(var(--x) * 1%);
    top: calc(var(--y) * 1%);
    box-shadow:
        calc(var(--width) * 0.01) calc(var(--width) * 0.01) calc(var(--width) * 0.01) 0 hsl(210 10% 6% / 0.25) inset,
        0 calc(var(--width) * 0.005) calc(var(--width) * 0.01) 0 hsl(210 10% 100% / 0.25);
}

.moon__crater:nth-of-type(1) {
    --size: 18;
    --x: 40;
    --y: 15;
}

.moon__crater:nth-of-type(2) {
    --size: 20;
    --x: 65;
    --y: 58;
}

.moon__crater:nth-of-type(3) {
    --size: 34;
    --x: 18;
    --y: 40;
}

.theme-switch input:checked + .theme-toggle {
    --dark: 1;
}

.theme-switch input:not(:checked) + .theme-toggle .toggle__backdrop--stars {
    transition-timing-function: cubic-bezier(0.2, -0.6, 0.7, 1.6);
}

.theme-switch input:not(:checked) + .theme-toggle .stars path {
    transition-delay: 0s;
}

@keyframes twinkle {
    0%,
    40%,
    60%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(0);
    }
}

.btn-add:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.btn-add-icon {
    font-size: 20px;
    font-weight: 700;
}

/* ===== Provider Filter ===== */
.provider-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.filter-label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    margin-right: 4px;
}

.filter-chip {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-chip-content {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.filter-chip:hover {
    border-color: var(--chip-color, var(--text-muted));
    color: var(--chip-color, var(--text-primary));
}

.filter-chip.active {
    background: var(--chip-color, var(--accent));
    color: white;
    border-color: var(--chip-color, var(--accent));
}

/* ===== Timeline ===== */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ===== Month Group ===== */
.month-group {
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.14), transparent 32%),
        linear-gradient(180deg, var(--bg-elevated), var(--bg-secondary));
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 22px;
    box-shadow: var(--shadow);
}

.month-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    cursor: pointer;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--header-divider);
    transition: border-color 0.2s ease, opacity 0.2s ease;
}

.month-header:hover {
    border-color: rgba(99, 102, 241, 0.45);
}

.month-heading {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.month-kicker {
    font-size: 11px;
    font-weight: 700;
    color: #8f96ac;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.month-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.month-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.month-count {
    font-size: 12px;
    color: var(--text-primary);
    background: var(--surface-strong);
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
}

.month-add-hint {
    font-size: 12px;
    color: var(--text-secondary);
}

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

/* ===== Release Cards ===== */
.release-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    min-height: 160px;
    display: flex;
    flex-direction: column;
}

.release-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--provider-color, var(--accent));
}

.release-card:hover {
    transform: translateY(-3px);
    border-color: var(--provider-color, var(--accent));
    box-shadow: var(--shadow);
}

.release-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.release-title-block {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.release-date-pill {
    min-width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
}

.release-header-side {
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.release-model {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

.release-provider-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    padding: 3px 9px 3px 4px;
    border-radius: 12px;
    font-weight: 500;
    color: white;
    background: var(--provider-color, var(--accent));
}

.release-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.release-date-label,
.release-type {
    display: flex;
    align-items: center;
    gap: 4px;
}

.release-description {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    flex: 1 1 auto;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--modal-overlay);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    max-height: 90svh;
    overflow-y: auto;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
}

@supports (height: 100dvh) {
    .modal-content {
        max-height: calc(100dvh - 40px);
    }
}

.modal-content-wide {
    max-width: 920px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 26px 18px;
    border-bottom: 1px solid var(--header-divider);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.btn-close {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-soft);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    border-radius: 999px;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

.provider-manager {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 24px;
    padding: 24px;
}

.provider-manager-list,
.provider-manager-form {
    background: var(--surface-strong);
    border: 1px solid var(--header-divider);
    border-radius: 18px;
}

.provider-manager-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid var(--header-divider);
}

.provider-manager-head h3 {
    font-size: 15px;
    font-weight: 700;
}

.provider-manager-head span {
    color: var(--text-secondary);
    font-size: 12px;
}

.provider-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
}

.provider-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--surface-soft);
}

.provider-item.active {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.provider-item-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.provider-item-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.provider-item-meta strong {
    font-size: 14px;
    overflow-wrap: anywhere;
}

.provider-item-meta span {
    font-size: 12px;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

.provider-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.provider-color-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.provider-logo {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid rgba(15, 17, 23, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.provider-logo img {
    width: 72%;
    height: 72%;
    object-fit: contain;
    display: block;
}

.provider-logo-fallback {
    width: 58%;
    height: 58%;
    border-radius: 999px;
    display: none;
}

.provider-logo.is-fallback {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.16);
}

.provider-logo.is-fallback .provider-logo-fallback {
    display: block;
}

.filter-chip-logo {
    width: 19px;
    height: 19px;
    border-radius: 6px;
}

.provider-item-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.provider-badge-logo {
    width: 18px;
    height: 18px;
    border-radius: 6px;
}

.btn-icon-action {
    min-width: 58px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--surface-soft);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon-action:hover {
    border-color: rgba(99, 102, 241, 0.45);
}

.btn-icon-action.danger {
    color: #fecaca;
    border-color: rgba(127, 29, 29, 0.9);
    background: rgba(81, 21, 21, 0.72);
}

.btn-icon-action.danger:hover {
    background: rgba(102, 25, 25, 0.82);
}

.provider-manager-form #providerForm {
    padding: 18px;
}

.provider-empty-state {
    padding: 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===== Form ===== */
#addForm,
#authForm {
    padding: 22px 26px 24px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #9da3b7;
    margin-bottom: 9px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--surface-soft);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    line-height: 1.4;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface-strong);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}

.form-group textarea {
    resize: vertical;
    min-height: 110px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--header-divider);
}

.btn-cancel {
    min-width: 92px;
    padding: 12px 18px;
    background: var(--surface-soft);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: var(--surface-hover);
}

.btn-submit {
    min-width: 92px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #726dff 0%, #5b5ce6 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(99, 102, 241, 0.24);
    transition: all 0.2s ease;
}

.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(99, 102, 241, 0.34);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #8c92a6;
}

.form-group select {
    background-image:
        linear-gradient(45deg, transparent 50%, #aeb3c5 50%),
        linear-gradient(135deg, #aeb3c5 50%, transparent 50%);
    background-position:
        calc(100% - 20px) calc(50% - 3px),
        calc(100% - 14px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 42px;
}

.form-group input[type="date"] {
    min-height: 52px;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.78);
    opacity: 0.8;
    cursor: pointer;
}

/* ===== Detail Modal ===== */
.detail-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    width: 120px;
    color: var(--text-muted);
    font-size: 13px;
    flex-shrink: 0;
}

.detail-value {
    color: var(--text-primary);
    font-size: 14px;
    min-width: 0;
    flex: 1;
}

.detail-value.provider-badge-large {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
}

.provider-badge-large {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 5px 12px 5px 5px;
    color: #fff;
    font-weight: 600;
}

.detail-date-form {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.detail-date-form input[type="date"] {
    min-width: 0;
    flex: 1;
    height: 42px;
    padding: 0 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font: inherit;
}

.detail-date-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.detail-date-button {
    min-width: 76px;
    padding: 9px 12px;
    border-radius: 10px;
}

.btn-delete {
    padding: 10px 20px;
    background: var(--danger);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-close-modal {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-close-modal:hover {
    background: var(--border-color);
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 24px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    box-shadow: var(--shadow);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state-icon:empty {
    display: none;
}

.empty-state-text {
    font-size: 16px;
    margin-bottom: 8px;
}

.empty-state-hint {
    font-size: 14px;
    color: var(--text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .header-right {
        width: 100%;
        justify-content: flex-end;
    }

    .btn-add,
    .btn-secondary {
        align-self: flex-end;
    }
    
    .provider-filter {
        padding: 10px 12px;
    }
    
    .timeline {
        gap: 18px;
    }

    .month-group {
        padding: 18px;
    }

    .month-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .month-title {
        font-size: 22px;
    }

    .month-summary {
        justify-content: flex-start;
    }

    .month-releases {
        grid-template-columns: 1fr;
    }

    .release-card {
        padding: 14px 16px;
        min-height: 0;
    }

    .release-header {
        flex-direction: column;
    }

    .release-header-side {
        justify-content: flex-start;
    }
    
    .release-model {
        font-size: 16px;
    }
    
    .modal-content {
        max-width: 100%;
        margin: 10px;
    }

    #addForm {
        padding: 18px 18px 20px;
    }

    .modal-header {
        padding: 18px 18px 16px;
    }

    .provider-manager {
        grid-template-columns: 1fr;
        padding: 18px;
    }

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

    .provider-item-actions {
        justify-content: flex-end;
    }

    .detail-row {
        flex-direction: column;
        gap: 8px;
    }

    .detail-label {
        width: auto;
    }

    .detail-date-form {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions {
        justify-content: stretch;
    }

    .btn-cancel,
    .btn-submit {
        flex: 1 1 0;
    }
}

/* ===== UX Refresh ===== */
.admin-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.admin-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--text-muted);
}

.admin-status.active {
    color: var(--text-primary);
    border-color: rgba(34, 197, 94, 0.5);
}

.admin-status.active .admin-status-dot {
    background: var(--success);
}

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

.provider-sidebar {
    position: sticky;
    top: 18px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

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

.sidebar-head h2,
.content-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.sidebar-head span {
    color: var(--text-secondary);
    background: var(--surface-strong);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 12px;
}

.search-input {
    width: 100%;
    min-height: 44px;
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--surface-soft);
    color: var(--text-primary);
    font: inherit;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}

.provider-sidebar .provider-filter {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
}

.provider-sidebar .filter-label {
    margin: 0 0 2px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.provider-sidebar .filter-chip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 9px 10px;
    border-radius: 14px;
    color: var(--text-primary);
    text-align: left;
}

.provider-sidebar .filter-chip.active {
    background: rgba(99, 102, 241, 0.14);
    color: var(--text-primary);
    border-color: var(--chip-color, var(--accent));
}

.filter-chip-count {
    flex-shrink: 0;
    min-width: 28px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--text-secondary);
    font-size: 12px;
    text-align: center;
}

.timeline-panel {
    min-width: 0;
}

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

.content-head p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.summary-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.metric {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--surface-soft);
}

.metric strong {
    font-size: 16px;
    line-height: 1.1;
}

.metric span {
    color: var(--text-secondary);
    font-size: 12px;
}

.timeline {
    position: relative;
    gap: 0;
    padding-left: 24px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 12px;
    bottom: 8px;
    width: 2px;
    background: var(--border-color);
}

.month-group {
    position: relative;
    margin-bottom: 20px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.month-header {
    align-items: center;
    margin-bottom: 10px;
    padding: 0;
    border: 0;
    cursor: default;
}

.month-header:hover {
    border-color: transparent;
}

.month-title {
    font-size: 17px;
    letter-spacing: 0;
}

.month-kicker {
    display: none;
}

.month-add-hint {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text-secondary);
    padding: 6px 10px;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
}

.month-add-hint:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

.release-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    overflow: visible;
    min-height: 0;
    margin-bottom: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--bg-secondary);
}

.release-card::before {
    left: -24px;
    top: 22px;
    bottom: auto;
    width: 12px;
    height: 12px;
    border: 3px solid var(--bg-primary);
    border-radius: 999px;
    background: var(--provider-color, var(--accent));
}

.release-card:hover {
    border-color: var(--provider-color, var(--accent));
}

.release-card:focus-visible {
    outline: 3px solid rgba(99, 102, 241, 0.36);
    outline-offset: 2px;
}

.release-date-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
    border-radius: 10px;
    background: var(--surface-soft);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.release-date-block strong {
    font-size: 18px;
    line-height: 1;
}

.release-date-block span {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.release-card-main {
    min-width: 0;
}

.release-header {
    display: block;
    align-items: start;
    margin-bottom: 0;
}

.release-title-block {
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.release-model {
    flex-basis: 100%;
    font-size: 17px;
    line-height: 1.3;
}

.release-provider-badge,
.provider-badge-large {
    border-radius: 999px;
}

.release-type {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.release-date-label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.release-description {
    margin-top: 7px;
    color: var(--text-secondary);
    font-size: 13px;
}

.release-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.provider-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--surface-soft);
}

.provider-preview-label,
.provider-preview-slug {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.provider-preview-badge {
    padding: 4px 10px 4px 5px;
}

@media (max-width: 900px) {
    .app-layout {
        display: block;
    }

    .provider-sidebar {
        position: static;
        margin-bottom: 16px;
    }

    .provider-sidebar .provider-filter {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .provider-sidebar .filter-label {
        display: none;
    }

    .provider-sidebar .filter-chip {
        width: auto;
        min-width: max-content;
        flex: 0 0 auto;
    }

    .content-head {
        display: block;
    }

    .summary-metrics {
        justify-content: flex-start;
        margin-top: 12px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 12px 12px calc(28px + env(safe-area-inset-bottom, 0px));
    }

    .header {
        gap: 12px;
        margin-bottom: 14px;
        padding: 12px 0;
    }

    .logo {
        font-size: 23px;
    }

    .logo-icon {
        font-size: 26px;
    }

    .subtitle {
        margin-left: 36px;
        font-size: 13px;
    }

    .header-right {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .theme-switch {
        width: 78px;
    }

    .theme-toggle {
        --width: 78px;
    }

    .admin-status {
        order: -1;
    }

    .summary-metrics {
        display: flex;
    }

    .metric {
        min-width: 0;
    }

    .provider-sidebar {
        margin-bottom: 14px;
        padding: 12px;
        border-radius: 14px;
    }

    .content-head {
        margin-bottom: 12px;
    }

    .content-head p {
        font-size: 13px;
    }

    .timeline {
        padding-left: 20px;
    }

    .timeline::before {
        left: 7px;
    }

    .month-group {
        margin-bottom: 16px;
    }

    .month-header {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        margin-bottom: 8px;
    }

    .month-title {
        font-size: 16px;
    }

    .month-summary {
        justify-content: flex-end;
    }

    .month-count {
        padding: 5px 9px;
    }

    .release-card {
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 10px;
        margin-bottom: 8px;
        padding: 10px 11px;
    }

    .release-card::before {
        left: -19px;
        top: 20px;
    }

    .release-date-block {
        min-width: 44px;
        min-height: 44px;
    }

    .release-model {
        font-size: 16px;
    }

    .release-description {
        display: -webkit-box;
        overflow: hidden;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
}
