:root {
    --bg: #f4f7fb;
    --paper: rgba(255, 255, 255, 0.88);
    --text: #142033;
    --text-soft: #607089;
    --line: #d9e1ef;
    --line-strong: #c5d0e3;
    --red: #ff5b6d;
    --red-dark: #d93652;
    --surface: #eef3fb;
    --surface-strong: #0f1d33;
    --surface-strong-2: #182946;
    --shadow: 0 24px 60px rgba(16, 24, 40, 0.12);
    --radius-lg: 24px;
    --radius-md: 18px;
}

html[data-theme="dark"] {
    --bg: #07111f;
    --paper: rgba(12, 22, 37, 0.92);
    --text: #eef4ff;
    --text-soft: #a9b9d3;
    --line: rgba(54, 74, 104, 0.78);
    --line-strong: rgba(79, 104, 144, 0.86);
    --red: #ff687b;
    --red-dark: #ff4f68;
    --surface: #122033;
    --surface-strong: #08111f;
    --surface-strong-2: #11203a;
    --shadow: 0 24px 56px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255, 91, 109, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.12), transparent 30%),
        linear-gradient(180deg, #f8fbff 0%, #eef3f9 45%, #f5f7fb 100%);
    color: var(--text);
    font-family: "Sora", "Avenir Next", sans-serif;
}

a {
    color: inherit;
}

.site-header {
    width: min(1240px, 94vw);
    margin: 0 auto;
    padding: 1rem 0 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    border-bottom: 1px solid #e5eaf4;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    width: min(1280px, 96vw);
    margin: 0.75rem auto 0;
    min-height: 4rem;
    background: rgba(15, 29, 51, 0.82);
    color: #f3f6ff;
    border: 1px solid rgba(127, 155, 198, 0.24);
    border-radius: 22px;
    backdrop-filter: blur(18px);
    box-shadow: 0 16px 40px rgba(10, 20, 36, 0.22);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 1rem;
}

.app-topbar-brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.app-topbar-logo {
    width: min(240px, 30vw);
    height: auto;
    display: block;
    filter: brightness(1.25) saturate(1.12);
}

.app-topbar-title {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    color: #b7c7e4;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.02em;
}

.app-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.app-topbar-link {
    text-decoration: none;
    color: #dbe7ff;
    border: 1px solid rgba(93, 120, 163, 0.55);
    border-radius: 999px;
    font-size: 0.78rem;
    padding: 0.38rem 0.72rem;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.app-topbar-link:hover,
.app-topbar-link.is-active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(188, 208, 238, 0.7);
    transform: translateY(-1px);
}

.site-brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.site-brand-logo {
    width: min(300px, 34vw);
    height: auto;
    display: block;
}

