:root {
    color-scheme: light;
    --ink: #21172c;
    --muted: #6f6578;
    --surface: #ffffff;
    --surface-soft: #f8f5ff;
    --surface-warm: #fbf6ff;
    --line: #e5dcf0;
    --plum: #241238;
    --primary: #7047eb;
    --primary-deep: #4e49c9;
    --primary-soft: #ece5ff;
    --lilac: #bfa8ff;
    --rose: #c74e96;
    --rose-soft: #f7e6f1;
    --gold: #f2c15f;
    --success: #25745b;
    --warning: #8b5b12;
    --danger: #a63a46;
    --shadow: 0 18px 50px rgba(36, 18, 56, 0.12);
    --radius-large: 28px;
    --radius-medium: 18px;
    --shell: 1100px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    min-height: 100%;
    background: var(--surface-soft);
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(84px + env(safe-area-inset-top));
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 90% 0%, rgba(199, 78, 150, 0.10), transparent 30rem),
        radial-gradient(circle at 5% 20%, rgba(112, 71, 235, 0.09), transparent 28rem),
        var(--surface-soft);
    font-size: 16px;
    line-height: 1.55;
    overscroll-behavior-x: none;
}

a {
    color: var(--primary-deep);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

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

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

:focus-visible {
    outline: 3px solid rgba(112, 71, 235, 0.38);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: calc(8px + env(safe-area-inset-top));
    left: 12px;
    padding: 10px 14px;
    transform: translateY(-180%);
    border-radius: 10px;
    color: #fff;
    background: var(--primary-deep);
    font-weight: 800;
    text-decoration: none;
}

.skip-link:focus {
    transform: translateY(0);
}

.page-shell:focus {
    outline: none;
}

.shell {
    width: min(calc(100% - 32px), var(--shell));
    margin-inline: auto;
}

.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    padding-top: env(safe-area-inset-top);
    border-bottom: 1px solid rgba(232, 226, 241, 0.85);
    background: rgba(248, 246, 255, 0.88);
    backdrop-filter: blur(18px);
}

.topbar-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.wordmark-mark,
.brand-mark {
    display: block;
    flex: none;
    object-fit: cover;
    background: var(--plum);
    box-shadow: 0 10px 24px rgba(36, 18, 56, 0.24);
}

.wordmark-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
}

.brand-mark {
    width: 58px;
    height: 58px;
    margin-bottom: 24px;
    border-radius: 18px;
}

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

.account-actions form {
    margin: 0;
}

.account-name {
    max-width: 220px;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-button {
    padding: 8px 12px;
    border: 0;
    color: var(--primary-deep);
    background: transparent;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}

.page-shell {
    min-height: calc(100vh - 154px);
    padding-block: 44px 72px;
}

.page-shell-authenticated {
    padding-bottom: 112px;
}

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

h1 {
    max-width: 18ch;
    margin-bottom: 14px;
    font-size: clamp(2.15rem, 6vw, 4rem);
    line-height: 1.02;
    letter-spacing: -0.055em;
}

h2 {
    margin-bottom: 8px;
    font-size: 1.25rem;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.eyebrow {
    margin-bottom: 8px;
    color: var(--primary-deep);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.hero-panel {
    position: relative;
    display: flex;
    min-height: 260px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: clamp(28px, 6vw, 58px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-large);
    color: #fff;
    background: linear-gradient(125deg, #241238 0%, #4e49c9 58%, #7047eb 100%);
    box-shadow: var(--shadow);
}

.hero-panel::after {
    position: absolute;
    width: 300px;
    height: 300px;
    right: -120px;
    bottom: -190px;
    border: 44px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    content: "";
}

.hero-panel .eyebrow {
    color: #d8cbff;
}

.hero-panel h1 {
    margin-bottom: 12px;
}

.hero-panel p:last-child {
    max-width: 50ch;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.82);
}

.hero-orb {
    position: relative;
    z-index: 1;
    display: grid;
    flex: 0 0 auto;
    width: clamp(86px, 16vw, 150px);
    height: clamp(86px, 16vw, 150px);
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    font-size: clamp(2.4rem, 7vw, 4.5rem);
    backdrop-filter: blur(10px);
}

.app-update-banner {
    position: fixed;
    z-index: 50;
    top: calc(82px + env(safe-area-inset-top));
    left: 50%;
    display: grid;
    width: min(calc(100% - 24px), 680px);
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    transform: translateX(-50%);
    border: 1px solid #d9d0ef;
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 48px rgba(43, 27, 77, 0.2);
}

.connectivity-banner {
    display: flex;
    width: min(calc(100% - 24px), 680px);
    gap: 10px;
    align-items: center;
    margin: 12px auto 0;
    padding: 11px 15px;
    border: 1px solid #e9c890;
    border-radius: 13px;
    color: #68430c;
    background: #fff7e7;
    box-shadow: 0 10px 28px rgba(79, 51, 16, 0.08);
    font-size: 0.82rem;
}

.app-update-banner strong,
.app-update-banner span {
    display: block;
}

.app-update-banner span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.8rem;
}

.app-update-banner .button,
.app-update-banner .text-button {
    white-space: nowrap;
}

.pwa-install-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    margin-top: 22px;
    padding: 20px 22px;
    border: 1px solid #d9d0ef;
    border-radius: var(--radius-medium);
    background: linear-gradient(145deg, #fff, var(--primary-soft));
    box-shadow: 0 12px 36px rgba(59, 43, 92, 0.06);
}

.pwa-install-icon {
    display: grid;
    width: 50px;
    height: 50px;
    place-items: center;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(145deg, var(--primary), var(--plum));
    box-shadow: 0 10px 24px rgba(36, 18, 56, 0.24);
    font-size: 1.25rem;
    font-weight: 850;
}

.pwa-install-copy h2,
.pwa-install-copy p:last-child {
    margin-bottom: 0;
}

.pwa-install-copy > p:not(.eyebrow) {
    color: var(--muted);
    font-size: 0.88rem;
}

.pwa-ios-steps {
    display: flex;
    gap: 8px 24px;
    margin: 10px 0 0;
    padding-left: 20px;
    color: var(--muted);
    font-size: 0.82rem;
}

.pwa-install-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.onboarding-panel {
    margin-top: 22px;
    padding: clamp(22px, 4vw, 34px);
    border: 1px solid #ded4f3;
    border-radius: var(--radius-large);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 42px rgba(59, 43, 92, 0.08);
}

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

.onboarding-heading p:last-child {
    margin-bottom: 0;
    color: var(--muted);
}

.setup-progress {
    display: grid;
    min-width: 150px;
    text-align: right;
}

.setup-progress strong {
    color: var(--primary-deep);
    font-size: 1.2rem;
}

.setup-progress span {
    color: var(--muted);
    font-size: 0.74rem;
}

.setup-progress progress {
    width: 150px;
    height: 7px;
    margin-top: 8px;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    color: var(--primary);
    background: #e9e5ee;
    accent-color: var(--primary);
}

.setup-progress progress::-webkit-progress-bar {
    border-radius: 999px;
    background: #e9e5ee;
}

.setup-progress progress::-webkit-progress-value {
    border-radius: 999px;
    background: var(--primary);
}

.onboarding-steps {
    display: grid;
    gap: 10px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}

.onboarding-steps > li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 15px;
    align-items: center;
    padding: 15px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-soft);
}

.onboarding-steps > li.is-complete {
    border-color: #cde5dc;
    background: #f4fbf8;
}

.onboarding-step-marker {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    color: var(--primary-deep);
    background: var(--primary-soft);
    font-size: 0.82rem;
    font-weight: 850;
}

.onboarding-steps > li.is-complete .onboarding-step-marker {
    color: #fff;
    background: var(--success);
}

.onboarding-steps h3 {
    margin: 0;
    font-size: 0.94rem;
}

.onboarding-steps h3 small {
    margin-left: 5px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 750;
}

.onboarding-steps p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.onboarding-steps .button {
    min-width: 110px;
}

