/* =====================================================================
   Наш Уютный Планер — стили
   Темы: светлая (по умолчанию) и тёмная через <html data-theme="dark">
   Раскладка: телефон — шапка + нижняя панель, ПК (>=900px) — боковое меню
   ===================================================================== */

:root {
    --bg: #f3f4f8;
    --surface: #ffffff;
    --surface-2: #f5f6fa;
    --surface-3: #e9ebf2;
    --text: #141826;
    --text-2: #4b5263;
    --muted: #8a91a3;
    --border: #e3e6ee;
    --accent: #5b5bf0;
    --accent-hover: #4a48d8;
    --accent-soft: #ededfe;
    --accent-text: #4a48d8;
    --on-accent: #ffffff;
    --green: #0f9f6e;
    --green-soft: #e2f6ed;
    --red: #e5484d;
    --red-soft: #fdecec;
    --amber: #f5a524;
    --overlay: rgba(15, 18, 30, .45);
    --shadow-sm: 0 1px 2px rgba(20, 24, 38, .05), 0 1px 3px rgba(20, 24, 38, .04);
    --shadow-md: 0 4px 14px rgba(20, 24, 38, .08);
    --shadow-lg: 0 18px 50px rgba(20, 24, 38, .2);
    --grad: linear-gradient(135deg, #ec4899, #6366f1);
    --grad-ai: linear-gradient(135deg, #7c3aed, #4f46e5);
    --radius: 16px;
    --radius-sm: 11px;
    --safe-top: calc(max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px)) + var(--tg-content-safe-area-inset-top, 0px));
    --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #0e1016;
    --surface: #171a23;
    --surface-2: #1e222d;
    --surface-3: #272c3a;
    --text: #e9ebf2;
    --text-2: #b4bac8;
    --muted: #7f8798;
    --border: #282d3a;
    --accent: #7c7cf8;
    --accent-hover: #9090fa;
    --accent-soft: rgba(124, 124, 248, .16);
    --accent-text: #a5a5fb;
    --on-accent: #ffffff;
    --green: #34c38f;
    --green-soft: rgba(52, 195, 143, .15);
    --red: #f2666a;
    --red-soft: rgba(242, 102, 106, .15);
    --amber: #f7b955;
    --overlay: rgba(0, 0, 0, .6);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, .35);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, .6);
    color-scheme: dark;
}

/* ---------- база ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    transition: background-color .2s, color .2s;
}
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
.markdown-body, textarea, input { -webkit-user-select: text; user-select: text; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

/* ---------- каркас ---------- */
.app {
    height: 100vh;
    height: 100dvh;
    height: var(--tg-viewport-stable-height, 100dvh);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "top" "main" "nav";
}