.site-nav {
    display: flex;
    flex: 1;
    justify-content: flex-end;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.site-nav a {
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    color: #2d3547;
    border: 1px solid #e3e8f2;
    border-radius: 999px;
    padding: 0.38rem 0.66rem;
    background: #fff;
    white-space: nowrap;
    line-height: 1.1;
}

.site-nav a:hover {
    border-color: #ced8e8;
    background: #f4f8ff;
}

.site-nav .nav-link-strong {
    border-color: #d4dceb;
    background: #edf3ff;
    color: #1f2f49;
}

.site-nav .nav-cta {
    border-color: #e8394f;
    background: linear-gradient(90deg, #e8394f, #cc243c);
    color: #fff;
}

.profile-menu {
    position: relative;
    margin-left: 0.2rem;
}

.profile-trigger {
    list-style: none;
    border-radius: 999px;
    border: 1px solid #ccd8ea;
    background: linear-gradient(180deg, #ffffff, #f3f7ff);
    color: #223149;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    padding: 0.2rem 0.55rem 0.2rem 0.22rem;
    min-height: 2.2rem;
}

.app-profile-trigger {
    border-color: #2e446f;
    background: linear-gradient(180deg, #10213f, #0d1d39);
    color: #ebf2ff;
}

.app-profile-trigger .profile-avatar {
    background: linear-gradient(180deg, #28497a, #1e3c66);
    border-color: #305488;
    color: #fff;
}

.app-profile-trigger .profile-trigger-caret {
    color: #c3d5f5;
}

.profile-avatar {
    width: 1.72rem;
    height: 1.72rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #e1ebfb, #cfdef5);
    border: 1px solid #bfd0ec;
    color: #213146;
    font-weight: 700;
    font-size: 0.77rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.profile-trigger-label {
    font-size: 0.8rem;
    font-weight: 600;
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-trigger-caret {
    font-size: 0.62rem;
    color: #4a5872;
}

.profile-trigger::-webkit-details-marker {
    display: none;
}

.profile-menu[open] .profile-trigger {
    border-color: #b8c8e4;
    box-shadow: 0 8px 24px rgba(16, 25, 39, 0.13);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 100;
    min-width: 13rem;
    background: #fff;
    border: 1px solid #d5ddef;
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(18, 28, 44, 0.13);
    padding: 0.7rem;
}

.app-profile-menu .profile-dropdown {
    right: 0;
}

.profile-name {
    margin: 0 0 0.55rem;
    font-size: 0.8rem;
    color: #4f5d78;
    word-break: break-word;
}

.profile-logout {
    width: 100%;
    border: 1px solid #d7deed;
    background: #f8faff;
    color: #1f2a3d;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 0.66rem;
    cursor: pointer;
}

.profile-logout:hover {
    background: #eef3fd;
}

.flash-shell {
    width: min(1240px, 94vw);
    margin: 0.3rem auto 0;
}

.flash-message {
    margin: 0;
    border: 1px solid #ffd3db;
    background: rgba(255, 244, 246, 0.92);
    color: #81233a;
    border-radius: 14px;
    padding: 0.72rem 0.9rem;
    box-shadow: 0 14px 28px rgba(129, 35, 58, 0.08);
}

.flash-message.success {
    border-color: #c7ecd5;
    background: rgba(240, 251, 244, 0.95);
    color: #21553a;
}

.flash-message.info {
    border-color: #c9ddf6;
    background: rgba(241, 247, 255, 0.95);
    color: #21486a;
}

.flash-message.warning {
    border-color: #ffd9a8;
    background: rgba(255, 247, 232, 0.96);
    color: #8b5a13;
}

.flash-message.error {
    border-color: #ffd3db;
    background: rgba(255, 244, 246, 0.95);
    color: #81233a;
}

.home-shell,
.page-shell {
    width: min(1240px, 94vw);
    margin: 0 auto;
    padding: 0.8rem 0 2.8rem;
}

.hero-banner {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 50% 0%, rgba(232, 57, 79, 0.08), transparent 44%),
        linear-gradient(180deg, #ffffff, #fafbfd);
    box-shadow: var(--shadow);
    padding: clamp(1.1rem, 3vw, 2rem) clamp(1rem, 3vw, 2.2rem);
    display: grid;
    place-items: center;
}

.hero-banner-logo {
    width: min(980px, 90vw);
    height: auto;
    display: block;
}

.hero-content {
    margin-top: 1.05rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    padding: 1.25rem;
}

.hero-content h1 {
    margin: 0;
    font-family: "Bebas Neue", sans-serif;
    letter-spacing: 0.04em;
    font-size: clamp(2.2rem, 5.5vw, 4rem);
}

.hero-content p {
    margin: 0.65rem 0 0;
    max-width: 82ch;
    color: var(--text-soft);
    line-height: 1.6;
}

.cta-row {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.btn {
    text-decoration: none;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.64rem 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(90deg, var(--red), var(--red-dark));
    color: #fff;
}

.btn-primary:hover {
    filter: brightness(0.97);
}

.btn-secondary {
    background: #eef2f9;
    color: #1b2232;
    border-color: #d6deec;
}

.btn-ghost {
    background: transparent;
    color: #1b2232;
    border-color: #d4dced;
}

.btn.full {
    width: 100%;
}

.value-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.value-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fbfcff;
    padding: 1rem;
}

.value-card h2 {
    margin: 0;
    font-family: "Bebas Neue", sans-serif;
    letter-spacing: 0.04em;
    font-size: 1.9rem;
}

.value-card p {
    margin: 0.35rem 0 0;
    color: var(--text-soft);
    line-height: 1.55;
}

.auth-shell {
    width: min(520px, 92vw);
    margin: 0 auto;
    padding: 1.1rem 0 2.4rem;
}

.auth-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow);
    padding: 1.2rem;
}

.auth-card h1 {
    margin: 0;
    font-family: "Bebas Neue", sans-serif;
    font-size: 2.5rem;
    letter-spacing: 0.04em;
}

.auth-subtle {
    margin: 0.2rem 0 0;
    color: var(--text-soft);
    font-size: 0.95rem;
}

.social-stack {
    margin-top: 1rem;
    display: grid;
    gap: 0.5rem;
}

.social-btn {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    border: 1px solid #d9e1ef;
    border-radius: 12px;
    padding: 0.6rem 0.7rem;
    background: #f9fbff;
    color: #20283a;
}

.social-mark {
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: #e7edf8;
    border: 1px solid #cfdaec;
    color: #243047;
}

.divider {
    margin: 0.85rem 0;
    position: relative;
    text-align: center;
    color: #6f7d97;
    font-size: 0.8rem;
}

.divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e1e7f2;
}

.divider span {
    background: #fff;
    position: relative;
    padding: 0 0.5rem;
}

.auth-form {
    display: grid;
    gap: 0.4rem;
}

.auth-form label {
    margin-top: 0.22rem;
    font-size: 0.82rem;
    color: #334058;
}

.auth-form input,
.auth-form select,
.auth-form textarea {
    width: 100%;
    border: 1px solid #d7dfed;
    border-radius: 10px;
    padding: 0.62rem 0.68rem;
    font: inherit;
}

.auth-form ul.errorlist {
    margin: 0;
    padding: 0;
    list-style: none;
    color: #b0233d;
    font-size: 0.75rem;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.auth-foot {
    margin: 0.8rem 0 0;
    color: #5f6f8d;
    font-size: 0.84rem;
}

.auth-foot a {
    color: #243457;
}

.pricing-card {
    width: min(620px, 94vw);
    margin: 0 auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    background: #fff;
    padding: 1.35rem;
}

.pricing-card h1 {
    margin: 0;
    font-family: "Bebas Neue", sans-serif;
    font-size: 2.4rem;
    letter-spacing: 0.04em;
}

.price {
    margin: 0.45rem 0 0;
    font-family: "Bebas Neue", sans-serif;
    font-size: 4rem;
    line-height: 0.9;
}

.price span {
    font-size: 1.45rem;
    color: #4f5d77;
    margin-left: 0.36rem;
}

.price-note {
    margin: 0.6rem 0 0;
    color: #33445f;
    font-weight: 500;
}

.pricing-card ul {
    margin: 0.8rem 0 1rem;
    padding-left: 1.1rem;
    color: #4d5d79;
    display: grid;
    gap: 0.36rem;
}

.prose-shell {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.prose-shell h1,
.prose-shell h2 {
    margin: 0;
    font-family: "Bebas Neue", sans-serif;
    letter-spacing: 0.04em;
}

.prose-shell h1 {
    font-size: 2.8rem;
}

.prose-shell h2 {
    margin-top: 0.9rem;
    font-size: 1.8rem;
}

.prose-shell p {
    margin: 0.35rem 0 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.support-shell {
    padding-top: 1rem;
}

.support-grid {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 0.9rem;
}

.support-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow);
    padding: 1rem;
}

.support-card h1,
.support-card h2 {
    margin: 0;
    font-family: "Bebas Neue", sans-serif;
    letter-spacing: 0.04em;
    font-size: 2rem;
}

.support-card p {
    margin: 0.45rem 0 0;
    color: var(--text-soft);
    line-height: 1.55;
}

.support-form {
    margin-top: 0.5rem;
    display: grid;
    gap: 0.42rem;
}

.support-form label {
    font-size: 0.82rem;
    color: #36445e;
}

.submit-ok {
    border: 1px solid #c9ecd8;
    background: #f0fbf4;
    color: #245f3f;
    border-radius: 10px;
    padding: 0.52rem 0.65rem;
}

.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
    padding: 1rem;
}

.app-workspace {
    display: grid;
    grid-template-columns: 245px minmax(0, 1fr);
    min-height: calc(100vh - 3.4rem);
    background: #edf2f9;
}

.app-rail {
    background: #071327;
    color: #dbe5f8;
    border-right: 1px solid #142644;
    padding: 0.8rem 0.55rem;
    display: grid;
    gap: 0.3rem;
    align-content: start;
}

.rail-item {
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    text-align: left;
    border-radius: 11px;
    padding: 0.52rem 0.55rem;
    display: flex;
    align-items: center;
    gap: 0.52rem;
    cursor: pointer;
}

.rail-item:hover {
    background: #132644;
    border-color: #253e66;
}

.rail-item.is-active {
    background: #1a2f50;
    border-color: #35558a;
}

.rail-icon {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9px;
    background: #243f66;
    border: 1px solid #335988;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
}

.rail-label {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-stage {
    padding: 1rem;
}

.stage-panel {
    display: none;
    background: #ffffff;
    border: 1px solid #d7e0ef;
    border-radius: 14px;
    padding: 1rem;
}

.stage-panel.is-visible {
    display: block;
}

.stage-header {
    margin-bottom: 0.75rem;
}

.stage-kicker {
    margin: 0;
    font-size: 0.75rem;
    color: #617292;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.stage-header h1 {
    margin: 0.16rem 0 0;
    font-size: clamp(1.45rem, 2.2vw, 2rem);
    line-height: 1.16;
}

.stage-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}

.stage-card {
    border: 1px solid #dde5f2;
    border-radius: 12px;
    background: #fbfdff;
    padding: 0.85rem;
}

.stage-card h2 {
    margin: 0;
    font-size: 1rem;
}

.stage-card h3 {
    margin: 0.7rem 0 0.35rem;
    font-size: 0.92rem;
}

.stage-card p {
    margin: 0.45rem 0;
    color: #50607c;
    line-height: 1.5;
}

.stage-stats strong {
    font-size: 1.35rem;
    color: #122036;
}

.setup-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    margin-bottom: 0.55rem;
}

.activity-list {
    display: grid;
    gap: 0.38rem;
    margin: 0.6rem 0 0.5rem;
}

.activity-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.88rem;
    color: #33445e;
}

.app-label {
    display: block;
    margin: 0.3rem 0 0.3rem;
    font-size: 0.8rem;
    color: #4f607a;
}

.app-input {
    width: 100%;
    border: 1px solid #d8dfed;
    border-radius: 10px;
    padding: 0.56rem 0.62rem;
    font: inherit;
    background: #fff;
}

.activity-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.56rem;
}

.community-rules {
    margin: 0.55rem 0 0.7rem;
    padding-left: 1.1rem;
    color: #42526d;
    display: grid;
    gap: 0.34rem;
}

.tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
}

