@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Space+Grotesk:wght@400;500;700&display=swap");

:root {
    --bg: #0b0a14;
    --bg-soft: #151224;
    --panel: rgba(22, 18, 38, 0.88);
    --panel-strong: rgba(32, 25, 54, 0.96);
    --panel-glow: rgba(126, 87, 255, 0.18);
    --line: rgba(197, 180, 255, 0.16);
    --line-strong: rgba(197, 180, 255, 0.28);
    --text: #f5f0ff;
    --text-soft: #baafd9;
    --text-faint: #8f86b0;
    --violet: #9a7cff;
    --magenta: #ff71d0;
    --blue: #68b6ff;
    --cyan: #7de7ff;
    --success: #7ef1be;
    --danger: #ff8cab;
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
    --shell-width: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(154, 124, 255, 0.2), transparent 28%),
        radial-gradient(circle at top right, rgba(104, 182, 255, 0.12), transparent 26%),
        radial-gradient(circle at bottom, rgba(255, 113, 208, 0.18), transparent 26%),
        radial-gradient(circle at 38% 78%, rgba(151, 23, 62, 0.16), transparent 18%),
        linear-gradient(180deg, #090811 0%, #0c0a16 45%, #090811 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

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

.app-page {
    min-height: 100vh;
    padding: 18px 14px 108px;
}

.shell {
    width: min(100%, var(--shell-width));
    margin: 0 auto;
}

.shell-header {
    position: sticky;
    top: 0;
    z-index: 40;
    display: grid;
    gap: 14px;
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(10, 9, 20, 0.86);
    backdrop-filter: blur(18px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

.brand-row,
.header-actions,
.shell-utility {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(154, 124, 255, 0.28), rgba(104, 182, 255, 0.18));
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 700;
    letter-spacing: 0.08em;
}

.brand-copy {
    min-width: 0;
}

.brand-name {
    display: block;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.brand-sub {
    margin: 2px 0 0;
    color: var(--text-faint);
    font-size: 0.88rem;
}

.header-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-soft);
}

.header-link--strong {
    background: linear-gradient(135deg, rgba(154, 124, 255, 0.22), rgba(104, 182, 255, 0.18));
    color: var(--text);
    border-color: rgba(154, 124, 255, 0.35);
}

.tool-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.tool-strip::-webkit-scrollbar {
    display: none;
}

.tool-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-soft);
    white-space: nowrap;
}

.tool-pill.is-active {
    color: var(--text);
    background: linear-gradient(135deg, rgba(154, 124, 255, 0.24), rgba(255, 113, 208, 0.16));
    border-color: rgba(154, 124, 255, 0.36);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.tool-pill__meta {
    color: var(--text-faint);
    font-size: 0.77rem;
}

.shell-main {
    display: grid;
    gap: 18px;
}

.shell-main--wide {
    max-width: none;
}

.page-hero,
.panel,
.stats-card,
.quick-link,
.auth-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(26, 21, 44, 0.94), rgba(14, 12, 24, 0.96));
    box-shadow: var(--shadow);
}

.page-hero,
.auth-card {
    position: relative;
    overflow: hidden;
}

.page-hero {
    padding: 24px 20px;
}

.page-hero::before,
.auth-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(154, 124, 255, 0.18), transparent 26%),
        radial-gradient(circle at left, rgba(104, 182, 255, 0.12), transparent 24%);
    pointer-events: none;
}

.page-hero > *,
.auth-card > * {
    position: relative;
    z-index: 1;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(154, 124, 255, 0.12);
    color: #d9cdff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-title,
.auth-card h1 {
    margin: 0 0 12px;
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(2rem, 7vw, 3.4rem);
    line-height: 0.98;
    letter-spacing: -0.03em;
}

.page-intro,
.auth-lede,
.panel p,
.quick-link__meta,
.stat-label,
.auth-hint {
    color: var(--text-soft);
    line-height: 1.6;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
}

.meta-chip strong {
    color: var(--text);
}

.panel-grid,
.stats-grid,
.quick-links {
    display: grid;
    gap: 14px;
}

.panel,
.stats-card,
.quick-link {
    padding: 18px 16px;
}

.panel h2,
.stats-card h2 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

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

.stats-card__value {
    margin: 0 0 8px;
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(1.6rem, 6vw, 2.3rem);
    line-height: 1;
}

.stat-label {
    margin: 0;
    font-size: 0.92rem;
}

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

.quick-link__title {
    margin: 0 0 4px;
    font-weight: 700;
}

.quick-link__meta {
    margin: 0;
    font-size: 0.88rem;
}

.quick-link__arrow {
    color: var(--text-faint);
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(11, 10, 20, 0), rgba(11, 10, 20, 0.94) 30%);
}

.bottom-nav__inner {
    width: min(100%, 640px);
    margin: 0 auto;
    display: flex;
    align-items: stretch;
    gap: 8px;
    padding: 8px;
    border-radius: 22px;
    border: 1px solid var(--line-strong);
    background: rgba(14, 12, 24, 0.92);
    backdrop-filter: blur(18px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.34);
    overflow-x: auto;
    scrollbar-width: none;
}

.bottom-nav__inner::-webkit-scrollbar {
    display: none;
}

.bottom-nav__item {
    min-height: 58px;
    min-width: 86px;
    flex: 1 0 86px;
    display: grid;
    place-items: center;
    padding: 8px 4px;
    border-radius: 16px;
    color: var(--text-faint);
    font-size: 0.76rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.bottom-nav__item strong {
    font-size: 0.82rem;
    color: currentColor;
    position: relative;
    z-index: 1;
}

.bottom-nav__item.is-active {
    color: var(--text);
    background: linear-gradient(135deg, rgba(154, 124, 255, 0.24), rgba(104, 182, 255, 0.18));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 22px rgba(118, 58, 255, 0.18);
}

.bottom-nav__item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(125deg, transparent 34%, rgba(255, 255, 255, 0.24) 48%, transparent 62%);
    opacity: 0;
    transform: translateX(-140%);
}

.bottom-nav__item.is-active::before {
    opacity: 0.8;
    animation: navShine 5.4s ease-in-out infinite;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
}

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

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(154, 124, 255, 0.14);
    color: #dacfff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.auth-form label {
    font-size: 0.95rem;
    font-weight: 700;
}

.auth-form input {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.auth-form input:focus {
    outline: none;
    border-color: rgba(154, 124, 255, 0.5);
    box-shadow: 0 0 0 4px rgba(154, 124, 255, 0.12);
}

.auth-submit {
    min-height: 52px;
    border: 0;
    border-radius: 16px;
    color: var(--text);
    font-weight: 700;
    background: linear-gradient(135deg, #835eff, #4c87ff 64%, #6bcdfc);
}

.auth-submit:disabled {
    opacity: 0.45;
}

.auth-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-soft);
    font-weight: 400;
}

.auth-toggle input {
    width: auto;
    min-height: 0;
    padding: 0;
}

.auth-alert,
.auth-hint {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.auth-alert {
    color: #ffd0dc;
    border-color: rgba(255, 140, 171, 0.35);
    background: rgba(255, 140, 171, 0.1);
}

.auth-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 20px;
    color: var(--text-soft);
}

.password-rules__title {
    margin: 0 0 10px;
    font-weight: 700;
    color: var(--text);
}