.topbar {
    grid-area: top;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(10px + var(--safe-top)) 16px 10px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-logo {
    position: relative;
    width: 38px; height: 38px; flex: none;
    display: grid; place-items: center;
    border-radius: 12px;
    background: var(--grad);
    color: #fff; font-size: 16px;
    box-shadow: var(--shadow-md);
}
.brand-logo .fa-heart { position: absolute; top: -4px; right: -4px; font-size: 11px; color: #f9a8d4; }
.brand-name { font-size: 16px; font-weight: 700; line-height: 1.2; }
.brand-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-head { display: none; min-width: 0; }
.page-title { font-size: 20px; font-weight: 700; }
.page-sub { font-size: 12.5px; color: var(--muted); }

.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; transition: background-color .2s; }
.sync-dot.ok { background: var(--green); }
.sync-dot.syncing { background: var(--amber); animation: pulse 1s infinite; }
.sync-dot.error { background: var(--red); }
@keyframes pulse { 50% { opacity: .35; } }
.user-badge {
    display: inline-flex; align-items: center; gap: 6px;
    max-width: 130px; padding: 6px 11px;
    border-radius: 999px;
    background: var(--accent-soft); color: var(--accent-text);
    font-size: 12px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.content { grid-area: main; overflow-y: auto; overscroll-behavior: contain; padding: 16px; }
.content-inner { max-width: 1180px; margin: 0 auto; }
.tab-content { display: flex; flex-direction: column; gap: 16px; }
#tab-ai { max-width: 860px; margin: 0 auto; }

/* ---------- навигация: низ на телефоне, сбоку на ПК ---------- */
.nav {
    grid-area: nav;
    display: flex;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 6px 8px calc(6px + var(--safe-bottom));
}
.nav .brand, .nav-foot, .nav-spacer { display: none; }
.nav-list { display: flex; flex: 1; justify-content: space-around; gap: 4px; }
.nav-btn {
    flex: 1; max-width: 140px;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 7px 4px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 11px; font-weight: 600;
    transition: color .15s, background-color .15s;
}
.nav-btn i { font-size: 18px; }
.nav-btn.active { color: var(--accent-text); }
.nav-btn:active { background: var(--surface-2); }

/* ---------- кнопки ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 38px; padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13.5px; font-weight: 600; white-space: nowrap;
    transition: background-color .15s, transform .1s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-green { background: var(--green); color: #fff; }
.btn-soft { background: var(--accent-soft); color: var(--accent-text); }
.btn-ghost { background: var(--surface-3); color: var(--text-2); }
.btn-ghost:hover { color: var(--text); }
.btn-text { color: var(--text-2); }
.btn-text:hover { background: var(--surface-2); }
.btn-ai { background: var(--grad-ai); color: #fff; }
.btn-sm { min-height: 32px; padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.icon-btn {
    width: 34px; height: 34px; flex: none;
    display: inline-grid; place-items: center;
    border-radius: 10px;
    color: var(--muted); font-size: 13px;
    transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--accent-text); }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }
.icon-btn.framed { background: var(--surface-2); color: var(--text-2); font-size: 15px; }

/* ---------- сегменты ---------- */
.segmented { display: flex; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 14px; }
.seg-btn {
    flex: 1; min-height: 38px; padding: 6px 8px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border-radius: 10px;
    color: var(--text-2); font-size: 13px; font-weight: 500; white-space: nowrap;
    transition: background-color .15s, color .15s;
}
.seg-btn.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
.seg-count {
    min-width: 19px; padding: 1px 5px;
    border-radius: 999px;
    background: var(--accent-soft); color: var(--accent-text);
    font-size: 11px; font-weight: 700; line-height: 1.5;
}
.seg-count:empty { display: none; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.section-title { font-size: 16px; font-weight: 700; }
.section-sub { font-size: 12px; color: var(--muted); }
.section-actions { display: flex; align-items: center; gap: 8px; }
.view { display: flex; flex-direction: column; gap: 12px; }

/* ---------- карточки ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: border-color .15s, background-color .2s, opacity .2s;
}
.card-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-items: start; }

.task { display: flex; align-items: flex-start; gap: 12px; padding: 14px; }
.task.done { opacity: .62; box-shadow: none; }
.task-body { flex: 1; min-width: 0; }
.task-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.task-title { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; padding-top: 1px; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-actions { display: flex; margin: -6px -6px 0 0; flex: none; }
.task-details { margin-top: 4px; font-size: 13px; color: var(--text-2); white-space: pre-line; overflow-wrap: anywhere; }
.task-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 8px;
    background: var(--accent-soft); color: var(--accent-text);
    font-size: 11.5px; font-weight: 600;
}
.chip.neutral { background: var(--surface-2); color: var(--text-2); }
.chip.ok { background: var(--green-soft); color: var(--green); }

.progress { height: 4px; margin-top: 10px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress-bar { height: 100%; border-radius: 4px; background: var(--accent); transition: width .25s; }
.subitems { display: flex; flex-direction: column; margin-top: 6px; }
.subitem { display: flex; align-items: flex-start; gap: 10px; padding: 5px 0; font-size: 13.5px; color: var(--text-2); cursor: pointer; overflow-wrap: anywhere; }
.subitem .check { margin-top: 1px; }
.more-btn { align-self: flex-start; padding: 6px 0 0; }
.subitem input:checked + span { text-decoration: line-through; color: var(--muted); }

.check {
    appearance: none; -webkit-appearance: none;
    width: 22px; height: 22px; flex: none; margin: 0;
    border: 2px solid var(--muted); border-radius: 7px;
    background: transparent;
    display: inline-grid; place-items: center;
    cursor: pointer;
    transition: background-color .15s, border-color .15s;
}
.check.sm { width: 18px; height: 18px; border-radius: 6px; }
.check::after {
    content: ''; width: 5px; height: 9px;
    border: solid #fff; border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0); margin-top: -2px;
    transition: transform .12s;
}
.check.sm::after { width: 4px; height: 8px; }
.check:checked { background: var(--accent); border-color: var(--accent); }
.check:checked::after { transform: rotate(45deg) scale(1); }

.empty { grid-column: 1 / -1; padding: 40px 16px; text-align: center; color: var(--muted); font-size: 13.5px; }
.empty i { display: block; font-size: 30px; margin-bottom: 10px; opacity: .7; }
.empty .btn { margin-top: 12px; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* ---------- заметки ---------- */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.folder { padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 18px; }
.folder:hover, .note-row:hover { border-color: var(--accent); }
.folder-top { display: flex; align-items: flex-start; justify-content: space-between; }
.folder-top > i { font-size: 26px; color: var(--amber); }
.folder-actions { display: flex; margin: -6px -6px 0 0; }
.folder-name { font-size: 14.5px; font-weight: 700; overflow-wrap: anywhere; }
.folder-count { font-size: 12px; color: var(--muted); margin-top: 2px; }
.note-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 14px; cursor: pointer; }
.note-row > i { font-size: 18px; color: var(--accent); flex: none; }
.note-info { flex: 1; min-width: 0; }
.note-name { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-snippet { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 4px; border-radius: 9px; color: var(--accent-text); font-size: 13.5px; font-weight: 600; }
.head-left { display: flex; align-items: center; gap: 6px; min-width: 0; }

/* ---------- ИИ ---------- */
.ai-hero { position: relative; overflow: hidden; padding: 18px; border-radius: var(--radius); background: var(--grad-ai); color: #fff; box-shadow: var(--shadow-md); }
.ai-hero h2 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.ai-hero h2 i { color: #fcd34d; }
.ai-hero p { margin-top: 5px; font-size: 13px; color: rgba(255, 255, 255, .85); max-width: 560px; }
.ai-hero .bg-icon { position: absolute; right: -10px; bottom: -22px; font-size: 110px; opacity: .12; }
.prompt-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.prompt-chip {
    flex: none; padding: 9px 13px;
    border: 1px solid var(--border); border-radius: 12px;
    background: var(--surface); color: var(--text-2);
    font-size: 13px; white-space: nowrap;
    transition: border-color .15s, color .15s;
}
.prompt-chip:hover { border-color: var(--accent); color: var(--text); }
.ai-box { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ai-box textarea { width: 100%; min-height: 92px; border: 0; outline: 0; resize: none; background: transparent; font-size: 16px; }
.ai-box textarea::placeholder, .field::placeholder { color: var(--muted); }
.ai-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.ai-model { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-model i { color: var(--amber); }
.ai-answer { padding: 14px; }
.ai-answer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.ai-answer-title { font-size: 13px; font-weight: 700; color: var(--accent-text); display: flex; align-items: center; gap: 6px; }

/* ---------- markdown ---------- */
.markdown-body { font-size: 14.5px; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body h1 { font-size: 1.35em; font-weight: 700; margin: 0 0 .5em; }
.markdown-body h2 { font-size: 1.18em; font-weight: 700; margin: 1em 0 .4em; }
.markdown-body h3, .markdown-body h4 { font-size: 1.04em; font-weight: 700; margin: .9em 0 .3em; }
.markdown-body p { margin: 0 0 .6em; }
.markdown-body ul, .markdown-body ol { padding-left: 1.4em; margin: 0 0 .6em; }
.markdown-body li { margin-bottom: .2em; }
.markdown-body a { color: var(--accent-text); }
.markdown-body code { padding: 1px 5px; border-radius: 5px; background: var(--surface-2); font-size: .9em; }
.markdown-body pre { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); overflow-x: auto; }
.markdown-body pre code { padding: 0; background: none; }
.markdown-body blockquote { margin: 0 0 .6em; padding: 2px 12px; border-left: 3px solid var(--accent); color: var(--text-2); }
.markdown-body table { border-collapse: collapse; margin-bottom: .6em; display: block; overflow-x: auto; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: 5px 9px; }
.markdown-body hr { border: 0; border-top: 1px solid var(--border); margin: 1em 0; }

/* ---------- формы ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.label { display: block; margin-bottom: 5px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.label-row .label { margin: 0; }
.link-btn { color: var(--accent-text); font-size: 12.5px; font-weight: 600; padding: 4px 0; }
.field {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: 16px; outline: 0;
    transition: border-color .15s, background-color .15s;
}
.field:focus { border-color: var(--accent); background: var(--surface); }
textarea.field { resize: none; }
.field.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.55; }
.sub-list { display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow-y: auto; }
.sub-item-row { display: flex; align-items: center; gap: 8px; }
.sub-item-row .field { padding: 8px 10px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }

/* ---------- модальные окна: шторка снизу на телефоне, окно по центру на ПК ---------- */
.modal {
    position: fixed; inset: 0; z-index: 50;
    display: flex; align-items: flex-end; justify-content: center;
    background: var(--overlay);
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    animation: fade .15s;
}
.sheet {
    width: 100%; max-width: 480px; max-height: 92%;
    display: flex; flex-direction: column; gap: 14px;
    padding: 18px 16px calc(16px + var(--safe-bottom));
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    animation: slide-up .2s ease-out;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--border); flex: none; }
.sheet-title { font-size: 16.5px; font-weight: 700; }
.sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); flex: none; }
.sheet-note { max-width: 780px; height: 100%; max-height: 100%; border-radius: 0; padding-top: calc(14px + var(--safe-top)); overflow: hidden; }
.note-title-input { flex: 1; min-width: 0; border: 0; border-bottom: 1px solid transparent; outline: 0; background: transparent; font-size: 16px; font-weight: 700; padding: 4px 0; }
.note-title-input:focus { border-bottom-color: var(--accent); }
.note-title-input:disabled { color: var(--text); -webkit-text-fill-color: var(--text); opacity: 1; }
.note-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.note-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.note-body textarea { flex: 1; min-height: 240px; }
.note-folder-tag { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide-up { from { transform: translateY(24px); opacity: 0; } }

.toast {
    position: fixed; left: 50%; bottom: calc(84px + var(--safe-bottom)); z-index: 60;
    transform: translateX(-50%);
    max-width: calc(100% - 32px); padding: 10px 16px;
    border-radius: 12px;
    background: var(--text); color: var(--bg);
    font-size: 13px; font-weight: 500; text-align: center;
    box-shadow: var(--shadow-lg);
    transition: opacity .25s; pointer-events: none;
}
.auth-error { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 32px; text-align: center; font-size: 19px; font-weight: 700; }
.auth-error span { font-size: 14px; font-weight: 400; color: var(--muted); max-width: 340px; }

/* ---------- планшет ---------- */
@media (min-width: 620px) {
    .content { padding: 20px 24px; }
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .folder-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
    .segmented { max-width: 520px; }
    .modal { align-items: center; padding: 20px; }
    .sheet { border-radius: 20px; padding: 20px; max-height: 100%; animation-name: pop; }
    .sheet-note { height: min(100%, 820px); border-radius: 20px; }
    .sheet-folder { max-width: 400px; }
    .field { font-size: 14.5px; }
    .ai-box textarea { font-size: 15px; }
    @keyframes pop { from { transform: scale(.97); opacity: 0; } }
}

/* ---------- ПК ---------- */
@media (min-width: 900px) {
    .app {
        grid-template-columns: 250px minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        grid-template-areas: "nav top" "nav main";
    }
    .topbar { padding: 16px 32px; background: transparent; border-bottom: 0; }
    .topbar .brand { display: none; }
    .page-head { display: block; }
    .content { padding: 8px 32px 32px; }
    .nav {
        flex-direction: column; gap: 22px;
        padding: 20px 14px;
        border-top: 0; border-right: 1px solid var(--border);
    }
    .nav .brand { display: flex; padding: 0 6px; }
    .nav-list { flex: none; flex-direction: column; justify-content: flex-start; gap: 4px; }
    .nav-btn { flex: none; max-width: none; flex-direction: row; gap: 12px; padding: 11px 12px; font-size: 14px; }
    .nav-btn i { width: 20px; text-align: center; font-size: 16px; }
    .nav-btn:hover { background: var(--surface-2); color: var(--text); }
    .nav-btn.active { background: var(--accent-soft); color: var(--accent-text); }
    .nav-spacer { display: block; flex: 1; }
    .nav-foot { display: flex; align-items: center; gap: 9px; padding: 12px 8px 0; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
    .task-actions, .folder-actions { opacity: .45; transition: opacity .15s; }
    .card:hover .task-actions, .card:hover .folder-actions { opacity: 1; }
    .toast { bottom: 28px; }
    .sub-list { max-height: 240px; }
}
@media (min-width: 1280px) {
    .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