.topic-tag {
    border: 1px solid #d5def0;
    background: #f4f8ff;
    border-radius: 999px;
    padding: 0.3rem 0.58rem;
    font-size: 0.77rem;
    color: #2a3b58;
}

.is-placeholder {
    border-style: dashed;
}

.placeholder-note {
    margin: 0.45rem 0 0;
    color: #304360;
    font-weight: 600;
}

.measurement-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
}

.measurement-card {
    border: 1px solid #d9e1ef;
    border-radius: 12px;
    background: #fafcff;
    padding: 0.7rem;
    display: grid;
    gap: 0.25rem;
}

.measurement-card span {
    font-size: 0.8rem;
    color: #5a6880;
}

.measurement-card strong {
    font-size: 1.1rem;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.report-card {
    border: 1px solid #dce4f2;
    border-radius: 12px;
    padding: 0.75rem;
    background: #fbfcff;
}

.report-card h3 {
    margin: 0;
}

.report-card p {
    margin: 0.4rem 0 0;
}

.launch-shell {
    width: min(760px, 94vw);
    margin: 0 auto;
    padding: 1rem 0 2rem;
    display: grid;
    gap: 0.8rem;
}

.launch-card {
    border: 1px solid #d6deec;
    border-radius: 16px;
    background: #fff;
    padding: 1rem;
    box-shadow: var(--shadow);
}

.launch-hero {
    background: linear-gradient(180deg, #0f1e36, #132745);
    color: #edf2ff;
    border-color: #203962;
}

.launch-kicker {
    margin: 0;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #bccded;
    font-weight: 700;
}

.launch-hero h1 {
    margin: 0.25rem 0 0;
    font-size: clamp(1.8rem, 6vw, 2.4rem);
}

.launch-copy {
    margin: 0.35rem 0 0.7rem;
    color: #d7e2f6;
}

.launch-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    margin-bottom: 0.8rem;
}

.launch-metrics article {
    border: 1px solid #2a4572;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.55rem;
    display: grid;
    gap: 0.15rem;
}

.launch-metrics span {
    font-size: 0.73rem;
    color: #bccdeb;
}

.launch-metrics strong {
    font-size: 1.05rem;
}

.launch-row-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.launch-form {
    gap: 0.55rem;
}

.task-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.62rem 0.7rem;
    border: 1px solid #d7dff0;
    border-radius: 11px;
    background: #f8fbff;
}