.onboarding-step-optional {
    border-style: dashed !important;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.action-card,
.panel,
.stat-card {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 36px rgba(59, 43, 92, 0.06);
}

.action-card {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 18px;
    min-height: 188px;
    padding: 26px;
    border-radius: var(--radius-medium);
    color: var(--ink);
    text-decoration: none;
}

.action-card p:not(.eyebrow) {
    margin-bottom: 0;
    color: var(--muted);
}

.action-card-primary {
    background: linear-gradient(145deg, var(--surface), #f5f0ff);
}

.action-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 15px;
    color: #fff;
    background: var(--primary);
    font-size: 1.45rem;
}

.action-icon-soft {
    color: var(--rose);
    background: var(--rose-soft);
}

.coming-soon {
    position: absolute;
    right: 20px;
    bottom: 18px;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 750;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 22px;
}

.stat-card {
    display: flex;
    min-height: 128px;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    border-radius: var(--radius-medium);
}

.stat-card-highlight {
    border-color: #f4d3e4;
    background: var(--surface-warm);
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 850;
    line-height: 1;
    letter-spacing: -0.06em;
}

.stat-label {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.86rem;
}

.panel {
    padding: 28px;
    border-radius: var(--radius-medium);
}

.foundation-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 22px;
}

.foundation-panel p:last-child {
    max-width: 68ch;
    margin-bottom: 0;
    color: var(--muted);
}

.privacy-badge,
.status-pill,
.coming-soon {
    white-space: nowrap;
}

.privacy-badge {
    padding: 9px 13px;
    border-radius: 999px;
    color: var(--success);
    background: #e6f5ef;
    font-size: 0.78rem;
    font-weight: 800;
}

.cost-notice {
    display: flex;
    gap: 8px 18px;
    margin-bottom: 20px;
    padding: 14px 18px;
    flex-wrap: wrap;
    border: 1px solid #d9d0ef;
    border-radius: 14px;
    color: var(--primary-deep);
    background: var(--primary-soft);
    font-size: 0.84rem;
}

.cost-notice-warning {
    border-color: #efd8b3;
    color: var(--warning);
    background: #fff6e8;
}

.spend-guard-panel {
    margin-bottom: 18px;
    border-top: 4px solid var(--success);
}

.spend-guard-panel.spend-state-attention {
    border-top-color: var(--warning);
}

.spend-guard-panel.spend-state-blocked {
    border-top-color: var(--danger);
}

.spend-guard-heading,
.spend-limit-label,
.spend-operation-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.spend-guard-heading h2 {
    max-width: 760px;
    margin-bottom: 0;
    font-size: clamp(1.2rem, 3vw, 1.55rem);
}

.spend-guard-state {
    padding: 7px 11px;
    border-radius: 999px;
    color: var(--success);
    background: #e6f5ef;
    font-size: 0.72rem;
    font-weight: 850;
    white-space: nowrap;
}

.spend-state-attention .spend-guard-state {
    color: var(--warning);
    background: #fff3df;
}

.spend-state-blocked .spend-guard-state {
    color: var(--danger);
    background: #fdebed;
}

.spend-limit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 24px;
}

.spend-limit-label {
    margin-bottom: 8px;
    font-size: 0.84rem;
}

.spend-limit-label strong {
    white-space: nowrap;
}

.spend-limit-grid progress {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    accent-color: var(--primary);
}

.spend-limit-grid progress::-webkit-progress-bar {
    border-radius: 999px;
    background: var(--primary-soft);
}

.spend-limit-grid progress::-webkit-progress-value {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--rose));
}

.spend-limit-grid small,
.spend-guard-note {
    color: var(--muted);
    font-size: 0.74rem;
}

.spend-operation-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.spend-operation-list li {
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--surface-soft);
    font-size: 0.78rem;
}

.spend-operation-list strong {
    font-size: 0.7rem;
}

.spend-operation-enabled {
    color: var(--success);
}

.spend-operation-paused {
    color: var(--danger);
}

.spend-guard-note {
    margin: 16px 0 0;
}

.spend-guard-note span {
    display: block;
    margin-top: 4px;
    color: var(--warning);
    font-weight: 750;
}

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

.cost-summary-card {
    display: flex;
    min-height: 132px;
    padding: 20px;
    flex-direction: column;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-medium);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 36px rgba(59, 43, 92, 0.06);
}

.cost-summary-card:last-child {
    border-color: #dacdf5;
    background: linear-gradient(145deg, #fff, var(--primary-soft));
}

.cost-summary-card strong {
    margin-block: 8px 5px;
    font-size: clamp(1.5rem, 3.5vw, 2.15rem);
    line-height: 1;
    letter-spacing: -0.05em;
}

.cost-period,
.cost-summary-card small,
.cost-legend,
.cost-sync-time,
.cost-footnote {
    color: var(--muted);
    font-size: 0.74rem;
}

.cost-period {
    font-weight: 800;
}

.cost-health-grid,
.cost-breakdown-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(240px, 0.7fr);
    gap: 18px;
    margin-bottom: 18px;
}

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

.cost-distribution-panel {
    margin-bottom: 18px;
}

.cost-distribution-note {
    max-width: 860px;
    margin: 8px 0 22px;
    color: var(--muted);
    font-size: 0.84rem;
}

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

.cost-distribution-grid h3 {
    margin-bottom: 8px;
    font-size: 1rem;
}

.cost-distribution-table {
    min-width: 500px;
}

.cost-distribution-table th:not(:first-child),
.cost-distribution-table td:not(:first-child) {
    text-align: right;
}

.cost-distribution-table td {
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    vertical-align: top;
}

.cost-member-cell strong,
.cost-member-cell small,
.cost-unpriced {
    display: block;
}

.cost-member-cell {
    max-width: 190px;
}

.cost-member-cell small,
.cost-unpriced {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
}

.cost-unpriced {
    color: var(--warning);
}

.cost-p95 {
    color: var(--primary-deep);
    font-weight: 850;
}

.cost-chart-panel {
    min-width: 0;
}

.cost-chart {
    display: flex;
    height: 230px;
    gap: 5px;
    align-items: flex-end;
    margin-top: 22px;
    padding-top: 28px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
}

.cost-bar-column {
    position: relative;
    display: flex;
    min-width: 13px;
    height: 100%;
    flex: 1 0 13px;
    align-items: center;
    flex-direction: column;
    justify-content: flex-end;
}

.cost-bar {
    width: 100%;
    min-height: 2px;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, var(--rose), var(--primary));
}

.cost-bar-height-1 { height: 5%; }
.cost-bar-height-2 { height: 10%; }
.cost-bar-height-3 { height: 15%; }
.cost-bar-height-4 { height: 20%; }
.cost-bar-height-5 { height: 25%; }
.cost-bar-height-6 { height: 30%; }
.cost-bar-height-7 { height: 35%; }
.cost-bar-height-8 { height: 40%; }
.cost-bar-height-9 { height: 45%; }
.cost-bar-height-10 { height: 50%; }
.cost-bar-height-11 { height: 55%; }
.cost-bar-height-12 { height: 60%; }
.cost-bar-height-13 { height: 65%; }
.cost-bar-height-14 { height: 70%; }
.cost-bar-height-15 { height: 75%; }
.cost-bar-height-16 { height: 80%; }
.cost-bar-height-17 { height: 85%; }
.cost-bar-height-18 { height: 90%; }
.cost-bar-height-19 { height: 95%; }
.cost-bar-height-20 { height: 100%; }

.cost-bar-estimated {
    background: repeating-linear-gradient(135deg, #a88bec 0 4px, #d6c9f6 4px 8px);
}

.cost-bar-date {
    padding-top: 5px;
    color: var(--muted);
    font-size: 0.57rem;
}

.cost-bar-value {
    display: none;
}

.cost-health-panel dl {
    margin: 20px 0;
}

.cost-health-panel dl div,
.cost-breakdown-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-block: 12px;
    border-bottom: 1px solid var(--line);
}

.cost-health-panel dt,
.cost-breakdown-list span {
    color: var(--muted);
    font-size: 0.84rem;
}

.cost-health-panel dd {
    margin: 0;
    font-weight: 850;
}

.cost-breakdown-list small {
    display: block;
    margin-top: 2px;
}

.cost-breakdown-list strong {
    white-space: nowrap;
}

.cost-footnote {
    margin: 4px 0 0;
    text-align: center;
}

.system-overview {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    margin-bottom: 18px;
    padding: clamp(22px, 4vw, 32px);
    border: 1px solid var(--line);
    border-radius: var(--radius-large);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow);
}

.system-overview h2 {
    margin-bottom: 7px;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    letter-spacing: -0.04em;
}

.system-overview p:last-child {
    margin-bottom: 0;
    color: var(--muted);
}

.system-overview-mark {
    width: 20px;
    height: 20px;
    border: 5px solid currentColor;
    border-radius: 999px;
    color: var(--success);
    box-shadow: 0 0 0 8px rgba(37, 116, 91, 0.11);
}