.password-rules ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.password-rule {
    display: flex;
    gap: 10px;
    align-items: center;
    color: var(--text-faint);
}

.password-rule.is-valid {
    color: var(--success);
}

.password-rule__icon {
    width: 20px;
    text-align: center;
}

.budget-grid {
    display: grid;
    gap: 14px;
}

.app-page--shopping {
    padding: 8px 8px 126px;
}

.app-page--shopping .shell {
    width: min(100%, 620px);
}

.app-page--shopping .shell-main {
    gap: 8px;
}

.shopping-shell {
    display: grid;
    gap: 8px;
}

.shopping-hero,
.shopping-panel,
.shopping-tabs,
.shopping-flash {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 188, 228, 0.18);
    border-radius: 20px;
    background:
        radial-gradient(circle at 88% 12%, rgba(255, 76, 143, 0.24), transparent 24%),
        radial-gradient(circle at 12% 20%, rgba(149, 124, 255, 0.22), transparent 22%),
        linear-gradient(180deg, rgba(18, 12, 27, 0.98), rgba(8, 7, 17, 1));
    box-shadow: var(--shadow), 0 0 30px rgba(255, 66, 139, 0.1);
}

.shopping-hero,
.shopping-panel,
.shopping-flash {
    padding: 10px;
}

.shopping-hero::before,
.shopping-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 18% 82%, rgba(255, 214, 238, 0.11), transparent 14%),
        linear-gradient(125deg, transparent 24%, rgba(255, 255, 255, 0.045) 44%, transparent 64%);
    animation: shoppingAura 7s ease-in-out infinite;
}

.shopping-hero > *,
.shopping-panel > *,
.shopping-tabs > *,
.shopping-flash {
    position: relative;
    z-index: 1;
}

.shopping-hero {
    display: grid;
    gap: 10px;
}

.shopping-kicker,
.shopping-panel__eyebrow {
    margin: 0 0 6px;
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    color: #ffd5ec;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.shopping-hero h1,
.shopping-panel h2 {
    margin: 0;
    font-family: "Fraunces", Georgia, serif;
    line-height: 0.94;
    text-shadow: 0 0 20px rgba(255, 90, 171, 0.24);
}

.shopping-hero h1 {
    font-size: clamp(1.75rem, 8vw, 2.45rem);
}

.shopping-panel h2 {
    font-size: 1.25rem;
}

.shopping-lede,
.shopping-empty {
    margin: 6px 0 0;
    color: var(--text-soft);
    line-height: 1.45;
}

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

.shopping-stats span {
    min-height: 54px;
    display: grid;
    place-items: center;
    padding: 7px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.055);
    color: var(--text-faint);
    font-size: 0.72rem;
}

.shopping-stats strong {
    display: block;
    color: var(--text);
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.25rem;
    line-height: 1;
}

.shopping-tabs {
    display: flex;
    gap: 6px;
    padding: 7px;
    background:
        linear-gradient(135deg, rgba(24, 13, 34, 0.98), rgba(10, 8, 19, 0.98));
}

.shopping-tab {
    flex: 1;
    min-height: 44px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: var(--text-faint);
    font-weight: 800;
    text-align: center;
}

.shopping-tab.is-active {
    color: var(--text);
    background: linear-gradient(135deg, rgba(255, 66, 139, 0.32), rgba(138, 111, 255, 0.28));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 24px rgba(255, 51, 136, 0.12);
}

.shopping-flash {
    min-height: 40px;
    display: flex;
    align-items: center;
    color: #ffd8ec;
    font-weight: 800;
    background:
        radial-gradient(circle at 12% 50%, rgba(255, 255, 255, 0.12), transparent 16%),
        linear-gradient(135deg, rgba(105, 31, 78, 0.78), rgba(80, 56, 143, 0.68));
}

.shopping-flash--error {
    border-color: rgba(255, 113, 113, 0.42);
    background: linear-gradient(135deg, rgba(112, 24, 45, 0.86), rgba(71, 25, 52, 0.78));
}

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

.shopping-store-form {
    min-width: 140px;
}

.shopping-store-form label,
.shopping-add-form label {
    display: grid;
    gap: 5px;
    color: var(--text-faint);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.shopping-store-form select,
.shopping-add-form input {
    width: 100%;
    min-height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(232, 209, 255, 0.18);
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
    font: inherit;
}

.shopping-store-form select {
    padding: 0 10px;
}

.shopping-sync-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.shopping-sync-bar::-webkit-scrollbar {
    display: none;
}

.shopping-chip,
.shopping-badge,
.shopping-save {
    border: 0;
    color: var(--text);
    font: inherit;
    font-weight: 800;
    background: linear-gradient(135deg, rgba(255, 67, 146, 0.28), rgba(139, 115, 255, 0.24));
}

.shopping-chip,
.shopping-badge {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid rgba(255, 188, 228, 0.18);
    white-space: nowrap;
}

.shopping-sync {
    flex: 1 0 auto;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    color: #d9c5f0;
    background: rgba(255, 255, 255, 0.045);
    font-size: 0.78rem;
    white-space: nowrap;
}

.shopping-shop-list,
.shopping-house-list {
    display: grid;
    gap: 7px;
}

.shopping-shop-row,
.shopping-house-row {
    position: relative;
    display: grid;
    gap: 8px;
    border-radius: 18px;
    border: 1px solid rgba(232, 209, 255, 0.14);
    background:
        radial-gradient(circle at 92% 20%, rgba(255, 87, 156, 0.12), transparent 20%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.035));
    transition: transform 140ms ease, border-color 140ms ease, opacity 140ms ease, background 140ms ease;
}

.shopping-shop-row {
    grid-template-columns: minmax(0, 1fr) 74px;
    align-items: stretch;
    min-height: 60px;
}

.shopping-shop-row.is-secondary {
    border-color: rgba(255, 188, 84, 0.22);
}

.shopping-shop-row.is-essential {
    box-shadow: inset 4px 0 0 rgba(255, 80, 157, 0.62);
}

.shopping-shop-row.is-bought {
    opacity: 0.58;
    background: linear-gradient(135deg, rgba(73, 78, 95, 0.42), rgba(22, 18, 32, 0.72));
}

.shopping-shop-row.is-bought .shopping-shop-row__name {
    text-decoration: line-through;
}

.shopping-shop-row.is-pending,
.shopping-house-row.is-pending {
    border-color: rgba(255, 222, 122, 0.58);
    box-shadow: 0 0 18px rgba(255, 222, 122, 0.12);
}

.shopping-shop-row__tap {
    min-width: 0;
    border: 0;
    border-radius: 18px;
    padding: 8px 7px 8px 10px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    color: var(--text);
    background: transparent;
    font: inherit;
    text-align: left;
}

.shopping-shop-row__check {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #ffb9dc;
    box-shadow: inset 0 0 0 1px rgba(255, 188, 228, 0.24);
}

