  @import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300;1,400&family=Tenor+Sans&display=swap');

  :root {
    --bg: #06060f;
    --accent: #c8b8e8;
    --text: #ffffff;
    --dim: #6a6080;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  select {
    -webkit-appearance: none;
    appearance: none;
    background-color: rgba(10,10,24,0.85);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='rgba(200,184,232,0.65)' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.55rem center;
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.88);
    font-family: 'Tenor Sans', sans-serif;
    letter-spacing: 0.06em;
    padding: 0.44rem 1.8rem 0.44rem 0.55rem;
    border-radius: 6px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.25s;
  }
  select:focus { border-color: rgba(200,184,232,0.55); }
  select option {
    background: #0d0d1e;
    color: rgba(255,255,255,0.9);
  }

  body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Cormorant Garamond', serif;
    min-height: 100vh;
    overflow: hidden;
    cursor: default;
  }

  /* ── LOGIN ── */
  #login {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 0;
    background: #06060f;
    z-index: 100;
    transition: opacity 1s ease;
    overflow-y: auto;
    padding: 2rem 1rem 2.5rem;
  }

  #login h1 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    letter-spacing: 0.3em;
    color: var(--accent);
    opacity: 0.8;
    margin-bottom: 2.2rem;
  }

  #login-form {
    display: flex;
    flex-direction: column;
    width: min(300px, calc(100vw - 2.4rem));
  }

  #login input {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--dim);
    color: var(--text);
    font-family: 'Tenor Sans', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.05em;
    padding: 0.7rem 0.2rem;
    text-align: left;
    width: 100%;
    outline: none;
    transition: border-color 0.3s;
  }
  #login input + input { margin-top: 0.5rem; }
  #login input:focus { border-color: var(--accent); }
  #login input::placeholder { color: var(--dim); letter-spacing: 0.06em; font-size: 0.88rem; }

  #login-btn {
    width: 100%;
    margin-top: 1.4rem;
    background: none;
    border: 1px solid rgba(255,255,255,0.25);
    color: var(--text);
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.3em;
    padding: 0.82rem 1rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: border-color 0.3s, color 0.3s;
  }
  #login-btn:hover { border-color: var(--accent); color: var(--accent); }

  #register-btn {
    margin-top: 1.6rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.42);
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.64rem;
    letter-spacing: 0.18em;
    padding: 0.2rem 0;
    cursor: pointer;
    text-transform: lowercase;
    text-decoration: underline;
    text-underline-offset: 0.2rem;
    transition: color 0.3s;
  }
  #register-btn:hover { color: var(--accent); }

  #reset-password-btn {
    margin-top: 0.55rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.26);
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.56rem;
    letter-spacing: 0.14em;
    padding: 0.1rem 0;
    cursor: pointer;
    text-transform: lowercase;
    text-decoration: underline;
    text-underline-offset: 0.18rem;
    transition: color 0.3s;
  }
  #reset-password-btn:hover { color: var(--accent); }

  #register-form,
  #password-update-form {
    display: none;
    width: min(300px, calc(100vw - 2.4rem));
    margin-top: 0.9rem;
  }
  #register-form.visible,
  #password-update-form.visible { display: flex; flex-direction: column; }
  #register-form input,
  #password-update-form input {
    width: 100%;
    margin-top: 0.5rem;
  }
  #register-actions,
  #password-update-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
  }
  #register-actions button,
  #password-update-actions button {
    flex: 1;
    background: none;
    border: 1px solid var(--dim);
    color: var(--dim);
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    padding: 0.6rem 0.5rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: border-color 0.3s, color 0.3s;
  }
  #register-actions button:hover,
  #password-update-actions button:hover {
    border-color: var(--accent);
    color: var(--accent);
  }

  #login-error {
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    color: #c87070;
    opacity: 0;
    transition: opacity 0.3s;
    min-height: 1em;
    margin-top: 0.9rem;
    text-align: center;
    max-width: min(300px, calc(100vw - 2.4rem));
    line-height: 1.5;
  }
  #login-error.show { opacity: 1; }

  #space-picker {
    display: none;
    width: min(460px, calc(100vw - 2rem));
    margin-top: -0.6rem;
    padding: 0.9rem 0.95rem 0.85rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 0.6rem;
    background: rgba(8, 8, 18, 0.6);
    backdrop-filter: blur(3px);
  }
  #space-picker.visible { display: block; }

  #space-picker-title {
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.58rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.86);
    text-align: center;
    margin-bottom: 0.7rem;
  }

  #space-picker-actions {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 0.68rem;
  }

  .space-choice-btn {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.24);
    color: rgba(255,255,255,0.92);
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.56rem 0.7rem;
    cursor: pointer;
    transition: border-color 0.25s, background-color 0.25s, color 0.25s;
  }
  .space-choice-btn:hover {
    border-color: rgba(200,184,232,0.85);
    color: var(--accent);
    background: rgba(255,255,255,0.1);
  }

  #space-picker-help {
    border-top: 1px solid rgba(255,255,255,0.14);
    padding-top: 0.6rem;
    color: rgba(255,255,255,0.78);
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.54rem;
    letter-spacing: 0.1em;
    line-height: 1.5;
    text-transform: uppercase;
  }
  #space-picker-help strong {
    color: rgba(255,255,255,0.96);
    letter-spacing: 0.16em;
    font-weight: 400;
  }
  #space-picker-help code {
    font-family: 'Tenor Sans', sans-serif;
    color: rgba(200,184,232,0.95);
    letter-spacing: 0.14em;
  }


  /* ── CANVAS ── */
  #sky { position: fixed; inset: 0; z-index: 6; }

  /* ── MOOD SELECTOR ── */
  #moods {
    position: fixed;
    bottom: 0.6rem;
    left: 50%;
    transform: translateX(-50%);
    width: min(92vw, 560px);
    height: min(36vh, 280px);
    z-index: 10;
    opacity: 0;
    transition: opacity 1.5s ease;
  }
  #moods.visible { opacity: 1; }

  #guest-hint {
    position: fixed;
    top: 6.8rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.58rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.8);
    background: rgba(8, 8, 18, 0.42);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 0.42rem;
    padding: 0.28rem 0.55rem;
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    z-index: 23;
    transition: opacity 0.35s ease;
  }
  #guest-hint.visible { opacity: 1; }

  #mood-wheel {
    width: 100%;
    height: 100%;
    display: block;
    cursor: pointer;
    filter: drop-shadow(0 0 20px rgba(200,184,232,0.35));
  }

  .mood-btn {
    background: none; border: none;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1rem, 4vw, 1.3rem);
    letter-spacing: 0.18em;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    padding: 0.4rem 0.2rem;
    transition: color 0.4s, opacity 0.4s;
    text-shadow: 0 0 15px rgba(200,184,232,0.6);
    position: relative;
  }
  .mood-btn::after {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transition: transform 0.4s;
  }
  .mood-btn:hover { color: var(--text); }
  .mood-btn:hover::after { transform: scaleX(1); }
  .mood-btn.active { color: var(--accent); }
  .mood-btn.active::after { transform: scaleX(1); }

  /* ── POEM PANEL ── */
  #panel {
    position: fixed;
    top: max(7vh, 5rem);
    left: 50%;
    transform: translateX(-50%);
    max-width: min(720px, 92vw);
    width: 100%;
    height: min(55vh, 560px);
    text-align: center;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
  }
  #panel.visible { opacity: 1; pointer-events: auto; }

  #panel-date {
    display: block;
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.58);
    margin-top: 0.15rem;
    margin-bottom: 0.05rem;
  }

  #panel-mood-label {
    display: inline-flex;
    align-self: center;
    justify-content: center;
    align-items: center;
    min-height: 1.7rem;
    padding: 0.2rem 0.7rem 0.18rem;
    border-radius: 0.42rem;
    border: 1px solid rgba(255,255,255,0.26);
    background: rgba(255,255,255,0.1);
    font-size: 0.65rem;
    letter-spacing: 0.28em;
    color: #ffffff;
    opacity: 0.98;
    margin-top: 0.9rem;
    margin-bottom: 0.22rem;
    font-family: 'Tenor Sans', sans-serif;
    text-transform: uppercase;
    text-shadow: none;
    box-shadow: 0 0 18px rgba(0,0,0,0.22);
  }

  #panel-states {
    font-family: 'Tenor Sans', sans-serif;
    font-size: clamp(0.7rem, 2vw, 0.95rem);
    letter-spacing: 0.08em;
    line-height: 1.5;
    color: rgba(255,255,255,0.72);
    max-width: min(720px, 92vw);
    margin: -0.04rem auto 0.2rem;
    padding: 0 0.45rem;
    text-align: center;
  }

  #panel-text {
    background: radial-gradient(ellipse at center, rgba(6,6,15,0.72) 30%, rgba(6,6,15,0.38) 70%, transparent 100%);
    border-radius: 1rem;
    font-size: clamp(1.1rem, 4vw, 1.85rem);
    font-weight: 400;
    font-style: italic;
    line-height: 1.6;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(200,184,232,0.4);
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    padding: 0 0.25rem 0.35rem;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-align: center;
  }
  #panel-text .para-break {
    display: block;
    height: 0.4em;
  }
  #panel-text::-webkit-scrollbar { display: none; }
  #panel-scroll-hint {
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.55rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    text-align: center;
    pointer-events: none;
    opacity: 0;
    max-height: 0;
    margin: 0;
    transition: opacity 0.25s ease, max-height 0.25s ease, margin 0.25s ease;
  }
  #panel-scroll-hint.visible {
    opacity: 0.9;
    max-height: 1.1rem;
    margin: -0.1rem 0 0.2rem;
  }
  #panel-nav {
    margin-top: auto !important;
    margin-bottom: 0.55rem;
  }

  #panel-first,
  #panel-prev,
  #panel-next,
  #panel-last {
    color: rgba(255,255,255,0.9) !important;
    text-shadow: 0 0 10px rgba(200,184,232,0.28);
  }

  #panel-first:hover,
  #panel-prev:hover,
  #panel-next:hover,
  #panel-last:hover {
    color: #ffffff !important;
  }

  #panel-close {
    position: absolute;
    top: 0.3rem;
    right: 0.4rem;
    background: none; border: none;
    font-family: 'Tenor Sans', sans-serif;
    font-size: 1.3rem;
    line-height: 1;
    letter-spacing: 0;
    color: var(--dim);
    cursor: pointer;
    text-transform: none;
    transition: color 0.3s;
    pointer-events: auto;
    padding: 0.2rem 0.4rem;
  }
  #panel-close:hover { color: var(--text); }

  /* ── TOP TITLE ── */
  #title {
    position: fixed; top: 0.8rem; left: 50%; transform: translateX(-50%);
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.05rem, 2.55vw, 1.35rem);
    letter-spacing: 0.5em;
    color: rgba(255,255,255,0.75);
    text-shadow: 0 0 30px rgba(200,184,232,0.6);
    background: rgba(8, 8, 18, 0.42);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 0.5rem;
    backdrop-filter: blur(2px);
    box-shadow: 0 0 18px rgba(0,0,0,0.22);
    padding: 0.28rem 0.72rem 0.22rem;
    z-index: 20;
    opacity: 0;
    transition: opacity 1.5s ease;
    text-transform: lowercase;
    pointer-events: auto;
    cursor: pointer;
  }
  #title.visible { opacity: 1; }

  /* ── MUSIC INDICATOR ── */
  #music-btn {
    position: fixed; top: 2rem; right: 2rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.34);
    color: rgba(255,255,255,0.92);
    cursor: pointer;
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.56rem;
    letter-spacing: 0.22em;
    padding: 0.45rem 0.75rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 24;
    opacity: 0;
    transition: opacity 1.5s ease, color 0.3s, border-color 0.3s, background 0.3s;
    text-transform: uppercase;
    backdrop-filter: blur(2px);
    box-shadow: 0 0 18px rgba(255,255,255,0.1);
  }
  #music-btn.visible { opacity: 1; }
  #music-btn:hover {
    color: var(--text);
    border-color: rgba(255,255,255,0.65);
    background: rgba(255,255,255,0.14);
  }

  #add-entry-btn {
    position: fixed;
    top: 2rem;
    right: 7.35rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.34);
    color: rgba(255,255,255,0.92);
    cursor: pointer;
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.56rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    padding: 0.45rem 0.75rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 24;
    opacity: 0;
    transition: opacity 1.5s ease, color 0.3s, border-color 0.3s, background 0.3s;
    backdrop-filter: blur(2px);
    box-shadow: 0 0 18px rgba(255,255,255,0.1);
  }
  #add-entry-btn.visible { opacity: 1; }
  #add-entry-btn:hover {
    color: var(--text);
    border-color: rgba(255,255,255,0.65);
    background: rgba(255,255,255,0.14);
  }

  #telegram-btn {
    position: fixed;
    top: 2rem;
    right: 13.1rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.34);
    color: rgba(255,255,255,0.92);
    cursor: pointer;
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.56rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.45rem 0.75rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 24;
    opacity: 0;
    transition: opacity 1.5s ease, color 0.3s, border-color 0.3s, background 0.3s;
    backdrop-filter: blur(2px);
    box-shadow: 0 0 18px rgba(255,255,255,0.1);
  }
  #telegram-btn.visible { opacity: 1; }
  #telegram-btn:hover {
    color: var(--text);
    border-color: rgba(255,255,255,0.65);
    background: rgba(255,255,255,0.14);
  }

  #cabinet-btn {
    position: fixed;
    top: 2rem;
    right: 19rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.34);
    color: rgba(255,255,255,0.92);
    cursor: pointer;
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.56rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.45rem 0.75rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 24;
    opacity: 0;
    transition: opacity 1.5s ease, color 0.3s, border-color 0.3s, background 0.3s;
    backdrop-filter: blur(2px);
    box-shadow: 0 0 18px rgba(255,255,255,0.1);
  }
  #cabinet-btn.visible { opacity: 1; }
  #cabinet-btn:hover {
    color: var(--text);
    border-color: rgba(255,255,255,0.65);
    background: rgba(255,255,255,0.14);
  }

  #logout-btn {
    position: fixed;
    top: 2rem;
    right: 24.9rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.34);
    color: rgba(255,255,255,0.92);
    cursor: pointer;
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.56rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.45rem 0.75rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 24;
    opacity: 0;
    transition: opacity 1.5s ease, color 0.3s, border-color 0.3s, background 0.3s;
    backdrop-filter: blur(2px);
    box-shadow: 0 0 18px rgba(255,255,255,0.1);
  }
  #logout-btn.visible { opacity: 1; }
  #logout-btn:hover {
    color: var(--text);
    border-color: rgba(255,255,255,0.65);
    background: rgba(255,255,255,0.14);
  }

  /* Hamburger — hidden on desktop */
  #menu-btn { display: none; }
  #menu-popup { display: none; }

  #cabinet {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 130;
    background: rgba(6,6,15,0.93);
    backdrop-filter: blur(2px);
    overflow-y: auto;
    padding: 2rem 1rem;
  }
  #cabinet.visible { display: block; }
  #cabinet-card {
    width: min(760px, 94vw);
    margin: 0 auto;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 12px;
    background: rgba(10,10,20,0.9);
    padding: 1rem;
  }
  #cabinet-title {
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.66rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.8rem;
  }
  #cabinet-skies {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }
  #cabinet-share {
    display: grid;
    gap: 0.55rem;
    border-top: 1px solid rgba(255,255,255,0.14);
    padding-top: 0.9rem;
    margin-bottom: 1rem;
  }
  #cabinet-share-title {
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.56rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.92);
  }
  #cabinet-share-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.5rem;
  }
  #cabinet-share select,
  #cabinet-share input {
    background-color: rgba(10,10,24,0.85);
    border: 1px solid var(--dim);
    color: var(--text);
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    padding: 0.42rem 1.8rem 0.42rem 0.5rem;
    outline: none;
    min-height: 2rem;
  }
  #cabinet-share input {
    padding: 0.42rem 0.5rem;
  }
  #cabinet-share select:focus,
  #cabinet-share input:focus { border-color: var(--accent); }
  #cabinet-invite-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
  }
  #cabinet-capsule-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem;
    align-items: center;
  }
  #cabinet-capsule-row label {
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.56rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.86);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
  }
  .cabinet-sky-row {
    display: flex;
    gap: 0.4rem;
    align-items: stretch;
  }
  .cabinet-sky-btn {
    flex: 1;
    text-align: left;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.9);
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.7rem;
    cursor: pointer;
  }
  .cabinet-sky-btn:hover {
    border-color: rgba(200,184,232,0.9);
    color: var(--accent);
  }
  .cabinet-sky-del {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.35);
    font-size: 1rem;
    padding: 0 0.65rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
  }
  .cabinet-sky-del:hover {
    color: #e08080;
    border-color: #e08080;
  }
  #cabinet-create {
    display: grid;
    gap: 0.55rem;
    border-top: 1px solid rgba(255,255,255,0.14);
    padding-top: 0.9rem;
  }
  #cabinet-create input {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--dim);
    color: var(--text);
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    padding: 0.45rem 0;
    outline: none;
  }
  #cabinet-create input:focus { border-color: var(--accent); }
  #cabinet-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
  }
  .cabinet-action {
    background: none;
    border: 1px solid var(--dim);
    color: var(--dim);
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.52rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 0.35rem 0.8rem;
    cursor: pointer;
  }
  .cabinet-action:hover { color: var(--text); border-color: var(--text); }
  #cabinet-error {
    min-height: 1em;
    color: #c87070;
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
  }

  #entry-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 120;
    background: rgba(6,6,15,0.8);
    backdrop-filter: blur(2px);
  }
  #entry-modal.visible { display: flex; }
  #entry-modal-card {
    width: min(560px, 92vw);
    background: rgba(10,10,20,0.95);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 14px 44px rgba(0,0,0,0.42);
  }
  #entry-modal-title {
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.64rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.8rem;
  }
  #entry-detected {
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.56rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.78);
    margin-bottom: 0.55rem;
  }
  #entry-manual-wrap {
    display: none;
    margin: 0.35rem 0 0.45rem;
  }
  #entry-manual-wrap.visible {
    display: block;
  }
  #entry-toggle-manual {
    background: none;
    border: 1px solid rgba(255,255,255,0.26);
    color: rgba(255,255,255,0.82);
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.52rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.32rem 0.52rem;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.25s, color 0.25s, background 0.25s;
    margin-bottom: 0.35rem;
  }
  #entry-toggle-manual:hover {
    border-color: rgba(255,255,255,0.5);
    color: #ffffff;
    background: rgba(255,255,255,0.06);
  }
  #entry-mood-manual {
    margin-top: 0.45rem;
    width: 100%;
    font-size: 0.66rem;
    padding: 0.5rem 1.8rem 0.5rem 0.55rem;
  }
  .entry-field {
    display: block;
    width: 100%;
    margin: 0.35rem 0;
    background: rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.18);
    color: var(--text);
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    padding: 0.5rem 0.55rem;
    border-radius: 6px;
    outline: none;
  }
  #entry-text {
    min-height: 7.2rem;
    resize: vertical;
    line-height: 1.45;
  }
  #entry-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    margin-top: 0.65rem;
  }
  .entry-action {
    background: none;
    border: 1px solid var(--dim);
    color: var(--dim);
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.52rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    padding: 0.34rem 0.75rem;
    cursor: pointer;
    transition: color 0.3s, border-color 0.3s;
  }
  .entry-action:hover { color: var(--text); border-color: var(--text); }

  /* ── OVERLAY for panel ── */
  #overlay {
    position: fixed; inset: 0;
    background: rgba(6,6,15,0.7);
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s;
    backdrop-filter: blur(2px);
  }
  #overlay.visible { opacity: 1; pointer-events: auto; }

  /* ── MOBILE ── */
  @media (max-width: 768px) {
    #moods {
      top: auto;
      bottom: 0.4rem;
      width: min(96vw, 420px);
      height: min(30vh, 190px);
      transform: translateX(-50%);
    }

    #title {
      top: 1rem;
      left: 50%;
      transform: translateX(-50%);
      width: calc(100% - 2rem);
      text-align: center;
      font-size: clamp(1rem, 4.2vw, 1.2rem);
      letter-spacing: 0.25em;
      padding: 0.28rem 0.54rem 0.22rem;
    }

    #guest-hint {
      top: 6.7rem;
      width: calc(100% - 2rem);
      text-align: center;
      font-size: 0.5rem;
      letter-spacing: 0.14em;
      padding: 0.24rem 0.4rem;
    }

    #panel {
      top: 6vh;
      max-width: 94vw;
      height: min(58vh, 520px);
    }

    #panel-text {
      min-height: 0;
      padding-bottom: 0.5rem;
      font-size: clamp(1rem, 5vw, 1.6rem);
    }

    #panel-states {
      font-size: clamp(0.65rem, 2.5vw, 0.85rem);
      letter-spacing: 0.06em;
      margin-bottom: 0.12rem;
      max-width: calc(100% - 1rem);
    }

    /* Hide desktop buttons, show hamburger */
    #music-btn, #add-entry-btn, #telegram-btn, #cabinet-btn, #logout-btn {
      display: none !important;
    }

    #menu-btn {
      display: flex;
      position: fixed;
      top: 0.7rem;
      right: 0.8rem;
      width: 2.4rem;
      height: 2.4rem;
      align-items: center;
      justify-content: center;
      background: rgba(255,255,255,0.08);
      border: 1px solid rgba(255,255,255,0.28);
      border-radius: 0.4rem;
      color: rgba(255,255,255,0.9);
      font-size: 1.1rem;
      cursor: pointer;
      z-index: 30;
      backdrop-filter: blur(4px);
      opacity: 1;
    }

    #menu-popup {
      position: fixed;
      top: 3.5rem;
      right: 0.8rem;
      z-index: 29;
      background: rgba(6,6,15,0.97);
      border: 1px solid rgba(255,255,255,0.13);
      border-radius: 0.55rem;
      backdrop-filter: blur(12px);
      flex-direction: column;
      min-width: 11rem;
      overflow: hidden;
      box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    }
    #menu-popup.open { display: flex; }

    .menu-item {
      background: none;
      border: none;
      border-bottom: 1px solid rgba(255,255,255,0.07);
      color: rgba(255,255,255,0.82);
      font-family: 'Tenor Sans', sans-serif;
      font-size: 0.65rem;
      letter-spacing: 0.22em;
      text-transform: uppercase;
      padding: 0.85rem 1.1rem;
      text-align: left;
      cursor: pointer;
      width: 100%;
    }
    .menu-item:last-child { border-bottom: none; }
    .menu-item:active { background: rgba(255,255,255,0.1); }
    .menu-auth { display: none; }
    .menu-auth.visible { display: block; }

    /* Fix panel top so date/mood-label don't hide under title */
    #panel {
      top: 4rem;
      height: min(54vh, 500px);
      background: rgba(4,4,12,0.78);
      border-radius: 1rem;
      padding: 0.6rem 0.7rem 0.4rem;
      backdrop-filter: blur(6px);
    }

    #add-entry-btn {
      top: 3.65rem;
      right: 8.05rem;
      font-size: 0.52rem;
      letter-spacing: 0.18em;
      padding: 0.38rem 0.5rem;
      height: 1.8rem;
      min-width: 6.7rem;
    }

    #music-btn {
      top: 3.65rem;
      right: 0.8rem;
      font-size: 0.52rem;
      letter-spacing: 0.12em;
      padding: 0.38rem 0.5rem;
      height: 1.8rem;
      min-width: 6.7rem;
    }

    #telegram-btn {
      top: 3.65rem;
      right: 15.3rem;
      font-size: 0.52rem;
      letter-spacing: 0.1em;
      padding: 0.38rem 0.5rem;
      height: 1.8rem;
      min-width: 6.4rem;
    }

    #cabinet-btn {
      top: 5.75rem;
      right: 0.8rem;
      font-size: 0.52rem;
      letter-spacing: 0.12em;
      padding: 0.38rem 0.5rem;
      height: 1.8rem;
      min-width: 8.6rem;
    }

    #logout-btn {
      top: 7.85rem;
      right: 0.8rem;
      font-size: 0.52rem;
      letter-spacing: 0.12em;
      padding: 0.38rem 0.5rem;
      height: 1.8rem;
      min-width: 8.6rem;
    }

    #cabinet-share-grid {
      grid-template-columns: 1fr;
    }
    #cabinet-invite-row,
    #cabinet-capsule-row {
      grid-template-columns: 1fr;
    }
    #cabinet-capsule-row label {
      justify-content: flex-start;
    }

    /* Entry modal — mobile */
    #entry-modal-card {
      width: 92vw;
      max-height: 80vh;
      overflow-y: auto;
    }
    .entry-field {
      font-size: 1rem;
    }
    #entry-text {
      min-height: 5rem;
      font-size: 1rem;
    }
  }

  /* ── FEELINGS TABLE MODAL ── */
  #feelings-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 140;
    background: rgba(4,4,12,0.88);
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: 1rem;
  }
  #feelings-modal.visible { display: flex; }

  #feelings-modal-card {
    width: min(680px, 96vw);
    max-height: 90vh;
    background: rgba(10,10,22,0.98);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  }

  #feelings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.2rem 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
  }

  #feelings-title {
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.62rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
  }

  #feelings-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.45);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.2rem;
    transition: color 0.2s;
  }
  #feelings-close:hover { color: #ffffff; }

  #feelings-tabs {
    display: flex;
    gap: 0;
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  #feelings-tabs::-webkit-scrollbar { display: none; }

  .feelings-tab {
    flex: 1 0 auto;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: rgba(255,255,255,0.45);
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.55rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 0.65rem 0.5rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
  }
  .feelings-tab:hover { color: rgba(255,255,255,0.75); }
  .feelings-tab.active {
    color: var(--tab-color, #fff);
    border-bottom-color: var(--tab-color, #fff);
  }

  #feelings-body {
    overflow-y: auto;
    padding: 1rem 1.2rem 1.2rem;
    flex: 1 1 auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
  }

  .feelings-section { margin-bottom: 1.2rem; }

  .feelings-section-title {
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.52rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    margin-bottom: 0.55rem;
  }

  .feelings-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .feelings-chip {
    display: inline-block;
    padding: 0.28rem 0.6rem;
    border: 1px solid var(--chip-color, rgba(255,255,255,0.3));
    border-radius: 2rem;
    color: var(--chip-color, rgba(255,255,255,0.8));
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    opacity: 0.82;
    cursor: default;
    transition: opacity 0.2s, background 0.2s;
  }
  .feelings-chip:hover {
    opacity: 1;
    background: color-mix(in srgb, var(--chip-color, #fff) 12%, transparent);
  }

  @media (max-width: 768px) {
    #feelings-modal { padding: 0.5rem; align-items: flex-end; }
    #feelings-modal-card {
      width: 100%;
      max-height: 88vh;
      border-radius: 1rem 1rem 0 0;
    }
    .feelings-tab { font-size: 0.5rem; padding: 0.6rem 0.4rem; }
    .feelings-chip { font-size: 0.68rem; }
  }

/* ── Encryption modals ─────────────────────────────────────────────────────── */
#pin-setup-modal,
#unlock-modal,
#pin-recovery-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,0.72);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
#pin-setup-modal.visible,
#unlock-modal.visible,
#pin-recovery-modal.visible { display: flex; }

#pin-setup-card,
#unlock-card,
#pin-recovery-card {
  background: rgba(12,14,28,0.97);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 1rem;
  padding: 2rem 1.6rem 1.8rem;
  width: min(340px, calc(100vw - 2rem));
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

#pin-setup-title,
#unlock-title,
#pin-recovery-title {
  font-family: 'Tenor Sans', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0.2rem;
}

#pin-setup-desc,
#unlock-desc,
#pin-recovery-desc {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.5;
}