.task-row input {
    width: 1rem;
    height: 1rem;
}

.checkin-grid {
    display: grid;
    gap: 0.55rem;
    align-items: end;
}

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

.checkin-grid-body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255, 91, 109, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.12), transparent 30%),
        linear-gradient(180deg, #f8fbff 0%, #eef3f9 45%, #f5f7fb 100%);
    color: var(--text);
    font-family: "Sora", "Avenir Next", sans-serif;
}

.checkin-field {
    display: grid;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: #314057;
}

.checkin-field input {
    width: 100%;
    min-width: 7ch;
    border: 1px solid #d7dfed;
    border-radius: 10px;
    padding: 0.62rem 0.65rem;
    font: inherit;
    background: #fff;
}

.checkin-submit-wrap {
    display: grid;
    gap: 0.45rem;
}

.reset-warning {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: #8a2237;
}

.history-list {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.history-item {
    border: 1px solid #d8e0ee;
    border-radius: 12px;
    padding: 0.66rem 0.7rem;
    background: #fbfcff;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.22rem 0.45rem;
}

.history-item p {
    margin: 0;
}

.history-item span {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    border: 1px solid #d1dbef;
    border-radius: 999px;
    padding: 0.2rem 0.5rem;
    font-size: 0.74rem;
}

.history-item.completed span {
    border-color: #b6e5c4;
    background: #eefaf2;
    color: #23613f;
}

.history-item.missed span {
    border-color: #f3bcc7;
    background: #fff1f4;
    color: #8d263c;
}

.calendar-sheet {
    background: #05070b;
    border-color: #161b24;
    color: #edf2fb;
    padding: 1rem;
    display: grid;
    justify-items: center;
}

.calendar-shell {
    width: min(1180px, 96vw);
}

.calendar-poster-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    position: relative;
    width: min(100%, 64rem);
}

