      :root {
        --cream: #fffaed;
        --cream-deep: #fbf2d9;
        --green: #0f6c05;
        --green-soft: #e4eedf;
        --night: #22284a;
        --night-deep: #171b33;
        --lavender: #d9d3ee;
        --gold: #e8b84b;
        --ink: #2b2a26;
        --ink-soft: #6b6858;
        --line: #e5dcc3;
        --radius: 18px;
      }
      * {
        box-sizing: border-box;
      }
      body {
        margin: 0;
        background: var(--cream);
        color: var(--ink);
        font-family: "DM Sans", sans-serif;
        -webkit-font-smoothing: antialiased;
      }
      h1,
      h2,
      h3 {
        font-family: "Playfair Display", serif;
        margin: 0;
        font-weight: 600;
        color: var(--night-deep);
      }
      .wrap {
        max-width: 880px;
        margin: 0 auto;
        padding: 32px 20px 80px;
      }

      /* ---------- HERO ---------- */
      .hero {
        background: linear-gradient(
          180deg,
          var(--night) 0%,
          var(--night-deep) 100%
        );
        border-radius: 24px;
        padding: 36px 32px 28px;
        color: var(--cream);
        position: relative;
        overflow: hidden;
      }
      .hero-top {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 16px;
        flex-wrap: wrap;
      }
      .brand-eyebrow {
        font-size: 12px;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        color: var(--lavender);
        margin-bottom: 6px;
        font-weight: 600;
      }
      .hero h1 {
        color: #fff;
        font-size: 34px;
        font-style: italic;
        letter-spacing: 0.01em;
      }
      .hero p.sub {
        margin: 8px 0 0;
        color: #c9c6e6;
        font-size: 14.5px;
        max-width: 440px;
        line-height: 1.5;
      }
      .streak-badge {
        background: rgba(232, 184, 75, 0.14);
        border: 1px solid rgba(232, 184, 75, 0.4);
        color: var(--gold);
        padding: 8px 14px;
        border-radius: 100px;
        font-size: 13px;
        font-weight: 600;
        white-space: nowrap;
      }
      #constellation {
        width: 100%;
        height: 150px;
        margin-top: 22px;
        display: block;
      }
      .const-caption {
        display: flex;
        justify-content: space-between;
        font-size: 11.5px;
        color: #9b98c4;
        margin-top: 2px;
        padding: 0 2px;
      }

      /* ---------- AUTH SCREEN ---------- */
      .auth-card {
        max-width: 420px;
        margin: 60px auto;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        padding: 34px 30px;
        text-align: center;
      }
      .auth-card .moon-big {
        font-size: 34px;
        display: block;
        margin-bottom: 10px;
      }
      .auth-card h2 {
        font-size: 23px;
        margin-bottom: 8px;
      }
      .auth-card p {
        color: var(--ink-soft);
        font-size: 14px;
        line-height: 1.6;
        margin: 0 0 22px;
      }
      .auth-card input[type="email"],
      .auth-card input[type="text"] {
        width: 100%;
        border: 1.5px solid var(--line);
        background: var(--cream);
        border-radius: 12px;
        padding: 12px 14px;
        font-size: 14.5px;
        font-family: "DM Sans", sans-serif;
        margin-bottom: 14px;
        box-sizing: border-box;
      }
      .auth-card input:focus {
        outline: 2px solid var(--green);
        outline-offset: 1px;
      }
      #codeInput {
        text-align: center;
        letter-spacing: 6px;
        font-size: 20px;
        font-weight: 700;
      }
      .auth-link-btn {
        display: block;
        width: 100%;
        background: none;
        border: none;
        color: var(--ink-soft);
        font-family: "DM Sans", sans-serif;
        font-size: 13px;
        text-decoration: underline;
        cursor: pointer;
        margin-top: 12px;
        padding: 4px;
      }
      .auth-link-btn:hover {
        color: var(--green);
      }
      .auth-msg {
        font-size: 13px;
        margin-top: 14px;
        min-height: 16px;
        font-weight: 600;
      }
      .auth-msg.ok {
        color: var(--green);
      }
      .auth-msg.err {
        color: #b0413e;
      }
      .hidden {
        display: none !important;
      }

      /* ---------- CARDS ---------- */
      .grid {
        display: grid;
        grid-template-columns: 1.1fr 0.9fr;
        gap: 20px;
        margin-top: 22px;
      }
      @media (max-width: 720px) {
        .grid {
          grid-template-columns: 1fr;
        }
      }

      .card {
        background: #fff;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        padding: 26px;
      }

      .lead-magnet-cta {
        display: flex;
        align-items: center;
        gap: 14px;
        background: var(--cream-deep);
        border: 1.5px solid var(--gold);
        border-radius: var(--radius);
        padding: 16px 20px;
        margin-top: 20px;
      }
      .lead-magnet-cta .moon {
        font-size: 22px;
        flex-shrink: 0;
      }
      .lead-magnet-copy {
        flex: 1;
        font-size: 13.5px;
        color: var(--ink);
        line-height: 1.5;
      }
      .lead-magnet-btn {
        flex-shrink: 0;
        background: var(--gold);
        color: var(--night-deep);
        font-weight: 700;
        font-size: 13.5px;
        padding: 10px 16px;
        border-radius: 12px;
        text-decoration: none;
        white-space: nowrap;
      }
      .lead-magnet-btn:hover {
        background: #dba936;
      }
      @media (max-width: 560px) {
        .lead-magnet-cta {
          flex-direction: column;
          align-items: flex-start;
        }
        .lead-magnet-btn {
          align-self: stretch;
          text-align: center;
        }
      }
      .card h2 {
        font-size: 21px;
        margin-bottom: 4px;
      }
      .card .hint {
        color: var(--ink-soft);
        font-size: 13px;
        margin: 0 0 20px;
      }

      label {
        display: block;
        font-size: 12.5px;
        font-weight: 600;
        color: var(--ink-soft);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 6px;
      }
      .field {
        margin-bottom: 18px;
      }
      .row2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
      }
      .row2 > div {
        min-width: 0;
      }
      @media (max-width: 420px) {
        .row2 {
          grid-template-columns: 1fr;
        }
      }

      input[type="time"],
      input[type="date"],
      textarea {
        width: 100%;
        box-sizing: border-box;
        -webkit-appearance: none;
        appearance: none;
        border: 1.5px solid var(--line);
        background: var(--cream);
        border-radius: 12px;
        padding: 11px 13px;
        font-family: "DM Sans", sans-serif;
        font-size: 14.5px;
        color: var(--ink);
      }
      textarea {
        resize: vertical;
        min-height: 64px;
      }
      input:focus,
      textarea:focus,
      button:focus-visible {
        outline: 2px solid var(--green);
        outline-offset: 1px;
      }

      .hours-readout {
        font-family: "Playfair Display", serif;
        font-style: italic;
        font-size: 15px;
        color: var(--green);
        margin-top: 6px;
      }

      .quality-scale {
        display: flex;
        gap: 8px;
      }
      .quality-scale button {
        flex: 1;
        padding: 11px 0;
        border-radius: 12px;
        border: 1.5px solid var(--line);
        background: var(--cream);
        font-family: "DM Sans", sans-serif;
        font-weight: 600;
        font-size: 16px;
        cursor: pointer;
        color: var(--ink-soft);
        transition: transform 0.15s ease;
      }
      .quality-scale button.active {
        background: var(--green);
        border-color: var(--green);
        color: #fff;
        transform: translateY(-2px);
      }

      .tags {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }
      .tag {
        padding: 8px 13px;
        border-radius: 100px;
        border: 1.5px solid var(--line);
        background: var(--cream);
        font-size: 13px;
        cursor: pointer;
        color: var(--ink-soft);
        user-select: none;
      }
      .tag.active {
        background: var(--green-soft);
        border-color: var(--green);
        color: var(--green);
        font-weight: 600;
      }

      .save-btn {
        width: 100%;
        background: var(--green);
        color: #fff;
        border: none;
        padding: 14px;
        border-radius: 12px;
        font-family: "DM Sans", sans-serif;
        font-weight: 700;
        font-size: 15px;
        cursor: pointer;
        margin-top: 6px;
      }
      .save-btn:hover {
        background: #0c5804;
      }
      .save-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
      }
      .save-msg {
        text-align: center;
        font-size: 13px;
        color: var(--green);
        margin-top: 10px;
        min-height: 16px;
        font-weight: 600;
      }

      .stat-row {
        display: flex;
        gap: 14px;
        margin-bottom: 18px;
      }
      .stat {
        flex: 1;
        background: var(--green-soft);
        border-radius: 14px;
        padding: 14px 12px;
        text-align: center;
      }
      .stat .num {
        font-family: "DM Sans", sans-serif;
        font-size: 26px;
        color: var(--green);
        font-weight: 700;
      }
      .stat .lbl {
        font-size: 11px;
        color: var(--ink-soft);
        text-transform: uppercase;
        letter-spacing: 0.04em;
        margin-top: 2px;
      }

      .insight {
        background: var(--cream-deep);
        border-left: 3px solid var(--gold);
        border-radius: 8px;
        padding: 14px 16px;
        font-size: 14px;
        line-height: 1.55;
        color: var(--ink);
        margin-bottom: 18px;
      }
      .insight strong {
        color: var(--night-deep);
      }

      .history-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
        max-height: 220px;
        overflow-y: auto;
        margin-bottom: 16px;
      }
      .h-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 10px;
        font-size: 13px;
      }
      .h-item .h-date {
        font-weight: 600;
        color: var(--night-deep);
      }
      .h-item .h-hrs {
        color: var(--ink-soft);
      }
      .h-dot {
        width: 9px;
        height: 9px;
        border-radius: 50%;
        display: inline-block;
        margin-right: 6px;
      }

      .ghost-btn {
        width: 100%;
        background: transparent;
        border: 1.5px solid var(--night-deep);
        color: var(--night-deep);
        padding: 11px;
        border-radius: 12px;
        font-weight: 700;
        font-size: 14px;
        cursor: pointer;
      }
      .ghost-btn:hover {
        background: var(--night-deep);
        color: #fff;
      }

      .empty-state {
        text-align: center;
        padding: 30px 10px;
        color: var(--ink-soft);
        font-size: 13.5px;
      }
      .empty-state .moon {
        font-size: 28px;
        display: block;
        margin-bottom: 8px;
      }

      .edit-banner {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: var(--cream-deep);
        border: 1px solid var(--gold);
        border-radius: 10px;
        padding: 10px 14px;
        font-size: 13px;
        color: var(--ink);
        margin-bottom: 18px;
      }
      @keyframes edit-highlight-pulse {
        0%,
        100% {
          box-shadow: 0 0 0 0 rgba(232, 184, 75, 0);
        }
        25% {
          box-shadow: 0 0 0 4px rgba(232, 184, 75, 0.55);
        }
      }
      .card.edit-highlight {
        animation: edit-highlight-pulse 1.4s ease-out;
      }
      .edit-banner strong {
        color: var(--night-deep);
      }
      .edit-banner button {
        background: transparent;
        border: 1px solid var(--ink-soft);
        color: var(--ink-soft);
        padding: 5px 12px;
        border-radius: 100px;
        font-size: 12px;
        cursor: pointer;
      }
      .edit-banner button:hover {
        background: var(--ink-soft);
        color: #fff;
      }

      .h-item {
        cursor: pointer;
        transition: background 0.15s ease;
      }
      .h-item:hover {
        background: var(--green-soft);
      }

      .account-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 14px;
        font-size: 13px;
        color: #c9c6e6;
      }
      .account-bar button {
        background: transparent;
        border: 1px solid rgba(255, 255, 255, 0.3);
        color: #fff;
        padding: 6px 12px;
        border-radius: 100px;
        font-size: 12px;
        cursor: pointer;
      }
      .account-bar button:hover {
        background: rgba(255, 255, 255, 0.12);
      }

      footer {
        text-align: center;
        margin-top: 34px;
        font-size: 12.5px;
        color: var(--ink-soft);
      }
      footer a {
        color: var(--green);
        text-decoration: none;
        font-weight: 600;
      }

      .sync-msg {
        text-align: center;
        font-size: 12px;
        color: var(--ink-soft);
        margin-top: 6px;
      }

      @media print {
        .card:first-of-type,
        .streak-badge,
        .no-print {
          display: none !important;
        }
        body {
          background: #fff;
        }
      }
      @media (prefers-reduced-motion: reduce) {
        .quality-scale button {
          transition: none;
        }
      }
