:root {
    --bg: #080c13;
    --panel: #101722;
    --panel-2: #151d2a;
    --panel-3: #0d131d;
    --text: #f7f9fc;
    --muted: #8d9ab2;
    --soft: #c5cede;
    --line: #242c3a;
    --line-soft: #1b2230;
    --success: #32d173;
    --success-2: #1fb95f;
    --danger: #ff3f5f;
    --warning: #f2b84b;
    --purple: #8d67ff;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.30);
    --radius: 12px;
    --cell: 34px;
    --cell-gap: 4px;
    --habit-col: 220px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at 15% -10%, rgba(50, 209, 115, 0.08), transparent 28%),
        radial-gradient(circle at 95% 12%, rgba(141, 103, 255, 0.10), transparent 26%),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
}

body.modal-lock {
    overflow: hidden;
}

a {
    color: var(--soft);
    text-decoration: none;
    transition: color 220ms ease, background 220ms ease, border-color 220ms ease, transform 220ms ease, box-shadow 220ms ease, opacity 220ms ease;
}

a:hover {
    color: var(--text);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: 32px;
    line-height: 1.1;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 16px;
    font-size: 15px;
    letter-spacing: 0;
}

h3 {
    margin-bottom: 4px;
    font-size: 14px;
}

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

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 12px;
    background: #0c111a;
    color: var(--text);
}

input[type="color"] {
    min-height: 43px;
    padding: 5px;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(50, 209, 115, 0.22);
    outline-offset: 2px;
}

textarea {
    resize: vertical;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 15%, rgba(50, 209, 115, 0.12), transparent 32%),
        radial-gradient(circle at 80% 20%, rgba(141, 103, 255, 0.12), transparent 30%),
        var(--bg);
}

.auth-card,
.panel,
.module-card,
.empty-state,
.board-card,
.analytics-card,
.stat-card {
    background: linear-gradient(180deg, rgba(21, 29, 42, 0.98), rgba(13, 19, 29, 0.98));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.auth-card {
    width: min(100%, 430px);
    padding: 28px;
}

.topbar {
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 30px;
    background: #0d121b;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
    color: var(--text);
    font-size: 18px;
    font-weight: 800;
}

.brand::before {
    content: "";
    width: 22px;
    height: 16px;
    border: 2px solid var(--success);
    border-radius: 5px;
    box-shadow: inset 0 -5px 0 rgba(50, 209, 115, 0.12);
}

.nav,
.account {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav {
    flex: 1;
}

.nav a {
    border-radius: 10px;
    padding: 8px 10px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.nav a:hover {
    background: #151c28;
    color: var(--text);
}

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

.page {
    width: 100%;
    max-width: 1700px;
    margin: 0 auto;
    padding: 26px 30px 56px;
}

.tracker-page {
    animation: page-in 260ms ease both;
}

.tracker-page.is-month-leaving {
    animation: page-out 180ms ease both;
}

.hero-strip {
    display: grid;
    gap: 8px;
    padding: 18px 0 28px;
}

.eyebrow {
    margin-bottom: 4px;
    color: var(--success);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

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

.small {
    font-size: 13px;
}

.form {
    display: grid;
    gap: 14px;
}

.form label,
.log-form label {
    display: grid;
    gap: 7px;
    color: var(--soft);
    font-size: 13px;
    font-weight: 700;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid var(--success);
    border-radius: 10px;
    padding: 0 16px;
    background: var(--success);
    color: #06100b;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    transition: background 220ms ease, border-color 220ms ease, color 220ms ease, transform 220ms cubic-bezier(.2,.9,.25,1.12), box-shadow 220ms ease;
}

.button:hover {
    background: #49e586;
    border-color: #49e586;
    color: #06100b;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(50, 209, 115, 0.16);
}

.button:active {
    transform: translateY(0) scale(0.98);
}

.button-small {
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
}

.button-light,
.button-ghost {
    background: #121925;
    border-color: var(--line);
    color: var(--soft);
}

.button-light:hover,
.button-ghost:hover {
    background: #1a2230;
    border-color: #334056;
    color: var(--text);
}

.notice {
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
}

.notice-success {
    background: rgba(50, 209, 115, 0.12);
    color: #8af5b4;
}

.notice-error {
    background: rgba(255, 63, 95, 0.12);
    color: #ff98aa;
}

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

.module-card {
    min-height: 190px;
    display: grid;
    align-content: start;
    gap: 12px;
    padding: 24px;
    color: var(--text);
}

.module-card:hover {
    border-color: #3c4a61;
    text-decoration: none;
    transform: translateY(-2px);
}

.module-icon,
.habit-icon {
    width: max-content;
    min-width: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    padding: 4px 7px;
    background: #182131;
    color: var(--soft);
    font-size: 12px;
    font-weight: 900;
}

.tracker-topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
    margin-bottom: 26px;
}

.tracker-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-size: 18px;
    font-weight: 850;
}

.month-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-self: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px;
    background: rgba(16, 23, 34, 0.75);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.month-nav a {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--muted);
    font-size: 24px;
}

.month-nav a:hover {
    background: #121925;
    border-color: var(--line);
    transform: scale(1.04);
}

.month-label {
    min-width: 132px;
    text-align: center;
    color: var(--soft);
    font-size: 14px;
    font-weight: 850;
}

.tracker-topbar .button {
    justify-self: end;
}

.tracker-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
}