.system-state-attention .system-overview-mark {
    color: var(--warning);
    box-shadow: 0 0 0 8px rgba(139, 91, 18, 0.11);
}

.system-state-problem .system-overview-mark {
    color: var(--danger);
    box-shadow: 0 0 0 8px rgba(166, 58, 70, 0.11);
}

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

.system-status-card {
    display: flex;
    min-width: 0;
    min-height: 260px;
    padding: 24px;
    flex-direction: column;
    border: 1px solid var(--line);
    border-top: 4px solid var(--success);
    border-radius: var(--radius-medium);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 36px rgba(59, 43, 92, 0.06);
}

.system-status-card.system-state-attention {
    border-top-color: var(--warning);
}

.system-status-card.system-state-problem {
    border-top-color: var(--danger);
}

.system-status-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.system-status-heading h2 {
    margin: 0;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
}

.system-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 999px;
    color: var(--success);
    background: #e6f5ef;
    font-size: 0.7rem;
    font-weight: 850;
    white-space: nowrap;
}

.system-status-pill span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
}

.system-state-attention .system-status-pill {
    color: var(--warning);
    background: #fff3df;
}

.system-state-problem .system-status-pill {
    color: var(--danger);
    background: #fdebed;
}

.system-status-summary {
    margin: 18px 0;
    color: var(--ink);
    font-weight: 700;
}

.system-status-facts {
    display: grid;
    gap: 8px;
    margin: 0 0 18px;
    padding: 0;
    color: var(--muted);
    font-size: 0.82rem;
    list-style: none;
}

.system-status-facts li {
    position: relative;
    padding-left: 16px;
    overflow-wrap: anywhere;
}

.system-status-facts li::before {
    position: absolute;
    top: 0.58em;
    left: 0;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: #b5a9c9;
    content: "";
}

.system-status-link {
    margin-top: auto;
    align-self: flex-start;
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
}

.system-status-footer {
    margin-top: 18px;
    color: var(--muted);
    font-size: 0.74rem;
    text-align: center;
}

.system-status-footer p {
    margin-bottom: 4px;
}

.auth-shell {
    display: grid;
    min-height: calc(100vh - 230px);
    place-items: center;
    padding-block: 20px;
}

.auth-card {
    width: min(100%, 510px);
    padding: clamp(26px, 7vw, 48px);
    border: 1px solid rgba(232, 226, 241, 0.9);
    border-radius: var(--radius-large);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.auth-card h1 {
    font-size: clamp(2rem, 8vw, 3.25rem);
}

.auth-intro,
.auth-note {
    color: var(--muted);
}

.auth-intro {
    margin-bottom: 28px;
}

.auth-note {
    margin: 24px 0 0;
    font-size: 0.86rem;
    text-align: center;
}

.security-setup,
.security-success,
.security-secondary,
.security-danger {
    max-width: 760px;
    margin-bottom: 18px;
}

.security-success {
    border-color: rgba(37, 116, 91, 0.28);
}

.security-danger {
    border-color: rgba(157, 53, 75, 0.28);
}

.security-steps {
    display: grid;
    gap: 12px;
    padding-left: 22px;
}

.security-key {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin-top: 8px;
    padding: 8px 10px;
    overflow-wrap: anywhere;
    border-radius: 8px;
    background: var(--surface-soft);
    font-size: 0.9rem;
    user-select: all;
}

.security-form {
    max-width: 480px;
    margin-top: 20px;
}

.recovery-code-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
    max-width: 520px;
    padding: 0;
    list-style: none;
}

.recovery-code-list code {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--surface-soft);
    font-size: 0.9rem;
    text-align: center;
    user-select: all;
}

.stack-form {
    display: grid;
    gap: 9px;
}

label {
    margin-top: 9px;
    color: var(--ink);
    font-size: 0.86rem;
    font-weight: 750;
}

input:not([type="checkbox"]) {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border: 1px solid #dcd4e8;
    border-radius: 13px;
    color: var(--ink);
    background: #fff;
}

select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dcd4e8;
    border-radius: 13px;
    color: var(--ink);
    background: #fff;
}

select {
    min-height: 50px;
}

textarea {
    resize: vertical;
}

input:not([type="checkbox"]):focus {
    border-color: var(--primary);
    outline: 3px solid rgba(112, 71, 235, 0.12);
}

.check-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
    margin-block: 8px 4px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 500;
}

.check-row input {
    width: 19px;
    height: 19px;
    margin-top: 2px;
    accent-color: var(--primary);
}

.button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    border: 0;
    border-radius: 13px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.button-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-deep));
    box-shadow: 0 10px 22px rgba(77, 36, 202, 0.18);
}

.button-secondary {
    border: 1px solid var(--line);
    color: var(--primary-deep);
    background: #fff;
}

.button-danger {
    border: 1px solid #f0bed0;
    color: #a82d57;
    background: #fff5f8;
}

.button-wide {
    width: 100%;
    margin-top: 10px;
}

.field-error,
.validation-summary {
    color: #a82d57;
    font-size: 0.82rem;
}

.validation-summary:empty,
.field-error:empty {
    display: none;
}

.validation-summary.validation-summary-valid {
    display: none;
}

.validation-summary ul {
    margin: 0 0 8px;
    padding-left: 20px;
}

.notice {
    display: grid;
    gap: 4px;
    margin-bottom: 24px;
    padding: 16px;
    border-radius: 13px;
}

.notice-warning {
    color: var(--warning);
    background: #fff3db;
}

.credit-balance-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 1.25rem 0 2rem;
}

