
    /* ================================================================
       BRAND — swap these to match exactly
       ================================================================ */
    :root {
      --brand:        #8B1A1A;
      --brand-dark:   #6B1212;
      --brand-light:  #A82020;
      --brand-tint:   #F9F0F0;

      --black:        #080808;
      --charcoal:     #1C1C1E;
      --text:         #1C1C1E;
      --text-2:       #48484A;
      --text-3:       #8A8A8E;
      --text-4:       #AEAEB2;

      --white:        #FFFFFF;
      --ivory:        #F7F4EF;    /* welcome screen bg */
      --ivory-dark:   #EDE8DF;
      --bg:           #FAFAFA;
      --surface:      #FFFFFF;
      --surface-2:    #F5F5F7;
      --border:       #E5E5EA;
      --border-light: #F0F0F2;

      --radius:       14px;
      --radius-sm:    9px;

      --shadow-sm:    0 2px 12px rgba(0,0,0,0.05), 0 1px 4px rgba(0,0,0,0.04);
      --shadow:       0 4px 20px rgba(0,0,0,0.07), 0 2px 8px rgba(0,0,0,0.04);
      --shadow-md:    0 8px 32px rgba(0,0,0,0.09), 0 4px 12px rgba(0,0,0,0.05);
      --shadow-lg:    0 16px 48px rgba(0,0,0,0.11), 0 8px 20px rgba(0,0,0,0.06);

      --ease:         cubic-bezier(0.4,0,0.2,1);
      --ease-spring:  cubic-bezier(0.34,1.56,0.64,1);
      --t:            0.22s;
    }

    *, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
    html { scroll-behavior:smooth; -webkit-font-smoothing:antialiased; }

    body {
      font-family:'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
      background:var(--bg);
      color:var(--text);
      min-height:100vh;
    }


    /* ================================================================
       WELCOME SCREEN — light ivory, luxurious
       ================================================================ */
    #welcome-screen {
      min-height:100vh;
      display:flex;
      flex-direction:column;
      align-items:center;
      justify-content:center;
      background:var(--ivory);
      padding:80px 24px 80px;
      position:relative;
      overflow:hidden;
    }

    /* Very subtle paper grain */
    #welcome-screen::before {
      content:'';
      position:absolute;
      inset:0;
      background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
      pointer-events:none;
    }

    /* Subtle vignette at edges */
    #welcome-screen::after {
      content:'';
      position:absolute;
      inset:0;
      background:
        radial-gradient(ellipse 120% 80% at 50% 50%,
          transparent 40%,
          rgba(0,0,0,0.03) 100%);
      pointer-events:none;
    }

    .welcome-inner {
      position:relative;
      z-index:1;
      text-align:center;
      max-width:800px;
      width:100%;
      animation:wFadeUp 0.9s var(--ease) both;
    }


    /* ---- Headline ---- */
    .welcome-eyebrow {
      display:flex;
      align-items:center;
      justify-content:center;
      gap:14px;
      font-size:10.5px;
      font-weight:500;
      letter-spacing:0.2em;
      text-transform:uppercase;
      color:var(--brand);
      margin-bottom:24px;
    }
    .welcome-eyebrow span {
      display:block;
      width:36px;
      height:1px;
      background:var(--brand);
      opacity:0.5;
    }

    .welcome-headline {
      font-family:'Cormorant Garamond', serif;
      font-size:clamp(48px,7.5vw,82px);
      font-weight:300;
      color:var(--charcoal);
      line-height:1.04;
      letter-spacing:-0.02em;
      margin-bottom:22px;
    }
    .welcome-headline em {
      font-style:italic;
      color:var(--brand);
      font-weight:300;
    }

    .welcome-body {
      font-size:15px;
      font-weight:300;
      color:var(--text-3);
      line-height:1.85;
      max-width:420px;
      margin:0 auto 72px;
      letter-spacing:0.01em;
    }


    /* ---- Preset cards ---- */
    .preset-row {
      display:grid;
      grid-template-columns:1fr 1fr;
      gap:18px;
      margin-bottom:52px;
    }
    @media(max-width:600px) { .preset-row { grid-template-columns:1fr; } }

    .preset-card {
      background:var(--white);
      border:1px solid var(--border);
      border-radius:var(--radius);
      padding:40px 36px 34px;
      cursor:pointer;
      transition:all var(--t) var(--ease);
      text-align:left;
      position:relative;
      overflow:hidden;
      box-shadow:var(--shadow-sm);
    }
    .preset-card::before {
      content:'';
      position:absolute;
      top:0; left:0; right:0;
      height:2px;
      background:var(--brand);
      transform:scaleX(0);
      transform-origin:left;
      transition:transform 0.35s var(--ease);
    }
    .preset-card:hover {
      border-color:rgba(139,26,26,0.2);
      box-shadow:var(--shadow-md);
      transform:translateY(-4px);
    }
    .preset-card:hover::before { transform:scaleX(1); }
    .preset-card:active { transform:translateY(-2px); }

    .pc-name {
      font-family:'Cormorant Garamond', serif;
      font-size:25px;
      font-weight:500;
      color:var(--charcoal);
      margin-bottom:10px;
      letter-spacing:-0.01em;
    }
    .pc-desc {
      font-size:13px;
      font-weight:300;
      color:var(--text-3);
      line-height:1.8;
      margin-bottom:24px;
    }
    .pc-tags {
      display:flex;
      flex-wrap:wrap;
      gap:6px;
      margin-bottom:30px;
    }
    .pc-tag {
      font-size:10px;
      font-weight:500;
      letter-spacing:0.06em;
      text-transform:uppercase;
      padding:4px 10px;
      border-radius:20px;
      background:var(--brand-tint);
      color:var(--brand);
      border:1px solid rgba(139,26,26,0.14);
    }
    .pc-cta {
      display:flex;
      align-items:center;
      gap:9px;
      font-size:11.5px;
      font-weight:500;
      letter-spacing:0.07em;
      text-transform:uppercase;
      color:var(--text-4);
      transition:color var(--t) var(--ease);
    }
    .pc-arrow { transition:transform var(--t) var(--ease); }
    .preset-card:hover .pc-cta { color:var(--brand); }
    .preset-card:hover .pc-arrow { transform:translateX(5px); }

    .welcome-note {
      font-size:12px;
      color:var(--text-4);
      letter-spacing:0.04em;
      font-weight:300;
    }


    /* ================================================================
       BUILDER SCREEN
       ================================================================ */
    #builder-screen { display:none; flex-direction:column; min-height:100vh; }
    #builder-screen.visible { display:flex; }

    .b-header {
      background:var(--black);
      height:64px;
      display:flex;
      align-items:center;
      justify-content:space-between;
      padding:0 32px;
      position:sticky;
      top:0;
      z-index:300;
      border-bottom:1px solid rgba(255,255,255,0.06);
    }
    .h-logo {
      display:flex;
      align-items:center;
      gap:12px;
      cursor:pointer;
      opacity:0.9;
      transition:opacity var(--t) var(--ease);
      user-select:none;
    }
    .h-logo:hover { opacity:1; }
    .h-logo img { height:32px; width:auto; display:block; }
    .h-logo-name {
      font-family:'Cormorant Garamond', serif;
      font-size:17px;
      font-weight:500;
      color:#E8E8E8;
      letter-spacing:0.15em;
      text-transform:uppercase;
    }
    .h-title {
      font-size:13px;
      font-weight:400;
      color:rgba(255,255,255,0.35);
      letter-spacing:0.02em;
      position:absolute;
      left:50%;
      transform:translateX(-50%);
    }
    @media(max-width:700px){ .h-title{ display:none; } }
    .h-actions { display:flex; align-items:center; gap:8px; }

    .btn {
      font-family:'Inter', sans-serif;
      font-size:12px;
      font-weight:500;
      letter-spacing:0.02em;
      padding:9px 18px;
      border-radius:8px;
      border:none;
      cursor:pointer;
      display:inline-flex;
      align-items:center;
      gap:6px;
      transition:all var(--t) var(--ease);
      white-space:nowrap;
    }
    .btn-ghost {
      background:rgba(255,255,255,0.07);
      color:rgba(255,255,255,0.6);
      border:1px solid rgba(255,255,255,0.1);
    }
    .btn-ghost:hover { background:rgba(255,255,255,0.12); color:#fff; }
    .btn-brand { background:var(--brand); color:#fff; }
    .btn-brand:hover { background:var(--brand-light); transform:translateY(-1px); box-shadow:0 4px 16px rgba(139,26,26,0.35); }
    .btn-muted { background:transparent; color:var(--text-3); border:1px solid var(--border); }
    .btn-muted:hover { background:var(--surface-2); color:var(--text); }

    .b-controls {
      background:var(--surface);
      border-bottom:1px solid var(--border-light);
      padding:12px 32px;
      display:flex;
      align-items:center;
      flex-wrap:wrap;
      gap:24px;
    }
    .ctrl-group { display:flex; align-items:center; gap:10px; }
    .ctrl-label {
      font-size:10.5px;
      font-weight:500;
      letter-spacing:0.07em;
      text-transform:uppercase;
      color:rgba(255,255,255,0.6);
    }
    .ctrl-input {
      font-family:'Inter', sans-serif;
      font-size:13.5px;
      font-weight:500;
      color:var(--text);
      background:var(--surface-2);
      border:1px solid var(--border);
      border-radius:var(--radius-sm);
      padding:7px 11px;
      transition:all var(--t) var(--ease);
      cursor:pointer;
    }
    .ctrl-input:focus { outline:none; border-color:var(--brand); background:var(--surface); box-shadow:0 0 0 3px rgba(139,26,26,0.1); }
    .ctrl-ceremony { font-size:14px; font-weight:600; color:var(--brand); }
    .ctrl-badge {
      font-size:10.5px;
      font-weight:500;
      letter-spacing:0.06em;
      padding:5px 12px;
      border-radius:20px;
      background:var(--brand-tint);
      color:var(--brand);
      border:1px solid rgba(139,26,26,0.18);
    }
    .ctrl-spacer { flex:1; }
    .ctrl-count { font-size:12px; color:var(--text-3); }
    .ctrl-finish { font-size:14px; font-weight:600; color:rgba(255,255,255,0.75); }
    .ctrl-finish.is-late { color:#ff6b6b; }

    /* Past-midnight warning banner */
    .late-warning {
      background:#c0392b;
      color:#fff;
      text-align:center;
      font-size:13px;
      font-weight:500;
      letter-spacing:0.02em;
      padding:9px 20px;
    }

    /* Events that start at or after midnight */
    .tl-item.is-overlate .ev-card {
      border-left-color:#c0392b !important;
      opacity:0.75;
    }
    .tl-item.is-overlate .ev-card::after {
      content:'Past midnight';
      display:block;
      font-size:10px;
      font-weight:600;
      letter-spacing:0.06em;
      color:#c0392b;
      margin-top:4px;
      text-transform:uppercase;
    }

    /* Timeline */
    .tl-area {
      flex:1;
      max-width:820px;
      width:100%;
      margin:0 auto;
      padding:52px 24px 100px;
    }
    .tl-hero {
      text-align:center;
      margin-bottom:56px;
      animation:fadeUp 0.4s var(--ease) both;
    }
    .tl-hero-title {
      font-family:'Cormorant Garamond', serif;
      font-size:clamp(30px,4.5vw,44px);
      font-weight:300;
      color:var(--charcoal);
      line-height:1.15;
      margin-bottom:10px;
      letter-spacing:-0.01em;
    }
    .tl-hero-title em { font-style:italic; color:var(--brand); }
    .tl-hero-hint { font-size:12.5px; color:var(--text-3); letter-spacing:0.01em; }
    .tl-hero-hint span { opacity:0.4; margin:0 7px; }

    #tl-list {
      list-style:none;
      position:relative;
      padding-left:88px;
    }
    #tl-list::before {
      content:'';
      position:absolute;
      left:64px;
      top:14px;
      bottom:14px;
      width:1.5px;
      background:linear-gradient(to bottom, var(--border) 0%, var(--border-light) 100%);
    }

    .tl-item {
      position:relative;
      margin-bottom:12px;
      animation:fadeUp 0.4s var(--ease) both;
    }
    .tl-item::before {
      content:'';
      position:absolute;
      left:-30px;
      top:26px;
      width:10px;
      height:10px;
      border-radius:50%;
      background:var(--surface);
      border:1.5px solid var(--border);
      z-index:2;
      transition:all var(--t) var(--ease);
    }
    .tl-item.is-ceremony::before {
      background:var(--brand);
      border-color:var(--brand);
      width:14px;
      height:14px;
      left:-32px;
      top:24px;
      box-shadow:0 0 0 4px var(--brand-tint);
    }
    .tl-item:hover::before { border-color:var(--brand); transform:scale(1.3); }
    .tl-item.is-buffer .ev-card { opacity:0.55; border-style:dashed; }
    .tl-item.is-buffer .tl-time { opacity:0.55; }
    .tl-item.is-buffer .ev-body::after { content:'auto-adjusted'; font-size:9px; letter-spacing:0.07em; text-transform:uppercase; color:var(--text-3); display:block; margin-top:4px; }

    .tl-time {
      position:absolute;
      right:calc(100% + 36px);
      top:24px;
      font-size:11.5px;
      font-weight:500;
      color:var(--text-4);
      letter-spacing:0.02em;
      white-space:nowrap;
    }

    .ev-card {
      background:var(--surface);
      border-radius:var(--radius);
      border:1px solid var(--border-light);
      padding:20px 20px 20px 20px;
      display:grid;
      grid-template-columns:18px 1fr auto;
      gap:16px;
      align-items:start;
      transition:all var(--t) var(--ease);
      position:relative;
      overflow:hidden;
    }
    .ev-card::before {
      content:'';
      position:absolute;
      left:0; top:0; bottom:0;
      width:3px;
      background:var(--accent-color, var(--border));
      border-radius:var(--radius) 0 0 var(--radius);
    }
    .ev-card:hover { box-shadow:var(--shadow-md); border-color:var(--border); transform:translateY(-1px) translateX(2px); }
    .ev-card.sortable-ghost { opacity:0.2; background:var(--surface-2); }
    .ev-card.sortable-drag { box-shadow:var(--shadow-lg); transform:rotate(0.5deg) scale(1.01); z-index:999; }

    .drag-handle {
      color:var(--text-4);
      cursor:grab;
      user-select:none;
      transition:color var(--t) var(--ease);
      align-self:center;
      display:flex;
      flex-direction:column;
      gap:3.5px;
      padding:2px 0;
    }
    .drag-handle span { display:block; width:14px; height:1.5px; background:currentColor; border-radius:2px; }
    .drag-handle:hover { color:var(--text-2); }
    .drag-handle:active { cursor:grabbing; }

    .ev-body { min-width:0; }
    .ev-header { display:flex; align-items:center; gap:10px; margin-bottom:4px; flex-wrap:wrap; }
    .ev-time-chip { font-size:12px; font-weight:600; color:var(--text-3); }
    .ev-dot { width:6px; height:6px; border-radius:50%; flex-shrink:0; }
    .ev-name {
      font-family:'Cormorant Garamond', serif;
      font-size:21px;
      font-weight:500;
      color:var(--text);
      line-height:1.15;
      letter-spacing:-0.01em;
    }
    .ev-meta { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top:4px; }
    .ev-duration { font-size:12px; font-weight:400; color:var(--text-3); }
    .ev-cat-pill { font-size:10.5px; font-weight:500; letter-spacing:0.05em; padding:2px 9px; border-radius:20px; }
    .ev-notes { font-size:12.5px; color:var(--text-3); font-weight:300; line-height:1.75; margin-top:10px; padding-top:10px; border-top:1px solid var(--border-light); font-style:italic; }

    .ev-actions { display:flex; flex-direction:column; gap:4px; align-self:center; }
    .ico-btn {
      width:30px; height:30px; border-radius:8px;
      border:1px solid var(--border-light);
      background:transparent; cursor:pointer;
      display:flex; align-items:center; justify-content:center;
      font-size:13px;
      transition:all var(--t) var(--ease);
      color:var(--text-3);
    }
    .ico-btn:hover { background:var(--surface-2); color:var(--text); border-color:var(--border); }
    .ico-btn.del:hover { background:#FEF2F2; color:#DC2626; border-color:#FECACA; }

    .add-area {
      display:flex; justify-content:center;
      padding-left:88px;
      margin-top:24px;
      animation:fadeUp 0.4s 0.5s var(--ease) both;
    }
    .add-btn {
      display:inline-flex; align-items:center; gap:10px;
      padding:14px 28px;
      background:var(--surface);
      border:1.5px dashed var(--border);
      border-radius:var(--radius);
      cursor:pointer;
      transition:all var(--t) var(--ease);
      font-family:'Inter', sans-serif;
      font-size:12px; font-weight:500; letter-spacing:0.04em;
      color:var(--text-3);
    }
    .add-btn:hover { border-color:var(--brand); background:var(--brand-tint); color:var(--brand); }
    .add-plus {
      width:22px; height:22px; border-radius:50%;
      background:var(--surface-2); color:var(--text-3);
      display:flex; align-items:center; justify-content:center;
      font-size:16px; font-weight:300;
      transition:all var(--t) var(--ease);
    }
    .add-btn:hover .add-plus { background:var(--brand); color:#fff; }

    .tl-item:nth-child(1)  { animation-delay:0.04s; }
    .tl-item:nth-child(2)  { animation-delay:0.08s; }
    .tl-item:nth-child(3)  { animation-delay:0.12s; }
    .tl-item:nth-child(4)  { animation-delay:0.16s; }
    .tl-item:nth-child(5)  { animation-delay:0.20s; }
    .tl-item:nth-child(6)  { animation-delay:0.24s; }
    .tl-item:nth-child(7)  { animation-delay:0.28s; }
    .tl-item:nth-child(8)  { animation-delay:0.32s; }
    .tl-item:nth-child(9)  { animation-delay:0.36s; }
    .tl-item:nth-child(10) { animation-delay:0.40s; }
    .tl-item:nth-child(11) { animation-delay:0.44s; }
    .tl-item:nth-child(12) { animation-delay:0.48s; }
    .tl-item:nth-child(n+13) { animation-delay:0.52s; }

    .b-footer {
      background:var(--black);
      border-top:1px solid rgba(255,255,255,0.06);
      padding:20px 32px;
      display:flex; align-items:center; justify-content:space-between;
      flex-wrap:wrap; gap:12px;
    }
    .footer-brand { font-family:'Cormorant Garamond', serif; font-size:14px; color:rgba(255,255,255,0.65); }
    .footer-brand strong { color:rgba(255,255,255,0.85); font-weight:500; }
    .footer-brand a { color:rgba(255,255,255,0.55); text-decoration:none; border-bottom:1px solid rgba(255,255,255,0.25); transition:color .2s,border-color .2s; }
    .footer-brand a:hover { color:rgba(255,255,255,0.85); border-color:rgba(255,255,255,0.55); }
    .footer-hint { font-size:12px; color:rgba(255,255,255,0.6); font-weight:300; font-style:italic; }

    /* Modal */
    .modal-overlay {
      display:none; position:fixed; inset:0;
      background:rgba(0,0,0,0.45); z-index:1000;
      align-items:center; justify-content:center;
      padding:24px;
      backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
      animation:fadeIn 0.18s var(--ease);
    }
    .modal-overlay.open { display:flex; }
    .modal {
      background:var(--surface);
      border-radius:18px; padding:36px 36px 32px;
      max-width:500px; width:100%;
      box-shadow:var(--shadow-lg);
      animation:mSlideUp 0.3s var(--ease-spring) both;
      max-height:90vh; overflow-y:auto;
      border:1px solid var(--border-light);
    }
    .modal-eyebrow { font-size:10.5px; font-weight:600; letter-spacing:0.14em; text-transform:uppercase; color:var(--brand); margin-bottom:8px; }
    .modal-title { font-family:'Cormorant Garamond', serif; font-size:28px; font-weight:400; color:var(--charcoal); margin-bottom:28px; letter-spacing:-0.01em; }
    .form-row { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
    .form-field { margin-bottom:20px; }
    .form-label { display:block; font-size:10.5px; font-weight:600; letter-spacing:0.09em; text-transform:uppercase; color:var(--text-2); margin-bottom:7px; }
    .form-input, .form-textarea {
      width:100%; font-family:'Inter', sans-serif;
      font-size:14px; font-weight:400; color:var(--text);
      background:var(--surface-2); border:1px solid var(--border);
      border-radius:var(--radius-sm); padding:11px 13px;
      transition:all var(--t) var(--ease);
    }
    .form-input:focus, .form-textarea:focus { outline:none; border-color:var(--brand); background:var(--surface); box-shadow:0 0 0 3px rgba(139,26,26,0.1); }
    .form-textarea { resize:vertical; min-height:80px; line-height:1.6; }
    .dur-picks { display:flex; gap:6px; flex-wrap:wrap; margin-top:8px; }
    .dur-pick { font-size:11px; font-weight:500; padding:4px 10px; border-radius:20px; background:var(--surface-2); border:1px solid var(--border); color:var(--text-3); cursor:pointer; transition:all var(--t) var(--ease); }
    .dur-pick:hover { background:var(--brand-tint); border-color:rgba(139,26,26,0.3); color:var(--brand); }
    .end-preview { display:flex; flex-direction:column; }
    .end-time-val { font-family:'Cormorant Garamond', serif; font-size:26px; font-weight:400; color:var(--charcoal); margin-top:8px; }
    .end-time-sub { font-size:11px; color:var(--text-3); font-weight:300; margin-top:3px; }
    .cat-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:7px; }
    @media(max-width:480px){ .cat-grid{ grid-template-columns:repeat(3,1fr); } }
    .cat-opt { display:flex; flex-direction:column; align-items:center; gap:5px; padding:10px 4px; border-radius:var(--radius-sm); border:1.5px solid var(--border); cursor:pointer; transition:all var(--t) var(--ease); font-size:9.5px; font-weight:600; letter-spacing:0.04em; text-transform:uppercase; color:var(--text-3); text-align:center; line-height:1.35; }
    .cat-opt:hover { border-color:var(--brand); background:var(--brand-tint); color:var(--brand); }
    .cat-opt.sel { border-color:var(--brand); background:var(--brand-tint); color:var(--brand); }
    .cat-opt-icon { font-size:18px; }
    .modal-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:24px; padding-top:20px; border-top:1px solid var(--border-light); }

    .print-only { display:none; }
    @media print {
      #welcome-screen, .b-header, .b-controls, .ev-actions, .drag-handle, .add-area, .b-footer, .modal-overlay { display:none !important; }
      body { background:#fff; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
      #builder-screen { display:flex !important; }
      .tl-area { padding:0 20px 40px; max-width:100%; }
      .print-only { display:block; text-align:center; padding:28px 0; margin-bottom:20px; border-bottom:2px solid #F0EDED; }
      .print-only h1 { font-family:'Cormorant Garamond',serif; font-size:30px; font-weight:300; color:#1C1C1E; margin-bottom:6px; }
      .print-only p { font-size:12px; color:#8A8A8E; font-weight:300; }
      .tl-hero { display:none; }
      .ev-card { break-inside:avoid; box-shadow:none; border:1px solid #E5E5EA; margin-bottom:10px; }
    }

    /* ================================================================
       AUTH SCREEN
       ================================================================ */
    #auth-screen {
      display:none;
      min-height:100vh;
      flex-direction:column;
      align-items:center;
      justify-content:center;
      background:var(--ivory);
      padding:60px 24px;
      position:relative;
      overflow:hidden;
    }
    #auth-screen.visible { display:flex; }
    #auth-screen::before {
      content:'';
      position:absolute; inset:0;
      background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
      pointer-events:none;
    }
    .auth-inner {
      position:relative; z-index:1;
      width:100%; max-width:460px;
    }
    .auth-back {
      display:inline-flex; align-items:center; gap:6px;
      font-size:11px; font-weight:500; letter-spacing:0.08em; text-transform:uppercase;
      color:var(--text-3); cursor:pointer; margin-bottom:36px;
      transition:color var(--t) var(--ease); text-decoration:none;
      background:none; border:none; padding:0;
    }
    .auth-back:hover { color:var(--brand); }
    .auth-logo { text-align:center; margin-bottom:32px; }
    .auth-logo img { height:72px; width:auto; }
    .auth-card {
      background:var(--surface);
      border:1px solid var(--border);
      border-radius:var(--radius);
      padding:40px;
      box-shadow:var(--shadow-md);
    }
    .auth-headline {
      font-family:'Cormorant Garamond', serif;
      font-size:26px; font-weight:400;
      color:var(--charcoal);
      text-align:center; margin-bottom:6px;
      letter-spacing:0.01em;
    }
    .auth-sub {
      font-size:13px; color:var(--text-3);
      text-align:center; margin-bottom:28px;
      font-weight:300; line-height:1.5;
    }
    .auth-tabs {
      display:flex;
      border-bottom:1px solid var(--border-light);
      margin-bottom:28px;
    }
    .auth-tab {
      flex:1; text-align:center;
      font-family:'Cormorant Garamond',serif;
      font-size:16px; font-weight:500;
      color:var(--text-3);
      padding:0 0 12px;
      cursor:pointer;
      border-bottom:2px solid transparent;
      margin-bottom:-1px;
      transition:all var(--t) var(--ease);
    }
    .auth-tab.active { color:var(--brand); border-bottom-color:var(--brand); }
    .auth-form { display:none; }
    .auth-form.active { display:block; }
    .auth-field { margin-bottom:18px; }
    .auth-label {
      display:block;
      font-size:11px; font-weight:500;
      letter-spacing:0.08em; text-transform:uppercase;
      color:var(--text-3); margin-bottom:7px;
    }
    .auth-input {
      width:100%;
      padding:11px 14px;
      font-family:'Inter', sans-serif;
      font-size:14px; color:var(--text);
      background:var(--surface-2);
      border:1px solid var(--border);
      border-radius:var(--radius-sm);
      outline:none;
      transition:border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
    }
    .auth-input:focus {
      border-color:var(--brand);
      box-shadow:0 0 0 3px rgba(139,26,26,0.08);
      background:var(--surface);
    }
    .auth-input::placeholder { color:var(--text-4); }
    .auth-hint { font-size:11px; color:var(--text-4); margin-top:5px; line-height:1.5; }
    .auth-err {
      display:none;
      background:#FEF2F2; border:1px solid #FECACA;
      color:#991B1B; border-radius:var(--radius-sm);
      padding:9px 13px; font-size:13px;
      margin-bottom:16px;
    }
    .auth-err.show { display:block; }
    .auth-submit {
      width:100%; margin-top:4px;
      padding:14px;
      font-family:'Cormorant Garamond', serif;
      font-size:17px; font-weight:500;
      letter-spacing:0.06em;
      background:var(--brand); color:#fff;
      border:none; border-radius:var(--radius-sm);
      cursor:pointer;
      transition:all var(--t) var(--ease);
    }
    .auth-submit:hover { background:var(--brand-dark); transform:translateY(-1px); box-shadow:0 4px 16px rgba(139,26,26,0.3); }
    .auth-switch {
      text-align:center; margin-top:18px;
      font-size:13px; color:var(--text-3);
    }
    .auth-switch a { color:var(--brand); cursor:pointer; text-decoration:none; }
    .auth-switch a:hover { text-decoration:underline; }
    .auth-divider {
      display:flex; align-items:center; gap:12px;
      margin:20px 0; color:var(--text-4); font-size:12px;
    }
    .auth-divider::before, .auth-divider::after {
      content:''; flex:1; height:1px; background:var(--border-light);
    }

    /* ---- Header user chip ---- */
    .h-user {
      display:flex; align-items:center; gap:10px;
    }
    .h-user-info { text-align:right; }
    .h-user-name {
      font-family:'Cormorant Garamond', serif;
      font-size:14px; font-weight:500;
      color:#E8E8E8; letter-spacing:0.03em;
      line-height:1.2; white-space:nowrap;
    }
    .h-user-days {
      font-size:10px; font-weight:400;
      color:rgba(255,255,255,0.38);
      letter-spacing:0.06em; text-transform:uppercase;
    }
    .h-user-avatar {
      width:32px; height:32px;
      background:var(--brand);
      border-radius:50%;
      display:flex; align-items:center; justify-content:center;
      font-family:'Cormorant Garamond', serif;
      font-size:13px; font-weight:600; color:#fff;
      flex-shrink:0; text-transform:uppercase;
    }
    .h-logout {
      background:none; border:none;
      font-size:11px; font-weight:500; letter-spacing:0.06em;
      text-transform:uppercase; color:rgba(255,255,255,0.28);
      cursor:pointer; padding:6px 0 6px 10px;
      transition:color var(--t) var(--ease);
    }
    .h-logout:hover { color:rgba(255,255,255,0.7); }
    .h-delete-account {
      background:none; border:none;
      font-size:10px; font-weight:500; letter-spacing:0.04em;
      color:rgba(255,160,160,0.75);
      cursor:pointer; padding:2px 0 2px 10px;
      transition:color var(--t) var(--ease);
      display:block; text-align:right;
    }
    .h-delete-account:hover { color:rgb(255,90,90); }

    /* Animations */
    @keyframes wFadeUp { from{opacity:0;transform:translateY(28px)} to{opacity:1;transform:translateY(0)} }
    @keyframes fadeUp  { from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:translateY(0)} }
    @keyframes fadeIn  { from{opacity:0} to{opacity:1} }
    @keyframes mSlideUp{ from{opacity:0;transform:translateY(20px) scale(0.98)} to{opacity:1;transform:translateY(0) scale(1)} }