.tracker-main {
    min-width: 0;
    display: grid;
    gap: 18px;
}

.analytics-sidebar {
    width: 320px;
    display: grid;
    gap: 24px;
    position: sticky;
    top: 96px;
}

.board-card {
    overflow: hidden;
    min-height: 520px;
}

.board-heading {
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 22px;
    border-bottom: 1px solid var(--line);
}

.board-heading h2,
.analytics-card h2 {
    margin: 0;
    color: var(--text);
    font-size: 15px;
}

.board-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.board-tools span {
    width: 14px;
    height: 14px;
    display: block;
    border: 1px solid #536176;
    border-radius: 4px;
    opacity: 0.7;
}

.board-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-color: #4a5669 #111722;
    scrollbar-width: thin;
    scroll-behavior: smooth;
}

.board-scroll::-webkit-scrollbar {
    height: 12px;
}

.board-scroll::-webkit-scrollbar-track {
    background: #111722;
}

.board-scroll::-webkit-scrollbar-thumb {
    border: 3px solid #111722;
    border-radius: 999px;
    background: #4a5669;
}

.habit-grid {
    min-width: max-content;
}

.habit-grid.days-28 {
    --day-count: 28;
}

.habit-grid.days-29 {
    --day-count: 29;
}

.habit-grid.days-30 {
    --day-count: 30;
}

.habit-grid.days-31 {
    --day-count: 31;
}

.grid-row {
    display: grid;
    grid-template-columns: var(--habit-col) repeat(var(--day-count), 1fr);
}

.grid-row {
    gap: 6px;
}

.grid-header {
    position: sticky;
    top: 0;
    z-index: 2;
    min-height: 66px;
    background: rgba(16, 23, 34, 0.98);
    border-bottom: 1px solid var(--line-soft);
}

.grid-header .habit-col {
    align-self: end;
    padding-bottom: 12px;
    color: var(--muted);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 14px;
}

.day-head {
    display: grid;
    justify-items: center;
    gap: 3px;
    align-self: end;
    padding-bottom: 8px;
    color: #71809a;
    font-size: 12px;
    font-weight: 800;
}

.day-head strong {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #7f8da7;
    font-size: 13px;
}

.day-head.is-today {
    color: var(--success);
}

.day-head.is-today strong {
    background: var(--success);
    color: #06100b;
}

.habit-row {
    border-bottom: 1px solid rgba(36, 44, 58, 0.42);
}

.habit-row:hover {
    background: rgba(255, 255, 255, 0.025);
}

.habit-row.is-streak-broken {
    background: linear-gradient(90deg, rgba(255, 63, 95, 0.07), transparent 42%);
}

.habit-name {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 10px;
    color: var(--text);
    font-size: 14px;
    font-weight: 780;
}

.habit-name span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.streak-badge {
    flex: 0 0 auto;
    border: 1px solid rgba(242, 184, 75, 0.26);
    border-radius: 999px;
    padding: 2px 7px;
    background: rgba(242, 184, 75, 0.10);
    color: #ffd88a;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.35;
    box-shadow: 0 0 16px rgba(242, 184, 75, 0.08);
}