.calendar-logo {
    width: min(240px, 42vw);
    height: auto;
    display: block;
    filter: brightness(1.08) contrast(1.03);
    margin: 0 auto;
}

.calendar-print-btn {
    background: #151b26;
    color: #edf2fb;
    border-color: #2a3344;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.calendar-hero {
    margin-top: 0.4rem;
    width: min(100%, 64rem);
    text-align: center;
    display: grid;
    gap: 0.1rem;
}

.calendar-hero-kicker {
    margin: 0;
    color: #ff727f;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.8rem;
    font-weight: 700;
}

.calendar-hero-day {
    margin: 0;
    font-family: "Bebas Neue", sans-serif;
    letter-spacing: 0.06em;
    font-size: clamp(2.6rem, 8vw, 4.6rem);
    line-height: 0.95;
    color: #f4f7ff;
    text-shadow: 0 0 16px rgba(232, 57, 79, 0.12);
}

.calendar-subtitle {
    margin: 0.25rem 0 0;
    color: #9ca9c3;
    font-size: 0.9rem;
}

.calendar-table-wrap {
    margin-top: 0.95rem;
    width: min(100%, 64rem);
    border: 1px solid #171f2c;
    border-radius: 12px;
    background: #070a10;
    padding: 0.4rem;
    overflow-x: auto;
    display: flex;
    justify-content: center;
}

.calendar-table {
    width: 100%;
    max-width: 100%;
    border-collapse: separate;
    border-spacing: 0.35rem;
    table-layout: fixed;
}

.calendar-table th,
.calendar-table td {
    text-align: center;
    vertical-align: middle;
}

.calendar-table thead th {
    color: #99a8c4;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 0.15rem 0.1rem 0.35rem;
}

.calendar-week-col {
    width: 3rem;
    color: #c3cede;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.calendar-day {
    min-height: 3.45rem;
    border: 1px solid #151c27;
    border-radius: 10px;
    background: #090c12;
    display: grid;
    grid-template-rows: auto 1fr;
    align-items: center;
    justify-items: center;
    position: relative;
    padding: 0.25rem;
    width: 100%;
}

.calendar-day-label {
    font-size: 0.58rem;
    color: #69758d;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1;
}

.calendar-day-number {
    font-family: "Bebas Neue", sans-serif;
    letter-spacing: 0.05em;
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    color: #5f6778;
    line-height: 1;
}

.calendar-day.is-complete {
    background: rgba(232, 57, 79, 0.08);
    border-color: rgba(232, 57, 79, 0.26);
}