.shopping-shop-row.is-bought .shopping-shop-row__check {
    background: linear-gradient(135deg, #ff4f9d, #a27bff);
    color: #fff;
}

.shopping-shop-row.is-bought .shopping-shop-row__check::before {
    content: "✓";
}

.shopping-shop-row.is-bought .shopping-shop-row__check {
    font-size: 0;
}

.shopping-shop-row__name {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 1.03rem;
    font-weight: 800;
    line-height: 1.08;
    text-overflow: ellipsis;
}

.shopping-shop-row__tag {
    grid-column: 2;
    margin-top: 3px;
    color: #ffb9dc;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.shopping-aisle {
    display: grid;
    place-items: center;
    gap: 2px;
    padding: 6px 7px 6px 0;
    color: var(--text-faint);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.shopping-aisle input {
    width: 56px;
    height: 40px;
    border-radius: 14px;
    border: 1px solid rgba(255, 188, 228, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font: inherit;
    font-size: 1.1rem;
    font-weight: 900;
    text-align: center;
}

.shopping-house-row {
    grid-template-columns: minmax(0, 1fr) 66px 66px;
    align-items: center;
    min-height: 58px;
    padding: 7px;
}

.shopping-house-row__main {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.shopping-house-row__main strong {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 0.98rem;
    line-height: 1.06;
    text-overflow: ellipsis;
}

.shopping-loc {
    color: #cdb8ef;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.shopping-toggle {
    display: grid;
    place-items: center;
    gap: 3px;
    color: var(--text-faint);
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
}

.shopping-toggle input {
    width: 28px;
    height: 28px;
    accent-color: #ff5fa8;
}

.shopping-house-row.is-needed {
    border-color: rgba(255, 95, 168, 0.32);
}

.shopping-house-row.is-essential {
    box-shadow: inset 4px 0 0 rgba(186, 142, 255, 0.7);
}

.shopping-add-form {
    display: grid;
    gap: 10px;
}

.shopping-add-form input {
    padding: 0 12px;
}

.shopping-add-grid {
    display: grid;
    grid-template-columns: 1fr 0.75fr;
    gap: 8px;
}

.shopping-add-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.shopping-add-checks label {
    flex: 1 1 130px;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.055);
    color: var(--text-soft);
    font-weight: 800;
}

.shopping-add-checks input {
    width: 22px;
    height: 22px;
    accent-color: #ff5fa8;
}

.shopping-save {
    min-height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, #58122f, #af2f70 45%, #ff6fb7 72%, #b98fff);
    box-shadow: 0 14px 26px rgba(255, 57, 136, 0.2);
}

.medication-layout {
    display: grid;
    gap: 14px;
}

.app-page--medication {
    padding: 8px 8px 86px;
}

.app-page--medication .shell {
    width: min(100%, 560px);
}

.app-page--medication .shell-main {
    gap: 8px;
}

.medication-compact {
    display: grid;
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(255, 174, 222, 0.24);
    border-radius: 18px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 92% 8%, rgba(255, 117, 167, 0.34), transparent 24%),
        radial-gradient(circle at 8% 18%, rgba(173, 129, 255, 0.26), transparent 22%),
        radial-gradient(circle at 72% 88%, rgba(145, 17, 45, 0.26), transparent 18%),
        conic-gradient(from 220deg at 50% 50%, rgba(255, 105, 180, 0.08), rgba(161, 129, 255, 0.12), rgba(255, 45, 94, 0.08), rgba(255, 105, 180, 0.08)),
        linear-gradient(180deg, rgba(21, 12, 27, 0.98), rgba(11, 8, 20, 1));
    box-shadow: var(--shadow), 0 0 32px rgba(255, 71, 142, 0.14);
}

.medication-compact::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 16% 24%, rgba(255, 255, 255, 0.18), transparent 9%),
        radial-gradient(circle at 82% 18%, rgba(255, 152, 204, 0.2), transparent 12%),
        radial-gradient(circle at 76% 82%, rgba(140, 223, 255, 0.14), transparent 10%),
        linear-gradient(120deg, transparent 28%, rgba(255, 255, 255, 0.06) 44%, transparent 58%);
    animation: medsGlow 5.8s ease-in-out infinite;
}

.medication-compact::after {
    content: "🖤 🍒 ✦ 💜";
    position: absolute;
    top: 10px;
    right: 12px;
    color: rgba(255, 205, 231, 0.82);
    font-size: 0.8rem;
    letter-spacing: 0.16em;
    text-shadow: 0 0 12px rgba(255, 83, 142, 0.32);
    animation: medsFloat 4.8s ease-in-out infinite;
    pointer-events: none;
}

.medication-compact__head,
.medication-compact__form,
.medication-table-wrap--compact,
.medication-empty,
.medication-saved {
    position: relative;
    z-index: 1;
}

.medication-compact__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.medication-compact__head h1 {
    margin: 0;
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.1rem;
    line-height: 1;
    position: relative;
    z-index: 1;
    text-shadow: 0 0 18px rgba(255, 98, 177, 0.24);
}

.medication-saved {
    min-height: 28px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 179, 223, 0.32);
    background: linear-gradient(135deg, rgba(103, 36, 82, 0.64), rgba(91, 65, 148, 0.5));
    color: #ffd9ed;
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: 0 0 18px rgba(255, 77, 151, 0.18);
    animation: medsSavedPop 760ms ease-out both;
}

.medication-compact__form {
    display: grid;
    gap: 6px;
}

.medication-compact__form input {
    width: 100%;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid rgba(232, 209, 255, 0.18);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.035));
    color: var(--text);
    font: inherit;
    font-size: 0.95rem;
    transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.medication-compact__form input::placeholder {
    color: var(--text-faint);
}

