/* =========================================================
   CONNECTO — DESIGN SYSTEM v2
   "Rooms with a key": cream paper, aubergine ink, coral accent,
   sticker colours, chunky outlines and hard offset shadows.
   Light is the default; dark is [data-theme="dark"].
========================================================= */

:root {
    --bg: #fff6e5;
    --bg-2: #ffeccb;
    --paper: #ffffff;
    --ink: #1a1330;
    --muted: #5e5876;
    --bd: #1a1330;               /* outline colour for chunky components */
    --soft: rgba(26, 19, 48, .14);
    --sh: #1a1330;               /* hard-shadow colour */
    --on-color: #1a1330;         /* text on bright colour fills */

    --coral: #ff5a3c;
    --sun: #ffc933;
    --sky: #7db3ff;
    --mint: #4bd6a5;
    --lilac: #b9a2ff;
    --pink: #ff93bd;

    --mine: var(--coral);
    --radius: 18px;
    --radius-lg: 28px;
    --header-h: 72px;
    --wrap: 1160px;
    --font-display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
    --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --ease: cubic-bezier(.22, .61, .36, 1);
    --spring: cubic-bezier(.34, 1.56, .64, 1);
    color-scheme: light;
}

/* Dark theme: deep aubergine night, softer outlines, lilac-tinted offset shadows */
:root[data-theme="dark"] {
    --bg: #110d1d;
    --bg-2: #181229;
    --paper: #201938;
    --paper-2: #2a2147;
    --ink: #f7f0e1;
    --muted: #aca3c8;
    --bd: rgba(247, 240, 225, .46);
    --soft: rgba(247, 240, 225, .12);
    --sh: #34285e;
    --coral: #ff6444;
    --sun: #f8c032;
    --sky: #78aaf6;
    --mint: #45d0a0;
    --lilac: #ae99f8;
    --pink: #f68cb8;
    color-scheme: dark;
}
:root[data-theme="dark"] body {
    background:
        radial-gradient(55% 38% at 88% -6%, rgba(255, 100, 68, .16), transparent 70%),
        radial-gradient(48% 36% at -4% 102%, rgba(174, 153, 248, .14), transparent 70%),
        var(--bg);
    background-attachment: fixed;
}
:root[data-theme="dark"] .site-header { background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom-color: var(--soft); }
:root[data-theme="dark"] .sticker,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .tile:not(.t-a):not(.t-f),
:root[data-theme="dark"] .messages-wrap,
:root[data-theme="dark"] dialog {
    background-image: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, 0) 55%);
}
:root[data-theme="dark"] .btn { background: var(--paper-2); }
:root[data-theme="dark"] .btn-primary { background: var(--coral); }
:root[data-theme="dark"] .btn-sun { background: var(--sun); }
:root[data-theme="dark"] .btn-ink { background: var(--ink); color: var(--bg); }
:root[data-theme="dark"] .btn-ghost { background: transparent; }
:root[data-theme="dark"] .btn-google { background: #fff; }
:root[data-theme="dark"] .icon-btn { background: var(--paper-2); }
:root[data-theme="dark"] .eyebrow, :root[data-theme="dark"] .chip { background: var(--paper-2); }
:root[data-theme="dark"] .code-input { background: var(--bg-2); }
:root[data-theme="dark"] .window { background: var(--paper); }
:root[data-theme="dark"] .window-bar { background: var(--paper-2); }
:root[data-theme="dark"] .messages { background-image: radial-gradient(rgba(247, 240, 225, .1) 1.2px, transparent 1.3px); }
:root[data-theme="dark"] .composer-row { background: var(--paper-2); }
:root[data-theme="dark"] .day-sep { background: var(--paper-2); }
:root[data-theme="dark"] .site-footer { background: var(--bg-2); border-top-color: var(--soft); }
:root[data-theme="dark"] .footer-big { color: rgba(247, 240, 225, .07); }
:root[data-theme="dark"] .ticker { border-color: var(--bd); }
:root[data-theme="dark"] .nav a:hover { background: var(--paper-2); }
:root[data-theme="dark"] ::selection { background: var(--coral); color: #1a1330; }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 16.5px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    transition: background .3s var(--ease), color .3s var(--ease);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
ul { list-style: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 1.02; letter-spacing: -.035em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; border-radius: 10px; }
::selection { background: var(--sun); color: #1a1330; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 12px; top: -64px; z-index: 300; background: var(--sun); color: #1a1330; border: 2px solid #1a1330; padding: 10px 18px; border-radius: 12px; font-weight: 700; transition: top .2s; }
.skip-link:focus { top: 12px; }
.wrap { width: 100%; max-width: calc(var(--wrap) + 48px); margin-inline: auto; padding-inline: 24px; }
main { flex: 1 0 auto; }

/* ---------- Sticker surface ---------- */
.sticker { background: var(--paper); border: 2px solid var(--bd); border-radius: var(--radius); box-shadow: 5px 5px 0 var(--sh); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 13px 24px;
    border: 2px solid var(--bd);
    border-radius: 999px;
    font-weight: 700; font-size: .98rem; line-height: 1; white-space: nowrap;
    color: var(--ink);
    background: var(--paper);
    box-shadow: 4px 4px 0 var(--sh);
    transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .2s;
}
.btn:hover:not([disabled]) { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--sh); }
.btn:active:not([disabled]) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--sh); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; box-shadow: 2px 2px 0 var(--sh); }
.btn-primary { background: var(--coral); color: #1a1330; }
.btn-sun { background: var(--sun); color: #1a1330; }
.btn-ink { background: var(--ink); color: var(--bg); }
.btn-ghost { box-shadow: none; background: transparent; }
.btn-ghost:hover:not([disabled]) { background: var(--paper); box-shadow: 3px 3px 0 var(--sh); }
.btn-sm { padding: 9px 16px; font-size: .88rem; box-shadow: 3px 3px 0 var(--sh); }
.btn-sm:hover:not([disabled]) { box-shadow: 5px 5px 0 var(--sh); }
.btn-lg { padding: 17px 32px; font-size: 1.08rem; }

.icon-btn { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--paper); border: 2px solid var(--bd); box-shadow: 3px 3px 0 var(--sh); transition: transform .15s var(--ease), box-shadow .15s var(--ease); }
.icon-btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--sh); }
.icon-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--sh); }
.icon-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Logo ---------- */
.logo-mark { width: 40px; height: 40px; overflow: visible; }
.logo-mark .bub { fill: var(--coral); stroke: var(--bd); stroke-width: 3; stroke-linejoin: round; }
.logo-mark .hole { fill: var(--on-color); }
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand:hover .logo-mark { animation: wiggle .5s var(--ease); }
@keyframes wiggle { 30% { transform: rotate(-8deg) scale(1.06); } 60% { transform: rotate(5deg); } }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.65rem; letter-spacing: -.045em; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 100; height: var(--header-h); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 2px solid var(--bd); }
.site-header .bar { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { padding: 8px 18px; border-radius: 999px; font-weight: 600; font-size: .96rem; border: 2px solid transparent; transition: background .2s, border-color .2s; }
.nav a:hover { background: var(--paper); border-color: var(--soft); }
.nav a[aria-current="page"] { background: var(--sun); color: #1a1330; border-color: var(--bd); }
.actions { display: flex; align-items: center; gap: 10px; }
.user { display: flex; align-items: center; gap: 10px; }
.user img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--bd); background: var(--sun); }
.user .name { font-size: .9rem; font-weight: 600; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-btn { display: none; }
.nav .nav-account { display: none; }

@media (max-width: 860px) {
    .menu-btn { display: grid; }
    .user .name, .user .btn { display: none; }
    .nav { position: absolute; left: 0; right: 0; top: var(--header-h); flex-direction: column; align-items: stretch; gap: 6px; padding: 14px 20px 22px; background: var(--bg); border-bottom: 2px solid var(--bd); display: none; }
    .nav.open { display: flex; }
    .nav a { padding: 14px 18px; font-size: 1.1rem; }
    .nav .nav-account { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; padding-top: 16px; border-top: 2px dashed var(--soft); }
    .nav .nav-account .btn { width: 100%; }
    #signInBtn { padding: 8px 14px; font-size: .86rem; }
}
@media (max-width: 380px) { .brand-name { font-size: 1.4rem; } .actions { gap: 8px; } .logo-mark { width: 34px; height: 34px; } }

/* ---------- Shared type ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border: 2px solid var(--bd); border-radius: 999px; background: var(--paper); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; box-shadow: 3px 3px 0 var(--sh); }
.eyebrow::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--coral); border: 2px solid var(--bd); }
.lead { font-size: clamp(1.08rem, 1.7vw, 1.28rem); color: var(--muted); max-width: 560px; }
.mark { background: linear-gradient(transparent 56%, var(--sun) 56% 90%, transparent 90%); padding: 0 .06em; margin: 0 -.06em; box-decoration-break: clone; -webkit-box-decoration-break: clone; color: var(--ink); }
:root[data-theme="dark"] .mark { color: #fff6e5; background: linear-gradient(transparent 56%, rgba(255, 201, 51, .55) 56% 90%, transparent 90%); }
.squiggle { color: var(--coral); }
.section { padding-block: clamp(60px, 9vw, 112px); }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(2.2rem, 5vw, 3.8rem); margin: 18px 0 14px; }
.section-head p { color: var(--muted); font-size: 1.1rem; }

/* =========================================================
   HERO
========================================================= */
.hero { position: relative; overflow: hidden; padding-block: clamp(44px, 7vw, 92px) clamp(64px, 9vw, 110px); }
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(28px, 4vw, 64px); align-items: center; }
.hero h1 { font-size: clamp(3.1rem, 7.6vw, 6.4rem); line-height: .94; margin: 22px 0 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 34px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 2px solid var(--bd); border-radius: 999px; background: var(--paper); font-size: .86rem; font-weight: 600; }
.chip i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bd); }
.chip i.c-sun { background: var(--sun); } .chip i.c-mint { background: var(--mint); } .chip i.c-sky { background: var(--sky); }
@media (max-width: 920px) { .hero-grid { grid-template-columns: 1fr; } }