.calendar-day.is-complete .calendar-day-number {
    color: #ff364f;
    text-shadow: 0 0 10px rgba(232, 57, 79, 0.18);
}

.calendar-day.is-complete .calendar-day-label {
    color: #ff98a1;
}

.calendar-day.is-complete::after {
    content: "";
    position: absolute;
    left: 10%;
    right: 10%;
    top: 50%;
    height: 2px;
    background: rgba(255, 54, 79, 0.65);
    transform: rotate(-8deg);
    transform-origin: center;
    box-shadow: 0 0 8px rgba(232, 57, 79, 0.2);
}

.calendar-day.is-current {
    box-shadow: inset 0 0 0 2px #f3f6ff;
}

.calendar-day.is-current:not(.is-complete) .calendar-day-number {
    color: #eef2fb;
}

.calendar-requirements {
    margin-top: 1rem;
    width: min(100%, 64rem);
    border-top: 1px solid #171f2c;
    padding-top: 0.8rem;
}

.calendar-requirements h2 {
    margin: 0;
    font-family: "Bebas Neue", sans-serif;
    font-size: 1.6rem;
    letter-spacing: 0.05em;
    color: #edf2fb;
}

.calendar-requirements ol {
    margin: 0.55rem 0 0;
    padding-left: 1.05rem;
    columns: 2;
    column-gap: 1.2rem;
    color: #bcc7da;
    line-height: 1.45;
}

.calendar-requirements li {
    break-inside: avoid;
    margin-bottom: 0.35rem;
}

.missed-modal {
    position: fixed;
    inset: 0;
    background: rgba(3, 10, 20, 0.62);
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.missed-modal-card {
    width: min(580px, 100%);
    background: #fff;
    border: 1px solid #d8dfed;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    padding: 1rem;
}

.missed-modal-card h2 {
    margin: 0;
    font-size: 1.15rem;
}

.missed-modal-card p {
    margin: 0.6rem 0 0;
    color: #394963;
    line-height: 1.5;
}

.missed-modal-actions {
    margin-top: 0.8rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

@media (max-width: 1020px) {
    .site-header {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .site-nav {
        width: 100%;
        justify-content: flex-start;
        gap: 0.45rem;
    }

    .value-grid,
    .support-grid,
    .stage-grid,
    .setup-grid,
    .portal-hero,
    .portal-slab,
    .portal-section-grid,
    .portal-section-grid-tight,
    .portal-feature-grid,
    .portal-feature-grid-wide,
    .portal-shop-preview .portal-shop-grid,
    .portal-product-grid,
    .hero-slab,
    .hero-slab-compact,
    .app-grid-two,
    .app-grid-three,
    .app-grid-four,
    .metric-chart-grid {
        grid-template-columns: 1fr;
    }

    .app-workspace {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .app-rail {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        border-right: none;
        border-bottom: 1px solid #142644;
    }

    .rail-label {
        font-size: 0.79rem;
    }

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

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

@media (max-width: 620px) {
    .calendar-shell {
        width: min(760px, 94vw);
    }

    .calendar-poster-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .calendar-print-btn {
        position: static;
        transform: none;
    }

    .calendar-requirements ol {
        columns: 1;
    }

    .calendar-table {
        min-width: 620px;
    }

    .app-topbar {
        width: calc(100% - 1rem);
        margin-top: 0.5rem;
        border-radius: 18px;
        padding: 0.65rem 0.8rem;
    }

    .app-page-shell {
        width: min(100% - 1rem, 1180px);
        padding: 0.7rem 0 1.8rem;
    }

    .hero-slab,
    .panel-card {
        border-radius: 20px;
        padding: 0.9rem;
    }

    .metric-pair-grid,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .hero-copy-block h1 {
        font-size: clamp(1.8rem, 11vw, 2.5rem);
    }

    .hero-action-row-tight {
        justify-content: flex-start;
    }

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

@media print {
    .app-topbar,
    .flash-shell,
    .calendar-print-btn {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #142033 !important;
    }

    .app-page-shell,
    .calendar-shell {
        width: 100%;
        max-width: none;
    }
}

body.app-authenticated::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 8% 10%, rgba(255, 91, 109, 0.1), transparent 24%),
        radial-gradient(circle at 92% 4%, rgba(56, 189, 248, 0.12), transparent 22%);
    z-index: -1;
}

.app-page-shell {
    width: min(1180px, 94vw);
    margin: 0 auto;
    padding: 1.15rem 0 2.4rem;
    display: grid;
    gap: 1rem;
}

.panel-card,
.hero-slab {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--paper);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}

.hero-slab {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 1rem;
    padding: 1.2rem;
    background:
        radial-gradient(circle at top left, rgba(255, 91, 109, 0.16), transparent 34%),
        linear-gradient(145deg, rgba(15, 29, 51, 0.98), rgba(24, 41, 70, 0.94));
    color: #f3f7ff;
    border-color: rgba(60, 88, 130, 0.7);
}

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

.hero-copy-block {
    display: grid;
    align-content: start;
}

.hero-copy-block h1 {
    margin: 0.2rem 0 0;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 0.94;
}

.hero-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.hero-action-row-tight {
    align-self: start;
    justify-content: flex-end;
}

.hero-stat-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    align-content: start;
}

.hero-stat-card {
    padding: 0.95rem;
    border-radius: 18px;
    border: 1px solid rgba(120, 146, 190, 0.45);
    background: rgba(255, 255, 255, 0.08);
    display: grid;
    gap: 0.2rem;
}

.hero-stat-card span,
.metric-label,
.section-kicker,
.chart-caption,
.section-chip,
.panel-copy,
.history-metrics-grid p,
.mini-history-card p,
.metric-chart-head p {
    color: var(--text-soft);
}

.hero-stat-card span,
.section-kicker,
.metric-label {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.hero-stat-card strong,
.metric-hero-value {
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    line-height: 1;
    color: var(--text);
}

.hero-stat-card strong {
    color: #fff;
}

.hero-stat-card small {
    color: #c6d4eb;
}

.panel-card {
    padding: 1.05rem;
}

.surface-strong {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 248, 255, 0.9));
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.section-head h2,
.panel-card h2 {
    margin: 0.14rem 0 0;
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    line-height: 1.05;
}

.section-link {
    color: #203a61;
    font-weight: 600;
    text-decoration: none;
}

.section-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    border: 1px solid #d6deec;
    background: #f6f9ff;
    color: #29435f;
    font-size: 0.8rem;
}

.panel-copy {
    margin: 0.85rem 0 0;
    line-height: 1.6;
}

.app-grid-two,
.app-grid-three,
.app-grid-four {
    display: grid;
    gap: 1rem;
}

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

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

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

.metric-pair-grid,
.summary-grid {
    display: grid;
    gap: 0.85rem;
}

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

.summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 0.9rem;
}