.medication-compact__form input:focus {
    outline: none;
    border-color: rgba(255, 143, 205, 0.68);
    box-shadow: 0 0 0 3px rgba(255, 113, 208, 0.16), 0 0 18px rgba(160, 124, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.medication-panel {
    display: grid;
    gap: 20px;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
}

.panel-heading h2 {
    margin: 0 0 6px;
}

.panel-heading p,
.medication-empty {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.medication-date {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 179, 223, 0.24);
    background: linear-gradient(135deg, rgba(91, 32, 62, 0.52), rgba(64, 34, 92, 0.34));
    color: #f1d6ea;
    font-size: 0.82rem;
    white-space: nowrap;
}

.medication-form,
.medication-group,
.medication-fields {
    display: grid;
    gap: 14px;
}

.medication-group h3 {
    margin: 0;
    color: var(--text);
    font-size: 0.92rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

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

.medication-field span {
    color: var(--text-soft);
    font-size: 0.94rem;
    font-weight: 700;
}

.medication-field input {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font: inherit;
}

.medication-field input:focus {
    outline: none;
    border-color: rgba(154, 124, 255, 0.5);
    box-shadow: 0 0 0 4px rgba(154, 124, 255, 0.12);
}

.medication-o2 {
    display: flex;
    align-items: center;
    gap: 12px;
}

.medication-o2 input {
    max-width: 120px;
}

.medication-o2--compact {
    gap: 8px;
}

.medication-o2--compact input {
    min-height: 32px;
    max-width: 92px;
}

.medication-o2 strong {
    color: var(--text-soft);
    font-size: 1rem;
}

.medication-submit {
    min-height: 54px;
    border: 0;
    border-radius: 18px;
    color: var(--text);
    font: inherit;
    font-weight: 700;
    background: linear-gradient(135deg, #4f0a22, #8f2057 28%, #ff5aa6 62%, #d28cff 100%);
    box-shadow: 0 18px 36px rgba(132, 31, 82, 0.3), 0 0 22px rgba(255, 92, 166, 0.2);
    position: relative;
    overflow: hidden;
    transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.medication-submit--compact {
    min-height: 34px;
    border-radius: 10px;
    font-size: 0.92rem;
    box-shadow: 0 10px 22px rgba(152, 73, 255, 0.22);
}

.medication-submit:hover {
    filter: saturate(1.12) brightness(1.04);
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(255, 56, 134, 0.28), 0 0 26px rgba(187, 134, 255, 0.2);
}

.medication-submit:active {
    transform: translateY(1px) scale(0.99);
}

.medication-submit::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 28%, rgba(255, 255, 255, 0.28) 44%, transparent 58%);
    transform: translateX(-140%);
    animation: medsShine 5.6s ease-in-out infinite;
}

.medication-table-wrap {
    overflow-x: auto;
}

.medication-table-wrap--compact {
    overflow-x: visible;
}

.medication-table {
    width: 100%;
    min-width: 420px;
    border-collapse: collapse;
}

.medication-table--compact {
    min-width: 0;
}

.medication-table th,
.medication-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.medication-table thead th {
    color: var(--text-faint);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.medication-table tbody th {
    color: var(--text);
    font-size: 0.92rem;
    text-align: left;
    white-space: nowrap;
}

.medication-table tbody td {
    color: var(--text-soft);
    font-variant-numeric: tabular-nums;
}

.medication-table tbody tr:last-child th,
.medication-table tbody tr:last-child td {
    border-bottom: 0;
}

.medication-table--compact th,
.medication-table--compact td {
    padding: 4px 3px;
    border-bottom: 0;
    font-size: 0.86rem;
    line-height: 1.2;
}

.medication-table--compact tbody th {
    width: 70px;
    font-size: 0.9rem;
}

.app-page--email {
    padding: 8px 8px 126px;
}

.app-page--email .shell {
    width: min(100%, 620px);
}

.app-page--email .shell-main {
    gap: 8px;
}

.email-shell {
    display: grid;
    gap: 8px;
    min-height: calc(100vh - 114px);
}

.email-dock,
.email-panel,
.email-flash {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(232, 209, 255, 0.16);
    border-radius: 20px;
    background:
        radial-gradient(circle at top right, rgba(169, 165, 255, 0.14), transparent 24%),
        radial-gradient(circle at left, rgba(139, 218, 255, 0.1), transparent 22%),
        linear-gradient(180deg, rgba(16, 12, 28, 0.98), rgba(9, 8, 18, 1));
    box-shadow: var(--shadow);
}

.email-dock,
.email-panel {
    padding: 10px;
}

.email-dock::before,
.email-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 84% 20%, rgba(255, 106, 142, 0.18), transparent 18%),
        radial-gradient(circle at 20% 84%, rgba(255, 179, 220, 0.08), transparent 14%);
    animation: emailAura 8s ease-in-out infinite;
}

.email-dock__intro,
.email-panel__head,
.email-dock__stats,
.email-dock__actions,
.trainer-card,
.email-pulse-grid,
.peek-columns {
    position: relative;
    z-index: 1;
}

.email-kicker,
.email-panel__eyebrow {
    margin: 0 0 6px;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    color: #f2cddd;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.email-dock h1,
.email-panel h2 {
    margin: 0;
    font-family: "Fraunces", Georgia, serif;
    line-height: 0.94;
}

.email-dock h1 {
    font-size: 1.36rem;
}

.email-panel h2 {
    font-size: 1.12rem;
}

.email-lede,
.trainer-hint,
.pulse-empty,
.email-empty p,
.peek-row span,
.run-row span {
    margin: 0;
    color: #bea9d5;
    line-height: 1.45;
}

.email-dock {
    display: grid;
    gap: 10px;
}

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

.email-stat {
    padding: 10px 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    text-align: center;
}

.email-stat strong {
    display: block;
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.22rem;
}

.email-stat span {
    color: var(--text-faint);
    font-size: 0.78rem;
}

.email-dock__actions {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.email-dock__actions::-webkit-scrollbar {
    display: none;
}

.email-chip,
.email-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(232, 209, 255, 0.16);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-soft);
    white-space: nowrap;
}

.email-chip--strong {
    color: var(--text);
    background: linear-gradient(135deg, rgba(101, 22, 46, 0.82), rgba(168, 94, 255, 0.34), rgba(255, 76, 144, 0.28));
    box-shadow: 0 14px 28px rgba(126, 41, 91, 0.2);
}

.email-chip--ghost {
    color: #d8c6eb;
}

.email-flash {
    padding: 10px 12px;
    font-size: 0.9rem;
}

.email-flash__spark {
    display: inline-block;
    margin-left: 6px;
    filter: drop-shadow(0 0 10px rgba(255, 117, 171, 0.34));
    animation: medsFloat 4.2s ease-in-out infinite;
}

.email-flash--ok {
    color: #f4d7ea;
    border-color: rgba(255, 123, 171, 0.34);
    background: linear-gradient(135deg, rgba(129, 34, 74, 0.56), rgba(61, 26, 53, 0.78));
}

.email-flash--error {
    color: #ffd6e0;
    border-color: rgba(255, 117, 117, 0.32);
    background: linear-gradient(135deg, rgba(103, 25, 42, 0.72), rgba(45, 17, 26, 0.82));
}

.email-deck {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.email-deck::-webkit-scrollbar {
    display: none;
}

.email-panel {
    width: 100%;
    min-width: 100%;
    flex: 0 0 100%;
    scroll-snap-align: start;
    min-height: calc(100vh - 286px);
    max-height: calc(100vh - 286px);
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
}

.email-panel--queue {
    grid-template-rows: auto 1fr;
}

.trainer-card,
.email-pulse-grid,
.peek-columns,
.email-empty {
    min-height: 0;
}

.email-panel__head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 10px;
    margin-bottom: 8px;
}

.trainer-card {
    display: grid;
    gap: 8px;
    align-content: start;
    overflow-y: auto;
    padding-right: 2px;
}

.trainer-fields {
    display: grid;
    gap: 6px;
}

.trainer-field {
    display: grid;
    grid-template-columns: 18px minmax(0, auto) minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(232, 209, 255, 0.08);
}

.trainer-field--active {
    border-color: rgba(255, 116, 169, 0.26);
    background: linear-gradient(135deg, rgba(123, 71, 255, 0.14), rgba(94, 18, 42, 0.12));
}

.trainer-field input[type="radio"] {
    accent-color: #ff7ab6;
    margin: 0;
}

.trainer-field__label {
    color: #f4e0ea;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.trainer-field input[type="text"],
.trainer-select,
.trainer-number {
    width: 100%;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 12px;
    border: 1px solid rgba(232, 209, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.trainer-field input[type="text"]:disabled {
    opacity: 0.48;
}

.trainer-field input[type="text"]:focus,
.trainer-select:focus,
.trainer-number:focus {
    outline: none;
    border-color: rgba(255, 125, 187, 0.46);
    box-shadow: 0 0 0 3px rgba(255, 98, 162, 0.14);
}

.trainer-mini,
.trainer-preset,
.trainer-secondary,
.peek-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid rgba(232, 209, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #dfccea;
    font-size: 0.82rem;
}

.trainer-mini,
.trainer-preset {
    cursor: pointer;
}

.trainer-presets {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.trainer-presets::-webkit-scrollbar {
    display: none;
}

.trainer-preset.is-fired {
    background: linear-gradient(135deg, rgba(255, 75, 141, 0.3), rgba(146, 76, 255, 0.24));
    box-shadow: 0 10px 20px rgba(164, 51, 101, 0.16);
}

.trainer-rulebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.trainer-delay {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 8px;
}

.trainer-select--unit {
    text-transform: lowercase;
}

.trainer-buttons {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.up-next {
    display: grid;
    gap: 6px;
    padding: 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
}

.up-next strong {
    color: #f0d8eb;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.up-next__row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.up-next__row::-webkit-scrollbar {
    display: none;
}

.up-next__chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(232, 209, 255, 0.14);
    background: linear-gradient(135deg, rgba(97, 24, 39, 0.42), rgba(138, 64, 114, 0.24));
    color: #f5d7e7;
    white-space: nowrap;
    font-size: 0.82rem;
}

.trainer-submit,
.trainer-submit--link {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 14px;
    color: #fff5ff;
    font-weight: 700;
    background: linear-gradient(135deg, #4d0f25, #7d2b49 28%, #ff67a7 72%, #c7a7ff);
    box-shadow: 0 14px 30px rgba(112, 21, 53, 0.26);
    position: relative;
    overflow: hidden;
}

.trainer-submit::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.22) 46%, transparent 60%);
    transform: translateX(-140%);
    animation: emailShine 5.2s ease-in-out infinite;
}

.trainer-submit--link {
    text-decoration: none;
}

.email-empty {
    display: grid;
    gap: 8px;
}

.email-pulse-grid,
.peek-columns {
    display: grid;
    gap: 8px;
    align-content: start;
    overflow-y: auto;
    padding-right: 2px;
}

.pulse-stack,
.peek-stack {
    display: grid;
    gap: 6px;
    align-content: start;
}

.peek-stack__actions {
    display: flex;
    justify-content: flex-start;
}

.pulse-stack h3,
.peek-stack h3 {
    margin: 0;
    font-size: 0.9rem;
    color: #f1dfef;
}

.mix-list,
.run-list,
.peek-list {
    display: grid;
    gap: 6px;
}

.mix-row,
.run-row,
.peek-row {
    display: grid;
    gap: 6px;
    padding: 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
}

.mix-row {
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
    align-items: center;
}

.mix-row__label {
    font-size: 0.8rem;
    color: #f1dfef;
}

.mix-row__bar {
    display: block;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.mix-row__bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, #7f6bff, #ff6daa 74%, #ffc7e4);
}

.run-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.run-row strong,
.peek-row strong {
    color: var(--text);
    font-size: 0.86rem;
}

.run-row em {
    color: var(--text-faint);
    font-style: normal;
    font-size: 0.8rem;
}

.peek-row.is-active {
    border: 1px solid rgba(255, 118, 176, 0.2);
    background: linear-gradient(135deg, rgba(125, 86, 255, 0.16), rgba(255, 73, 185, 0.1));
}

.peek-row--rule {
    align-content: start;
}

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

.radar-topline span {
    color: #cdb6db;
    font-size: 0.82rem;
}

.radar-input {
    width: 100%;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid rgba(232, 209, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.radar-input:focus {
    outline: none;
    border-color: rgba(255, 125, 187, 0.46);
    box-shadow: 0 0 0 3px rgba(255, 98, 162, 0.14);
}

.radar-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px 86px;
    gap: 6px;
}

.trainer-select--radar,
.trainer-select--radar-unit,
.trainer-number--radar {
    min-height: 34px;
    font-size: 0.82rem;
}

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

.peek-row--summary {
    gap: 4px;
    border: 1px solid rgba(255, 121, 176, 0.18);
    background: linear-gradient(135deg, rgba(73, 19, 35, 0.44), rgba(91, 56, 167, 0.18));
}

.peek-row--summary em,
.peek-row--summary small {
    color: #ceb6dc;
    font-style: normal;
    line-height: 1.4;
}

.peek-row--summary small {
    color: #f5d8ea;
}

.peek-delete {
    text-decoration: none;
}

.email-panel--rules-page {
    min-height: auto;
    max-height: none;
}

.rules-library {
    display: grid;
    gap: 8px;
}

.peek-list--rules {
    overflow-y: auto;
    padding-right: 2px;
}

.app-page--routine {
    padding: 4px 5px 104px;
    isolation: isolate;
}

.app-page--routine::before,
.app-page--routine::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.app-page--routine::before {
    background:
        radial-gradient(circle at 16% 14%, rgba(255, 108, 194, 0.28) 0 1px, transparent 2px),
        radial-gradient(circle at 72% 9%, rgba(230, 239, 255, 0.7) 0 1px, transparent 2px),
        radial-gradient(circle at 84% 42%, rgba(139, 241, 255, 0.32) 0 1px, transparent 2px),
        radial-gradient(circle at 24% 74%, rgba(255, 225, 137, 0.26) 0 1px, transparent 2px);
    background-size: 82px 98px, 118px 132px, 96px 112px, 136px 154px;
    opacity: 0.62;
    mix-blend-mode: screen;
    animation: routineGlitterRain 9s linear infinite;
}

.app-page--routine::after {
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 93, 179, 0.2), transparent 28%),
        conic-gradient(from 190deg at 50% -6%, transparent 0 26%, rgba(236, 232, 255, 0.11) 28% 31%, transparent 34% 54%, rgba(255, 105, 190, 0.11) 57% 60%, transparent 64%);
    opacity: 0.85;
    animation: routineWitchlight 6.5s ease-in-out infinite;
}

.app-page--routine .shell {
    width: min(100%, 680px);
    position: relative;
    z-index: 1;
}

.app-page--routine .shell-main {
    gap: 5px;
}

.routine-shell {
    display: grid;
    gap: 5px;
}

.routine-hero,
.routine-panel,
.routine-section,
.routine-tabs,
.routine-control-row,
.routine-flash {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(232, 209, 255, 0.16);
    border-radius: 20px;
    background:
        radial-gradient(circle at top right, rgba(255, 87, 165, 0.18), transparent 24%),
        radial-gradient(circle at 12% 18%, rgba(125, 231, 255, 0.1), transparent 22%),
        linear-gradient(180deg, rgba(17, 12, 30, 0.98), rgba(8, 7, 17, 1));
    box-shadow: var(--shadow);
}

.routine-hero::before,
.routine-panel::before,
.routine-section::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(120deg, transparent 18%, rgba(255, 255, 255, 0.06) 28%, transparent 38%),
        radial-gradient(circle at 78% 18%, rgba(255, 215, 244, 0.16), transparent 14%);
    opacity: 0.75;
    animation: routinePulse 7.2s ease-in-out infinite;
}

.routine-hero::after,
.routine-panel::after,
.routine-section::after {
    content: "";
    position: absolute;
    inset: -40% -55%;
    pointer-events: none;
    background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.12) 47%, transparent 56%);
    opacity: 0.26;
    transform: translateX(-32%) rotate(2deg);
    animation: routineGlassSlash 5.8s ease-in-out infinite;
}