#pin-setup-input,
#pin-setup-input2,
#unlock-pwd,
#pin-recovery-input,
#pin-recovery-pwd,
#pin-recovery-pwd2 {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  color: var(--text);
  font-family: 'Tenor Sans', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
  padding: 0.6rem 0.2rem;
  outline: none;
}
#pin-setup-input:focus,
#pin-setup-input2:focus,
#unlock-pwd:focus,
#pin-recovery-input:focus,
#pin-recovery-pwd:focus,
#pin-recovery-pwd2:focus {
  border-bottom-color: rgba(255,255,255,0.5);
}

#pin-setup-error,
#unlock-error,
#pin-recovery-error {
  font-size: 0.75rem;
  color: #c07888;
  min-height: 1rem;
}

#pin-setup-submit,
#unlock-submit,
#pin-recovery-submit {
  margin-top: 0.4rem;
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--text);
  font-family: 'Tenor Sans', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.8rem 1rem;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s;
}
#pin-setup-submit:hover,
#unlock-submit:hover,
#pin-recovery-submit:hover {
  border-color: rgba(255,255,255,0.6);
}

/* ── Guest cabinet ─────────────────────────────────────────────────────────── */
#guest-cabinet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(0,0,0,0.82);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
#guest-cabinet.visible { display: flex; }