.metric-pair-grid > div,
.summary-grid > div {
    padding: 0.95rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 255, 0.94));
    min-height: 100%;
}

.metric-pair-grid.compact {
    gap: 0.7rem;
}

.metric-pair-grid.compact > div {
    padding: 0.82rem;
}

.metric-pair-grid strong,
.summary-grid strong {
    display: block;
    margin-top: 0.16rem;
    font-size: 1.2rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 6rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px solid #d4deee;
    background: #f7faff;
}

.status-pill.complete {
    border-color: #cbead5;
    background: #eff9f2;
    color: #1e6a44;
}

.status-pill.pending {
    border-color: #f2ddaa;
    background: #fff8e7;
    color: #8b6411;
}

.status-pill.muted {
    color: #5a6983;
}

.mini-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.8rem;
}

.mini-history-card {
    padding: 0.95rem;
    border: 1px solid #d9e2f0;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, #f7faff);
    display: grid;
    gap: 0.3rem;
}

.mini-history-card p {
    margin: 0;
}

.mini-history-card strong {
    font-size: 1rem;
}

.mini-history-day {
    margin: 0;
    color: #7b8ca8;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.analytics-cta-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(125deg, rgba(15, 29, 51, 0.96), rgba(22, 56, 88, 0.92));
    color: #eff5ff;
    border-color: rgba(67, 104, 145, 0.72);
}

.analytics-cta-card .panel-copy,
.analytics-cta-card .section-kicker,
.analytics-hero .launch-copy,
.hero-slab .launch-copy {
    color: #cedbf0;
}

.launch-shell-wide {
    width: min(1080px, 94vw);
}

.checkin-layout {
    display: grid;
    gap: 1rem;
}

.checkin-section {
    display: grid;
    gap: 0.85rem;
}

.field-stack {
    display: grid;
    gap: 0.35rem;
    color: #314057;
    font-size: 0.86rem;
}