.routine-hero,
.routine-panel,
.routine-section {
    padding: 6px;
}

.routine-hero {
    display: block;
}

.routine-hero > *,
.routine-panel > *,
.routine-section > * {
    position: relative;
    z-index: 1;
}

.routine-kicker,
.routine-panel__eyebrow {
    margin: 0 0 6px;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    color: #ffd4eb;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.routine-hero h1,
.routine-panel h2,
.routine-section h2,
.task-section h3 {
    margin: 0;
    font-family: "Fraunces", Georgia, serif;
    line-height: 0.96;
}

.routine-hero h1 {
    font-size: 1.48rem;
}

.routine-lede,
.routine-empty {
    margin: 0;
    color: #c8b6dd;
    line-height: 1.45;
}

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

.routine-stat {
    min-height: 46px;
    display: grid;
    place-items: center;
    padding: 5px 3px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
}

.routine-stat::before {
    content: "";
    position: absolute;
    inset: -40%;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.65) 0 1px, transparent 2px),
        linear-gradient(115deg, transparent 36%, rgba(255, 255, 255, 0.13) 47%, transparent 58%);
    opacity: 0;
    transform: translateX(-30%) rotate(12deg);
    animation: routineStatSparkle 4.6s ease-in-out infinite;
}

.routine-stat strong,
.routine-stat span {
    position: relative;
    z-index: 1;
}

