  :root {
    --ink: #f2ece2;
    --ink-dim: #a89f92;
    --line: rgba(255, 236, 210, 0.12);
    --glass: rgba(12, 15, 15, 0.56);
    --accent: #ffc978;
    --accent-soft: rgba(255, 201, 120, 0.16);
    --gold-line: rgba(255, 201, 120, 0.42);
    --gold-soft: rgba(255, 201, 120, 0.20);
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Nanum Myeongjo", "Apple SD Gothic Neo", "Malgun Gothic", serif;
  }
  * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html, body {
    margin: 0; padding: 0; width: 100%; height: 100%;
    background: #070a0b; color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
    overflow: hidden;
    letter-spacing: -0.01em;
  }
  #app { position: fixed; inset: 0; }
  #app canvas { display: block; width: 100%; height: 100%; }

  .hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
  .hud button { pointer-events: auto; font: inherit; color: inherit; cursor: pointer; }

  .brand { position: absolute; top: calc(26px + env(safe-area-inset-top)); left: calc(30px + env(safe-area-inset-left)); }
  .brand .t1 {
    font-size: 15px; font-weight: 600; letter-spacing: 0.01em;
    display: flex; align-items: center; gap: 8px;
  }
  .brand .t1 .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 12px rgba(255, 201, 120, 0.9);
  }
  .brand .t2 {
    margin-top: 5px; font-size: 10.5px; color: var(--ink-dim);
    letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500;
  }

  /* ---------------- 트리 꾸미기 창 (기본 접힘 · 톱니바퀴 아이콘 바로 아래 열림) ---------------- */
  .dock {
    position: absolute; top: calc(86px + env(safe-area-inset-top)); right: calc(30px + env(safe-area-inset-right));
    max-width: calc(100vw - 60px - env(safe-area-inset-left) - env(safe-area-inset-right));
    max-height: calc(100vh - 110px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y: auto; overscroll-behavior: contain;
    display: flex; flex-direction: column; gap: 8px;
    padding: 10px;
    background: var(--glass); border: 1px solid var(--line);
    border-radius: 16px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
    pointer-events: none;
    opacity: 0; visibility: hidden;
    transform: translateY(-8px) scale(0.99);
    transform-origin: top right;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  }
  .dock:not(.is-open) button, .carols:not(.is-open) button { pointer-events: none; }
  .dock.is-open {
    pointer-events: auto;
    opacity: 1; visibility: visible; transform: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
  }
  .dock .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .dock .lab {
    font-size: 9.5px; letter-spacing: 0.14em; color: #8b8478;
    text-transform: uppercase; font-weight: 600; min-width: 26px;
  }
  .seg { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(255, 255, 255, 0.035); flex-wrap: wrap; }
  .dock button {
    border: 0; background: transparent; color: var(--ink-dim);
    font-size: 12px; padding: 7px 11px; border-radius: 8px;
    display: flex; align-items: center; gap: 6px;
    transition: background 0.18s ease, color 0.18s ease;
    white-space: nowrap;
  }
  .dock button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
  .dock .seg button.active { color: #ffe6bd; background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(255, 201, 120, 0.22); }
  .dock .toggles { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(255, 255, 255, 0.035); flex-wrap: wrap; }
  .dock .toggles button.on { color: #ffe6bd; background: var(--accent-soft); }
  .dock kbd {
    font: inherit; font-size: 9px; font-weight: 600; letter-spacing: 0.05em;
    padding: 2px 5px; border-radius: 4px; color: #8a8378;
    border: 1px solid rgba(255, 255, 255, 0.13); background: rgba(255, 255, 255, 0.03);
  }
  .dock button.on kbd, .dock .seg button.active kbd { color: #e5c793; border-color: rgba(255, 201, 120, 0.32); }

  .dock .seg#colors button { padding: 7px 10px; }
  .dock .seg#styles button { padding: 7px 10px; }

  /* ---------------- 캐롤 음표 아이콘 토글 ---------------- */
  .carols-toggle {
    position: absolute; top: calc(82px + env(safe-area-inset-top)); left: calc(30px + env(safe-area-inset-left));
    width: 46px; height: 46px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 14px;
    background: var(--glass); border: 1px solid var(--line);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    color: #cfc6b8;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  }
  .carols-toggle:hover { color: #fff0d8; border-color: rgba(255, 236, 210, 0.22); }
  .carols-toggle:focus-visible { outline: 2px solid rgba(255, 201, 120, 0.55); outline-offset: 2px; }
  .carols-toggle[aria-expanded="true"] {
    color: #ffe6bd; background: var(--accent-soft);
    border-color: rgba(255, 201, 120, 0.3);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 201, 120, 0.16);
  }
  .carols-toggle .note-dot {
    position: absolute; top: 9px; right: 9px;
    width: 6px; height: 6px; border-radius: 50%;
    background: transparent;
    transition: background 0.2s ease, box-shadow 0.2s ease;
  }
  .carols-toggle.is-playing { color: #ffe6bd; border-color: rgba(255, 201, 120, 0.26); }
  .carols-toggle.is-playing .note-dot {
    background: var(--accent); box-shadow: 0 0 10px rgba(255, 201, 120, 0.9);
    animation: crpulse 1.9s ease-in-out infinite;
  }

  /* ---------------- 우측 상단 아이콘 두 개(쪽지 · 톱니바퀴) ---------------- */
  .dock-toggle {
    position: absolute; top: calc(28px + env(safe-area-inset-top)); right: calc(30px + env(safe-area-inset-right));
    width: 46px; height: 46px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 14px;
    background: var(--glass); border: 1px solid var(--line);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    color: #cfc6b8;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  }
  .dock-toggle:hover { color: #fff0d8; border-color: rgba(255, 236, 210, 0.22); }
  .dock-toggle:focus-visible { outline: 2px solid rgba(255, 201, 120, 0.55); outline-offset: 2px; }
  .dock-toggle[aria-expanded="true"] {
    color: #ffe6bd; background: var(--accent-soft);
    border-color: rgba(255, 201, 120, 0.3);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 201, 120, 0.16);
  }
  .dock-toggle svg { transition: transform 0.35s ease; }
  .dock-toggle[aria-expanded="true"] svg { transform: rotate(60deg); }

  .note-toggle {
    position: absolute; top: calc(28px + env(safe-area-inset-top)); right: calc(86px + env(safe-area-inset-right));
    width: 46px; height: 46px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 14px;
    background: var(--glass); border: 1px solid var(--line);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    color: #cfc6b8;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  }
  .note-toggle:hover { color: #fff0d8; border-color: rgba(255, 236, 210, 0.22); }
  .note-toggle:focus-visible { outline: 2px solid rgba(255, 201, 120, 0.55); outline-offset: 2px; }
  .note-toggle[aria-expanded="true"] {
    color: #ffe6bd; background: var(--accent-soft);
    border-color: rgba(255, 201, 120, 0.3);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 201, 120, 0.16);
  }
  .note-toggle .draft-dot {
    position: absolute; top: 9px; right: 9px;
    width: 6px; height: 6px; border-radius: 50%; background: transparent;
    transition: background 0.2s ease, box-shadow 0.2s ease;
  }
  .note-toggle.has-draft .draft-dot {
    background: var(--accent); box-shadow: 0 0 10px rgba(255, 201, 120, 0.9);
  }

  /* ---------------- 쪽지 작성 창 ---------------- */
  .note-composer {
    position: fixed; top: calc(88px + env(safe-area-inset-top)); right: calc(30px + env(safe-area-inset-right));
    width: 398px; max-width: calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right));
    max-height: calc(100vh - 112px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y: auto; overscroll-behavior: contain;
    z-index: 9;
    padding: 16px 17px 15px;
    background: linear-gradient(180deg, rgba(16, 18, 18, 0.82), rgba(9, 11, 12, 0.9));
    border: 1px solid var(--line);
    border-radius: 18px;
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    opacity: 0; visibility: hidden;
    transform: translateY(-8px) scale(0.99);
    transform-origin: top right;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  }
  .note-composer.is-open {
    pointer-events: auto; opacity: 1; visibility: visible; transform: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
  }
  .nc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
  .nc-eyebrow {
    font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase;
    color: #8b8478; font-weight: 600;
  }
  .nc-title {
    margin: 4px 0 0; font-size: 16px; font-weight: 600; color: #f7f1e6; letter-spacing: 0;
  }
  .nc-close {
    width: 28px; height: 28px; padding: 0; border: 0; border-radius: 9px;
    background: rgba(255, 255, 255, 0.05); color: #a89f92;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: color 0.16s ease, background 0.16s ease;
  }
  .nc-close:hover { color: #fff0d8; background: rgba(255, 255, 255, 0.1); }
  .nc-field { margin-top: 12px; }
  .nc-field label {
    display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
    font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
    color: #9b948a; font-weight: 600;
  }
  .nc-field label span { color: #6f6a61; letter-spacing: 0.04em; font-weight: 500; }
  .nc-field input, .nc-field textarea {
    width: 100%; margin-top: 6px;
    padding: 9px 11px;
    font: inherit; font-size: 13px; color: #f6efe2;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
  }
  .nc-field input::placeholder, .nc-field textarea::placeholder { color: #625d55; }
  .nc-field input:focus, .nc-field textarea:focus {
    border-color: rgba(255, 201, 120, 0.5);
    background: rgba(255, 201, 120, 0.05);
    box-shadow: 0 0 0 3px rgba(255, 201, 120, 0.08);
  }
  .nc-field textarea {
    resize: vertical; min-height: 104px; max-height: 34vh;
    line-height: 1.72; font-size: 13px;
  }
  .nc-actions { display: flex; gap: 8px; margin-top: 14px; }
  .nc-btn {
    flex: 0 0 auto; padding: 9px 14px; border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.05);
    color: #ddd3c4; font: inherit; font-size: 12.5px; cursor: pointer;
    transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease, transform 0.1s ease;
  }
  .nc-btn:hover { color: #fff5e4; background: rgba(255, 255, 255, 0.09); }
  .nc-btn:active { transform: translateY(1px); }
  .nc-primary {
    border: 0; color: #241705;
    background: linear-gradient(180deg, #ffdc9f, #efb160);
    box-shadow: 0 6px 18px rgba(239, 177, 96, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    font-weight: 600;
  }
  .nc-primary:hover { background: linear-gradient(180deg, #ffe6b7, #f3ba70); color: #241705; }
  .nc-primary.pull { margin-left: auto; }
  .nc-primary.is-copied { background: linear-gradient(180deg, #e9f2d6, #b8d39a); color: #1d2a12; }
  .nc-link {
    margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 236, 210, 0.1);
    display: none;
  }
  .nc-link.is-shown { display: block; }
  .nc-link > label {
    font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase;
    color: #8b8478; font-weight: 600;
  }
  .nc-link-row { display: flex; gap: 6px; margin-top: 6px; }
  .nc-link-row input {
    flex: 1 1 auto; min-width: 0; padding: 8px 10px; font: inherit; font-size: 11px;
    color: #cfc6b8; background: rgba(0, 0, 0, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 9px; outline: none;
    text-overflow: ellipsis;
  }
  .nc-copy {
    flex: 0 0 auto; padding: 8px 12px; border-radius: 9px;
    border: 1px solid rgba(255, 201, 120, 0.32); background: rgba(255, 201, 120, 0.1);
    color: #ffe6bd; font: inherit; font-size: 11.5px; cursor: pointer;
  }
  .nc-copy:hover { background: rgba(255, 201, 120, 0.18); }
  .nc-note { margin-top: 7px; font-size: 10px; color: #7f7a70; line-height: 1.55; }
  .nc-note b { color: #ffcf94; font-weight: 600; }

  /* ---------------- 캐롤 미니 플레이어 (기본 접힘) ---------------- */
  .carols {
    position: absolute; left: calc(30px + env(safe-area-inset-left)); top: calc(140px + env(safe-area-inset-top)); width: 302px;
    max-height: calc(100vh - 164px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y: auto; overscroll-behavior: contain;
    padding: 12px 13px 10px;
    background: var(--glass); border: 1px solid var(--line);
    border-radius: 16px;
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
    pointer-events: none;
    opacity: 0; visibility: hidden;
    transform: translateY(-6px) scale(0.985);
    transform-origin: top left;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
  }
  .carols.is-open {
    pointer-events: auto;
    opacity: 1; visibility: visible; transform: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
  }
  .carols .cr-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .carols .cr-eyebrow {
    display: flex; align-items: center; gap: 6px;
    font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase;
    color: #8b8478; font-weight: 600;
  }
  .carols .cr-eyebrow .pulse {
    width: 5px; height: 5px; border-radius: 50%; background: #6f6a61;
    transition: background 0.25s ease, box-shadow 0.25s ease;
  }
  .carols.is-playing .cr-eyebrow .pulse {
    background: var(--accent); box-shadow: 0 0 10px rgba(255, 201, 120, 0.9);
    animation: crpulse 1.9s ease-in-out infinite;
  }
  @keyframes crpulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
  .carols .cr-meter {
    font-size: 9.5px; color: #8b8478; letter-spacing: 0.04em; white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }
  .carols .cr-title {
    margin-top: 7px; font-size: 13px; font-weight: 600; color: #f7f1e6;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .carols .cr-sub {
    margin-top: 2px; font-size: 10.5px; color: #9c958a;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .carols .cr-bar {
    margin: 9px 0 9px; height: 2px; border-radius: 2px;
    background: rgba(255, 255, 255, 0.085); overflow: hidden;
  }
  .carols .cr-fill {
    height: 100%; width: 0%; border-radius: 2px;
    background: linear-gradient(90deg, rgba(255, 201, 120, 0.5), var(--accent));
  }
  .carols .cr-row { display: flex; align-items: center; gap: 7px; }
  .carols .cr-btn {
    width: 28px; height: 28px; padding: 0; border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.045);
    color: #cfc6b8; display: flex; align-items: center; justify-content: center;
    transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
  }
  .carols .cr-btn:hover { color: #fff0d8; background: rgba(255, 255, 255, 0.09); }
  .carols .cr-btn:active { transform: translateY(0.5px); }
  .carols .cr-play {
    width: 34px; height: 34px; border-radius: 11px; border: 0;
    color: #241705; background: linear-gradient(180deg, #ffdc9f, #efb160);
    box-shadow: 0 4px 14px rgba(239, 177, 96, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    display: flex; align-items: center; justify-content: center;
  }
  .carols .cr-play:hover { background: linear-gradient(180deg, #ffe6b7, #f3ba70); }
  .carols.is-playing .cr-play {
    color: #2a1a06; background: linear-gradient(180deg, #ffe9c2, #f6c076);
  }
  .carols .cr-vol {
    margin-left: auto; display: flex; align-items: center; gap: 7px;
    padding-right: 2px;
  }
  .carols .cr-vol .spk { color: #8b8478; display: flex; }
  .carols .cr-vol input {
    -webkit-appearance: none; appearance: none;
    width: 72px; height: 3px; border-radius: 3px;
    background: rgba(255, 255, 255, 0.14); outline: none; cursor: pointer;
  }
  .carols .cr-vol input::-webkit-slider-thumb {
    -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%;
    background: #ffd79b; box-shadow: 0 0 0 3px rgba(255, 201, 120, 0.14);
  }
  .carols .cr-vol input::-moz-range-thumb {
    width: 11px; height: 11px; border: 0; border-radius: 50%;
    background: #ffd79b;
  }
  .carols .cr-vol-v {
    font-size: 9.5px; color: #8b8478; min-width: 17px; text-align: right;
    font-variant-numeric: tabular-nums;
  }
  /* 17단계: 패널 안 7곡 목록 (넘침 없이 한 줄씩) */
  .carols .cr-list {
    margin-top: 8px; padding-top: 7px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    display: flex; flex-direction: column; gap: 1px;
    max-height: 200px; overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: rgba(255, 201, 120, 0.35) transparent;
  }
  .carols .cr-list::-webkit-scrollbar { width: 4px; }
  .carols .cr-list::-webkit-scrollbar-thumb { background: rgba(255, 201, 120, 0.3); border-radius: 3px; }
  .carols .cr-item {
    display: flex; align-items: baseline; gap: 6px;
    width: 100%; min-width: 0; padding: 4px 6px;
    border: 0; border-radius: 7px; background: transparent;
    color: #b5aea2; text-align: left; font: inherit; cursor: pointer;
    transition: color 0.14s ease, background 0.14s ease;
  }
  .carols .cr-item:hover { color: #fff0d8; background: rgba(255, 255, 255, 0.055); }
  .carols .cr-item:focus-visible { outline: 2px solid rgba(255, 201, 120, 0.5); outline-offset: 1px; }
  .carols .cr-num {
    flex: 0 0 11px; font-size: 9px; color: #7c766c;
    font-variant-numeric: tabular-nums; text-align: right;
  }
  .carols .cr-name {
    flex: 0 1 auto; min-width: 0; font-size: 10.5px; letter-spacing: 0.01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .carols .cr-ko {
    flex: 1 1 auto; min-width: 0; font-size: 9.5px; color: #6f6a61;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right;
  }
  .carols .cr-item.is-active { color: #ffdfab; background: rgba(255, 201, 120, 0.1); }
  .carols .cr-item.is-active .cr-num { color: #ffcf94; }
  .carols .cr-item.is-active .cr-name { font-weight: 600; }
  .carols.is-playing .cr-item.is-active .cr-num { animation: crpulse 1.9s ease-in-out infinite; }
  .carols .cr-hint2 {
    margin-top: 9px; font-size: 9.5px; color: #6f6a61; letter-spacing: 0.03em;
    display: flex; align-items: center; gap: 5px;
  }
  .carols kbd {
    font: inherit; font-size: 9px; font-weight: 600; letter-spacing: 0.05em;
    padding: 1px 5px; border-radius: 4px; color: #8a8378;
    border: 1px solid rgba(255, 255, 255, 0.13); background: rgba(255, 255, 255, 0.03);
  }

  .stats {
    position: absolute; right: calc(30px + env(safe-area-inset-right)); bottom: calc(26px + env(safe-area-inset-bottom));
    text-align: right; font-size: 10.5px; line-height: 1.78;
    color: #7f7a70; letter-spacing: 0.02em;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
  }
  .stats b { color: #d3c7b3; font-weight: 600; }
  .stats .sub { color: #6f6a61; }

  .hint {
    position: absolute; left: 50%; bottom: calc(27px + env(safe-area-inset-bottom)); transform: translateX(-50%);
    font-size: 10.5px; color: #635f57; letter-spacing: 0.05em;
    white-space: nowrap;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  #loader {
    position: fixed; inset: 0; z-index: 20; display: flex;
    flex-direction: column; align-items: center; justify-content: center; gap: 20px;
    background: #070a0b; transition: opacity 0.7s ease, visibility 0s linear 0.7s;
  }
  #loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
  #loader.hidden .ring { animation: none; }
  #loader .ring {
    width: 34px; height: 34px; border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.10);
    border-top-color: var(--accent);
    animation: spin 1.1s linear infinite;
  }
  #loader .lt { font-size: 11.5px; color: #7f7a70; letter-spacing: 0.16em; }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ================================================================
   *  받는 사람 카드 — 다크 유리 · 금박 테두리
   * ================================================================ */
  .card-view {
    position: fixed; inset: 0; z-index: 8;
    display: flex; align-items: center; justify-content: flex-start;
    padding: 0 0 0 clamp(20px, 4.2vw, 68px);
    pointer-events: none;
    opacity: 0; visibility: hidden;
    transition: opacity 0.55s ease, visibility 0s linear 0.55s;
  }
  .card-view.is-open {
    opacity: 1; visibility: visible;
    transition: opacity 0.55s ease, visibility 0s;
  }
  .xcard {
    position: relative;
    pointer-events: none;
    width: min(436px, 40vw);
    max-height: min(78vh, 700px);
    display: flex; flex-direction: column;
    padding: 22px 22px 16px;
    border-radius: 20px;
    border: 1px solid var(--gold-line);
    background:
      radial-gradient(120% 60% at 50% -10%, rgba(255, 201, 120, 0.13), rgba(255, 201, 120, 0) 62%),
      linear-gradient(180deg, rgba(24, 22, 18, 0.80) 0%, rgba(11, 12, 13, 0.90) 58%, rgba(8, 9, 10, 0.94) 100%);
    backdrop-filter: blur(16px) saturate(115%); -webkit-backdrop-filter: blur(16px) saturate(115%);
    box-shadow:
      0 34px 90px rgba(0, 0, 0, 0.58),
      0 0 44px rgba(255, 201, 120, 0.10),
      inset 0 1px 0 rgba(255, 236, 205, 0.14),
      inset 0 0 0 1px rgba(255, 201, 120, 0.06);
    transform: translateY(10px) scale(0.985);
    transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1), max-height 0.45s ease, opacity 0.3s ease;
  }
  .card-view.is-open .xcard { transform: none; pointer-events: auto; }
  /* 금박 모서리 장식 */
  .xcard .xc-corner {
    position: absolute; width: 15px; height: 15px; pointer-events: none;
    border: 1px solid rgba(255, 201, 120, 0.62);
    opacity: 0.85;
  }
  .xcard .xc-corner.tl { top: 7px; left: 7px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
  .xcard .xc-corner.tr { top: 7px; right: 7px; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
  .xcard .xc-corner.bl { bottom: 7px; left: 7px; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
  .xcard .xc-corner.br { bottom: 7px; right: 7px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }

  .xc-back {
    align-self: flex-start;
    margin: -4px 0 10px;
    padding: 5px 10px 5px 8px;
    border: 1px solid rgba(255, 236, 210, 0.14); border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: #b3a99a; font: inherit; font-size: 10.5px; letter-spacing: 0.02em;
    display: none; align-items: center; gap: 5px; cursor: pointer;
  }
  .xc-back:hover { color: #fff0d8; border-color: rgba(255, 201, 120, 0.34); }
  .card-view.is-preview .xc-back { display: inline-flex; }

  .xc-head { position: relative; flex: 0 0 auto; }
  .xc-eyebrow {
    display: flex; align-items: center; gap: 9px;
    font-family: var(--serif);
    font-size: 9.5px; letter-spacing: 0.26em; text-transform: uppercase;
    color: rgba(255, 201, 120, 0.72); font-weight: 600;
  }
  .xc-eyebrow .xc-line {
    flex: 1 1 auto; height: 1px;
    background: linear-gradient(90deg, rgba(255, 201, 120, 0.02), rgba(255, 201, 120, 0.42));
  }
  .xc-eyebrow .xc-line:last-child {
    background: linear-gradient(90deg, rgba(255, 201, 120, 0.42), rgba(255, 201, 120, 0.02));
  }
  .xc-to {
    margin-top: 13px; display: flex; align-items: baseline; gap: 9px;
    min-width: 0;
  }
  .xc-lbl {
    flex: 0 0 auto;
    font-family: var(--serif); font-style: italic;
    font-size: 12px; letter-spacing: 0.04em; color: rgba(255, 201, 120, 0.82);
  }
  .xc-who {
    font-family: var(--serif);
    font-size: 19px; font-weight: 600; color: #fbf4e6; letter-spacing: 0.01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-shadow: 0 2px 16px rgba(255, 201, 120, 0.22);
  }
  .xc-rule {
    margin: 13px 0 0; height: 1px;
    background: linear-gradient(90deg, rgba(255, 201, 120, 0.44), rgba(255, 201, 120, 0.10) 55%, rgba(255, 201, 120, 0));
  }

  .xc-scroll {
    position: relative;
    flex: 1 1 auto; min-height: 0;
    overflow-y: auto; overflow-x: hidden;
    margin: 4px -6px 0; padding: 14px 8px 10px;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 12px, #000 calc(100% - 26px), transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 12px, #000 calc(100% - 26px), transparent 100%);
    scrollbar-width: thin; scrollbar-color: rgba(255, 201, 120, 0.34) transparent;
    overscroll-behavior: contain;
    outline: none;
  }
  .xc-scroll::-webkit-scrollbar { width: 4px; }
  .xc-scroll::-webkit-scrollbar-track { background: transparent; }
  .xc-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 201, 120, 0.3); border-radius: 3px;
  }
  .xc-body {
    margin: 0;
    font-family: var(--serif);
    font-size: 14.5px; line-height: 1.98; color: #f0e8d9;
    white-space: pre-wrap; word-break: break-word;
    letter-spacing: 0.005em;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
  }
  .xc-body.is-empty { color: #8b8478; font-style: italic; }
  .xc-sign {
    margin-top: 20px; display: flex; align-items: baseline; gap: 8px; justify-content: flex-end;
  }
  .xc-who-sm { font-size: 15px; }
  .xc-tail {
    margin-top: 10px; text-align: right;
    font-size: 9px; color: rgba(255, 201, 120, 0.42); letter-spacing: 0.2em;
  }
  .xc-progress {
    flex: 0 0 auto; height: 1px; margin: 0 2px;
    background: rgba(255, 236, 210, 0.09);
  }
  .xc-progress span {
    display: block; height: 100%; width: 0%;
    background: linear-gradient(90deg, rgba(255, 201, 120, 0.35), rgba(255, 201, 120, 0.85));
    transition: width 0.18s linear;
  }
  .xc-foot {
    flex: 0 0 auto;
    display: flex; align-items: center; gap: 7px;
    padding-top: 11px;
  }
  .xc-btn {
    border: 1px solid rgba(255, 236, 210, 0.13); background: rgba(255, 255, 255, 0.045);
    color: #c7bdae; font: inherit; font-size: 11.5px; letter-spacing: 0.01em;
    padding: 7px 11px; border-radius: 9px;
    display: inline-flex; align-items: center; gap: 6px;
    white-space: nowrap; cursor: pointer;
    transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
  }
  .xc-btn:hover { color: #fff3e2; background: rgba(255, 255, 255, 0.075); border-color: rgba(255, 201, 120, 0.26); }
  .xc-btn svg { flex: 0 0 auto; }
  .xc-btn.xc-primary {
    margin-left: auto; border-color: rgba(255, 201, 120, 0.34);
    background: rgba(255, 201, 120, 0.12); color: #ffe6bd;
  }
  .xc-btn.xc-primary:hover { background: rgba(255, 201, 120, 0.2); color: #fff5e4; }
  .xc-btn.is-on { color: #ffe6bd; border-color: rgba(255, 201, 120, 0.34); background: rgba(255, 201, 120, 0.14); }
  .xc-fold {
    position: absolute; top: -1px; right: -1px;
    width: 30px; height: 30px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255, 201, 120, 0.3);
    border-radius: 0 19px 0 13px;
    background: rgba(255, 201, 120, 0.08); color: #e8cfa6; cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease;
  }
  .xc-fold:hover { background: rgba(255, 201, 120, 0.18); color: #fff5e4; }

  /* 접힌 카드 */
  /* 접혀 있지 않을 때는 펼치기 버튼이 자리를 차지하지 않게 한다(모바일에서 카드가 왼쪽으로 밀리는 것 방지) */
  .card-view:not(.is-folded) .xc-reopen { display: none; }
  .card-view.is-folded { align-items: flex-end; padding-bottom: 24px; }
  .card-view.is-folded .xcard { display: none; }
  .xc-reopen {
    pointer-events: none; opacity: 0; visibility: hidden;
    display: flex; align-items: center; gap: 7px;
    padding: 8px 13px; border-radius: 999px;
    border: 1px solid var(--gold-line);
    background: linear-gradient(180deg, rgba(28, 25, 20, 0.86), rgba(12, 13, 14, 0.9));
    color: #f0dcba; font: inherit; font-size: 11.5px; letter-spacing: 0.04em;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 24px rgba(255, 201, 120, 0.1);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    cursor: pointer;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
  }
  .card-view.is-folded .xc-reopen {
    pointer-events: auto; opacity: 1; visibility: visible;
    transition: opacity 0.3s ease, visibility 0s;
  }
  .xc-reopen .xc-reopen-dot {
    width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
    box-shadow: 0 0 9px rgba(255, 201, 120, 0.9);
  }

  /* 받는 사람 모드: 편집용 UI 감춤 */
  body.card-mode .dock-toggle,
  body.card-mode .note-toggle,
  body.card-mode .dock,
  body.card-mode .hint,
  body.card-mode .stats,
  body.card-mode .carols,
  body.card-mode .carols-toggle,
  body.card-mode .note-composer { display: none !important; }
  body.card-mode .brand { opacity: 0.5; transition: opacity 0.4s ease; }
  body.card-mode .hud { pointer-events: none; }

  @media (max-width: 1100px) {
    .carols { width: 272px; }
    .carols .cr-vol input { width: 56px; }
    .xcard { width: min(410px, 46vw); }
  }
  @media (max-width: 1100px) and (min-width: 901px) {
    .card-view { padding-left: 22px; }
  }
  @media (max-width: 900px) {
    .hint { display: none; }
  }
  @media (max-width: 760px) {
    .brand { top: calc(18px + env(safe-area-inset-top)); left: calc(18px + env(safe-area-inset-left)); }
    .carols-toggle { top: calc(64px + env(safe-area-inset-top)); left: calc(18px + env(safe-area-inset-left)); width: 44px; height: 44px; border-radius: 13px; }
    .dock-toggle { top: calc(18px + env(safe-area-inset-top)); right: calc(18px + env(safe-area-inset-right)); width: 44px; height: 44px; border-radius: 13px; }
    .note-toggle { top: calc(18px + env(safe-area-inset-top)); right: calc(72px + env(safe-area-inset-right)); width: 44px; height: 44px; border-radius: 13px; }
    .carols {
      left: calc(12px + env(safe-area-inset-left)); right: calc(12px + env(safe-area-inset-right));
      width: auto; top: calc(118px + env(safe-area-inset-top));
      max-height: calc(100vh - 134px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
      padding: 10px 11px 9px;
    }
    .carols .cr-list { max-height: 186px; }
    .carols .cr-hint2 { display: none; }
    .dock {
      top: calc(72px + env(safe-area-inset-top)); bottom: auto;
      left: calc(12px + env(safe-area-inset-left)); right: calc(12px + env(safe-area-inset-right));
      max-width: none; max-height: calc(100vh - 88px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
      padding: 8px;
      transform-origin: top right;
    }
    .dock button { font-size: 11px; padding: 6px 8px; }
    .dock .seg#colors button { font-size: 11px; padding: 6px 8px; }
    .dock .seg#styles button { font-size: 11px; padding: 6px 8px; }
    .dock .toggles button { font-size: 11px; padding: 6px 7px; }
    .dock .lab { display: none; }
    .stats { display: none; }

    .note-composer {
      top: auto; bottom: calc(12px + env(safe-area-inset-bottom));
      left: calc(12px + env(safe-area-inset-left)); right: calc(12px + env(safe-area-inset-right));
      width: auto; max-width: none;
      max-height: calc(76vh - env(safe-area-inset-bottom)); overflow-y: auto;
      transform: translateY(14px) scale(0.995); transform-origin: bottom center;
    }
    .note-composer.is-open { transform: none; }
    .nc-field textarea { max-height: 26vh; }

    .card-view {
      align-items: flex-end; justify-content: center;
      padding: 0 calc(12px + env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
    }
    /* 카드 뒤 나무를 은은하게 가라앉혀 글자가 더 잘 읽히게 */
    .card-view::before {
      content: ''; position: absolute; inset: 0; pointer-events: none;
      background: linear-gradient(180deg, rgba(4, 6, 7, 0) 0%, rgba(4, 6, 7, 0.28) 34%, rgba(4, 6, 7, 0.72) 62%, rgba(4, 6, 7, 0.9) 100%);
    }
    .card-view.is-folded::before { opacity: 0; }
    .xcard, .xc-reopen { position: relative; }
    .xcard {
      width: 100%;
      max-height: 66vh;
      padding: 18px 17px 13px;
      border-radius: 18px;
      /* 모바일은 뒤의 나무가 비쳐 보이지 않도록 유리 뒷면을 더 진하게 */
      background:
        radial-gradient(120% 60% at 50% -10%, rgba(255, 201, 120, 0.14), rgba(255, 201, 120, 0) 62%),
        linear-gradient(180deg, rgba(26, 24, 20, 0.94) 0%, rgba(12, 13, 14, 0.975) 52%, rgba(8, 9, 10, 0.985) 100%);
    }
    .xc-who { font-size: 17px; }
    .xc-body { font-size: 13.5px; line-height: 1.92; }
    .xc-btn { font-size: 11px; padding: 7px 9px; }
    .xc-foot { gap: 6px; }
    .card-view.is-folded { align-items: flex-end; justify-content: flex-start; padding-bottom: 18px; }
  }
  @media (max-width: 380px) {
    .xc-btn span.xc-btn-t { display: none; }
  }
  @media (prefers-reduced-motion: reduce) {
    .xcard { transition: none; }
    .card-view { transition: opacity 0.2s ease, visibility 0s linear 0.2s; }
    .card-view.is-open { transition: opacity 0.2s ease, visibility 0s; }
    .carols-toggle.is-playing .note-dot,
    .carols.is-playing .cr-eyebrow .pulse,
    .carols.is-playing .cr-item.is-active .cr-num,
    #loader .ring { animation: none; }
  }

  /* ================================================================
   *  16단계 — 계정 · 내 카드 · 로그인/신고 모달 · 볼 수 없는 카드
   * ================================================================ */
  .nc-account {
    display: flex; align-items: center; gap: 8px;
    margin-top: 11px; padding: 7px 9px;
    border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.035);
  }
  .nc-acc-dot {
    flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: #6f6a61;
    transition: background 0.2s ease, box-shadow 0.2s ease;
  }
  .nc-account.is-signed-in .nc-acc-dot { background: var(--accent); box-shadow: 0 0 9px rgba(255, 201, 120, 0.9); }
  .nc-acc-who {
    flex: 1 1 auto; min-width: 0; font-size: 11px; color: #b6ada0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .nc-acc-btn {
    flex: 0 0 auto; padding: 4px 9px; border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.13); background: rgba(255, 255, 255, 0.05);
    color: #cfc6b8; font: inherit; font-size: 10.5px; cursor: pointer;
  }
  .nc-acc-btn:hover { color: #fff0d8; border-color: rgba(255, 201, 120, 0.3); }
  .nc-acc-btn[hidden] { display: none; }

  .nc-tabs {
    display: flex; gap: 4px; margin-top: 10px; padding: 3px;
    border-radius: 10px; background: rgba(255, 255, 255, 0.035);
  }
  .nc-tab {
    flex: 1 1 0; padding: 7px 8px; border: 0; border-radius: 8px;
    background: transparent; color: #9b948a; font: inherit; font-size: 12px; cursor: pointer;
    transition: color 0.16s ease, background 0.16s ease;
  }
  .nc-tab:hover { color: #e5dccc; }
  .nc-tab.is-active {
    color: #ffe6bd; background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px rgba(255, 201, 120, 0.22);
  }
  .nc-panel { display: block; }
  .nc-panel[hidden] { display: none; }

  .nc-warn {
    display: none; margin-top: 8px; padding: 8px 10px; border-radius: 9px;
    font-size: 10.5px; line-height: 1.62; color: #ffd9a3;
    background: rgba(255, 170, 80, 0.09); border: 1px solid rgba(255, 170, 80, 0.28);
  }
  .nc-warn.is-shown { display: block; }
  .nc-cloud-note { margin-top: 9px; }
  .nc-cloud-note.is-warn { color: #ffc58f; }
  .nc-cloud-note.is-ok { color: #cfe3b4; }
  .nc-cloud-note.is-flash { animation: ncflash 0.9s ease; }
  @keyframes ncflash { 0%, 100% { opacity: 1; } 40% { opacity: 0.35; } }
  .nc-primary.is-warn { background: linear-gradient(180deg, #ffd0a0, #e6975a); color: #2b1503; }

  .nc-mine { margin-top: 10px; max-height: 40vh; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; }
  .nc-mine-status { margin-top: 12px; font-size: 11px; color: #9b948a; line-height: 1.65; }
  .nc-mine-status[hidden] { display: none; }
  .nc-mine-empty { margin-top: 16px; font-size: 11.5px; color: #7f7a70; text-align: center; line-height: 1.75; }
  .nc-mine-empty[hidden] { display: none; }
  .mir-item {
    padding: 10px 11px; border-radius: 11px;
    background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08);
  }
  .mir-top { display: flex; align-items: center; gap: 8px; }
  .mir-to {
    flex: 1 1 auto; min-width: 0; font-size: 12.5px; color: #f2e9da;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .mir-badge {
    flex: 0 0 auto; padding: 2px 6px; border-radius: 999px; font-size: 9px;
    border: 1px solid rgba(255, 255, 255, 0.14); color: #a9a196;
  }
  .mir-badge.is-active { color: #cfe3b4; border-color: rgba(160, 210, 120, 0.34); background: rgba(120, 180, 90, 0.12); }
  .mir-badge.is-hidden { color: #ffc58f; border-color: rgba(255, 170, 80, 0.34); background: rgba(255, 170, 80, 0.1); }
  .mir-badge.is-deleted { color: #9b948a; }
  .mir-sub { margin-top: 3px; font-size: 10px; color: #8b8478; }
  .mir-msg { margin-top: 5px; font-size: 11px; color: #c7bdae; line-height: 1.55; }
  .mir-acts { display: flex; gap: 6px; margin-top: 8px; }
  .mir-btn {
    padding: 5px 9px; border-radius: 8px; font: inherit; font-size: 10.5px; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.05); color: #cfc6b8;
  }
  .mir-btn:hover { color: #fff0d8; border-color: rgba(255, 201, 120, 0.3); }
  .mir-btn:disabled { opacity: 0.45; cursor: default; }
  .mir-danger { margin-left: auto; color: #f0b3a0; border-color: rgba(240, 140, 110, 0.26); }

  /* ---------------- 모달 (로그인 · 신고) ---------------- */
  .modal {
    position: fixed; inset: 0; z-index: 30;
    display: flex; align-items: center; justify-content: center; padding: 18px;
    background: rgba(4, 6, 7, 0.45);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.22s ease, visibility 0s linear 0.22s;
  }
  .modal.is-open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 0.22s ease, visibility 0s; }
  .modal-card {
    width: min(420px, 100%); max-height: min(86vh, 640px); overflow-y: auto;
    padding: 18px 18px 16px; border-radius: 18px;
    background: linear-gradient(180deg, rgba(22, 23, 21, 0.985), rgba(10, 12, 13, 0.995));
    border: 1px solid rgba(255, 201, 120, 0.26);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 236, 205, 0.08);
    transform: translateY(8px) scale(0.99);
    transition: transform 0.22s ease;
  }
  .modal.is-open .modal-card { transform: none; }
  .modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
  .modal-eyebrow { font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: #8b8478; font-weight: 600; }
  .modal-title { margin: 4px 0 0; font-size: 16px; font-weight: 600; color: #f7f1e6; }
  .modal-x {
    flex: 0 0 auto; width: 28px; height: 28px; border-radius: 9px;
    border: 0; background: rgba(255, 255, 255, 0.05); color: #a89f92;
    font: inherit; font-size: 16px; line-height: 1; cursor: pointer;
  }
  .modal-x:hover { color: #fff0d8; background: rgba(255, 255, 255, 0.1); }
  .modal-desc { margin: 9px 0 0; font-size: 11px; color: #9b948a; line-height: 1.7; }
  .modal-field { margin-top: 12px; }
  .modal-field label {
    display: block; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
    color: #9b948a; font-weight: 600;
  }
  .modal-field input, .modal-field textarea {
    width: 100%; margin-top: 6px; padding: 10px 11px;
    font: inherit; font-size: 13px; color: #f6efe2;
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px; outline: none;
  }
  .modal-field input:focus, .modal-field textarea:focus {
    border-color: rgba(255, 201, 120, 0.5); box-shadow: 0 0 0 3px rgba(255, 201, 120, 0.08);
  }
  .modal-field textarea { min-height: 66px; resize: vertical; line-height: 1.6; }
  .modal-code { letter-spacing: 0.42em; font-size: 19px !important; text-align: center; font-variant-numeric: tabular-nums; }
  .modal-err { display: none; margin-top: 7px; font-size: 10.5px; line-height: 1.55; color: #ffb59a; }
  .modal-err.is-shown { display: block; }
  .modal-primary {
    width: 100%; margin-top: 12px; padding: 11px 12px; border: 0; border-radius: 11px;
    font: inherit; font-size: 13px; font-weight: 600; color: #241705;
    background: linear-gradient(180deg, #ffdc9f, #efb160); cursor: pointer;
    box-shadow: 0 6px 18px rgba(239, 177, 96, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }
  .modal-primary:disabled { opacity: 0.6; cursor: default; }
  .modal-ghost {
    width: 100%; margin-top: 8px; padding: 8px; border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.1); background: transparent;
    color: #b6ada0; font: inherit; font-size: 11.5px; cursor: pointer;
  }
  .modal-ghost:hover { color: #fff0d8; border-color: rgba(255, 201, 120, 0.26); }
  .modal-ghost:disabled { opacity: 0.5; cursor: default; }
  .modal-hint { margin-top: 7px; font-size: 10px; color: #7f7a70; line-height: 1.6; }
  .modal-reasons { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
  .modal-reasons label {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px;
    background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12px; color: #ddd3c4; cursor: pointer; line-height: 1.5;
  }
  .modal-reasons input { accent-color: #efb160; }

  /* ---------------- 받는 카드 하단: 주의 문구 · 신고 ---------------- */
  .xc-caution {
    flex: 0 0 auto; margin: 8px 2px 0; padding-top: 8px;
    border-top: 1px dashed rgba(255, 236, 210, 0.1);
    font-size: 9px; line-height: 1.62; color: #8b8478; text-align: center; letter-spacing: 0;
  }
  .xc-btn.xc-report { color: #ffc0a8; border-color: rgba(240, 140, 110, 0.26); }
  .xc-btn.xc-report:hover { color: #ffd8c8; border-color: rgba(240, 140, 110, 0.42); }
  .xc-btn.xc-report[hidden] { display: none; }

  /* ---------------- 볼 수 없는 카드 ---------------- */
  .id-error {
    position: fixed; inset: 0; z-index: 18;
    display: flex; align-items: center; justify-content: center; padding: 20px;
    background: radial-gradient(120% 90% at 50% 30%, rgba(10, 14, 15, 0.74), rgba(4, 5, 6, 0.95));
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
  }
  .id-error.is-open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 0.3s ease, visibility 0s; }
  .id-error-card {
    width: min(430px, 100%); padding: 24px 22px; border-radius: 18px; text-align: center;
    border: 1px solid rgba(255, 201, 120, 0.3);
    background: linear-gradient(180deg, rgba(24, 22, 18, 0.94), rgba(9, 10, 11, 0.97));
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 236, 205, 0.1);
  }
  .id-error .ie-icon { font-size: 26px; line-height: 1; }
  .id-error h2 { margin: 12px 0 0; font-size: 17px; font-weight: 600; color: #f7f1e6; }
  .id-error p { margin: 9px 0 0; font-size: 12px; line-height: 1.75; color: #a89f92; }
  .id-error button {
    margin-top: 16px; padding: 10px 16px; border: 0; border-radius: 10px;
    font: inherit; font-size: 12.5px; font-weight: 600; color: #241705;
    background: linear-gradient(180deg, #ffdc9f, #efb160); cursor: pointer;
  }
  .id-error button[hidden] { display: none; }
  body.id-error-mode .dock, body.id-error-mode .dock-toggle, body.id-error-mode .note-toggle,
  body.id-error-mode .note-composer, body.id-error-mode .carols, body.id-error-mode .carols-toggle,
  body.id-error-mode .stats, body.id-error-mode .hint { display: none !important; }

  /* ---------------- 토스트 ---------------- */
  .cloud-toast {
    position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); z-index: 40;
    transform: translate(-50%, 12px); max-width: min(480px, calc(100vw - 32px));
    padding: 10px 14px; border-radius: 11px; font-size: 11.5px; line-height: 1.6; color: #f6efe2;
    background: rgba(18, 20, 19, 0.95); border: 1px solid rgba(255, 201, 120, 0.28);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  }
  .cloud-toast.is-shown {
    opacity: 1; visibility: visible; transform: translate(-50%, 0); pointer-events: auto;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
  }

  @media (max-width: 760px) {
    .modal { align-items: flex-end; padding: 0 calc(10px + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left)); }
    .modal-card { width: 100%; border-radius: 16px; max-height: 84vh; }
    .nc-mine { max-height: 34vh; }
    .cloud-toast { bottom: calc(16px + env(safe-area-inset-bottom)); }
  }