.credit-balance-card,
.credit-history-entry {
    padding: 1.15rem;
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.credit-balance-value {
    margin: .15rem 0 0;
    color: var(--primary-deep);
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 700;
    line-height: 1;
}

.credit-history {
    display: grid;
    gap: .75rem;
}

.credit-history-entry {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.credit-history-entry p {
    margin: .25rem 0 0;
}

.credit-history-change {
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .credit-balance-grid {
        grid-template-columns: 1fr;
    }

    .credit-history-entry {
        display: grid;
    }

    .credit-history-change {
        text-align: left;
        white-space: normal;
    }
}

.page-heading {
    margin-bottom: 24px;
}

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

.page-heading-actions h1,
.compact-heading h1 {
    margin-bottom: 10px;
}

.compact-heading {
    max-width: 720px;
}

.page-heading p:last-child {
    color: var(--muted);
}

.compact-panel,
.invitation-result {
    margin-bottom: 18px;
}

.invitation-result {
    border-color: #d9cfff;
    background: linear-gradient(145deg, #fff, #f7f3ff);
}

.copy-field,
.inline-form {
    display: flex;
    gap: 12px;
    align-items: end;
}

.copy-field input,
.inline-form > div {
    flex: 1;
}

.inline-form label {
    display: block;
    margin-top: 0;
    margin-bottom: 7px;
}

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

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

th,
td {
    padding: 14px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

th {
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.status-pill {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--muted);
    background: #f1eef5;
    font-size: 0.72rem;
    font-weight: 800;
}

.status-ready {
    color: var(--success);
    background: #e6f5ef;
}

.status-pill-laundry {
    color: #286f86;
    background: #e2f3f8;
}

.empty-state {
    margin-bottom: 0;
    color: var(--muted);
}

.back-link {
    display: inline-block;
    margin-bottom: 24px;
    font-size: 0.88rem;
    font-weight: 750;
    text-decoration: none;
}

.wardrobe-empty {
    display: grid;
    min-height: 360px;
    place-items: center;
    align-content: center;
    text-align: center;
}

.wardrobe-empty p:not(.eyebrow) {
    max-width: 46ch;
    color: var(--muted);
}

.empty-state-tips {
    display: flex;
    gap: 7px;
    margin: 4px 0 22px;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
}

.empty-state-tips li {
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 0.76rem;
}

.empty-icon {
    display: grid;
    width: 62px;
    height: 62px;
    margin-bottom: 18px;
    place-items: center;
    border-radius: 20px;
    color: var(--primary-deep);
    background: var(--primary-soft);
    font-size: 2rem;
}

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

.wardrobe-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-medium);
    color: var(--ink);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 36px rgba(59, 43, 92, 0.06);
    text-decoration: none;
}

.wardrobe-card-image {
    display: grid;
    aspect-ratio: 4 / 5;
    place-items: center;
    overflow: hidden;
    background: #f0ecf7;
}

.wardrobe-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wardrobe-card-image .empty-icon {
    margin: 0;
}

.wardrobe-card-copy {
    display: grid;
    gap: 2px;
    padding: 15px 16px 17px;
}

.wardrobe-card-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wardrobe-card-copy span {
    color: var(--muted);
    font-size: 0.8rem;
}

.wardrobe-card > .status-pill {
    position: absolute;
    top: 12px;
    right: 12px;
}

.wardrobe-tools {
    margin-bottom: 16px;
    padding: 18px;
}

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

.wardrobe-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.wardrobe-search-row label,
.wardrobe-filter-grid label {
    display: block;
    margin: 0 0 7px;
}

.wardrobe-filter-disclosure {
    padding-top: 2px;
}

.wardrobe-filter-disclosure summary {
    display: flex;
    gap: 9px;
    width: fit-content;
    align-items: center;
    color: var(--primary-deep);
    font-size: 0.84rem;
    font-weight: 800;
    cursor: pointer;
}

.wardrobe-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.wardrobe-filter-actions {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-top: 14px;
}

.wardrobe-clear-link {
    color: var(--primary-deep);
    font-size: 0.84rem;
    font-weight: 800;
    text-decoration: none;
}

.wardrobe-results-summary {
    display: flex;
    min-height: 32px;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.84rem;
}

.wardrobe-results-summary p {
    margin: 0;
}

.wardrobe-results-summary strong {
    color: var(--ink);
}

.wardrobe-no-results {
    display: grid;
    min-height: 280px;
    place-items: center;
    align-content: center;
    text-align: center;
}

.wardrobe-no-results p {
    max-width: 44ch;
    color: var(--muted);
}

.catalogue-form {
    display: grid;
    gap: 18px;
}

.photo-field > label {
    display: block;
    margin: 0 0 10px;
}

.photo-picker {
    position: relative;
    display: grid;
    min-height: 330px;
    place-items: center;
    overflow: hidden;
    border: 2px dashed #cfc3e2;
    border-radius: var(--radius-medium);
    background: #faf8fe;
}

.photo-picker[data-photo-state="ready"] {
    border-style: solid;
    border-color: #80c8ae;
}

.photo-picker[data-photo-state="problem"] {
    border-color: #d99aaa;
}

.photo-picker input[type="file"] {
    position: absolute;
    z-index: 2;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.photo-picker-selected {
    position: relative;
    display: grid;
    width: 100%;
    min-height: 326px;
    place-items: center;
}

.photo-picker-selected[hidden] {
    display: none;
}

.photo-picker-prompt {
    display: grid;
    max-width: 300px;
    place-items: center;
    gap: 6px;
    padding: 28px;
    color: var(--muted);
    text-align: center;
}

.photo-picker-prompt strong {
    color: var(--ink);
}

.photo-picker-prompt span:last-child,
.field-help {
    font-size: 0.8rem;
}

.photo-picker-icon {
    display: grid;
    width: 56px;
    height: 56px;
    margin-bottom: 8px;
    place-items: center;
    border-radius: 18px;
    color: #fff;
    background: var(--primary);
    font-size: 1.7rem;
}

.photo-picker img {
    width: 100%;
    max-height: 560px;
    object-fit: contain;
}

.photo-picker-selected-overlay {
    position: absolute;
    z-index: 1;
    right: 14px;
    bottom: 14px;
    left: 14px;
    display: grid;
    gap: 1px;
    padding: 11px 13px;
    border-radius: 12px;
    color: #fff;
    background: rgba(35, 28, 49, 0.82);
    backdrop-filter: blur(10px);
    pointer-events: none;
}

.photo-picker-selected-overlay span {
    font-size: 0.76rem;
}

.photo-selection-status {
    display: grid;
    gap: 2px;
    margin: 10px 0 0;
    padding: 11px 13px;
    border-radius: 12px;
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 0.8rem;
}

.photo-selection-status[hidden] {
    display: none;
}

.photo-selection-status strong {
    color: var(--ink);
}

.photo-selection-status[data-state="ready"] {
    color: var(--success);
    background: #e6f5ef;
}

.photo-selection-status[data-state="ready"] strong {
    color: var(--success);
}

.photo-selection-status[data-state="problem"] {
    color: var(--danger);
    background: #fff0f3;
}

.photo-selection-status[data-state="problem"] strong {
    color: var(--danger);
}

.wardrobe-save-confirmation {
    margin-bottom: 18px;
}

.wardrobe-duplicate-warning {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 20px;
    margin-bottom: 18px;
    align-items: center;
    border-color: #e4c987;
    background: #fff9e9;
}

.wardrobe-duplicate-warning img {
    width: 150px;
    aspect-ratio: 4 / 5;
    border-radius: 13px;
    object-fit: cover;
}

.wardrobe-duplicate-warning h2 {
    margin-bottom: 7px;
    font-size: 1.35rem;
}

.wardrobe-duplicate-warning p:not(.eyebrow) {
    color: var(--muted);
}

.field-help {
    margin: 10px 0 0;
    color: var(--muted);
}

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

.choice-group {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.choice-group legend {
    margin-bottom: 9px;
    font-size: 0.86rem;
    font-weight: 750;
}

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

.choice-grid label {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    font-weight: 650;
}

.choice-grid input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.field-group {
    display: grid;
    align-content: start;
    gap: 7px;
}

.field-group label {
    margin: 0;
}

.field-group-wide {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.wardrobe-draft-photo {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
    align-items: center;
    gap: clamp(20px, 4vw, 42px);
}

.wardrobe-draft-photo img {
    width: 100%;
    max-height: 440px;
    object-fit: contain;
    border-radius: var(--radius-medium);
    background: #f0ecf7;
}

.wardrobe-draft-photo h2 {
    margin-bottom: 8px;
}

.wardrobe-draft-details summary {
    cursor: pointer;
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 800;
}

.wardrobe-draft-details[open] summary {
    margin-bottom: 8px;
}

.wardrobe-draft-details > .form-grid {
    margin-top: 20px;
}

.wardrobe-details {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: clamp(28px, 6vw, 72px);
    align-items: start;
}

.wardrobe-details-image {
    display: grid;
    min-height: 520px;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-large);
    background: #f0ecf7;
    box-shadow: var(--shadow);
}

.wardrobe-details-image img {
    width: 100%;
    max-height: 760px;
    object-fit: contain;
}

.wardrobe-details-image .empty-icon {
    margin: 0;
}

.wardrobe-details-copy {
    padding-top: 20px;
}

.wardrobe-details-copy h1 {
    font-size: clamp(2.3rem, 5vw, 3.8rem);
}

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

.details-title-row h1 {
    margin-bottom: 14px;
}

.analysis-note {
    display: grid;
    gap: 2px;
    margin: 22px 0;
    padding: 14px 16px;
    border-radius: 14px;
    color: var(--muted);
    background: #f1eef5;
    font-size: 0.86rem;
}

.analysis-note strong {
    color: var(--ink);
}

.analysis-note-ready {
    color: var(--success);
    background: #e6f5ef;
}

.analysis-note-ready strong {
    color: var(--success);
}

.analysis-note-warning {
    color: var(--warning);
    background: #fff3db;
}

.analysis-note-warning strong {
    color: var(--warning);
}

.details-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.details-actions form {
    margin: 0;
}

.availability-control {
    display: flex;
    gap: 18px;
    margin: 0 0 20px;
    padding: 16px;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
}

.availability-control > div {
    display: grid;
    gap: 2px;
}

.availability-control .eyebrow {
    margin-bottom: 2px;
}

.availability-control span {
    color: var(--muted);
    font-size: 0.8rem;
}

.availability-control form {
    flex: 0 0 auto;
    margin: 0;
}

.availability-actions {
    display: flex !important;
    flex: 0 0 auto;
    gap: 8px !important;
}

.item-description {
    color: var(--muted);
    white-space: pre-line;
}

.item-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 30px 0;
}

.item-facts div {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
}

.item-facts dt {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.item-facts dd {
    margin: 4px 0 0;
    font-weight: 750;
}

.reference-guidance {
    display: grid;
    grid-template-columns: minmax(180px, 0.7fr) minmax(280px, 1fr) minmax(280px, 1fr);
    gap: 28px;
    align-items: start;
    margin-bottom: 22px;
}

.reference-guidance > div > p:last-child {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.reference-guidance-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.reference-guidance-steps li {
    padding: 11px 12px;
    border-radius: 12px;
    background: var(--surface-soft);
}

.reference-guidance-steps strong,
.reference-guidance-steps span {
    display: block;
}

.reference-guidance-steps strong {
    font-size: 0.78rem;
}

.reference-guidance-steps span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.72rem;
}

.reference-privacy {
    margin: 0;
    padding: 15px;
    border-radius: 14px;
    color: var(--success);
    background: #e6f5ef;
    font-size: 0.86rem;
}

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

.reference-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-medium);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 36px rgba(59, 43, 92, 0.06);
}

.reference-card-image {
    position: relative;
    display: grid;
    aspect-ratio: 3 / 4;
    place-items: center;
    overflow: hidden;
    background: linear-gradient(145deg, #f0ecf7, #faf8fe);
}

.reference-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.reference-placeholder {
    color: #c7b8e1;
    font-size: 5rem;
}

.reference-priority {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--primary-deep);
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.7rem;
    font-weight: 800;
}

.reference-status {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.68rem;
    font-weight: 800;
}

.reference-status.is-added {
    color: var(--success);
    background: rgba(230, 245, 239, 0.94);
}

.reference-card-copy {
    padding: 18px;
}

.reference-card-copy p {
    min-height: 3.8em;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 0.84rem;
}

.reference-card-copy .reference-date {
    min-height: 0;
    margin-top: -6px;
    font-size: 0.74rem;
}

.reference-upload-form {
    display: grid;
    gap: 8px;
}

.reference-upload-form label {
    margin: 0;
}

.reference-upload-form input[type="file"] {
    width: 100%;
    color: var(--muted);
    font-size: 0.78rem;
}

.reference-upload-form input[type="file"]::file-selector-button {
    margin-right: 8px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--ink);
    background: var(--surface-soft);
    font-weight: 700;
}

.reference-photo-picker[data-photo-state="ready"] input[type="file"] {
    color: var(--success);
}

.reference-photo-selected {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 10px;
    margin-top: 8px;
    padding: 8px;
    align-items: center;
    border: 1px solid #80c8ae;
    border-radius: 12px;
    background: #f1faf7;
}

.reference-photo-selected[hidden] {
    display: none;
}

.reference-photo-selected img {
    width: 68px;
    height: 78px;
    border-radius: 9px;
    object-fit: cover;
}

.reference-photo-selected span,
.reference-photo-selected strong,
.reference-photo-selected small {
    display: block;
    min-width: 0;
}

.reference-photo-selected small {
    margin-top: 2px;
    color: var(--muted);
}

.reference-card-copy .photo-selection-status-compact {
    min-height: 0;
    margin: 0;
    text-align: left;
}

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

.reference-upload-form .field-help {
    margin: 0;
    text-align: left;
}

.reference-card-copy form:last-child {
    margin: 8px 0 0;
    text-align: center;
}

.reference-remove {
    color: #a82d57;
    font-size: 0.78rem;
}

.reference-footer-note {
    margin-top: 18px;
    text-align: center;
}

@media (max-width: 1180px) {
    .reference-guidance {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .reference-guidance > div:first-child {
        grid-column: 1 / -1;
    }

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

.notice-success {
    color: var(--success);
    background: #e6f5ef;
}

button:disabled,
input[type="submit"]:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

button[aria-busy="true"],
input[type="submit"][aria-busy="true"] {
    border-color: #d6d1dc !important;
    color: #625c6d !important;
    background: #e4e1e8 !important;
    box-shadow: none !important;
    cursor: wait;
    opacity: 1;
}

/* Bootstrap's standard small border-spinner pattern, kept local so the app
   does not load the complete framework stylesheet for one component. */
.spinner-border {
    --bs-spinner-width: 2rem;
    --bs-spinner-height: 2rem;
    --bs-spinner-border-width: 0.25em;
    display: inline-block;
    width: var(--bs-spinner-width);
    height: var(--bs-spinner-height);
    flex: 0 0 auto;
    border: var(--bs-spinner-border-width) solid currentcolor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -0.125em;
    animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
    --bs-spinner-width: 1rem;
    --bs-spinner-height: 1rem;
    --bs-spinner-border-width: 0.2em;
}

button[aria-busy="true"] .spinner-border {
    margin-right: 8px;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .spinner-border {
        animation-duration: 1.5s;
    }
}

@media (prefers-contrast: more) {
    :root {
        --muted: #51495e;
        --line: #bcb3c9;
    }

    .button,
    input,
    select,
    textarea,
    .panel,
    .bottom-nav {
        border-color: currentColor;
    }
}

@media (forced-colors: active) {
    .bottom-nav-item.is-active,
    .routine-shortcut-list button.is-today,
    .weather-context.has-weather {
        border: 2px solid Highlight;
    }

    .wordmark-mark,
    .brand-mark,
    .style-hero,
    .hero-panel {
        forced-color-adjust: none;
    }
}

.style-hero {
    position: relative;
    display: flex;
    min-height: 240px;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 22px;
    padding: clamp(30px, 7vw, 64px);
    overflow: hidden;
    border-radius: var(--radius-large);
    color: #fff;
    background:
        radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.2), transparent 12rem),
        linear-gradient(140deg, #2b1855, #6432e5 68%, #b83b88);
    box-shadow: var(--shadow);
}

.style-hero::after {
    position: absolute;
    right: -55px;
    bottom: -95px;
    width: 270px;
    height: 270px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    content: "";
}

.style-hero > * {
    position: relative;
    z-index: 1;
}

.style-hero h1 {
    margin-bottom: 12px;
    color: #fff;
    font-size: clamp(2.5rem, 7vw, 4.8rem);
}

.style-hero p:last-child {
    max-width: 58ch;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
}

.style-spark {
    display: grid;
    flex: 0 0 auto;
    width: 110px;
    height: 110px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    font-size: 3rem;
    backdrop-filter: blur(12px);
}

.style-request-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.75fr);
    gap: clamp(26px, 5vw, 54px);
    padding: clamp(24px, 5vw, 44px);
}