.routine-stat strong {
    display: block;
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.08rem;
    line-height: 0.9;
}

.routine-stat span {
    color: var(--text-faint);
    font-size: 0.58rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.routine-stat--black {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(30, 27, 43, 0.74));
}

.routine-stat--white {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(169, 198, 255, 0.12));
    box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.08);
}

.routine-stat--yellow {
    background: linear-gradient(135deg, rgba(255, 219, 118, 0.24), rgba(255, 117, 167, 0.12));
    box-shadow: inset 0 0 16px rgba(255, 219, 118, 0.12), 0 0 16px rgba(255, 205, 79, 0.08);
    animation: yellowStatPurr 3.8s ease-in-out infinite;
}

.routine-stat--red {
    background: linear-gradient(135deg, rgba(255, 62, 117, 0.32), rgba(104, 22, 54, 0.42));
    box-shadow: inset 0 0 18px rgba(255, 62, 117, 0.18), 0 0 18px rgba(255, 62, 117, 0.12);
    animation: redStatPulse 2.7s ease-in-out infinite;
}

.routine-tabs,
.routine-control-row {
    display: flex;
    gap: 5px;
    padding: 5px;
    overflow-x: auto;
    scrollbar-width: none;
}

.routine-tabs::-webkit-scrollbar,
.routine-control-row::-webkit-scrollbar {
    display: none;
}

.routine-tab,
.routine-mode,
.routine-button,
.routine-icon-button,
.task-icon-link,
.task-card__actions button {
    min-height: 31px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(232, 209, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-soft);
    padding: 0 10px;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.routine-tab::after,
.routine-mode::after,
.routine-button::after,
.routine-icon-button::after,
.task-icon-link::after,
.task-card__actions button::after {
    content: "";
    position: absolute;
    inset: -45% -80%;
    pointer-events: none;
    background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.22) 49%, transparent 58%);
    opacity: 0;
    transform: translateX(-60%);
}

.routine-tab:hover,
.routine-mode:hover,
.routine-button:hover,
.routine-icon-button:hover,
.task-icon-link:hover,
.task-card__actions button:hover {
    filter: saturate(1.16) brightness(1.08);
    border-color: rgba(255, 184, 232, 0.36);
}

.routine-tab:active,
.routine-mode:active,
.routine-button:active,
.routine-icon-button:active,
.task-icon-link:active,
.task-card__actions button:active {
    transform: scale(0.96);
    box-shadow: 0 0 24px rgba(246, 244, 255, 0.36), 0 0 38px rgba(255, 73, 164, 0.22);
}

.routine-tab:active::after,
.routine-mode:active::after,
.routine-button:active::after,
.routine-icon-button:active::after,
.task-icon-link:active::after,
.task-card__actions button:active::after {
    opacity: 1;
    animation: routineButtonSlash 420ms ease-out;
}

.routine-tab.is-active,
.routine-mode.is-active,
.routine-button--hot {
    color: var(--text);
    border-color: rgba(255, 113, 208, 0.42);
    background: linear-gradient(135deg, rgba(255, 69, 145, 0.34), rgba(139, 93, 255, 0.24), rgba(104, 182, 255, 0.12));
    box-shadow: 0 12px 26px rgba(255, 76, 158, 0.16);
    animation: routineHotShimmer 3.7s ease-in-out infinite;
}

.routine-mode-switch {
    display: flex;
    gap: 5px;
}

.routine-day-picker {
    margin-left: auto;
}

.routine-day-picker select,
.routine-edit-form input,
.routine-edit-form select,
.routine-textarea,
.routine-add-daily input {
    width: 100%;
    min-height: 32px;
    padding: 0 9px;
    border-radius: 10px;
    border: 1px solid rgba(232, 209, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.routine-day-picker label,
.routine-edit-form label {
    display: grid;
    gap: 5px;
    color: #d8c6ec;
    font-size: 0.82rem;
    font-weight: 700;
}

.routine-flash {
    padding: 7px 10px;
    color: #ffdbef;
    background: linear-gradient(135deg, rgba(255, 71, 148, 0.18), rgba(154, 124, 255, 0.14));
}

.routine-flash--error {
    color: #ffd2dc;
    border-color: rgba(255, 140, 171, 0.4);
}

.routine-panel__head,
.task-section__head,
.routine-edit-form__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.routine-badge {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-soft);
    font-size: 0.78rem;
    white-space: nowrap;
}

.routine-add-daily {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    margin-top: 4px;
}

.routine-compact-title {
    margin: 0;
    color: #ffd4eb;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.routine-mini-list {
    display: grid;
    gap: 4px;
    margin-top: 5px;
}

.routine-mini-item button {
    width: 100%;
    min-height: 30px;
    border: 1px solid rgba(232, 209, 255, 0.12);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    text-align: left;
    padding: 0 12px;
}

.routine-mini-item.is-done button {
    color: var(--text-faint);
    text-decoration: line-through;
}

.routine-list {
    display: grid;
    gap: 5px;
}

.routine-section h2 {
    margin-bottom: 5px;
    color: #fff1fb;
    font-size: 1rem;
}

.routine-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 6px;
    align-items: stretch;
    margin-top: 4px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.045);
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.routine-item::before {
    content: "";
    position: absolute;
    inset: -28% -45%;
    pointer-events: none;
    background: linear-gradient(112deg, transparent 37%, rgba(255, 255, 255, 0.18) 47%, transparent 58%);
    opacity: 0;
    transform: translateX(-58%) rotate(4deg);
}

.routine-item:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 191, 235, 0.28);
    box-shadow: 0 12px 28px rgba(5, 2, 16, 0.28);
}

.routine-item > * {
    position: relative;
    z-index: 1;
}

.routine-item--black {
    border-color: rgba(231, 222, 255, 0.14);
}

.routine-item--white {
    border-color: rgba(255, 255, 255, 0.38);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(112, 138, 255, 0.08));
}