#guest-cabinet-card {
  background: rgba(10,12,26,0.98);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 1rem;
  padding: 2rem 1.6rem 1.8rem;
  width: min(360px, calc(100vw - 2rem));
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#guest-cabinet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#guest-cabinet-title {
  font-family: 'Tenor Sans', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

#guest-cabinet-close-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}
#guest-cabinet-close-btn:hover { color: rgba(255,255,255,0.7); }

#guest-cabinet-sky-name {
  font-family: 'Tenor Sans', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  color: var(--text);
}

#guest-cabinet-desc {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.5;
}

#guest-cabinet-tg-section {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.6rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

#guest-cabinet-tg-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
}

#guest-cabinet-steps {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.8;
}

#guest-cabinet-link-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

#guest-cabinet-link-input {
  flex: 1;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 0.4rem;
  color: rgba(255,255,255,0.6);
  font-size: 0.7rem;
  padding: 0.5rem 0.6rem;
  min-width: 0;
}

#guest-cabinet-copy-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 0.4rem;
  color: var(--text);
  font-family: 'Tenor Sans', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s;
}
#guest-cabinet-copy-btn:hover { border-color: rgba(255,255,255,0.5); }

#guest-cabinet-tg-btn {
  display: block;
  text-align: center;
  background: rgba(41,182,246,0.12);
  border: 1px solid rgba(41,182,246,0.3);
  border-radius: 0.4rem;
  color: rgba(41,182,246,0.9);
  font-family: 'Tenor Sans', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 0.6rem;
  text-decoration: none;
  transition: background 0.2s;
}
#guest-cabinet-tg-btn:hover { background: rgba(41,182,246,0.2); }

#title.guest-title-clickable {
  cursor: pointer;
}
#title.guest-title-clickable:hover {
  opacity: 0.75;
}

/* ── Info tooltips ───────────────────────────────────────────────────────── */
.info-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 0.78rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.1rem;
  vertical-align: middle;
  transition: color 0.2s;
  flex-shrink: 0;
}
.info-btn:hover { color: rgba(255,255,255,0.7); }
.info-btn.active { color: rgba(167,184,242,0.85); }

.info-popover {
  display: none;
  background: rgba(16,18,36,0.97);
  border: 1px solid rgba(167,184,242,0.22);
  border-radius: 0.5rem;
  padding: 0.75rem 0.9rem;
  font-family: 'Tenor Sans', sans-serif;
  font-size: 0.74rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.72);
  letter-spacing: 0.03em;
  margin-top: 0.1rem;
  margin-bottom: 0.2rem;
  position: relative;
}
.info-popover.open { display: block; }

#cabinet-share-title {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