.style-request-form {
    display: grid;
    align-content: start;
    gap: 11px;
}

.style-request-form > label {
    margin-top: 0;
    font-size: 1.2rem;
}

.style-request-form textarea {
    min-height: 150px;
    padding: 18px;
    font-size: 1.02rem;
}

.prompt-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-block: 3px 10px;
}

.prompt-examples button {
    padding: 7px 11px;
    border: 1px solid #ddd4f2;
    border-radius: 999px;
    color: var(--primary-deep);
    background: var(--primary-soft);
    font-size: 0.76rem;
    font-weight: 750;
    cursor: pointer;
}

.routine-shortcuts {
    display: grid;
    gap: 8px;
    margin-bottom: 8px;
}

.routine-shortcuts > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    font-size: 0.8rem;
}

.routine-shortcuts > div:first-child a {
    font-weight: 750;
}

.routine-shortcut-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.routine-shortcut-list button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #ddd4f2;
    border-radius: 12px;
    color: var(--ink);
    background: #fff;
    font-weight: 750;
    cursor: pointer;
}

.routine-shortcut-list button.is-today {
    border-color: #b8a3ef;
    background: var(--primary-soft);
}

.routine-shortcut-list small {
    padding: 2px 6px;
    border-radius: 999px;
    color: #fff;
    background: var(--primary-deep);
    font-size: 0.64rem;
    text-transform: uppercase;
}

.routine-empty-link {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.82rem;
    font-weight: 750;
}

.weather-context {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 16px;
    align-items: center;
    margin: 2px 0 10px;
    padding: 14px;
    border: 1px solid #dcd5e8;
    border-radius: 15px;
    background: var(--surface-soft);
}

.weather-context.has-weather {
    border-color: #add9ca;
    background: #f2fbf7;
}