.streak-badge.is-broken {
    border-color: rgba(255, 63, 95, 0.28);
    background: rgba(255, 63, 95, 0.10);
    color: #ff9aac;
    box-shadow: none;
}

.streak-badge.is-pulsing {
    animation: streak-pop 520ms cubic-bezier(.2,.9,.25,1.15);
}

.habit-cell {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
}

.habit-cell {
    max-width: 38px;
    margin: auto;
}

.habit-check {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    border: 1px solid #253044;
    border-radius: 9px;
    background: linear-gradient(180deg, #111925, #0c121b);
    color: transparent;
    cursor: default;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: transform 240ms cubic-bezier(.2,.9,.25,1.16), border-color 240ms ease, background 240ms ease, box-shadow 240ms ease, color 240ms ease;
}

.habit-check.is-done {
    border-color: rgba(50, 209, 115, 0.70);
    background: linear-gradient(180deg, rgba(50, 209, 115, 0.26), rgba(31, 185, 95, 0.16));
    color: #9ff7bf;
    box-shadow: 0 0 0 1px rgba(50, 209, 115, 0.10), 0 0 18px rgba(50, 209, 115, 0.16), 0 8px 18px rgba(50, 209, 115, 0.10);
}

.habit-check.is-missed {
    border-color: rgba(255, 63, 95, 0.22);
    background: rgba(255, 63, 95, 0.05);
}

.habit-check.is-today {
    cursor: pointer;
}

.habit-check.is-today:hover {
    border-color: var(--success);
    transform: translateY(-1px) scale(1.08);
    box-shadow: 0 0 0 4px rgba(50, 209, 115, 0.08);
}

.habit-check.is-today:active {
    transform: scale(0.92);
}

.habit-check.is-toggling {
    animation: checkbox-pop 420ms cubic-bezier(.2,.9,.25,1.25), checkbox-glow 620ms ease-out;
}

.habit-check:disabled {
    cursor: wait;
    opacity: 0.82;
}

.cell-form {
    margin: 0;
}

.cell-form button {
    border: 1px solid #253044;
}

.empty-state {
    margin: 22px;
    padding: 28px;
    display: grid;
    justify-items: start;
    gap: 10px;
    background:
        radial-gradient(circle at 15% 0%, rgba(50, 209, 115, 0.14), transparent 38%),
        linear-gradient(180deg, rgba(21, 29, 42, 0.98), rgba(13, 19, 29, 0.98));
}

.habit-form-panel {
    padding: 22px;
}

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

.analytics-card {
    padding: 20px;
    transition: transform 240ms ease, border-color 240ms ease, background 240ms ease, box-shadow 240ms ease;
}

.analytics-card:hover,
.stat-card:hover {
    border-color: #344158;
    transform: translateY(-1px);
    box-shadow: 0 26px 78px rgba(0, 0, 0, 0.36);
}

.chart-card {
    padding: 22px;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 0%, rgba(34, 197, 94, 0.10), transparent 34%),
        linear-gradient(180deg, rgba(21, 29, 42, 0.99), rgba(13, 19, 29, 0.99));
}

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

.chart-head h2 {
    margin-bottom: 4px;
}

.chart-labels {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.chart-pill {
    flex: 0 0 auto;
    border: 1px solid rgba(124, 234, 168, 0.22);
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(50, 209, 115, 0.08);
    color: #9ff7bf;
    font-size: 12px;
    font-weight: 850;
}

.chart-pill-hot {
    border-color: rgba(242, 184, 75, 0.26);
    background: rgba(242, 184, 75, 0.10);
    color: #ffd88a;
}

.chart-shell {
    height: 280px;
    min-height: 280px;
    position: relative;
}

.chart-shell canvas {
    width: 100% !important;
    height: 100% !important;
}

.level-card {
    display: grid;
    gap: 14px;
}

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

.level-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 850;
}

.level-xp {
    color: var(--purple);
    font-size: 12px;
    font-weight: 850;
}

.progress-track {
    width: 100%;
    height: 10px;
    appearance: none;
    -webkit-appearance: none;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    background: #1b2230;
}

.progress-track::-webkit-progress-bar {
    border-radius: 999px;
    background: #1b2230;
}