.stage { position: relative; max-width: 500px; margin-inline: auto; width: 100%; padding: 28px 8px 36px; }
.window { background: var(--paper); border: 2px solid var(--bd); border-radius: 24px; box-shadow: 9px 9px 0 var(--sh); overflow: hidden; transform: rotate(1.6deg); }
.window-bar { display: flex; align-items: center; gap: 8px; padding: 13px 16px; border-bottom: 2px solid var(--bd); background: var(--bg-2); }
.window-bar i { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--bd); }
.window-bar i:nth-child(1) { background: var(--coral); } .window-bar i:nth-child(2) { background: var(--sun); } .window-bar i:nth-child(3) { background: var(--mint); }
.window-bar span { margin-left: 8px; font: 700 .78rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .12em; }
.window-body { padding: 20px 18px 22px; display: grid; gap: 10px; min-height: 300px; align-content: end; }
.win-msg { max-width: 82%; padding: 11px 16px; border: 2px solid var(--bd); border-radius: 18px; font-size: .95rem; line-height: 1.4; font-weight: 500; color: #1a1330; opacity: 0; transform: translateY(10px) scale(.96); animation: pop .5s var(--spring) forwards; }
.win-msg.a { background: var(--sky); border-bottom-left-radius: 5px; }
.win-msg.b { background: var(--coral); justify-self: end; border-bottom-right-radius: 5px; }
.win-msg.c { background: var(--mint); border-bottom-left-radius: 5px; }
.win-msg:nth-child(1) { animation-delay: .4s; } .win-msg:nth-child(2) { animation-delay: 1.3s; } .win-msg:nth-child(3) { animation-delay: 2.3s; } .win-msg:nth-child(4) { animation-delay: 3.2s; }
@keyframes pop { to { opacity: 1; transform: none; } }
.float { position: absolute; z-index: 2; }
.stamp { top: -2px; right: -4px; display: grid; place-items: center; width: 108px; height: 108px; border-radius: 50%; background: var(--sun); color: #1a1330; border: 2px solid var(--bd); box-shadow: 4px 4px 0 var(--sh); font: 800 .8rem/1.1 var(--font-display); text-align: center; letter-spacing: .03em; text-transform: uppercase; transform: rotate(12deg); animation: bob 5s ease-in-out infinite; }
.stamp svg { width: 34px; height: 34px; margin: 0 auto 2px; }
.ticket-float { left: -6px; bottom: -4px; transform: rotate(-5deg); animation: bob 6s ease-in-out -2s infinite; }
@keyframes bob { 50% { translate: 0 -8px; } }

/* ---------- Ticker ---------- */
.ticker { background: var(--coral); color: #1a1330; border-block: 2px solid var(--bd); overflow: hidden; padding-block: 14px; transform: rotate(-1deg); margin-block: 6px; }
.ticker-track { display: flex; width: max-content; animation: ticker 32s linear infinite; }
.ticker-group { display: flex; flex-shrink: 0; }
.ticker-group span { display: inline-flex; align-items: center; gap: 26px; padding-right: 26px; font: 800 clamp(1.1rem, 2.4vw, 1.6rem)/1 var(--font-display); letter-spacing: -.02em; white-space: nowrap; }
.ticker-group span::after { content: "✦"; font-size: .8em; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Ticket (room code) ---------- */
.ticket { position: relative; display: inline-flex; flex-direction: column; gap: 4px; background: var(--sun); color: #1a1330; border: 2px solid var(--bd); border-radius: 16px; padding: 14px 26px; box-shadow: 4px 4px 0 var(--sh); }
.ticket::before, .ticket::after { content: ""; position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); border: 2px solid var(--bd); translate: 0 -50%; }
.ticket::before { left: -11px; } .ticket::after { right: -11px; }
.ticket small { font: 700 .66rem ui-monospace, Menlo, Consolas, monospace; letter-spacing: .2em; text-transform: uppercase; opacity: .75; }
.ticket b { font: 700 1.4rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .14em; }

/* =========================================================
   STEPS / BENTO / BANDS
========================================================= */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.step { position: relative; padding: 30px 28px 32px; border: 2px solid var(--bd); border-radius: var(--radius-lg); box-shadow: 6px 6px 0 var(--sh); color: #1a1330; transition: transform .25s var(--spring), box-shadow .25s; }
.step:nth-child(1) { background: var(--sun); transform: rotate(-1.4deg); }
.step:nth-child(2) { background: var(--sky); transform: rotate(1deg); }
.step:nth-child(3) { background: var(--mint); transform: rotate(-.8deg); }
.step:hover { transform: rotate(0) translateY(-6px); box-shadow: 10px 10px 0 var(--sh); }
.step .n { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #fff6e5; border: 2px solid #1a1330; font: 800 1.5rem var(--font-display); margin-bottom: 20px; }
.step h3 { font-size: 1.6rem; margin-bottom: 10px; }
.step p { font-weight: 500; opacity: .85; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; } .step { transform: none !important; } }

.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 22px; }
.tile { position: relative; padding: 28px; border: 2px solid var(--bd); border-radius: var(--radius-lg); background: var(--paper); box-shadow: 5px 5px 0 var(--sh); overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s; }
.tile:hover { transform: translate(-2px, -3px); box-shadow: 8px 9px 0 var(--sh); }
.tile h3 { font-size: 1.55rem; margin: 14px 0 8px; }
.tile p { color: var(--muted); font-weight: 500; }
.tile .ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; border: 2px solid var(--bd); color: #1a1330; }
.tile .ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tile.t-a { grid-column: span 4; background: var(--lilac); color: #1a1330; }
.tile.t-a p { color: #3a2f5e; }
.tile.t-b { grid-column: span 2; }
.tile.t-c, .tile.t-d, .tile.t-e { grid-column: span 2; }
.tile.t-f { background: var(--mint); color: #1a1330; }
.tile.t-f p { color: #124a39; }
.tile .ico.i-sun { background: var(--sun); } .tile .ico.i-sky { background: var(--sky); } .tile .ico.i-pink { background: var(--pink); } .tile .ico.i-coral { background: var(--coral); } .tile .ico.i-paper { background: var(--paper); }
.mini-code { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.mini-code i { width: 38px; height: 46px; border: 2px solid #1a1330; border-radius: 10px; background: #fff6e5; display: grid; place-items: center; font: 800 1.15rem ui-monospace, Menlo, Consolas, monospace; font-style: normal; color: #1a1330; }
.typing-dots { display: inline-flex; gap: 5px; padding: 10px 14px; border: 2px solid var(--bd); border-radius: 16px; background: var(--sky); margin-top: 16px; }
.typing-dots i { width: 8px; height: 8px; border-radius: 50%; background: #1a1330; animation: blink 1s infinite; }
.typing-dots i:nth-child(2) { animation-delay: .15s; } .typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-4px); } }
.avatars { display: flex; margin-top: 4px; }
.avatars i { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #1a1330; margin-left: -10px; display: grid; place-items: center; font: 800 1rem var(--font-display); font-style: normal; color: #1a1330; }
.avatars i:first-child { margin-left: 0; }
@media (max-width: 900px) { .bento { grid-template-columns: 1fr 1fr; } .tile.t-a, .tile.t-f { grid-column: 1 / -1; } .tile.t-b, .tile.t-c, .tile.t-d, .tile.t-e { grid-column: span 1; } .tile.t-f { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .bento { grid-template-columns: 1fr; } .tile.t-b, .tile.t-c, .tile.t-d, .tile.t-e { grid-column: 1 / -1; } }

.cta-band { position: relative; margin-block: clamp(40px, 6vw, 80px) clamp(56px, 8vw, 96px); }
.cta-card { position: relative; overflow: hidden; background: var(--coral); color: #1a1330; border: 2px solid var(--bd); border-radius: 36px; box-shadow: 10px 10px 0 var(--sh); padding: clamp(36px, 6vw, 80px); text-align: center; }
.cta-card h2 { font-size: clamp(2.6rem, 7vw, 5.6rem); line-height: .95; margin-bottom: 18px; }
.cta-card p { font-size: 1.15rem; font-weight: 500; margin: 0 auto 32px; max-width: 480px; }
.cta-card .hero-actions { justify-content: center; margin-top: 0; }
.cta-card::before, .cta-card::after { content: ""; position: absolute; border: 2px solid #1a1330; border-radius: 50%; }
.cta-card::before { width: 170px; height: 170px; background: var(--sun); left: -50px; top: -50px; }
.cta-card::after { width: 120px; height: 120px; background: var(--sky); right: -34px; bottom: -34px; }
.cta-card > * { position: relative; z-index: 1; }

/* ---------- Footer ---------- */
.site-footer { border-top: 2px solid var(--bd); background: var(--bg-2); flex-shrink: 0; overflow: hidden; }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 18px 32px; padding-block: 34px 10px; }
.footer-top nav { display: flex; gap: 22px; font-weight: 600; }
.footer-top a:hover { color: var(--coral); }
.footer-big { font: 800 clamp(4rem, 16.5vw, 13rem)/.8 var(--font-display); letter-spacing: -.02em; color: var(--soft); white-space: nowrap; text-align: center; margin-bottom: -.06em; user-select: none; }
.footer-small { padding-block: 12px 22px; text-align: center; font-size: .86rem; color: var(--muted); }

/* =========================================================
   INNER PAGES
========================================================= */
.page-head { padding-block: clamp(44px, 7vw, 88px) clamp(20px, 3vw, 36px); }
.page-head h1 { font-size: clamp(2.8rem, 6.4vw, 5.2rem); margin: 20px 0 16px; line-height: .96; }
.panel { background: var(--paper); border: 2px solid var(--bd); border-radius: var(--radius-lg); box-shadow: 7px 7px 0 var(--sh); padding: clamp(24px, 4vw, 44px); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.panel.p-mint { background: var(--mint); color: #1a1330; } .panel.p-coral { background: var(--pink); color: #1a1330; } .panel.p-sun { background: var(--sun); color: #1a1330; }
.panel h3 { font-size: 1.6rem; margin-bottom: 8px; }
.checklist { display: grid; gap: 12px; margin-top: 18px; }
.checklist li { position: relative; padding-left: 34px; font-weight: 500; }
.checklist li::before { content: "✓"; position: absolute; left: 0; top: -1px; width: 24px; height: 24px; border-radius: 50%; background: #fff6e5; border: 2px solid #1a1330; display: grid; place-items: center; font-weight: 800; font-size: .8rem; color: #1a1330; }
.checklist.no li::before { content: "✕"; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.action-card { display: flex; flex-direction: column; gap: 14px; padding: 36px; border: 2px solid var(--bd); border-radius: var(--radius-lg); box-shadow: 8px 8px 0 var(--sh); color: #1a1330; transition: transform .25s var(--spring), box-shadow .25s; min-height: 320px; }
.action-card:nth-child(1) { background: var(--sun); transform: rotate(-1deg); }
.action-card:nth-child(2) { background: var(--sky); transform: rotate(1deg); }
.action-card:hover { transform: rotate(0) translateY(-6px); box-shadow: 12px 12px 0 var(--sh); }
.action-card .ico { width: 68px; height: 68px; border-radius: 20px; background: #fff6e5; border: 2px solid #1a1330; display: grid; place-items: center; }
.action-card .ico svg { width: 32px; height: 32px; fill: none; stroke: #1a1330; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.action-card h2 { font-size: clamp(2rem, 4vw, 2.8rem); }
.action-card p { flex: 1; font-weight: 500; font-size: 1.05rem; }
.action-card .go { font-weight: 800; display: inline-flex; gap: 10px; font-family: var(--font-display); font-size: 1.15rem; transition: gap .2s; }
.action-card:hover .go { gap: 18px; }
@media (max-width: 700px) { .action-grid { grid-template-columns: 1fr; } .action-card { transform: none !important; min-height: 0; } }

.card-center { max-width: 580px; margin: 0 auto; padding-block: 8px clamp(60px, 8vw, 100px); }
.field { display: grid; gap: 10px; }
.field label { font-weight: 700; font-size: 1rem; }
.code-input { width: 100%; padding: 20px; border-radius: var(--radius); border: 2px solid var(--bd); background: var(--bg); font: 700 clamp(1.4rem, 5vw, 1.9rem) ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .24em; text-align: center; box-shadow: inset 4px 4px 0 var(--soft); transition: box-shadow .2s, border-color .2s; }
.code-input::placeholder { color: var(--muted); opacity: .5; }
.code-input:focus { outline: none; border-color: var(--coral); box-shadow: 4px 4px 0 var(--coral); }
.code-input[aria-invalid="true"] { border-color: #e03131; box-shadow: 4px 4px 0 #e03131; }
.hint { font-size: .9rem; color: var(--muted); }
.error-text { color: #d6291f; font-size: .94rem; font-weight: 600; min-height: 1.4em; }
:root[data-theme="dark"] .error-text { color: #ff8a80; }
.form-actions { margin-top: 24px; display: grid; gap: 14px; }

.room-code { position: relative; text-align: center; padding: 30px 16px 26px; border-radius: var(--radius); background: var(--sun); color: #1a1330; border: 2px solid var(--bd); box-shadow: 5px 5px 0 var(--sh); }
.room-code::before, .room-code::after { content: ""; position: absolute; top: 50%; width: 22px; height: 22px; border-radius: 50%; background: var(--paper); border: 2px solid var(--bd); translate: 0 -50%; }
.room-code::before { left: -13px; } .room-code::after { right: -13px; }
.room-code .label { font: 700 .72rem ui-monospace, Menlo, Consolas, monospace; letter-spacing: .22em; text-transform: uppercase; opacity: .75; }
.room-code .code { margin-top: 8px; font: 700 clamp(2rem, 8vw, 3rem) ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .14em; word-break: break-all; user-select: all; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 440px) { .btn-row { grid-template-columns: 1fr; } }

/* ---------- Dialog ---------- */
dialog { margin: auto; border: 2px solid var(--bd); border-radius: 28px; background: var(--paper); color: var(--ink); padding: 0; max-width: 430px; width: calc(100% - 32px); box-shadow: 9px 9px 0 var(--sh); }
dialog::backdrop { background: rgba(26, 19, 48, .6); backdrop-filter: blur(3px); }
.dialog-body { padding: 36px 30px 28px; text-align: center; }
.dialog-body .logo-mark { width: 64px; height: 64px; margin: 0 auto 16px; }
.dialog-body h2 { font-size: 2rem; margin-bottom: 10px; }
.dialog-body p { color: var(--muted); margin-bottom: 24px; font-weight: 500; }
.dialog-body .btn { width: 100%; }
.btn-google { background: #fff; color: #1f1f1f; gap: 12px; }
.btn-google svg { width: 20px; height: 20px; }
.dialog-close { margin-top: 14px; color: var(--muted); font-weight: 600; font-size: .92rem; padding: 8px; text-decoration: underline; text-underline-offset: 3px; }
.dialog-close:hover { color: var(--ink); }

/* ---------- Toast ---------- */
.toasts { position: fixed; z-index: 400; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 10px; width: max-content; max-width: calc(100% - 32px); pointer-events: none; }
.toast { padding: 12px 22px; border-radius: 999px; background: var(--ink); color: var(--bg); border: 2px solid var(--bd); box-shadow: 4px 4px 0 var(--sh); font-weight: 600; font-size: .94rem; animation: toastIn .3s var(--spring); }
.toast.error { background: #d6291f; color: #fff; border-color: #1a1330; }
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.95); } }

/* =========================================================
   CHAT
========================================================= */
body.chat-page { height: 100vh; height: 100dvh; overflow: hidden; }
.chat-shell { flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; max-width: 960px; margin-inline: auto; padding: 14px 14px 14px; gap: 12px; }
.room-bar { display: flex; align-items: center; gap: 12px 16px; padding: 12px 16px; background: var(--sun); color: #1a1330; border: 2px solid var(--bd); border-radius: 20px; box-shadow: 4px 4px 0 var(--sh); flex-wrap: wrap; }
.room-info { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.room-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--mint); border: 2px solid #1a1330; flex-shrink: 0; transition: background .3s; }
.room-dot.offline { background: var(--coral); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.room-label { font: 700 .66rem ui-monospace, Menlo, Consolas, monospace; letter-spacing: .2em; text-transform: uppercase; opacity: .75; line-height: 1.2; }
.room-id { font: 700 1.2rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .1em; word-break: break-all; line-height: 1.2; }
.room-status { font-size: .8rem; font-weight: 700; }
.people { display: flex; align-items: center; margin-left: auto; }
.people .p { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #1a1330; margin-left: -9px; display: grid; place-items: center; font: 800 .85rem var(--font-display); color: #1a1330; background: var(--pc, var(--sky)); overflow: hidden; }
.people .p:first-child { margin-left: 0; }
.people .p img { width: 100%; height: 100%; object-fit: cover; }
.people .more { background: #fff6e5; font-size: .72rem; }
.room-actions { display: flex; gap: 8px; }
.room-bar .btn { background: #fff6e5; color: #1a1330; border-color: #1a1330; box-shadow: 3px 3px 0 #1a1330; }
.room-bar .btn:hover:not([disabled]) { box-shadow: 5px 5px 0 #1a1330; }

.messages-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--paper); border: 2px solid var(--bd); border-radius: 24px; box-shadow: 6px 6px 0 var(--sh); overflow: hidden; }
.messages { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 20px 12px; display: flex; flex-direction: column; gap: 3px; scroll-behavior: smooth; overscroll-behavior: contain; background-image: radial-gradient(var(--soft) 1.2px, transparent 1.3px); background-size: 22px 22px; }
.day-sep { align-self: center; margin: 18px 0 10px; padding: 5px 16px; border: 2px solid var(--bd); border-radius: 999px; background: var(--bg); font-size: .76rem; font-weight: 700; letter-spacing: .04em; }
.row { display: flex; align-items: flex-end; gap: 10px; max-width: 100%; animation: rowIn .4s var(--spring); }
@keyframes rowIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.row.mine { flex-direction: row-reverse; }
.row.first { margin-top: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; object-fit: cover; background: var(--pc, var(--sky)); border: 2px solid var(--bd); display: grid; place-items: center; font: 800 .88rem var(--font-display); color: #1a1330; }
.avatar.ghost { visibility: hidden; border: 0; }
.stack { display: flex; flex-direction: column; min-width: 0; max-width: min(78%, 580px); }
.row.mine .stack { align-items: flex-end; }
.who { display: flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 700; margin: 0 0 5px 8px; }
.who::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--pc, var(--sky)); border: 2px solid var(--bd); }
.bubble { padding: 10px 16px; border: 2px solid var(--bd); border-radius: 20px; font-size: 1rem; line-height: 1.5; font-weight: 500; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; color: #1a1330; box-shadow: 3px 3px 0 var(--sh); }
.row.theirs .bubble { background: var(--pc, var(--sky)); border-bottom-left-radius: 6px; }
.row.mine .bubble { background: var(--mine); border-bottom-right-radius: 6px; }
.row.theirs:not(.first) .bubble { border-top-left-radius: 6px; }
.row.mine:not(.first) .bubble { border-top-right-radius: 6px; }
.bubble a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 2px; color: #1a1330; font-weight: 700; word-break: break-all; }
.when { font-size: .7rem; font-weight: 600; color: var(--muted); margin: 6px 10px 0; display: none; }
.row.end .when { display: block; }
.c0 { --pc: var(--sun); } .c1 { --pc: var(--sky); } .c2 { --pc: var(--mint); } .c3 { --pc: var(--lilac); } .c4 { --pc: var(--pink); }

.empty, .loading, .notice { margin: auto; text-align: center; max-width: 400px; padding: 24px; }
.empty .big { font-size: 3rem; margin-bottom: 8px; }
.empty h2, .notice h2 { font-size: 1.9rem; margin-bottom: 10px; }
.empty p, .notice p { color: var(--muted); font-weight: 500; }
.skeleton { display: grid; gap: 14px; width: min(420px, 90%); margin: auto; }
.skeleton i { height: 44px; border-radius: 18px; border: 2px solid var(--soft); background: linear-gradient(90deg, var(--bg-2), var(--bg), var(--bg-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; width: 62%; }
.skeleton i:nth-child(even) { justify-self: end; width: 48%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.jump { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 5; padding: 10px 20px; border: 2px solid var(--bd); border-radius: 999px; background: var(--coral); color: #1a1330; font-weight: 800; font-size: .88rem; box-shadow: 4px 4px 0 var(--sh); }

.composer { position: relative; }
.composer-row { display: flex; align-items: flex-end; gap: 10px; background: var(--paper); border: 2px solid var(--bd); border-radius: 26px; padding: 7px 8px; box-shadow: 5px 5px 0 var(--sh); transition: box-shadow .2s, border-color .2s; }
.composer-row:focus-within { border-color: var(--coral); box-shadow: 5px 5px 0 var(--coral); }
.composer textarea { flex: 1; resize: none; border: 0; background: transparent; outline: none; padding: 10px 6px; max-height: 140px; line-height: 1.45; min-height: 42px; font-weight: 500; }
.composer textarea::placeholder { color: var(--muted); }
.round-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; transition: background .2s, transform .2s var(--spring); }
.round-btn:hover:not([disabled]) { background: var(--bg-2); transform: scale(1.08); }
.round-btn svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.send { background: var(--coral); color: #1a1330; border: 2px solid var(--bd); }
.send:hover:not([disabled]) { background: var(--coral); transform: scale(1.1) rotate(-6deg); }
.send[disabled] { background: var(--bg-2); color: var(--muted); border-color: var(--soft); cursor: not-allowed; }
.composer-meta { display: flex; justify-content: space-between; gap: 12px; padding: 8px 18px 0; min-height: 26px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.composer-meta .err { color: #d6291f; }
:root[data-theme="dark"] .composer-meta .err { color: #ff8a80; }
.composer-meta .count.warn { color: var(--coral); }
.emoji-pop { position: absolute; left: 0; bottom: calc(100% + 12px); z-index: 20; border: 2px solid var(--bd); box-shadow: 6px 6px 0 var(--sh); border-radius: 18px; overflow: hidden; background: var(--paper); }
.emoji-pop emoji-picker { width: min(340px, calc(100vw - 36px)); height: 360px; --background: var(--paper); --border-color: var(--soft); }

@media (max-width: 640px) {
    .chat-shell { padding: 10px; gap: 10px; }
    .room-bar { padding: 10px 12px; }
    .room-info { flex: 1 1 100%; }
    .room-id { word-break: normal; white-space: nowrap; font-size: 1.1rem; }
    .people-btn { margin-left: 0; order: 3; }
    .room-actions { width: 100%; order: 2; }
    .room-actions .btn { flex: 1; padding-inline: 10px; }
    .messages { padding-inline: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; animation-delay: 0s !important; }
    .win-msg { opacity: 1; transform: none; }
    .messages { scroll-behavior: auto; }
    .ticker-track { animation: none; }
}


/* =========================================================
   MESSAGE MEDIA (stickers + GIFs)
========================================================= */
.row.has-media .stack { max-width: min(80%, 300px); }
.media { display: block; }
.sticker-msg { width: clamp(110px, 28vw, 150px); filter: drop-shadow(3px 3px 0 var(--sh)); }
.sticker-msg svg { width: 100%; height: auto; }
.row.mine .sticker-msg { transform: rotate(2deg); }
.row.theirs .sticker-msg { transform: rotate(-2deg); }
.gif-msg { border: 2px solid var(--bd); border-radius: 20px; overflow: hidden; background: var(--bg-2); box-shadow: 3px 3px 0 var(--sh); line-height: 0; max-width: 260px; }
.gif-msg img { width: 100%; height: auto; max-height: 300px; object-fit: cover; }
.gif-msg.broken { padding: 16px 20px; font-size: .9rem; font-weight: 600; line-height: 1.4; color: var(--muted); }
.crown { margin-left: 4px; padding: 1px 8px; border: 2px solid var(--bd); border-radius: 999px; background: var(--sun); color: #1a1330; font-size: .68rem; font-weight: 800; letter-spacing: .02em; }

/* =========================================================
   PICKER (emoji · stickers · GIFs)
========================================================= */
.picker { width: min(380px, calc(100vw - 36px)); height: min(420px, 62vh); display: flex; flex-direction: column; background: var(--paper); color: var(--ink); }
.pk-tabs { display: flex; gap: 6px; padding: 10px 10px 0; border-bottom: 2px solid var(--bd); background: var(--bg-2); }
.pk-tab { padding: 9px 16px; border: 2px solid transparent; border-bottom: 0; border-radius: 14px 14px 0 0; font-weight: 700; font-size: .9rem; color: var(--muted); margin-bottom: -2px; }
.pk-tab:hover { color: var(--ink); }
.pk-tab[aria-selected="true"] { background: var(--paper); color: var(--ink); border-color: var(--bd); }
.pk-body { flex: 1; min-height: 0; position: relative; }
.pk-panel { position: absolute; inset: 0; display: flex; flex-direction: column; }
.pk-panel[hidden] { display: none; }
.pk-search { margin: 10px 10px 6px; padding: 10px 14px; border: 2px solid var(--bd); border-radius: 12px; background: var(--bg); font-weight: 500; width: calc(100% - 20px); }
.pk-search:focus { outline: none; border-color: var(--coral); }
.pk-search:disabled { opacity: .55; }
.pk-cats { display: flex; gap: 2px; padding: 0 8px 6px; overflow-x: auto; scrollbar-width: none; border-bottom: 2px dashed var(--soft); }
.pk-cats::-webkit-scrollbar { display: none; }
.pk-cat { flex: 0 0 auto; width: 38px; height: 34px; border-radius: 10px; font-size: 1.15rem; display: grid; place-items: center; }
.pk-cat:hover { background: var(--bg-2); }
.pk-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 10px 12px; overscroll-behavior: contain; }
.pk-sec { content-visibility: auto; contain-intrinsic-size: auto 200px; }
.pk-sec[hidden] { display: none; }
.pk-sec h4 { position: sticky; top: 0; z-index: 1; margin: 0 -10px; padding: 8px 12px 4px; background: var(--paper); font: 800 .72rem var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 2px; }
.pk-emoji { aspect-ratio: 1; border-radius: 10px; font-size: 1.5rem; line-height: 1; display: grid; place-items: center; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; transition: transform .1s var(--spring), background .15s; }
.pk-emoji[hidden] { display: none; }
.pk-emoji:hover, .pk-emoji:focus-visible { background: var(--sun); transform: scale(1.25); position: relative; z-index: 2; }
.pk-none { padding: 28px 16px; text-align: center; color: var(--muted); font-weight: 600; font-size: .94rem; }
.pk-none[hidden], .pk-err:empty { display: none; }
.pk-stickers { flex: 1; overflow-y: auto; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; align-content: start; overscroll-behavior: contain; }
.pk-sticker { aspect-ratio: 1; padding: 6px; border-radius: 16px; border: 2px solid transparent; transition: transform .15s var(--spring), background .15s, border-color .15s; }
.pk-sticker svg { width: 100%; height: 100%; }
.pk-sticker:hover, .pk-sticker:focus-visible { background: var(--bg-2); border-color: var(--bd); transform: rotate(-4deg) scale(1.08); }
.pk-notice { margin: auto; padding: 24px; text-align: center; max-width: 320px; }
.pk-notice[hidden] { display: none; }
.pk-notice h4 { font: 800 1.25rem var(--font-display); letter-spacing: -.02em; margin-bottom: 8px; }
.pk-notice p { color: var(--muted); font-size: .92rem; margin-bottom: 16px; }
.pk-gifmain { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pk-gifmain[hidden] { display: none; }
.pk-gifs { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 10px 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-content: start; overscroll-behavior: contain; }
.pk-gifcol { display: grid; gap: 6px; align-content: start; }
.pk-gif { display: block; border-radius: 12px; overflow: hidden; border: 2px solid var(--soft); background: var(--bg-2); line-height: 0; min-height: 60px; transition: border-color .15s, transform .15s var(--spring); }
.pk-gif:hover, .pk-gif:focus-visible { border-color: var(--coral); transform: scale(1.03); }
.pk-gif img { width: 100%; height: auto; }
.pk-paste { display: flex; gap: 8px; padding: 8px 10px 10px; border-top: 2px dashed var(--soft); }
.pk-paste input { flex: 1; min-width: 0; padding: 9px 12px; border: 2px solid var(--bd); border-radius: 12px; background: var(--bg); font-weight: 500; font-size: .88rem; }
.pk-paste input:focus { outline: none; border-color: var(--coral); }
.pk-err { padding: 0 12px 10px; color: #d6291f; font-size: .82rem; font-weight: 600; }
:root[data-theme="dark"] .pk-err { color: #ff8a80; }
.emoji-pop { overflow: hidden; }

/* =========================================================
   PEOPLE BUTTON + DIALOG (members, admin tools, ban list)
========================================================= */
.people-btn { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; padding: 4px 12px 4px 6px; border: 2px solid #1a1330; border-radius: 999px; background: #fff6e5; color: #1a1330; box-shadow: 3px 3px 0 #1a1330; transition: transform .15s var(--ease), box-shadow .15s var(--ease); }
.people-btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 #1a1330; }
.people-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #1a1330; }
.people-btn .people { margin-left: 0; }
.people-btn[hidden] { display: none; }
.people-label { font-weight: 700; font-size: .86rem; }
.people-label b { margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: #1a1330; color: #fff6e5; font-size: .76rem; }
.people-label b:empty { display: none; }
.people .p.admin { box-shadow: 0 0 0 2px var(--sun), 0 0 0 4px #1a1330; }

.pd { padding: 24px 24px 22px; max-height: min(80vh, 640px); display: flex; flex-direction: column; }
.pd-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.pd-head h2 { font-size: 2rem; }
.pd-tabs { display: flex; gap: 6px; margin-bottom: 14px; padding: 5px; border: 2px solid var(--bd); border-radius: 999px; background: var(--bg-2); }
.pd-tabs button { flex: 1; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: .9rem; color: var(--muted); }
.pd-tabs button[aria-selected="true"] { background: var(--sun); color: #1a1330; box-shadow: 0 0 0 2px var(--bd) inset; }
.pd-tabs button[hidden] { display: none; }
.pd-tabs b { margin-left: 4px; font-weight: 800; }
#pdMembersPanel, #pdBannedPanel { min-height: 0; overflow-y: auto; }
.pd-list { display: grid; gap: 8px; }
.pd-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 2px solid var(--bd); border-radius: 16px; background: var(--bg); }
.pd-row .avatar { width: 40px; height: 40px; }
.pd-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pd-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-tags { display: flex; flex-wrap: wrap; gap: 6px; font-size: .8rem; color: var(--muted); }
.tag { padding: 0 8px; border: 2px solid var(--bd); border-radius: 999px; font-size: .68rem; font-weight: 800; color: #1a1330; }
.tag.admin { background: var(--sun); } .tag.you { background: var(--mint); }
.pd-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-danger { background: var(--coral); color: #1a1330; }
.btn.armed { background: var(--sun); transform: translate(-1px, -1px); }
.btn-danger.armed { background: #ff3b30; color: #fff; }
.pd-banform { display: flex; gap: 8px; margin-bottom: 6px; }
.pd-banform input { flex: 1; min-width: 0; padding: 11px 14px; border: 2px solid var(--bd); border-radius: 14px; background: var(--bg); font-weight: 500; }
.pd-banform input:focus { outline: none; border-color: var(--coral); box-shadow: 3px 3px 0 var(--coral); }
.pd-note { margin-top: 16px; padding-top: 14px; border-top: 2px dashed var(--soft); }
dialog:has(.pd) { max-width: 520px; }
@media (max-width: 520px) {
    .pd { padding: 18px 16px; }
    .pd-row { flex-wrap: wrap; }
    .pd-actions { width: 100%; }
    .pd-actions .btn { flex: 1; }
}

/* Invisible pre-paint used once at page load, so the browser's first-time emoji glyph work happens before the first click */
.emoji-pop.warm { position: fixed; left: 0; bottom: 0; z-index: -1; opacity: .01; pointer-events: none; }

/* Dark theme: buttons that sit on bright fills keep dark text */
:root[data-theme="dark"] .btn-danger { background: var(--coral); color: #1a1330; }
:root[data-theme="dark"] .btn.armed { background: var(--sun); color: #1a1330; }
:root[data-theme="dark"] .btn-danger.armed { background: #ff3b30; color: #fff; }
:root[data-theme="dark"] .room-bar .btn { background: #fff6e5; color: #1a1330; }

/* Home: admin tile */
.tile.t-f { grid-column: span 3; display: block; }
.tile.t-g { grid-column: span 3; background: var(--pink); color: #1a1330; }
.tile.t-g p { color: #5a1640; }
.tile.t-g .ico { background: #fff6e5; }
@media (max-width: 900px) { .tile.t-f, .tile.t-g { grid-column: 1 / -1; } }


/* =========================================================
   FILES (photos, videos, documents) — shared device to device
========================================================= */
.file-msg { width: 280px; max-width: 100%; border: 2px solid var(--bd); border-radius: 20px; background: var(--paper); box-shadow: 3px 3px 0 var(--sh); overflow: hidden; color: var(--ink); }
.fc-preview { position: relative; aspect-ratio: 4 / 3; max-height: 340px; background: var(--bg-2); display: grid; place-items: center; overflow: hidden; line-height: 0; }
.kind-file .fc-preview { aspect-ratio: auto; min-height: 92px; }
.fc-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(7px) saturate(1.15); transform: scale(1.1); }
.is-local .fc-thumb { filter: none; transform: none; }
.fc-thumb[hidden], .fc-icon[hidden], .fc-get[hidden], .fc-progress[hidden] { display: none; }
.fc-full { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.fc-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.fc-icon { position: relative; display: grid; justify-items: center; gap: 4px; padding: 20px; color: var(--muted); line-height: 1; }
.fc-icon svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fc-icon b { font: 800 .72rem var(--font-ui); letter-spacing: .08em; }
.kind-video .fc-icon svg { fill: currentColor; }
.fc-get { position: absolute; left: 50%; top: 50%; translate: -50% -50%; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 2px solid var(--bd); border-radius: 999px; background: var(--coral); color: #1a1330; font: 800 .86rem var(--font-ui); line-height: 1; box-shadow: 3px 3px 0 var(--sh); transition: transform .15s var(--ease), box-shadow .15s var(--ease); }
.fc-get:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--sh); }
.fc-get svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.fc-progress { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border: 2px solid #1a1330; border-radius: 999px; background: #fff6e5; color: #1a1330; font: 800 .78rem var(--font-ui); line-height: 1; }
.fc-track { flex: 1; height: 10px; border: 2px solid #1a1330; border-radius: 999px; background: #fff; overflow: hidden; }
.fc-track i { display: block; height: 100%; width: 0; background: var(--coral); transition: width .2s linear; }
.fc-progress span[aria-live] { min-width: 3.4em; text-align: right; }
.fc-cancel { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #1a1330; color: #fff6e5; flex-shrink: 0; }
.fc-cancel svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.fc-info { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 12px 2px; font-size: .86rem; font-weight: 700; line-height: 1.3; }
.fc-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-size { flex-shrink: 0; color: var(--muted); font-weight: 600; }
.fc-note { padding: 0 12px 4px; font-size: .78rem; font-weight: 600; line-height: 1.35; color: var(--muted); }
.fc-note:empty { display: none; }
.fc-note.err { color: #d6291f; }
:root[data-theme="dark"] .fc-note.err { color: #ff8a80; }
.fc-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 2px 12px 10px; font-size: .78rem; font-weight: 700; }
.fc-link { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; text-decoration-color: var(--coral); }
.fc-link[hidden] { display: none; }
.fc-actions:not(:has(> :not([hidden]))) { display: none; }
.messages-wrap.dragging { outline: 3px dashed var(--coral); outline-offset: -8px; }
.messages-wrap.dragging::after { content: "Drop to send"; position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; font: 800 1.7rem var(--font-display); letter-spacing: -.02em; background: color-mix(in srgb, var(--paper) 82%, transparent); pointer-events: none; }
.online-dot { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border: 2px solid var(--bd); border-radius: 50%; background: var(--mint); vertical-align: 1px; }
dialog#lightbox { max-width: min(96vw, 1100px); width: auto; background: var(--paper); }
.lb { position: relative; padding: 14px; text-align: center; }
.lb img { max-width: 100%; max-height: 76vh; margin: 0 auto; border-radius: 14px; border: 2px solid var(--bd); }
.lb-close { position: absolute; top: 22px; right: 22px; z-index: 2; }
#lightboxName { margin-top: 10px; color: var(--muted); font-weight: 600; font-size: .9rem; }

/* Documents: icon on top, download button underneath (no overlap) */
.kind-file .fc-preview { min-height: 138px; align-content: start; }
.kind-file .fc-icon { padding-top: 22px; padding-bottom: 56px; }
.kind-file .fc-get { top: auto; bottom: 14px; translate: -50% 0; }
.kind-file.is-local .fc-icon { padding-bottom: 22px; }
.kind-file.is-local .fc-preview { min-height: 104px; }
.kind-file .fc-progress { bottom: 14px; }

/* Home: files tile */
.tile.t-h { grid-column: span 6; background: var(--sky); color: #1a1330; }
.tile.t-h p { color: #123a73; max-width: 640px; }
.tile.t-h .ico { background: #fff6e5; }
@media (max-width: 900px) { .tile.t-h { grid-column: 1 / -1; } }