.routine-item--yellow {
    border-color: rgba(255, 219, 118, 0.62);
    background:
        radial-gradient(circle at 8% 22%, rgba(255, 255, 255, 0.18), transparent 16%),
        radial-gradient(circle at 92% 28%, rgba(255, 230, 145, 0.18), transparent 28%),
        linear-gradient(135deg, rgba(255, 205, 79, 0.2), rgba(255, 113, 208, 0.1));
    box-shadow: inset 0 0 18px rgba(255, 221, 111, 0.12), 0 0 18px rgba(255, 207, 72, 0.16), 0 0 30px rgba(255, 118, 210, 0.08);
    animation: yellowTaskWink 2.6s ease-in-out infinite;
}

.routine-item--yellow::before {
    opacity: 0.82;
    animation: routineTaskGleam 3.1s ease-in-out infinite;
}

.routine-item--red {
    border-color: rgba(255, 77, 130, 0.72);
    background:
        radial-gradient(circle at 10% 50%, rgba(255, 255, 255, 0.16), transparent 14%),
        radial-gradient(circle at 88% 24%, rgba(255, 95, 155, 0.26), transparent 30%),
        linear-gradient(135deg, rgba(255, 44, 104, 0.28), rgba(94, 12, 47, 0.34));
    box-shadow: inset 0 0 24px rgba(255, 54, 121, 0.2), 0 0 26px rgba(255, 54, 121, 0.28), 0 0 42px rgba(139, 93, 255, 0.1);
    animation: redTaskThrob 1.9s ease-in-out infinite;
}

.routine-item--red::before {
    opacity: 0.92;
    background:
        radial-gradient(circle at 48% 50%, rgba(255, 255, 255, 0.24) 0 1px, transparent 2px),
        linear-gradient(112deg, transparent 34%, rgba(255, 220, 238, 0.24) 45%, transparent 57%);
    animation: routineTaskGleam 2.3s ease-in-out infinite;
}

.routine-item--yellow .routine-stage {
    color: #ffe38b;
    text-shadow: 0 0 10px rgba(255, 224, 119, 0.42);
}

.routine-item--red .routine-stage {
    color: #ff9abe;
    text-shadow: 0 0 12px rgba(255, 76, 145, 0.58);
}

.routine-item__body strong {
    display: block;
    color: var(--text);
    line-height: 1.15;
    font-size: 0.95rem;
}

.routine-stage {
    display: inline-flex;
    margin-bottom: 2px;
    color: var(--text-faint);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.routine-item__action button {
    width: 34px;
    height: 100%;
    min-height: 34px;
    border: 0;
    border-radius: 12px;
    color: var(--text);
    background: linear-gradient(135deg, rgba(126, 241, 190, 0.34), rgba(154, 124, 255, 0.22));
    font-size: 1.05rem;
    font-weight: 700;
}

.routine-nested {
    margin: 4px 0 0;
    padding-left: 18px;
    color: #ccb9df;
    font-size: 0.82rem;
}

.routine-nested .is-done {
    text-decoration: line-through;
    color: var(--text-faint);
}

.routine-panel--completed {
    display: grid;
    gap: 7px;
}

.routine-completed-section {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.routine-completed-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.04);
}

.routine-completed-item span {
    color: var(--text-faint);
    text-decoration: line-through;
}

.routine-completed-item button {
    border: 0;
    border-radius: 999px;
    padding: 6px 10px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

.routine-textarea {
    min-height: 62vh;
    padding: 12px;
    line-height: 1.45;
    resize: vertical;
}

.routine-editor {
    border: 1px solid rgba(232, 209, 255, 0.12);
    border-radius: 16px;
    padding: 9px;
    background: rgba(255, 255, 255, 0.04);
}

.routine-editor summary {
    cursor: pointer;
    font-weight: 700;
    color: #ffe1f1;
}

.routine-editor-list {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.routine-edit-form {
    display: grid;
    gap: 8px;
    margin-top: 8px;
    padding: 9px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
}

.routine-edit-form.is-hidden,
.routine-edit-form.is-ended {
    opacity: 0.58;
}

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

.routine-period-grid,
.routine-day-grid,
.routine-check-row {
    display: grid;
    gap: 6px;
}

.routine-period-grid {
    grid-template-columns: minmax(94px, 0.8fr) minmax(0, 1fr);
}

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

.routine-check-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.routine-check,
.routine-check-row label,
.routine-day-grid label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-soft);
    font-size: 0.82rem;
}

.business-stack,
.business-list,
.business-task-deck,
.business-task-groups,
.business-task-list {
    display: grid;
    gap: 8px;
}

.business-task-deck {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(232, 209, 255, 0.12);
}

.business-area-picker select {
    min-height: 36px;
    max-width: 180px;
    border-radius: 999px;
    border: 1px solid rgba(232, 209, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    padding: 0 10px;
}

.business-task-group {
    border: 1px solid rgba(232, 209, 255, 0.12);
    border-radius: 16px;
    padding: 9px;
    background: rgba(255, 255, 255, 0.04);
}

.business-task-group summary {
    cursor: pointer;
    color: #ffe1f1;
    font-weight: 700;
}

.business-task-list {
    margin-top: 8px;
}

.business-task {
    display: block;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-soft);
}

.business-task.is-done {
    color: var(--text-faint);
    text-decoration: line-through;
}

.business-card {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-height: 48px;
    padding: 7px 9px;
    border: 1px solid rgba(232, 209, 255, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.045);
}

.business-card.is-driving {
    border-color: rgba(255, 219, 118, 0.35);
    background: linear-gradient(135deg, rgba(255, 219, 118, 0.16), rgba(255, 113, 208, 0.08));
}

.business-card.is-dragging {
    opacity: 0.5;
}

.business-card__rank {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    color: #ffe3f3;
    font-weight: 700;
}

.business-card label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-soft);
    font-size: 0.82rem;
}

.routine-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.task-section {
    margin-top: 10px;
}

.task-section__head {
    margin-bottom: 7px;
}

.task-section__head h3 {
    font-size: 1.08rem;
}

.task-section__head span {
    min-width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-soft);
}

.task-list {
    display: grid;
    gap: 7px;
}

.task-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: stretch;
    padding: 8px;
    border: 1px solid rgba(232, 209, 255, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.045);
}

.task-card--wombad {
    border-color: rgba(255, 219, 118, 0.36);
}

.task-card--review {
    border-color: rgba(255, 77, 130, 0.48);
}

.task-card--done {
    opacity: 0.55;
}

.task-card__main button {
    width: 100%;
    min-height: 42px;
    border: 0;
    background: transparent;
    color: var(--text);
    text-align: left;
    padding: 0;
}

.task-card__main strong {
    display: block;
    line-height: 1.25;
}

.task-card__main span {
    display: block;
    margin-top: 3px;
    color: var(--text-faint);
    font-size: 0.78rem;
}

.task-card--done .task-card__main strong {
    text-decoration: line-through;
}

.task-card__actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.task-card__actions button,
.task-icon-link {
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 12px;
}

@keyframes navShine {
    0%, 16% {
        transform: translateX(-140%);
    }
    32%, 100% {
        transform: translateX(180%);
    }
}

@keyframes routinePulse {
    0%, 100% {
        opacity: 0.5;
        transform: translate3d(0, 0, 0);
    }
    50% {
        opacity: 0.92;
        transform: translate3d(0, -2px, 0);
    }
}