.progress-track::-webkit-progress-value {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--success), #7ceaa8);
    transition: width 320ms ease;
}

.progress-track::-moz-progress-bar {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--success), #7ceaa8);
}

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

.stat-card {
    display: grid;
    justify-items: center;
    gap: 4px;
    padding: 16px 10px;
    box-shadow: none;
    transition: transform 180ms ease, border-color 180ms ease;
}

.stat-card strong {
    font-size: 25px;
    line-height: 1;
}

.stat-card span {
    color: var(--muted);
    font-size: 12px;
}

.analysis-list {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.analysis-item {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 12px;
}

.analysis-item:hover .habit-icon {
    border-color: rgba(50, 209, 115, 0.35);
    color: var(--text);
}

.analysis-item strong {
    display: block;
    margin-bottom: 7px;
    color: var(--text);
    font-size: 14px;
}

.analysis-meta {
    display: grid;
    gap: 5px;
}

.analysis-count {
    color: var(--muted);
    font-size: 12px;
}

.analysis-percent {
    color: var(--danger);
    font-size: 13px;
    font-weight: 850;
}

.analysis-percent.is-good {
    color: var(--success);
}

.card-actions,
.archived-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.xp-popup {
    position: absolute;
    z-index: 999;
    pointer-events: none;
    transform: translate(-50%, 8px) scale(0.90);
    opacity: 0;
    border: 1px solid rgba(34, 197, 94, 0.48);
    border-radius: 999px;
    padding: 5px 10px;
    background: rgba(14, 20, 30, 0.96);
    color: #bbf7d0;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35), 0 0 28px rgba(34, 197, 94, 0.20);
    font-size: 12px;
    font-weight: 900;
    transition: opacity 220ms ease-out, transform 620ms cubic-bezier(.16,1,.3,1);
}

.xp-popup.is-visible {
    transform: translate(-50%, -20px) scale(1);
    opacity: 1;
}

.xp-popup.is-leaving {
    transform: translate(-50%, -48px) scale(0.96);
    opacity: 0;
}

.celebration-toast {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 120;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.90);
    opacity: 0;
    border: 1px solid rgba(50, 209, 115, 0.35);
    border-radius: 18px;
    padding: 18px 24px;
    background:
        radial-gradient(circle at 50% 0%, rgba(50, 209, 115, 0.22), transparent 58%),
        rgba(13, 19, 29, 0.94);
    color: #f7f9fc;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.46), 0 0 46px rgba(50, 209, 115, 0.16);
    font-size: 24px;
    font-weight: 950;
    letter-spacing: 0;
    transition: opacity 220ms ease, transform 320ms cubic-bezier(.2,.9,.25,1.18);
}

.celebration-toast.is-visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    animation: celebration-pop 720ms ease both;
}

.level-toast {
    border-color: rgba(141, 103, 255, 0.40);
    background:
        radial-gradient(circle at 50% 0%, rgba(141, 103, 255, 0.24), transparent 58%),
        rgba(13, 19, 29, 0.94);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.46), 0 0 46px rgba(141, 103, 255, 0.18);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(3, 6, 11, 0.72);
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 230ms ease;
}

.modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.modal-overlay.is-closing {
    opacity: 0;
    pointer-events: none;
}

.habit-modal {
    width: min(100%, 480px);
    position: relative;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 0%, rgba(50, 209, 115, 0.13), transparent 34%),
        linear-gradient(180deg, rgba(21, 29, 42, 0.98), rgba(13, 19, 29, 0.98));
    box-shadow: 0 34px 100px rgba(0, 0, 0, 0.55);
    transform: translateY(12px) scale(0.95);
    opacity: 0;
    transition: transform 260ms cubic-bezier(.2,.9,.25,1.12), opacity 230ms ease;
}

.modal-overlay.is-open .habit-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-overlay.is-closing .habit-modal {
    transform: translateY(10px) scale(0.95);
    opacity: 0;
}

.modal-close {
    width: 34px;
    height: 34px;
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #111925;
    color: var(--muted);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    transition: color 220ms ease, border-color 220ms ease, background 220ms ease, transform 220ms ease;
}

.modal-close:hover {
    border-color: #3a465c;
    background: #182131;
    color: var(--text);
    transform: rotate(4deg);
}

.modal-heading {
    padding-right: 44px;
    margin-bottom: 20px;
}