.field-stack select,
.field-stack textarea {
    width: 100%;
    border: 1px solid #d7dfed;
    border-radius: 14px;
    padding: 0.78rem 0.82rem;
    font: inherit;
    background: #fff;
}

.checkin-fieldset {
    border: 1px solid #d7dff0;
    border-radius: 16px;
    padding: 0.8rem;
    margin: 0;
    display: grid;
    gap: 0.65rem;
}

.checkin-fieldset legend {
    padding: 0 0.35rem;
    color: #52627d;
    font-weight: 600;
}

.checkin-grid-activity {
    grid-template-columns: minmax(0, 220px);
}

.history-list-detailed {
    margin-top: 0.3rem;
}

.history-primary {
    display: grid;
    gap: 0.18rem;
}

.history-metrics-grid {
    display: grid;
    gap: 0.32rem;
}

.history-metrics-grid p,
.history-primary p {
    margin: 0;
}

.chart-panel {
    overflow: hidden;
}

.chart-host {
    width: 100%;
    min-height: 220px;
    border: 1px solid #dbe4f3;
    border-radius: 20px;
    background: linear-gradient(180deg, #fcfdff, #f3f7fd);
    padding: 0.55rem;
}

.chart-host-large {
    min-height: 320px;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.75rem;
    margin-bottom: 0.75rem;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.84rem;
    color: #3b4b65;
    font-weight: 600;
}

.legend-item i,
.metric-swatch {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 999px;
    display: inline-block;
}

.metric-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.metric-chart-card {
    border: 1px solid #d9e2f0;
    border-radius: 20px;
    background: linear-gradient(180deg, #fff, #f8fbff);
    padding: 0.9rem;
    display: grid;
    gap: 0.7rem;
}

.metric-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
}

.metric-chart-head strong {
    font-size: 1.2rem;
}

.mini-chart {
    min-height: 160px;
    border-radius: 16px;
    border: 1px solid #e2e9f5;
    background: #fcfdff;
    padding: 0.35rem;
}

.chart-svg {
    width: 100%;
    height: 100%;
}

.chart-grid line {
    stroke: rgba(162, 177, 204, 0.45);
    stroke-width: 1;
}

.chart-axis {
    fill: #6b7a93;
    font-size: 12px;
    font-family: "Sora", sans-serif;
}

.chart-empty {
    min-height: 140px;
    display: grid;
    place-items: center;
    color: #7c8ba5;
    font-weight: 600;
}

.empty-state-panel {
    display: grid;
    justify-items: start;
    gap: 0.7rem;
}

html[data-theme="dark"] .surface-strong {
    background: linear-gradient(180deg, rgba(16, 28, 45, 0.98), rgba(10, 19, 31, 0.95));
}

html[data-theme="dark"] .metric-pair-grid > div,
html[data-theme="dark"] .summary-grid > div,
html[data-theme="dark"] .mini-history-card,
html[data-theme="dark"] .metric-chart-card,
html[data-theme="dark"] .chart-host,
html[data-theme="dark"] .mini-chart,
html[data-theme="dark"] .checkin-fieldset {
    border-color: rgba(59, 77, 107, 0.72);
    background: linear-gradient(180deg, rgba(17, 31, 50, 0.96), rgba(10, 21, 35, 0.94));
}

html[data-theme="dark"] .metric-label,
html[data-theme="dark"] .section-kicker,
html[data-theme="dark"] .panel-copy,
html[data-theme="dark"] .mini-history-card p,
html[data-theme="dark"] .mini-history-day,
html[data-theme="dark"] .chart-axis,
html[data-theme="dark"] .legend-item {
    color: #9fb0cb;
}

html[data-theme="dark"] .status-pill {
    border-color: rgba(64, 85, 117, 0.8);
    background: rgba(255, 255, 255, 0.04);
    color: #dbe7fb;
}

html[data-theme="dark"] .status-pill.complete {
    border-color: rgba(95, 214, 146, 0.36);
    background: rgba(58, 147, 96, 0.16);
    color: #98efb9;
}

html[data-theme="dark"] .status-pill.pending {
    border-color: rgba(244, 191, 76, 0.4);
    background: rgba(245, 158, 11, 0.14);
    color: #ffd78d;
}

html[data-theme="dark"] .status-pill.muted {
    color: #b9c9e4;
}

html[data-theme="dark"] .section-link {
    color: #9ec9ff;
}

html[data-theme="dark"] .chart-grid line {
    stroke: rgba(103, 126, 161, 0.34);
}