.weather-context-copy {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.weather-context-copy strong,
.weather-context-copy span {
    display: block;
}

.weather-context-copy span {
    color: var(--muted);
    font-size: 0.72rem;
}

.weather-context-icon {
    display: grid !important;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 11px;
    color: #336d87 !important;
    background: #e5f5fb;
    font-size: 1.1rem !important;
}

.weather-context-actions {
    display: flex;
    align-items: center;
}

.weather-context-status {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.weather-context-status[data-state="ready"] {
    color: var(--success);
}

.weather-context-status[data-state="problem"] {
    color: var(--danger);
}

.request-context {
    display: inline-flex;
    max-width: 70ch;
    align-items: flex-start;
    gap: 7px;
    margin: 0 0 8px;
    padding: 7px 11px;
    border-radius: 10px;
    color: #335c6e;
    background: #eaf6fa;
    font-size: 0.82rem;
}

.routine-layout {
    display: grid;
    grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
    gap: 24px;
    align-items: start;
}

.routine-form-panel {
    padding: clamp(22px, 4vw, 34px);
}

.routine-form {
    display: grid;
    gap: 16px;
}

.routine-form > div:not(.form-actions) {
    display: grid;
    gap: 6px;
}

.routine-form input[type="text"],
.routine-form input[type="time"],
.routine-form textarea {
    width: 100%;
}

.routine-days {
    margin: 0;
    padding: 0;
    border: 0;
}

.routine-days legend {
    margin-bottom: 8px;
    font-weight: 750;
}

.routine-days > div {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
}

.routine-days label {
    display: grid;
    min-height: 50px;
    place-items: center;
    gap: 1px;
    padding: 5px 2px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
    font-size: 0.7rem;
    cursor: pointer;
}

.routine-days input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.routine-list-section {
    min-width: 0;
}

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

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

.routine-card h3 {
    margin: 3px 0 5px;
}

.routine-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.routine-schedule {
    color: var(--primary-deep);
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.routine-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.routine-empty-state {
    min-height: 260px;
}

.style-submit {
    min-height: 52px;
}

.preference-guidance {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.preference-guidance > span:first-child {
    flex: 0 0 auto;
    color: var(--rose);
    font-size: 0.95rem;
    line-height: 1.4;
}

.wear-guidance > span:first-child {
    color: #2d7890;
}

.workflow-progress {
    display: grid;
    gap: 14px;
    margin-top: 5px;
    padding: 16px;
    border: 1px solid #d8cbf3;
    border-radius: 16px;
    color: var(--primary-deep);
    background: linear-gradient(145deg, #f7f3ff, #fff8fc);
}

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

.workflow-progress-heading {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.workflow-progress-heading .spinner-border {
    --bs-spinner-width: 1.8rem;
    --bs-spinner-height: 1.8rem;
    --bs-spinner-border-width: 0.18em;
}

.workflow-progress-heading strong,
.workflow-progress-heading span {
    display: block;
}

.workflow-progress-heading span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.76rem;
}

.workflow-progress ol {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.workflow-progress li {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 6px;
    align-items: center;
    padding: 8px;
    border-radius: 10px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.65);
    font-size: 0.7rem;
    font-weight: 750;
}

.workflow-progress li > span {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    color: var(--muted);
    background: #e9e5ee;
    font-size: 0.67rem;
}

.workflow-progress li.is-active {
    color: var(--primary-deep);
    background: #fff;
    box-shadow: inset 0 0 0 1px #d8cbf3;
}

.workflow-progress li.is-active > span {
    color: #fff;
    background: var(--primary);
}

.workflow-progress li.is-complete > span {
    color: #fff;
    background: var(--success);
}

.style-readiness {
    padding: 24px;
    border-radius: 20px;
    background: var(--surface-soft);
}

.style-readiness h2 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.readiness-row {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.readiness-row > span {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    color: var(--muted);
    background: #e9e5ee;
    font-size: 0.8rem;
    font-weight: 850;
}

.readiness-row.is-ready > span {
    color: #fff;
    background: var(--success);
}

.readiness-row strong,
.readiness-row small {
    display: block;
}

.readiness-row small {
    margin-top: 2px;
    color: var(--muted);
}

.style-readiness .button {
    width: 100%;
    margin-top: 8px;
}

.recent-outfits {
    margin-top: 38px;
}

.section-title-row,
.outfit-title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.section-title-row h2 {
    margin-bottom: 0;
}

.text-link {
    font-size: 0.84rem;
    font-weight: 750;
    text-decoration: none;
}

.request-history-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.request-history-card {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr) auto auto;
    gap: 16px;
    align-items: center;
    padding: 17px 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.88);
    text-decoration: none;
}

.request-history-card:hover {
    border-color: #d5c8ee;
    box-shadow: 0 10px 28px rgba(59, 43, 92, 0.07);
}

.request-history-card small,
.request-history-date {
    color: var(--muted);
    font-size: 0.76rem;
}

.request-history-card-status {
    border-color: #ead7ae;
    background: #fffaf0;
}

.request-history-card-status:hover {
    border-color: #ead7ae;
    box-shadow: none;
}

.request-history-state span {
    display: block;
}

.request-retry-form {
    margin: 0;
}

.button-compact {
    min-height: 38px;
    padding: 8px 13px;
    font-size: 0.76rem;
}

.request-status-badge {
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--warning);
    background: #fff0cf;
    font-size: 0.72rem;
    font-weight: 800;
}

.outfit-results-heading blockquote {
    max-width: 760px;
    margin: 16px 0 6px;
    color: var(--muted);
    font-size: 1.05rem;
}

.request-date {
    color: var(--muted);
    font-size: 0.78rem;
}

.outfit-suggestion-list {
    display: grid;
    gap: 28px;
}

.outfit-suggestion {
    display: grid;
    grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-large);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
    scroll-margin-top: 90px;
}

.outfit-suggestion-visual {
    position: relative;
    min-height: 620px;
    overflow: hidden;
    background: linear-gradient(145deg, #e9e1ff, #fbe8f3);
}

.outfit-suggestion-visual > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 7px 10px;
    border-radius: 999px;
    color: #fff;
    background: rgba(33, 26, 50, 0.74);
    font-size: 0.7rem;
    font-weight: 800;
    backdrop-filter: blur(10px);
}

.outfit-collage {
    display: grid;
    width: 100%;
    height: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 1px;
    background: rgba(255, 255, 255, 0.6);
}

.outfit-collage img {
    width: 100%;
    height: 100%;
    min-height: 300px;
    object-fit: cover;
}

.outfit-collage > span {
    display: grid;
    min-height: 300px;
    place-items: center;
    color: var(--primary-deep);
    font-size: 2rem;
}

.outfit-collage > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.preview-number {
    position: absolute;
    right: 22px;
    bottom: 12px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 4.2rem;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 4px 22px rgba(33, 26, 50, 0.25);
}

.outfit-suggestion-copy {
    display: flex;
    flex-direction: column;
    padding: clamp(25px, 5vw, 48px);
}

.outfit-title-row {
    align-items: flex-start;
}

.outfit-title-row h2 {
    margin-bottom: 0;
    font-size: clamp(1.75rem, 4vw, 2.6rem);
}

.save-outfit-button {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

.save-outfit-button.is-saved {
    border-color: #f2bfd7;
    color: #a82d57;
    background: var(--rose-soft);
}

.outfit-summary {
    margin-block: 16px 22px;
    color: var(--muted);
    font-size: 1.02rem;
}

.selected-item-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.selected-item {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 11px;
    align-items: center;
    min-width: 0;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
}

.selected-item img,
.selected-item > span {
    width: 54px;
    height: 54px;
    border-radius: 10px;
    object-fit: cover;
}

.selected-item > span {
    display: grid;
    place-items: center;
    background: var(--primary-soft);
}

.selected-item strong,
.selected-item small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-item strong {
    font-size: 0.82rem;
}

.selected-item small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.7rem;
}

.styling-note {
    margin-top: 20px;
    padding: 16px 18px;
    border-left: 3px solid var(--rose);
    border-radius: 0 13px 13px 0;
    background: var(--surface-warm);
}

.styling-note strong {
    font-size: 0.78rem;
}

.styling-note p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 0.87rem;
}

.outfit-feedback {
    margin-top: 20px;
    padding: 17px;
    border: 1px solid #e0d7f4;
    border-radius: 16px;
    background: linear-gradient(145deg, #faf8ff, #fffafd);
}

.outfit-feedback-heading {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    justify-content: space-between;
}

.outfit-feedback-heading .eyebrow {
    margin-bottom: 3px;
    font-size: 0.65rem;
}

.outfit-feedback-heading h3 {
    margin: 0;
    font-size: 1rem;
}

.feedback-saved-state {
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--success);
    background: #e4f4ed;
    font-size: 0.68rem;
    font-weight: 800;
}

.outfit-feedback-form {
    display: grid;
    gap: 10px;
    margin-top: 13px;
}

.feedback-reactions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.feedback-reactions legend {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.feedback-reactions label {
    display: flex;
    gap: 8px;
    align-items: center;
    min-height: 44px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    font-size: 0.78rem;
    font-weight: 750;
    cursor: pointer;
}

.feedback-reactions label:has(input:checked) {
    border-color: #b9a5ee;
    color: var(--primary-deep);
    background: var(--primary-soft);
}

.feedback-reactions input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin: 0;
    accent-color: var(--primary);
}

.feedback-note-label {
    margin: 2px 0 -4px;
    font-size: 0.76rem;
    font-weight: 750;
}

.feedback-note-label span {
    color: var(--muted);
    font-weight: 500;
}

.outfit-feedback-form textarea {
    min-height: 72px;
    padding: 10px 12px;
    font-size: 0.82rem;
}

.outfit-feedback-form small {
    color: var(--muted);
    font-size: 0.69rem;
}

.outfit-feedback-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.outfit-wear {
    display: grid;
    gap: 11px;
    margin-top: 14px;
    padding: 17px;
    border: 1px solid #d5e7eb;
    border-radius: 16px;
    background: linear-gradient(145deg, #f7fcfd, #fff);
}

.outfit-wear-heading {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    justify-content: space-between;
}

.outfit-wear-heading .eyebrow {
    margin-bottom: 3px;
    color: #2d7890;
    font-size: 0.65rem;
}

.outfit-wear-heading h3 {
    margin: 0;
    font-size: 1rem;
}

.wear-count {
    padding: 4px 8px;
    border-radius: 999px;
    color: #286f86;
    background: #e2f3f8;
    font-size: 0.68rem;
    font-weight: 800;
    white-space: nowrap;
}

.outfit-wear > p,
.outfit-wear > small {
    margin: 0;
    color: var(--muted);
    font-size: 0.72rem;
}

.outfit-wear-form {
    display: flex;
    gap: 9px;
    align-items: end;
    margin: 0;
}

.outfit-wear-form > div {
    display: grid;
    flex: 1;
    gap: 4px;
}

.outfit-wear-form label {
    font-size: 0.72rem;
    font-weight: 750;
}

.outfit-wear-form input {
    min-height: 42px;
    padding: 8px 10px;
}

.outfit-wear-list {
    display: grid;
    gap: 6px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.outfit-wear-list li {
    display: flex;
    gap: 10px;
    min-height: 36px;
    padding: 6px 9px;
    align-items: center;
    justify-content: space-between;
    border-radius: 10px;
    background: #fff;
    font-size: 0.75rem;
}

.outfit-wear-list form {
    margin: 0;
}

.preview-action-form,
.preview-prerequisite {
    display: grid;
    gap: 8px;
    margin-top: auto;
    padding-top: 24px;
}

.preview-action-form .button,
.preview-prerequisite .button {
    width: 100%;
}

.preview-action-form small,
.preview-prerequisite p {
    margin: 0;
    color: var(--muted);
    font-size: 0.74rem;
    text-align: center;
}

.preview-status {
    display: grid;
    gap: 2px;
    margin-top: 20px;
    padding: 13px 14px;
    border-radius: 13px;
    color: var(--primary-deep);
    background: var(--primary-soft);
    font-size: 0.78rem;
}

.preview-status span {
    color: var(--muted);
}

.preview-status-problem {
    color: var(--warning);
    background: #fff3db;
}

.preview-status + .preview-action-form {
    margin-top: 0;
    padding-top: 12px;
}

.workflow-progress-preview {
    margin: 2px 0;
    text-align: left;
}

.preview-action-form .workflow-progress-preview span {
    text-align: left;
}

.preview-delete-form {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

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

.data-page-heading {
    max-width: 760px;
}

.data-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.data-summary-grid article {
    display: grid;
    gap: 2px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.84);
}

.data-summary-grid strong {
    color: var(--primary-deep);
    font-size: 2rem;
    line-height: 1;
}

.data-summary-grid span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.data-export-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 28px;
    align-items: center;
}

.data-export-panel h2,
.data-history-panel h2,
.retention-panel h2,
.danger-zone h2 {
    margin-bottom: 8px;
}

.data-export-panel p:last-child,
.retention-panel li,
.danger-zone > p {
    color: var(--muted);
}

.data-export-panel form,
.data-history-actions form {
    margin: 0;
}

.data-history-panel,
.retention-panel,
.danger-zone {
    margin-top: 22px;
}

.development-import-panel {
    display: grid;
    gap: 18px;
    margin-top: 22px;
    border-color: #dbcdf8;
    background: #fbf9ff;
}

.development-import-panel h2 {
    margin-bottom: 8px;
}

.development-import-panel > div:first-child p:last-child {
    color: var(--muted);
}

.development-import-form {
    display: grid;
    max-width: 720px;
    gap: 16px;
    margin: 0;
}

.development-import-form > div:not(.validation-summary) {
    display: grid;
    gap: 7px;
}

.development-import-form label {
    font-size: 0.84rem;
    font-weight: 800;
}

.development-import-form input {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    background: #fff;
}

.development-import-form input[type="file"] {
    height: auto;
}

.development-import-form .button {
    justify-self: start;
}

.data-history-panel .section-title-row > span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 750;
}

.data-history-list {
    display: grid;
    gap: 0;
    margin-top: 16px;
}

.data-history-list article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 18px 0;
    border-top: 1px solid var(--line);
}