.modal-heading h2 {
    margin-bottom: 6px;
    font-size: 24px;
}

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

.emoji-choice {
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #101720;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    transition: transform 220ms cubic-bezier(.2,.9,.25,1.15), border-color 220ms ease, background 220ms ease, box-shadow 220ms ease, filter 220ms ease;
}

.emoji-choice:hover {
    border-color: rgba(124, 234, 168, 0.42);
    background: #151f2e;
    filter: brightness(1.12);
    transform: translateY(-2px) scale(1.05);
}

.emoji-choice.is-selected {
    border-color: rgba(50, 209, 115, 0.78);
    background: rgba(50, 209, 115, 0.14);
    box-shadow: 0 0 0 4px rgba(50, 209, 115, 0.08);
}

.modal-form.is-submitting {
    opacity: 0.78;
    pointer-events: none;
}

.modal-form .button {
    width: 100%;
    margin-top: 4px;
}

@keyframes checkbox-pop {
    0% {
        transform: scale(0.90);
    }

    48% {
        transform: scale(1.10);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes checkbox-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    }

    70% {
        box-shadow: 0 0 0 9px rgba(34, 197, 94, 0), 0 0 22px rgba(34, 197, 94, 0.18);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

@keyframes celebration-pop {
    0% {
        transform: translate(-50%, -50%) scale(0.90);
    }

    42% {
        transform: translate(-50%, -50%) scale(1.06);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes streak-pop {
    0% {
        transform: scale(0.92);
    }

    50% {
        transform: scale(1.12);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes page-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes page-out {
    to {
        opacity: 0;
        transform: translateY(6px);
    }
}

.card-actions {
    flex-wrap: wrap;
    padding-top: 4px;
}

.link-button {
    border: 0;
    background: transparent;
    color: var(--soft);
    cursor: pointer;
    padding: 0;
    font-weight: 750;
}

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

.danger {
    color: #ff8da0;
}

.archived-panel {
    padding: 22px;
}

.archived-list {
    display: grid;
    gap: 10px;
}

.archived-item {
    justify-content: space-between;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

@media (max-width: 1080px) {
    .tracker-layout {
        grid-template-columns: 1fr;
    }

    .analytics-sidebar {
        width: 100%;
        position: static;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .emoji-picker {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .habit-modal {
        padding: 20px;
    }

    .chart-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 760px) {
    .topbar {
        min-height: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 16px;
    }

    .brand {
        min-width: 0;
    }

    .nav,
    .account {
        flex-wrap: wrap;
    }

    .page {
        padding: 18px 14px 40px;
    }

    .tracker-topbar {
        grid-template-columns: 1fr;
    }

    .month-nav,
    .tracker-topbar .button {
        justify-self: stretch;
    }

    .month-nav {
        justify-content: space-between;
    }

    .module-grid,
    .form-row,
    .stats-strip {
        grid-template-columns: 1fr;
    }

    .grid-row {
        padding-left: 12px;
    }

    :root {
        --habit-col: 200px;
        --cell: 27px;
        --cell-gap: 7px;
    }

    .auth-card {
        padding: 22px;
    }
}

.habit-edit-btn {
    border: 1px solid var(--line);
    background: #111925;
    color: var(--muted);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    padding: 4px 6px;
    transition: all 0.2s ease;
}

.habit-edit-btn:hover {
    color: var(--text);
    border-color: var(--success);
    transform: scale(1.1);
}

.habit-edit-col {
    display: flex;
    justify-content: center;
}

.habit-edit-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #111925;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.habit-edit-btn:hover {
    border-color: var(--success);
    color: var(--success);
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(50,209,115,0.3);
}

.habit-name {
    position: relative;
    padding-left: 34px;
}

.habit-edit-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);

    width: 24px;
    height: 24px;

    border-radius: 6px;
    border: 1px solid var(--line);
    background: #0f1722;
    color: var(--muted);

    font-size: 12px;
    cursor: pointer;

    opacity: 0;
    transition: all 0.2s ease;
}

.habit-row:hover .habit-edit-btn {
    opacity: 1;
}

.habit-edit-btn:hover {
    color: var(--success);
    border-color: var(--success);
    transform: translateY(-50%) scale(1.1);
}