@keyframes routineGlitterRain {
    0% {
        background-position: 0 0, 20px 0, 8px 14px, 38px 26px;
        opacity: 0.5;
    }
    50% {
        opacity: 0.82;
    }
    100% {
        background-position: 82px 98px, 138px 132px, 104px 126px, 174px 180px;
        opacity: 0.5;
    }
}

@keyframes routineWitchlight {
    0%, 100% {
        opacity: 0.56;
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        opacity: 0.96;
        transform: translate3d(0, -4px, 0) scale(1.02);
    }
}

@keyframes routineGlassSlash {
    0%, 18% {
        opacity: 0;
        transform: translateX(-34%) rotate(2deg);
    }
    36% {
        opacity: 0.34;
    }
    58%, 100% {
        opacity: 0;
        transform: translateX(34%) rotate(2deg);
    }
}

@keyframes routineStatSparkle {
    0%, 30% {
        opacity: 0;
        transform: translateX(-34%) rotate(12deg);
    }
    44% {
        opacity: 0.62;
    }
    68%, 100% {
        opacity: 0;
        transform: translateX(34%) rotate(12deg);
    }
}

@keyframes routineButtonSlash {
    0% {
        transform: translateX(-60%) rotate(0deg);
    }
    100% {
        transform: translateX(60%) rotate(0deg);
    }
}

@keyframes routineHotShimmer {
    0%, 100% {
        filter: saturate(1) brightness(1);
        box-shadow: 0 12px 26px rgba(255, 76, 158, 0.16);
    }
    50% {
        filter: saturate(1.22) brightness(1.08);
        box-shadow: 0 12px 30px rgba(255, 76, 158, 0.28), 0 0 28px rgba(142, 226, 255, 0.12);
    }
}

@keyframes shoppingAura {
    0%, 100% {
        opacity: 0.58;
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        opacity: 0.96;
        transform: translate3d(0, -2px, 0) scale(1.015);
    }
}

@keyframes yellowStatPurr {
    0%, 100% {
        filter: saturate(1);
        transform: translateY(0);
    }
    50% {
        filter: saturate(1.35) brightness(1.08);
        transform: translateY(-1px);
    }
}

@keyframes redStatPulse {
    0%, 100% {
        filter: saturate(1);
        transform: scale(1);
    }
    50% {
        filter: saturate(1.35) brightness(1.12);
        transform: scale(1.025);
    }
}

@keyframes yellowTaskWink {
    0%, 100% {
        border-color: rgba(255, 219, 118, 0.54);
        filter: saturate(1) brightness(1);
        transform: translateX(0) scale(1);
    }
    50% {
        border-color: rgba(255, 240, 168, 0.82);
        filter: saturate(1.28) brightness(1.08);
        transform: translateX(1px) scale(1.004);
    }
}

@keyframes redTaskThrob {
    0%, 100% {
        border-color: rgba(255, 77, 130, 0.66);
        filter: saturate(1) brightness(1);
        transform: scale(1);
    }
    50% {
        border-color: rgba(255, 162, 200, 0.9);
        filter: saturate(1.38) brightness(1.12);
        transform: scale(1.012);
    }
}

@keyframes routineTaskGleam {
    0%, 22% {
        transform: translateX(-58%) rotate(4deg);
        opacity: 0;
    }
    42% {
        opacity: 0.9;
    }
    64%, 100% {
        transform: translateX(58%) rotate(4deg);
        opacity: 0;
    }
}

@keyframes silverBurst {
    0% {
        opacity: 0.95;
        transform: translate(-50%, -50%) scale(0.2) rotate(0deg);
        filter: blur(0);
    }
    55% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.9) rotate(42deg);
        filter: blur(0.6px);
    }
}

.silver-burst {
    position: fixed;
    z-index: 1000;
    width: 72px;
    height: 72px;
    pointer-events: none;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.98) 0 4%, transparent 5%),
        radial-gradient(circle at 18% 30%, rgba(255, 112, 197, 0.82) 0 2px, transparent 3px),
        radial-gradient(circle at 78% 64%, rgba(158, 234, 255, 0.82) 0 2px, transparent 3px),
        conic-gradient(from 8deg, transparent 0 6%, rgba(255, 255, 255, 0.95) 7% 9%, transparent 10% 19%, rgba(214, 231, 255, 0.95) 20% 22%, transparent 23% 36%, rgba(255, 211, 239, 0.95) 37% 39%, transparent 40% 52%, rgba(255, 255, 255, 0.9) 53% 55%, transparent 56% 70%, rgba(202, 223, 255, 0.9) 71% 73%, transparent 74%);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.82), 0 0 38px rgba(203, 212, 255, 0.58), 0 0 46px rgba(255, 105, 190, 0.28);
    animation: silverBurst 820ms ease-out forwards;
}

@keyframes medsGlow {
    0%, 100% {
        opacity: 0.68;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.03);
    }
}

@keyframes medsFloat {
    0%, 100% {
        transform: translate3d(0, 0, 0);
        opacity: 0.76;
    }
    50% {
        transform: translate3d(0, -2px, 0);
        opacity: 1;
    }
}

@keyframes medsShine {
    0%, 14% {
        transform: translateX(-140%);
    }
    28%, 100% {
        transform: translateX(180%);
    }
}

@keyframes medsSavedPop {
    0% {
        opacity: 0;
        transform: translateY(-4px) scale(0.96);
    }
    62% {
        opacity: 1;
        transform: translateY(1px) scale(1.01);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes emailAura {
    0%, 100% {
        opacity: 0.55;
        transform: translate3d(0, 0, 0);
    }
    50% {
        opacity: 0.95;
        transform: translate3d(0, -2px, 0);
    }
}

@keyframes emailShine {
    0%, 14% {
        transform: translateX(-140%);
    }
    32%, 100% {
        transform: translateX(180%);
    }
}

@media (min-width: 760px) {
    .app-page {
        padding: 22px 22px 24px;
    }

    .shell-header {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .tool-strip {
        grid-column: 1 / -1;
    }

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

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

    .budget-grid {
        grid-template-columns: 1.15fr 0.85fr;
    }

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

    .app-page--medication {
        padding: 14px 14px 24px;
    }

    .app-page--shopping {
        padding: 14px 14px 34px;
    }

    .shopping-hero {
        grid-template-columns: minmax(0, 1fr) 230px;
        align-items: center;
    }

    .app-page--email {
        padding: 14px 14px 34px;
    }

    .app-page--routine {
        padding: 14px 14px 34px;
    }

    .routine-hero {
        grid-template-columns: minmax(0, 1fr) 280px;
        align-items: center;
    }

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

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

    .email-shell {
        min-height: auto;
    }

    .email-deck {
        display: grid;
        overflow-x: visible;
        scroll-snap-type: none;
    }

    .email-panel {
        width: auto;
        min-width: 0;
        flex: initial;
        min-height: auto;
        max-height: none;
    }

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

@media (min-width: 980px) {
    .shell-main--wide {
        grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
        align-items: start;
    }

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

@media (min-width: 1040px) {
    .app-page {
        padding-bottom: 26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .shopping-hero::before,
    .shopping-panel::before,
    .medication-compact::before,
    .medication-compact::after,
    .medication-submit::before,
    .medication-saved {
        animation: none;
    }

    .medication-compact__form input,
    .medication-submit {
        transition: none;
    }
}