.data-history-copy h3 {
    margin: 3px 0 5px;
    font-size: 1rem;
    line-height: 1.3;
}

.data-history-copy p,
.data-history-note {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.data-history-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.retention-panel ul {
    display: grid;
    gap: 8px;
    margin: 12px 0 0;
    padding-left: 20px;
}

.danger-zone {
    border-color: #efc7d0;
    background: #fff9fb;
}

.delete-account-form {
    display: grid;
    max-width: 620px;
    gap: 16px;
    margin-top: 20px;
}

.delete-account-form > div:not(.validation-summary) {
    display: grid;
    gap: 7px;
}

.delete-account-form label {
    font-size: 0.84rem;
    font-weight: 800;
}

.delete-account-form input {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    background: #fff;
}

.delete-account-form .button {
    justify-self: start;
}

.illustrative-note {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 24px;
    padding: 17px 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.72);
}

.illustrative-note > span {
    display: grid;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    color: var(--primary-deep);
    background: var(--primary-soft);
    font-size: 0.75rem;
    font-weight: 850;
}

.illustrative-note p {
    margin: 0;
    font-size: 0.82rem;
}

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

.saved-outfit-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    color: var(--ink);
    background: #fff;
    box-shadow: 0 12px 32px rgba(59, 43, 92, 0.07);
    text-decoration: none;
}

.saved-outfit-image {
    display: grid;
    aspect-ratio: 4 / 5;
    place-items: center;
    overflow: hidden;
    color: var(--primary-deep);
    background: linear-gradient(145deg, var(--primary-soft), var(--rose-soft));
    font-size: 3rem;
}

.saved-outfit-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.saved-outfit-copy {
    padding: 18px;
}

.saved-outfit-copy h2,
.saved-outfit-copy h3 {
    margin-block: 5px 8px;
    font-size: 1.3rem;
}

.saved-outfit-copy p,
.saved-outfit-copy small {
    color: var(--muted);
}

.saved-outfit-copy p {
    margin-bottom: 12px;
    font-size: 0.86rem;
}

.saved-outfit-copy small {
    font-size: 0.72rem;
}

.worn-history-section {
    margin-bottom: 32px;
}

.worn-history-section .section-title-row > span {
    color: var(--muted);
    font-size: 0.76rem;
}

.worn-history-list {
    display: grid;
    gap: 9px;
}

.worn-history-card {
    display: grid;
    grid-template-columns: minmax(105px, auto) 1fr auto;
    gap: 14px;
    min-height: 64px;
    padding: 13px 15px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--ink);
    background: #fff;
    text-decoration: none;
}

.worn-history-card time {
    color: #286f86;
    font-size: 0.74rem;
    font-weight: 800;
}

.worn-history-card > span:nth-child(2) {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.worn-history-card small {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-heading + .empty-state {
    display: grid;
    min-height: 380px;
    place-items: center;
    align-content: center;
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: var(--radius-large);
    background: rgba(255, 255, 255, 0.9);
    text-align: center;
}

.page-heading + .empty-state p {
    max-width: 45ch;
}

.prose-page {
    width: min(100%, 760px);
    padding: clamp(25px, 6vw, 50px);
    border: 1px solid var(--line);
    border-radius: var(--radius-large);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.prose-page h1 {
    font-size: clamp(2.1rem, 6vw, 3.5rem);
}

.prose-page h2 {
    margin-top: 32px;
}

.prose-page p {
    color: var(--muted);
}

.bottom-nav {
    position: fixed;
    z-index: 30;
    right: 50%;
    bottom: calc(12px + env(safe-area-inset-bottom));
    display: flex;
    width: min(calc(100% - 24px), 520px);
    min-height: 68px;
    padding: 7px;
    transform: translateX(50%);
    border: 1px solid rgba(224, 216, 238, 0.9);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 16px 44px rgba(43, 27, 77, 0.17);
    backdrop-filter: blur(18px);
}

.bottom-nav-item {
    display: grid;
    flex: 1;
    place-items: center;
    align-content: center;
    gap: 2px;
    border-radius: 16px;
    color: var(--muted);
    font-size: 0.69rem;
    font-weight: 750;
    text-decoration: none;
}

.bottom-nav-item > span:first-child {
    font-size: 1.25rem;
    line-height: 1;
}

.bottom-nav-primary {
    color: var(--primary-deep);
}

.bottom-nav-item.is-active {
    color: var(--primary-deep);
    background: var(--primary-soft);
    box-shadow: inset 0 0 0 1px rgba(112, 71, 235, 0.08);
}

.is-disabled {
    opacity: 0.55;
}

.site-footer {
    padding: 22px 0 calc(22px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.8rem;
}

.site-footer .shell {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
}

.site-footer .shell > span {
    margin-right: auto;
}

.bottom-nav + .site-footer {
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
}

@media (max-width: 700px) {
    .shell {
        width: min(calc(100% - 24px), var(--shell));
    }

    .site-footer .shell {
        justify-content: flex-start;
        gap: 12px 18px;
    }

    .site-footer .shell > span {
        flex-basis: 100%;
    }

    .topbar-inner {
        min-height: 60px;
    }

    .account-name {
        display: none;
    }

    .account-actions {
        gap: 0;
    }

    .account-actions .text-button {
        padding-inline: 7px;
        font-size: 0.78rem;
    }

    .account-data {
        display: none;
    }

    .account-grants,
    .account-status,
    .account-costs,
    .account-invite {
        display: none;
    }

    .page-shell {
        padding-top: 22px;
    }

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

    .data-export-panel {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .data-export-panel .button {
        width: 100%;
    }

    .data-history-list article {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .data-history-actions {
        justify-content: stretch;
    }

    .data-history-actions > *,
    .data-history-actions .button {
        flex: 1;
    }

    .delete-account-form .button,
    .development-import-form .button {
        width: 100%;
    }

    .app-update-banner {
        top: calc(70px + env(safe-area-inset-top));
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
    }

    .app-update-banner .text-button {
        grid-column: 2;
        padding-block: 2px;
        font-size: 0.74rem;
    }

    .pwa-install-panel {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 14px;
        padding: 18px;
    }

    .pwa-install-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .pwa-ios-steps {
        display: grid;
        gap: 4px;
    }

    .onboarding-heading {
        display: grid;
    }

    .setup-progress {
        min-width: 0;
        text-align: left;
    }

    .setup-progress progress {
        width: 100%;
    }

    .onboarding-steps > li {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }

    .onboarding-steps .button {
        grid-column: 2;
        width: 100%;
        min-width: 0;
    }

    .hero-panel {
        min-height: 225px;
        align-items: flex-end;
    }

    .hero-orb {
        position: absolute;
        top: 24px;
        right: 24px;
        width: 64px;
        height: 64px;
        font-size: 2rem;
    }

    .quick-actions,
    .stats-grid {
        grid-template-columns: 1fr;
    }

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

    .cost-summary-card:last-child {
        grid-column: 1 / -1;
    }

    .cost-health-grid,
    .cost-breakdown-grid,
    .cost-distribution-grid {
        grid-template-columns: 1fr;
    }

    .spend-limit-grid,
    .spend-operation-list {
        grid-template-columns: 1fr;
    }

    .spend-guard-heading {
        align-items: flex-start;
    }

    .system-status-grid {
        grid-template-columns: 1fr;
    }

    .system-status-card {
        min-height: 0;
        padding: 20px;
    }

    .cost-chart-panel {
        padding-inline: 16px;
    }

    .cost-chart {
        gap: 4px;
    }

    .action-card {
        min-height: 172px;
    }

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

    .stat-card {
        min-height: 108px;
        padding: 16px 12px;
    }

    .stat-value {
        font-size: 1.9rem;
    }

    .stat-label {
        font-size: 0.72rem;
    }

    .foundation-panel,
    .inline-form,
    .copy-field {
        align-items: stretch;
        flex-direction: column;
    }

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

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

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

    .wardrobe-search-row {
        grid-template-columns: 1fr;
    }

    .wardrobe-search-row .button {
        width: 100%;
    }

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

    .wardrobe-filter-grid > div:last-child {
        grid-column: 1 / -1;
    }

    .wardrobe-card-copy {
        padding: 12px;
    }

    .photo-field,
    .form-panel {
        padding: 18px;
    }

    .photo-picker {
        min-height: 290px;
    }

    .wardrobe-duplicate-warning {
        grid-template-columns: 90px minmax(0, 1fr);
        gap: 14px;
    }

    .wardrobe-duplicate-warning img {
        width: 90px;
    }

    .form-grid,
    .wardrobe-details,
    .wardrobe-draft-photo {
        grid-template-columns: 1fr;
    }

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

    .reference-guidance,
    .reference-grid {
        grid-template-columns: 1fr;
    }

    .reference-card-image {
        max-height: 520px;
    }

    .reference-card-copy p {
        min-height: 0;
    }

    .style-hero {
        min-height: 270px;
        align-items: flex-end;
        padding: 28px 24px;
    }

    .style-spark {
        position: absolute;
        top: 22px;
        right: 22px;
        width: 64px;
        height: 64px;
        font-size: 1.8rem;
    }

    .style-request-panel {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 20px;
    }

    .prompt-examples {
        flex-wrap: nowrap;
        padding-bottom: 4px;
        overflow-x: auto;
    }

    .prompt-examples button {
        flex: 0 0 auto;
    }

    .routine-shortcut-list {
        flex-wrap: nowrap;
        padding-bottom: 4px;
        overflow-x: auto;
    }

    .routine-shortcut-list button {
        flex: 0 0 auto;
    }

    .weather-context {
        grid-template-columns: 1fr;
    }

    .weather-context-actions {
        justify-content: flex-start;
    }

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

    .routine-card {
        grid-template-columns: 1fr;
    }

    .routine-card-actions {
        justify-content: flex-start;
    }

    .workflow-progress ol {
        grid-template-columns: 1fr;
    }

    .section-title-row {
        align-items: flex-start;
    }

    .request-history-card {
        grid-template-columns: 1fr auto;
        gap: 5px 12px;
    }

    .request-history-card strong,
    .request-history-card small {
        grid-column: 1;
    }

    .request-history-arrow {
        grid-column: 2;
        grid-row: 1 / span 3;
    }

    .request-history-card-status {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .request-history-card-status .request-history-date,
    .request-history-card-status strong,
    .request-history-card-status small,
    .request-retry-form,
    .request-status-badge {
        grid-column: 1;
    }

    .request-retry-form,
    .request-status-badge {
        justify-self: start;
    }

    .outfit-suggestion {
        grid-template-columns: 1fr;
    }

    .outfit-suggestion-visual {
        min-height: 500px;
    }

    .outfit-collage img,
    .outfit-collage > span {
        min-height: 250px;
    }

    .outfit-suggestion-copy {
        padding: 24px 20px;
    }

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

    .feedback-reactions {
        grid-template-columns: 1fr;
    }

    .outfit-wear-form {
        align-items: stretch;
        flex-direction: column;
    }

    .outfit-wear-form .button {
        width: 100%;
    }

    .worn-history-card {
        grid-template-columns: 1fr auto;
        gap: 4px 12px;
    }

    .worn-history-card time {
        grid-column: 1;
    }

    .worn-history-card > span:nth-child(2) {
        grid-column: 1;
    }

    .worn-history-card > span:last-child {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    .saved-outfit-grid {
        grid-template-columns: 1fr;
    }

    .saved-outfit-card {
        display: grid;
        grid-template-columns: 120px 1fr;
    }

    .saved-outfit-image {
        aspect-ratio: auto;
        min-height: 175px;
    }

    .details-title-row {
        align-items: start;
    }

    .field-group-wide {
        grid-column: auto;
    }

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

    .wardrobe-details {
        gap: 24px;
    }

    .wardrobe-details-image {
        min-height: 390px;
    }

    .wardrobe-details-copy {
        padding-top: 0;
    }

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

    .availability-control .button {
        width: 100%;
    }

    .availability-actions {
        flex-direction: column;
    }

}

@media (max-width: 360px) {
    .wordmark > span:last-child {
        display: none;
    }

    .account-actions .text-button {
        padding-inline: 5px;
        font-size: 0.72rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
