/*
 * AiTransPal OPC — 2026 responsive interface system
 * Loaded after opc-style.css so legacy screens can migrate incrementally.
 */

:root {
    --brand: #14b8a6;
    --brand-strong: #0f766e;
    --brand-soft: rgba(20, 184, 166, 0.14);
    --accent: #38bdf8;
    --accent-soft: rgba(56, 189, 248, 0.12);
    --surface-0: #061312;
    --surface-1: #0b1d1c;
    --surface-2: #102725;
    --surface-3: #15312f;
    --surface-glass: rgba(9, 29, 28, 0.88);
    --border: rgba(153, 246, 228, 0.13);
    --border-strong: rgba(94, 234, 212, 0.28);
    --text: #f0fdfa;
    --text-muted: #a7c7c2;
    --text-subtle: #6f9690;
    --danger: #fb7185;
    --success: #34d399;
    --warning: #fbbf24;
    --bubble-color: #0f766e;
    --shadow-sm: 0 8px 24px rgba(1, 10, 9, 0.24);
    --shadow-lg: 0 28px 80px rgba(1, 10, 9, 0.46);
    --focus-ring: 0 0 0 3px rgba(56, 189, 248, 0.28);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
}

html {
    color-scheme: dark;
    background: var(--surface-0);
}

body.opc-landing-page,
body.opc-home-page,
body.opc-room-page,
body.opc-guest-page {
    font-family: "Noto Sans", "Noto Sans Thai", "Noto Sans TC", "Outfit", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 12% 0%, rgba(20, 184, 166, 0.18), transparent 34rem),
        radial-gradient(circle at 92% 96%, rgba(56, 189, 248, 0.12), transparent 32rem),
        linear-gradient(145deg, #04100f 0%, #071817 48%, #061312 100%);
    color: var(--text);
    letter-spacing: 0;
}

body.opc-landing-page::before,
body.opc-home-page::before,
body.opc-room-page::before,
body.opc-guest-page::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.22;
    background-image:
        linear-gradient(rgba(153, 246, 228, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(153, 246, 228, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, black, transparent 72%);
}

body :where(button, a, input, select, textarea):focus-visible {
    outline: 2px solid var(--accent) !important;
    outline-offset: 2px;
    box-shadow: var(--focus-ring) !important;
}

body :where(button, a, input, select, textarea):disabled {
    cursor: not-allowed !important;
    opacity: 0.58;
}

.opc-container {
    position: relative;
    width: min(1180px, calc(100% - 32px));
    max-width: 1180px;
    height: min(930px, calc(var(--opc-viewport-height, 100dvh) - 32px));
    max-height: none;
    margin: 16px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: rgba(7, 24, 23, 0.9);
    box-shadow: var(--shadow-lg), inset 0 1px rgba(255, 255, 255, 0.035);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    animation: opc-shell-in 360ms cubic-bezier(.2, .8, .2, 1);
}

@keyframes opc-shell-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* App bar */
.opc-header {
    position: sticky !important;
    top: 0;
    z-index: 100;
    display: grid !important;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, auto) minmax(220px, 1fr);
    align-items: center !important;
    gap: 14px !important;
    min-height: 72px !important;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 18px 10px !important;
    border-bottom: 1px solid var(--border) !important;
    background: rgba(6, 19, 18, 0.88) !important;
    backdrop-filter: blur(22px) saturate(125%) !important;
    -webkit-backdrop-filter: blur(22px) saturate(125%) !important;
}

.opc-header-nav,
.opc-header-identity,
.opc-header-actions {
    min-width: 0;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
}

.opc-header-actions { justify-content: flex-end !important; }
.opc-header-identity { justify-content: center !important; }

.opc-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--text);
    text-decoration: none;
}

.opc-brand-mark {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: white;
    background: linear-gradient(145deg, var(--brand), var(--brand-strong));
    box-shadow: 0 10px 24px rgba(20, 184, 166, 0.22), inset 0 1px rgba(255,255,255,.2);
}

.opc-brand-copy { min-width: 0; line-height: 1.15; }
.opc-brand-title { display: block; font-size: .96rem; font-weight: 800; letter-spacing: -.01em; }
.opc-brand-subtitle { display: block; margin-top: 3px; color: var(--text-subtle); font-size: .69rem; font-weight: 600; }

.opc-back-link,
.opc-icon-button,
.opc-action-button {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0 !important;
    padding: 9px 12px !important;
    border-radius: 13px !important;
    border: 1px solid var(--border) !important;
    background: rgba(255, 255, 255, 0.045) !important;
    color: var(--text-muted) !important;
    text-decoration: none;
    box-shadow: none !important;
    font-size: .82rem !important;
    font-weight: 700 !important;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease !important;
}

.opc-action-button.is-primary {
    border-color: rgba(20, 184, 166, .32) !important;
    background: var(--brand-soft) !important;
    color: #ccfbf1 !important;
}

.opc-back-link:hover,
.opc-icon-button:hover,
.opc-action-button:hover {
    transform: translateY(-1px) !important;
    border-color: var(--border-strong) !important;
    background: rgba(20, 184, 166, .12) !important;
    color: var(--text) !important;
}

.opc-header svg { width: 18px; height: 18px; flex: 0 0 auto; }

.opc-profile {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, .04);
}

.opc-profile img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.opc-profile-name { max-width: 126px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; color: var(--text-muted); font-weight: 700; }
.opc-guest-badge { padding: 3px 6px; border-radius: 999px; color: #ccfbf1; background: rgba(20,184,166,.15); font-size: .58rem; font-weight: 800; letter-spacing: .05em; }

.opc-language-select {
    min-height: 44px;
    width: auto !important;
    max-width: 154px !important;
    margin: 0;
    padding: 8px 30px 8px 11px !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    background-color: rgba(255,255,255,.045) !important;
    color: var(--text-muted) !important;
    font-family: inherit;
    font-size: .75rem !important;
    font-weight: 650;
}

/* Entry */
.opc-landing-page .opc-container { overflow-y: auto; }
.opc-login-card {
    width: min(980px, calc(100% - 48px)) !important;
    max-width: 980px !important;
    min-height: 580px;
    margin: 28px auto !important;
    padding: 0 !important;
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(330px, .94fr);
    overflow: hidden;
    border: 1px solid var(--border) !important;
    border-radius: 28px !important;
    background: rgba(11, 29, 28, .76) !important;
    box-shadow: var(--shadow-lg) !important;
    text-align: left !important;
    flex-shrink: 0;
}

.opc-entry-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 36px;
    padding: 52px 48px;
    overflow: hidden;
    background:
        linear-gradient(160deg, rgba(20,184,166,.18), transparent 58%),
        rgba(5, 21, 20, .75);
}

.opc-entry-hero::after {
    content: "";
    position: absolute;
    right: -110px;
    bottom: -130px;
    width: 360px;
    height: 360px;
    border: 64px solid rgba(56, 189, 248, .055);
    border-radius: 50%;
}

.opc-entry-logo { position: relative; z-index: 1; }
.opc-entry-mark { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 22px; background: linear-gradient(145deg, var(--brand), var(--brand-strong)); box-shadow: 0 18px 36px rgba(20,184,166,.2); }
.opc-entry-mark svg { width: 34px; height: 34px; }
.opc-entry-hero h1 { margin: 26px 0 8px !important; color: var(--text) !important; -webkit-text-fill-color: currentColor !important; background: none !important; font-size: clamp(2.2rem, 4vw, 3.4rem) !important; font-weight: 850 !important; letter-spacing: -.045em !important; line-height: 1.02; }
.opc-entry-kicker { color: #5eead4; font-size: .8rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.opc-entry-lead { max-width: 28rem; margin-top: 20px; color: var(--text-muted); font-size: 1.05rem; line-height: 1.75; }
.opc-entry-benefit { position: relative; z-index: 1; padding: 18px; border: 1px solid var(--border); border-radius: 18px; background: rgba(6,19,18,.5); }
.opc-entry-benefit strong { display: block; margin-bottom: 6px; color: var(--text); font-size: .92rem; }
.opc-entry-benefit p { color: var(--text-muted); font-size: .86rem; line-height: 1.65; }

.opc-entry-actions { display: flex; flex-direction: column; justify-content: center; padding: 44px 40px; background: rgba(13, 36, 34, .66); }
.opc-entry-actions h2 { margin: 0 0 8px; font-size: 1.42rem; letter-spacing: -.02em; }
.opc-entry-actions > p { margin: 0 0 28px; color: var(--text-muted); font-size: .88rem; line-height: 1.6; }
.opc-entry-options { display: flex; flex-direction: column; gap: 12px; }
.opc-entry-button { min-height: 54px; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-radius: 15px; text-decoration: none; font-size: .98rem; font-weight: 800; }
.opc-entry-button.is-line { color: white; background: #06c755; box-shadow: 0 10px 24px rgba(6,199,85,.18); }
.opc-entry-button.is-guest { border: 1px solid var(--border); color: var(--text); background: rgba(255,255,255,.045); }
.opc-entry-button:hover { transform: translateY(-1px); }
.opc-entry-button img { width: 23px; height: 23px; }
.opc-divider { display: flex; align-items: center; gap: 12px; margin: 4px 0; color: var(--text-subtle); font-size: .75rem; font-weight: 700; }
.opc-divider::before, .opc-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.opc-auth-note { margin: -4px 2px 2px; color: var(--text-subtle); font-size: .72rem; line-height: 1.5; text-align: center; }
.opc-auth-note.is-account { color: #86efac; }
.opc-entry-links { margin-top: 24px; text-align: center; }
.opc-entry-links a { color: #5eead4; font-size: .82rem; text-decoration: none; font-weight: 700; }
.opc-entry-recent { margin-top: 20px; padding: 14px; border: 1px solid var(--border); border-radius: 15px; background: rgba(20,184,166,.045); }
.opc-entry-recent[hidden] { display: none; }
.opc-entry-recent-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.opc-entry-recent-heading h3 { margin: 0; color: var(--text); font-size: .78rem; }
.opc-entry-recent-heading button { min-height: 38px; margin: 0; padding: 6px 9px; border: 1px solid var(--border); border-radius: 9px; background: transparent; color: var(--text-subtle); box-shadow: none; font-size: .64rem; }
.opc-entry-recent > p { margin: 4px 0 10px; color: var(--text-subtle); font-size: .65rem; line-height: 1.45; }
.opc-entry-recent-list { display: grid; gap: 6px; }
.opc-entry-recent-list a { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 11px; border-radius: 10px; background: rgba(255,255,255,.035); color: var(--text); text-decoration: none; }
.opc-entry-recent-list strong { font-size: .72rem; }
.opc-entry-recent-list span { color: var(--brand-light); font-size: .62rem; text-align: right; }
.opc-landing-footer { margin-top: auto; padding: 18px; color: var(--text-subtle); text-align: center; font-size: .72rem; }

/* Dashboard */
.landing-page.opc-dashboard { flex: 1; min-height: 0; overflow-y: auto; }
.opc-home-page .opc-container { overflow-y: auto; }
.opc-home-page .landing-page.opc-dashboard { flex: 0 0 auto; min-height: auto; overflow: visible; }
.opc-dashboard-main { width: min(1060px, calc(100% - 40px)); margin: 0 auto; padding: 30px 0 40px; }
.opc-dashboard-welcome { margin-bottom: 24px; }
.opc-dashboard-welcome h1 { margin: 0 0 7px; color: var(--text); font-size: clamp(1.45rem, 3vw, 2.05rem); letter-spacing: -.035em; }
.opc-dashboard-welcome p { color: var(--text-muted); font-size: .9rem; }
.opc-member-summary { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 16px; margin-bottom: 22px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 20px; background: linear-gradient(145deg, rgba(20,184,166,.09), rgba(11,29,28,.78)); box-shadow: var(--shadow-sm); }
.opc-member-avatar { width: 58px; height: 58px; object-fit: cover; border: 2px solid rgba(94,234,212,.25); border-radius: 18px; background: var(--surface-2); }
.opc-member-copy { min-width: 0; }
.opc-member-eyebrow { display: block; margin-bottom: 2px; color: var(--brand-light); font-size: .67rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.opc-member-copy h1 { display: inline; margin: 0; color: var(--text); font-size: 1.18rem; letter-spacing: -.02em; }
.opc-member-type { display: inline-flex; margin-left: 7px; padding: 3px 7px; border: 1px solid rgba(94,234,212,.14); border-radius: 999px; background: var(--brand-soft); color: #99f6e4; font-size: .62rem; font-weight: 800; vertical-align: 2px; }
.opc-member-copy p { margin: 4px 0 0; color: var(--text-muted); font-size: .74rem; line-height: 1.5; }
.opc-member-stats { display: grid; grid-template-columns: repeat(2, minmax(66px, auto)); gap: 7px; margin: 0; }
.opc-member-stats div { padding: 9px 12px; border: 1px solid var(--border); border-radius: 13px; background: rgba(0,0,0,.12); text-align: center; }
.opc-member-stats dt { color: var(--text-subtle); font-size: .63rem; }
.opc-member-stats dd { margin: 2px 0 0; color: var(--text); font-size: 1.05rem; font-weight: 850; }
.opc-guest-persistence-note { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: -4px 0 20px; padding: 14px 16px; border: 1px solid rgba(251,191,36,.2); border-radius: 16px; background: rgba(251,191,36,.06); }
.opc-guest-persistence-note strong { display: block; margin-bottom: 3px; color: #fde68a; font-size: .82rem; }
.opc-guest-persistence-note p { color: var(--text-muted); font-size: .75rem; line-height: 1.5; }
.opc-guest-persistence-note a { min-height: 44px; flex: 0 0 auto; display: inline-flex; align-items: center; padding: 8px 13px; border: 1px solid rgba(6,199,85,.28); border-radius: 12px; background: rgba(6,199,85,.1); color: #86efac; text-decoration: none; font-size: .76rem; font-weight: 800; }
.opc-dashboard-grid { display: grid; grid-template-columns: minmax(300px, 370px) minmax(0, 1fr); gap: 22px; align-items: start; }
.opc-dashboard-actions { position: sticky; top: 94px; padding: 20px; border: 1px solid var(--border); border-radius: 22px; background: rgba(11,29,28,.8); box-shadow: var(--shadow-sm); }
.action-tabs { display: grid !important; grid-template-columns: 1fr 1fr; gap: 5px !important; margin: 0 0 18px !important; padding: 5px !important; border: 1px solid var(--border) !important; border-radius: 14px !important; background: rgba(0,0,0,.17) !important; }
.tab-btn { min-height: 44px; margin: 0 !important; padding: 8px 10px !important; border: 0 !important; border-radius: 10px !important; background: transparent !important; color: var(--text-subtle) !important; box-shadow: none !important; font-size: .86rem !important; }
.tab-btn.active { background: var(--brand-strong) !important; color: white !important; }
.action-buttons-inner, .opc-join-panel { padding: 0 !important; border: 0 !important; background: transparent !important; }
.config-panel.opc-room-config { display: grid !important; grid-template-columns: 1fr; gap: 16px !important; margin: 0 0 18px !important; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
.opc-field { min-width: 0; }
.opc-field label { display: block; margin: 0 0 7px !important; color: var(--text-muted) !important; font-size: .74rem !important; font-weight: 750 !important; letter-spacing: .04em !important; text-transform: none !important; }
.opc-field :where(input, select) { width: 100%; min-height: 48px; margin: 0; padding: 11px 13px !important; border: 1px solid var(--border) !important; border-radius: 12px !important; background: rgba(255,255,255,.04) !important; color: var(--text) !important; font-family: inherit; font-size: .9rem !important; }
.opc-primary-button { min-height: 50px; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 9px; margin: 0; padding: 12px 16px !important; border: 1px solid rgba(94,234,212,.16) !important; border-radius: 13px !important; background: linear-gradient(145deg, var(--brand), var(--brand-strong)) !important; color: white !important; box-shadow: 0 12px 24px rgba(15,118,110,.2) !important; font-size: .94rem !important; }
.opc-secondary-button { min-height: 48px; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 11px 14px !important; border: 1px solid var(--border-strong) !important; border-radius: 13px !important; background: var(--brand-soft) !important; color: #99f6e4 !important; box-shadow: none !important; }
.opc-join-intro { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.opc-join-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 12px; color: #5eead4; background: var(--brand-soft); }
.opc-join-intro h2 { margin: 0 0 4px; font-size: .98rem; }
.opc-join-intro p { color: var(--text-muted); font-size: .76rem; line-height: 1.5; }
.opc-join-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; margin-bottom: 10px; }
.opc-join-row input { min-width: 0; min-height: 48px; }
.opc-join-row button { min-width: 86px; }

.opc-rooms-panel { min-width: 0; padding: 22px; border: 1px solid var(--border); border-radius: 22px; background: rgba(11,29,28,.66); }
.opc-room-group + .opc-room-group { margin-top: 26px; }
.opc-room-group-title { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; color: var(--text-muted); font-size: .86rem; font-weight: 800; }
.opc-room-group-title svg { width: 17px; height: 17px; color: #5eead4; }
.opc-room-group-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.opc-room-group-heading .opc-room-group-title { margin-bottom: 4px; }
.opc-room-group-heading p { margin: 0; color: var(--text-subtle); font-size: .68rem; line-height: 1.5; }
.opc-room-history-clear { min-height: 40px; flex: 0 0 auto; margin: 0; padding: 7px 11px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.035); color: var(--text-subtle); box-shadow: none; font-size: .68rem; }
.opc-recent-room-group { padding-top: 4px; border-top: 1px solid var(--border); }
.opc-recent-room-card .opc-room-card { padding-right: 17px; }
.opc-room-list { display: flex; flex-direction: column; gap: 10px; }
.opc-room-skeleton { min-height: 94px; border: 1px solid var(--border); border-radius: 16px; background: linear-gradient(90deg, rgba(255,255,255,.025), rgba(255,255,255,.065), rgba(255,255,255,.025)); background-size: 200% 100%; animation: opc-shimmer 1.4s linear infinite; }
@keyframes opc-shimmer { to { background-position: -200% 0; } }
.opc-empty-state { padding: 28px 18px; border: 1px dashed var(--border-strong); border-radius: 16px; color: var(--text-subtle); text-align: center; font-size: .82rem; background: rgba(255,255,255,.018); }
.opc-room-card-wrap { position: relative; animation: opc-item-in 260ms ease both; }
@keyframes opc-item-in { from { opacity: 0; transform: translateY(5px); } }
.opc-room-card { display: block; padding: 16px 58px 15px 17px; border: 1px solid var(--border); border-radius: 17px; background: rgba(255,255,255,.035); color: var(--text); text-decoration: none; transition: transform 160ms ease, background 160ms ease, border-color 160ms ease; }
.opc-room-card:hover { transform: translateY(-2px); border-color: var(--border-strong); background: rgba(20,184,166,.075); }
.opc-room-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.opc-room-card-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .87rem; font-weight: 800; }
.opc-room-card-time { flex: 0 0 auto; color: var(--text-subtle); font-size: .69rem; }
.opc-room-card-preview { min-width: 0; display: flex; align-items: baseline; gap: 6px; margin-top: 6px; color: var(--text-muted); font-size: .78rem; }
.opc-room-preview-sender { min-width: 0; max-width: 38%; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #b8d7d1; font-weight: 750; }
.opc-room-preview-sender::after { content: ':'; }
.opc-room-preview-message { min-width: 0; flex: 1 1 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opc-room-preview-empty { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opc-room-card-meta { min-width: 0; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; margin-top: 10px; color: var(--text-subtle); font-size: .69rem; }
.opc-room-count { padding: 3px 7px; border-radius: 999px; color: #99f6e4; background: var(--brand-soft); font-weight: 750; }
.opc-unread { position: absolute; top: -7px; left: -7px; z-index: 3; min-width: 22px; height: 22px; display: grid; place-items: center; padding: 1px 6px; border: 2px solid var(--surface-1); border-radius: 999px; color: white; background: #e11d48; box-shadow: 0 5px 14px rgba(225,29,72,.32); font-size: .65rem; font-weight: 850; line-height: 1; pointer-events: none; }
.opc-room-owner, .opc-room-participants { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opc-room-owner { max-width: 11rem; text-align: right; }
.opc-room-tools { position: absolute; top: 8px; right: 8px; z-index: 2; display: flex; flex-direction: column; gap: 3px; }
.opc-room-tool { width: 44px; height: 44px; min-width: 44px; min-height: 44px; margin: 0; padding: 0 !important; display: grid; place-items: center; border: 0 !important; border-radius: 11px !important; background: transparent !important; color: var(--text-subtle) !important; box-shadow: none !important; }
.opc-room-tool:hover { color: var(--text) !important; background: rgba(255,255,255,.06) !important; }
.opc-room-tool.is-pinned { color: var(--warning) !important; }
.opc-room-tool.is-danger:hover { color: var(--danger) !important; }
.opc-mode-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.opc-mode-dot.is-love { background: #fb7185; box-shadow: 0 0 0 4px rgba(251,113,133,.13); }
.opc-mode-dot.is-business { background: #38bdf8; box-shadow: 0 0 0 4px rgba(56,189,248,.13); }

/* Conversation */
.opc-room-page .opc-container { overflow: hidden; }
.opc-room-page .chat-area,
.opc-room-page #msg_list { padding: 22px clamp(14px, 3vw, 34px); gap: 13px; background: linear-gradient(180deg, rgba(6,19,18,.18), rgba(20,184,166,.025)); }
.opc-chat-loader { width: min(300px, 90%); margin: auto; padding: 20px; color: var(--text-subtle); text-align: center; font-size: .82rem; }
.opc-chat-loader-ring { width: 28px; height: 28px; margin: 0 auto 12px; border: 3px solid rgba(94,234,212,.14); border-top-color: var(--brand); border-radius: 50%; animation: opc-spin .8s linear infinite; }
@keyframes opc-spin { to { transform: rotate(360deg); } }
.msg { max-width: min(76%, 720px); padding: 11px 15px; border-radius: 18px; box-shadow: var(--shadow-sm); font-family: inherit; }
.msg.received { border-color: var(--border); border-bottom-left-radius: 6px; background: rgba(255,255,255,.055); color: var(--text); }
.msg.sent { border-bottom-right-radius: 6px; background: var(--bubble-color); background: linear-gradient(145deg, var(--bubble-color), color-mix(in srgb, var(--bubble-color), #04100f 24%)); box-shadow: 0 12px 28px rgba(15,118,110,.2); box-shadow: 0 12px 28px color-mix(in srgb, var(--bubble-color), transparent 75%); }
.msg .sender { color: var(--text-subtle); font-size: .7rem; font-weight: 700; }
.msg .content { font-weight: 600; line-height: 1.62; }
.msg .translation { border-top-color: rgba(255,255,255,.14); color: var(--translation-color, #7dd3fc); font-style: normal; font-weight: 550; white-space: pre-wrap; }
.input-area { gap: 8px; margin: 0 16px 16px; padding: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)); border-color: var(--border); border-radius: 18px; background: rgba(9,29,28,.94); box-shadow: 0 12px 30px rgba(1,10,9,.35); }
.input-area input { min-width: 0; min-height: 46px; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--text); }
.input-area input::placeholder { color: var(--text-subtle); }
.input-area button { min-height: 46px; margin: 0; box-shadow: none; }
#emoji_btn { width: 46px; min-width: 46px; padding: 0 !important; border: 0; background: transparent; }
#send_btn { min-width: 92px; padding: 10px 18px; border-radius: 12px; background: linear-gradient(145deg, var(--brand), var(--brand-strong)); }
#scroll_bottom_btn { width: 44px !important; height: 44px !important; bottom: 82px !important; right: 24px !important; padding: 0 !important; border: 1px solid var(--border-strong) !important; background: rgba(15,118,110,.94) !important; box-shadow: var(--shadow-sm) !important; }
.opc-emoji-picker { left: 16px !important; right: 16px !important; bottom: 82px !important; max-height: 190px !important; padding: 12px !important; border-color: var(--border) !important; border-radius: 18px !important; background: var(--surface-2) !important; }
.opc-emoji-option { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; border-radius: 10px; cursor: pointer; }
.opc-emoji-option:hover { background: rgba(255,255,255,.07); }
.opc-room-page footer { display: none; }

/* Save the active QR room before the user closes the in-app browser. */
.opc-room-save-prompt { position: absolute; top: 78px; left: 50%; z-index: 80; width: min(680px, calc(100% - 30px)); display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 13px 14px; border: 1px solid rgba(94,234,212,.27); border-radius: 17px; background: rgba(8,28,27,.97); box-shadow: 0 18px 50px rgba(0,0,0,.43); opacity: 0; transform: translate(-50%, -10px); transition: opacity 180ms ease, transform 180ms ease; }
.opc-room-save-prompt[hidden] { display: none; }
.opc-room-save-prompt.is-visible { opacity: 1; transform: translate(-50%, 0); }
.opc-room-save-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--brand-soft); color: var(--brand-light); }
.opc-room-save-icon svg { width: 22px; height: 22px; }
.opc-room-save-copy { min-width: 0; }
.opc-room-save-copy strong { display: block; color: var(--text); font-size: .82rem; }
.opc-room-save-copy p { margin: 3px 0 0; color: var(--text-muted); font-size: .7rem; line-height: 1.45; }
.opc-room-save-copy .opc-room-install-hint { color: #fde68a; }
.opc-room-save-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.opc-room-save-actions :where(button, a) { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; margin: 0; padding: 7px 11px; border-radius: 10px; font-size: .69rem; font-weight: 800; text-decoration: none; white-space: nowrap; box-shadow: none; }
.opc-room-install-button, .opc-room-save-actions a { border: 1px solid rgba(94,234,212,.2); background: var(--brand-strong); color: white; }
.opc-room-save-dismiss { border: 1px solid var(--border); background: transparent; color: var(--text-subtle); }

/* Modals and settings */
.modal, .opc-overlay { background: rgba(1,10,9,.78) !important; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.modal-content, .opc-dialog { max-width: 440px; padding: 26px !important; border: 1px solid var(--border) !important; border-radius: 22px !important; background: var(--surface-1) !important; box-shadow: var(--shadow-lg) !important; color: var(--text); }
.opc-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.opc-dialog-header h2 { margin: 0 !important; font-size: 1.18rem !important; text-align: left !important; }
.opc-dialog-close { width: 44px !important; min-width: 44px; height: 44px; min-height: 44px; margin: 0 !important; padding: 0 !important; border: 1px solid var(--border) !important; border-radius: 12px !important; background: rgba(255,255,255,.035) !important; color: var(--text-muted) !important; box-shadow: none !important; }
.opc-dialog-actions { display: grid; gap: 10px; margin-top: 18px; }
.opc-dialog-actions > .opc-primary-button,
.opc-dialog-actions > .opc-logout-button { width: 100%; height: 50px; min-height: 50px; display: inline-flex; align-items: center; justify-content: center; margin: 0; padding: 12px 16px; }
.opc-dialog-actions > .opc-logout-button { border: 1px solid rgba(251,113,133,.25); background: rgba(251,113,133,.08); color: #fda4af; box-shadow: none; }
.opc-dialog-actions > .opc-logout-button:hover { background: rgba(251,113,133,.15); color: #fecdd3; box-shadow: none; }
.opc-settings-list { display: flex; flex-direction: column; gap: 4px; }
.opc-setting-row { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 0; color: var(--text-muted); font-size: .86rem; cursor: pointer; }
.opc-setting-row input[type="checkbox"] { width: 42px; height: 24px; flex: 0 0 auto; accent-color: var(--brand); }
.opc-setting-row input[type="color"] { width: 54px; height: 36px; flex: 0 0 auto; padding: 2px; border: 1px solid var(--border); border-radius: 9px; background: transparent; }
.opc-setting-section { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.opc-setting-section-first { margin-top: 0; padding-top: 0; padding-bottom: 10px; border-top: 0; border-bottom: 1px solid var(--border); }
.opc-setting-label { display: block; margin-bottom: 8px; color: var(--text-subtle); font-size: .72rem; font-weight: 750; }
.opc-setting-section select { width: 100%; min-height: 46px; margin: 0; padding: 9px 34px 9px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); font: inherit; font-size: .82rem; }
#setting_room_languages { font-size: .76rem; }
.opc-setting-section select:disabled { color: var(--text-subtle); }
.opc-setting-help { margin: 8px 2px 0; color: var(--text-subtle); font-size: .7rem; line-height: 1.5; }
.opc-setting-help[data-state="success"] { color: #6ee7b7; }
.opc-setting-help[data-state="error"] { color: #fda4af; }
.opc-setting-inline { display: flex; align-items: center; gap: 9px; }
.opc-setting-inline input[type="text"] { min-width: 0; min-height: 44px; margin: 0; }
.opc-privacy-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:8px 16px; margin:14px 0 2px; }
.opc-privacy-actions a { color:var(--brand-strong); font-size:.78rem; font-weight:750; text-decoration:none; }
.opc-privacy-actions a:hover { text-decoration:underline; }
.opc-setting-inline button { min-height: 44px; margin: 0; padding: 8px 14px; }
.opc-nickname-inline { display: grid; grid-template-columns: minmax(0, 1fr) auto; width: 100%; }
.opc-nickname-inline input[type="text"] { width: 100% !important; min-width: 0; }
.opc-nickname-inline .opc-nickname-update { width: auto !important; min-width: 72px; max-width: 88px; min-height: 40px; flex: 0 0 auto; padding: 6px 11px; font-size: .75rem; white-space: nowrap; }
.opc-push-status { padding: 12px; border: 1px solid var(--border); border-radius: 13px; background: rgba(255,255,255,.025); }
.opc-push-status-text { margin-bottom: 9px; color: var(--text-muted); font-size: .75rem; line-height: 1.55; }
.opc-push-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opc-push-actions button { min-height: 44px; margin: 0; padding: 7px; border: 1px solid var(--border); background: rgba(255,255,255,.04); color: var(--text-muted); box-shadow: none; }
.opc-owner-zone { margin-top: 16px; padding: 14px; border: 1px solid rgba(251,113,133,.2); border-radius: 14px; background: rgba(251,113,133,.055); }
.opc-owner-zone strong { display: block; margin-bottom: 4px; color: #fda4af; font-size: .75rem; }
.opc-owner-help { margin: 0 0 11px; color: var(--text-subtle); font-size: .7rem; line-height: 1.5; }
.opc-owner-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opc-owner-actions button { min-height: 50px; margin: 0; padding: 9px; border: 1px solid rgba(251,113,133,.25); background: rgba(251,113,133,.1); color: #fda4af; line-height: 1.35; box-shadow: none; }
#owner_actions { border-color: rgba(244,114,182,.34) !important; background: rgba(244,114,182,.13) !important; color: #f9a8d4 !important; }
#owner_delete_room { border-color: rgba(239,68,68,.45) !important; background: rgba(239,68,68,.16) !important; color: #f87171 !important; }
#owner_actions:hover { background: rgba(244,114,182,.22) !important; }
#owner_delete_room:hover { background: rgba(239,68,68,.27) !important; color: #fecaca !important; }
.opc-session-status { margin: 14px 0 8px; color: var(--text-subtle); text-align: center; font-size: .72rem; }
.opc-session-upgrade { min-height: 36px; display: inline-flex; align-items: center; margin-left: 8px; color: #86efac; font-weight: 800; text-decoration: none; }
.opc-modal-version { color: #446861; text-align: center; font-size: .6rem; }
#qrcode { margin: 14px auto !important; padding: 12px !important; border-radius: 16px !important; }
.opc-share-hint { color: var(--text-muted); text-align: center; font-size: .8rem; line-height: 1.55; }
.opc-footer { padding: 22px 20px calc(24px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); background: rgba(3,16,15,.44); }
.opc-footer-inner { max-width: 460px; margin: 0 auto; text-align: center; }
.opc-footer .cta-link { display: inline-flex !important; margin-bottom: 8px !important; color: #5eead4 !important; }
.opc-footer-copy { color: var(--text-subtle); font-size: .72rem; line-height: 1.65; }
.opc-footer-version { margin-top: 7px; color: #365a54; font-size: .58rem; }

.scanner-modal { position: fixed; inset: 0; z-index: 1100; display: none; padding: 18px; background: rgba(1,10,9,.88); backdrop-filter: blur(12px); }
.scanner-content { width: min(500px, 100%); max-height: calc(100dvh - 36px); margin: min(8vh, 72px) auto; padding: 20px; overflow-y: auto; border: 1px solid var(--border); border-radius: 22px; background: var(--surface-1); box-shadow: var(--shadow-lg); }
#reader { width: 100%; overflow: hidden; border-radius: 14px; background: #000; }

/* Guest standalone page */
body.opc-guest-page { min-height: 100dvh; padding: 18px; align-items: center; }
.opc-guest-language { position: fixed; top: max(14px, env(safe-area-inset-top)); right: 18px; z-index: 5; }
.opc-guest-card { width: min(420px, 100%); padding: 34px; border: 1px solid var(--border); border-radius: 26px; background: rgba(11,29,28,.88); box-shadow: var(--shadow-lg); text-align: left; }
.opc-guest-card .opc-entry-mark { width: 58px; height: 58px; margin-bottom: 24px; }
.opc-guest-card h1 { margin: 0 0 8px; font-size: 1.55rem; }
.opc-guest-card > p { margin-bottom: 24px; color: var(--text-muted); font-size: .9rem; }
.opc-guest-card label { display: block; margin-bottom: 8px; color: var(--text-muted); font-size: .78rem; font-weight: 700; }
.opc-guest-card input { width: 100%; min-height: 50px; margin: 0 0 14px; }
.opc-guest-card .opc-entry-button { margin-bottom: 10px; }
.opc-guest-card .opc-divider { margin: 20px 0; }
.opc-guest-card form .opc-auth-note { margin-top: 10px; }

/* Shared public/marketing polish. Theme pages keep their individual accents. */
body.opc-public-page {
    font-family: "Noto Sans", "Noto Sans Thai", "Noto Sans TC", "Outfit", system-ui, sans-serif !important;
    background-color: var(--surface-0) !important;
}
body.opc-public-page :where(a, button):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
body.opc-public-page :where(.topbar, .fixed-header, .header-top, header.header) { backdrop-filter: blur(20px) !important; -webkit-backdrop-filter: blur(20px) !important; border-bottom-color: var(--border) !important; }
body.opc-public-page :where(.card, .feature-card, .portal-card, .step, .faq, .reason, .work, .info-box, .flow-svg-wrap) { box-shadow: var(--shadow-sm); }
body.opc-public-page :where(.btn-primary, .btn-cta, .nav-cta) { background: linear-gradient(145deg, var(--brand), var(--brand-strong)) !important; box-shadow: 0 12px 28px rgba(15,118,110,.23) !important; }
body.opc-portal-page .portal-container { max-width: 1120px !important; padding-inline: 20px !important; }
body.opc-portal-page .portal-card { border-color: var(--border) !important; border-radius: 20px !important; background: rgba(11,29,28,.68) !important; }
body.opc-portal-page .portal-card:hover { border-color: var(--border-strong) !important; background: rgba(20,184,166,.08) !important; }
body.opc-about-page .feature-card,
body.opc-about-page .step { border-color: var(--border) !important; border-radius: 22px !important; background: rgba(11,29,28,.68) !important; }

/* 2026-08-17 unified international light specification. */
:root {
    --brand: #0d9488;
    --brand-strong: #0f766e;
    --brand-soft: #ecfdf5;
    --accent: #0284c7;
    --accent-soft: #e0f2fe;
    --surface-0: #f8fafc;
    --surface-1: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;
    --surface-glass: rgba(255, 255, 255, .94);
    --border: #e2e8f0;
    --border-strong: #99f6e4;
    --text: #0f172a;
    --text-muted: #475569;
    --text-subtle: #64748b;
    --danger: #dc2626;
    --success: #059669;
    --warning: #b45309;
    --shadow-sm: 0 8px 24px rgba(15, 23, 42, .07);
    --shadow-lg: 0 24px 70px rgba(15, 23, 42, .12);
}
html { color-scheme: light; background: var(--surface-0); }
body.opc-landing-page,
body.opc-home-page,
body.opc-room-page,
body.opc-guest-page {
    background: radial-gradient(circle at 10% 0%, #ccfbf1 0, transparent 30rem), linear-gradient(145deg, #fff 0%, #f8fafc 100%);
}
body.opc-landing-page::before,
body.opc-home-page::before,
body.opc-room-page::before,
body.opc-guest-page::before { opacity: .2; background-image: linear-gradient(rgba(15,118,110,.07) 1px,transparent 1px),linear-gradient(90deg,rgba(15,118,110,.07) 1px,transparent 1px); }
.opc-container { background: rgba(255,255,255,.96); box-shadow: var(--shadow-lg); }
.opc-header { background: rgba(255,255,255,.94) !important; }
.opc-back-link,.opc-icon-button,.opc-action-button,.opc-profile,.opc-language-select { background-color: #fff !important; }
.opc-action-button.is-primary,.opc-secondary-button { color: #0f766e !important; }
.opc-login-card,.opc-entry-actions,.opc-dashboard-actions,.opc-rooms-panel,.opc-guest-card { background: #fff !important; }
.opc-entry-hero { background: linear-gradient(155deg,#f0fdfa,#eff6ff) !important; }
.opc-entry-benefit,.opc-member-summary,.action-tabs,.opc-room-card,.opc-room-history-clear,.opc-entry-recent-list a,.opc-empty-state { background: #f8fafc !important; }
.opc-entry-kicker,.opc-entry-links a,.opc-room-group-title svg,.opc-join-icon,.opc-footer .cta-link,.opc-member-eyebrow { color: #0f766e !important; }
.opc-member-type,.opc-room-count,.opc-guest-badge { color: #0f766e !important; }
.opc-member-stats div { background: #fff; }
.opc-guest-persistence-note { background: #fffbeb; }
.opc-guest-persistence-note strong,.opc-room-save-copy .opc-room-install-hint { color: #92400e; }
.opc-guest-persistence-note a { color: #047857; background: #ecfdf5; }
.opc-field :where(input,select),.opc-setting-section select,.opc-setting-inline input,.opc-push-actions button { background: #fff !important; color: var(--text) !important; }
.opc-room-page .chat-area,.opc-room-page #msg_list { background: linear-gradient(180deg,#f8fafc,#fff); }
.msg.received { background: #fff; }
.msg.sent { color: #fff; }
.msg .translation { border-top-color: rgba(255,255,255,.35); }
.input-area { background: #fff; box-shadow: 0 12px 30px rgba(15,23,42,.12); }
.opc-room-save-prompt { background: #fff; box-shadow: var(--shadow-lg); }
.modal,.opc-overlay,.scanner-modal { background: rgba(15,23,42,.42) !important; }
.modal-content,.opc-dialog,.scanner-content { background: #fff !important; }
.opc-dialog-close,.opc-push-status { background: #f8fafc !important; }
.opc-owner-zone { background: #fff1f2; }
.opc-owner-zone strong,.opc-dialog-actions>.opc-logout-button { color: #be123c; }
.opc-footer { background: #f8fafc; }
body.opc-public-page { background-color: #f8fafc !important; color: #0f172a !important; }
body.opc-public-page :where(.topbar,.fixed-header,.header-top,header.header) { background: rgba(255,255,255,.94) !important; color: #0f172a !important; }
body.opc-public-page :where(.card,.feature-card,.portal-card,.step,.faq,.reason,.work,.info-box,.flow-svg-wrap) { background: #fff !important; color: #0f172a !important; }
body.opc-portal-page .portal-card,body.opc-about-page .feature-card,body.opc-about-page .step { background: #fff !important; }

@media (max-width: 860px) {
    .opc-container { width: min(100% - 20px, 760px); height: calc(var(--opc-viewport-height, 100dvh) - 20px); margin: 10px; border-radius: 24px; }
    .opc-header { grid-template-columns: minmax(0,1fr) auto auto; gap: 8px !important; padding-inline: 12px !important; }
    .opc-header-identity { justify-content: flex-end !important; }
    .opc-profile-name, .opc-guest-badge { display: none; }
    .opc-profile { padding-right: 4px; }
    .opc-language-select { max-width: 132px !important; }
    .opc-action-button span { display: none; }
    .opc-login-card { grid-template-columns: 1fr; width: min(620px, calc(100% - 32px)) !important; }
    .opc-entry-hero { padding: 38px; }
    .opc-entry-actions { padding: 36px 38px; }
    .opc-dashboard-grid { grid-template-columns: 1fr; }
    .opc-dashboard-actions { position: static; }
}

@media (max-width: 600px) {
    body.opc-landing-page,
    body.opc-home-page,
    body.opc-room-page { align-items: stretch; }
    .opc-container { width: 100%; height: var(--opc-viewport-height, 100dvh); margin: 0; border: 0; border-radius: 0; box-shadow: none; }
    .opc-header { grid-template-columns: minmax(0, 1fr) auto auto; min-height: 64px !important; padding: calc(7px + env(safe-area-inset-top, 0px)) 8px 7px !important; }
    .opc-brand-mark { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; }
    .opc-brand-copy { display: none; }
    .opc-back-link { width: 44px; padding: 0 !important; }
    .opc-back-link span { display: none; }
    .opc-profile { display: none; }
    .opc-language-select { width: 106px !important; max-width: 106px !important; min-height: 44px; padding-inline: 8px !important; }
    .opc-header-actions { gap: 5px !important; }
    .opc-action-button { width: 44px !important; padding: 0 !important; }
    .opc-login-card { width: 100% !important; min-height: 0; margin: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
    .opc-entry-hero { min-height: 310px; padding: 30px 22px; }
    .opc-entry-mark { width: 58px; height: 58px; border-radius: 18px; }
    .opc-entry-hero h1 { margin-top: 20px !important; font-size: 2.15rem !important; }
    .opc-entry-lead { margin-top: 13px; font-size: .93rem; }
    .opc-entry-benefit { display: none; }
    .opc-entry-actions { padding: 28px 20px 20px; }
    .opc-landing-footer { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
    .opc-dashboard-main { width: 100%; padding: 22px 14px 34px; }
    .opc-dashboard-welcome { padding: 0 2px; }
    .opc-dashboard-welcome h1 { font-size: 1.4rem; }
    .opc-member-summary { grid-template-columns: auto minmax(0,1fr); gap: 12px; padding: 15px; }
    .opc-member-avatar { width: 50px; height: 50px; border-radius: 15px; }
    .opc-member-copy h1 { font-size: 1rem; }
    .opc-member-copy p { font-size: .68rem; }
    .opc-member-stats { grid-column: 1 / -1; width: 100%; }
    .opc-member-stats div { padding: 7px 9px; }
    .opc-guest-persistence-note { align-items: stretch; flex-direction: column; gap: 10px; }
    .opc-guest-persistence-note a { justify-content: center; }
    .opc-dashboard-actions, .opc-rooms-panel { padding: 16px; border-radius: 19px; }
    .opc-dashboard-grid { gap: 14px; }
    .opc-room-card { padding: 14px 56px 14px 14px; }
    .opc-room-card-meta { grid-template-columns: auto minmax(0,1fr); }
    .opc-room-owner { grid-column: 1 / -1; max-width: 100%; text-align: left; }
    .opc-room-page .chat-area, .opc-room-page #msg_list { padding: 11px 10px; gap: 10px; }
    .opc-room-save-prompt { top: calc(70px + env(safe-area-inset-top, 0px)); width: calc(100% - 18px); grid-template-columns: auto minmax(0,1fr); gap: 10px; padding: 12px; border-radius: 15px; }
    .opc-room-save-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); width: 100%; }
    .opc-room-save-actions :where(button, a) { white-space: normal; text-align: center; }
    .msg { max-width: 91%; padding: 10px 13px; border-radius: 16px; line-height: 1.52; }
    .input-area { margin: 0 8px max(8px, env(safe-area-inset-bottom)); padding: 7px; border-radius: 16px; }
    #send_btn { min-width: 48px; width: 48px; padding: 0 !important; font-size: 0 !important; }
    #send_btn svg { width: 19px; height: 19px; }
    #scroll_bottom_btn { right: 14px !important; bottom: calc(76px + env(safe-area-inset-bottom)) !important; }
    .modal { align-items: flex-end !important; padding: 0 !important; }
    .modal-content, .opc-dialog { width: 100% !important; max-width: none !important; max-height: calc(var(--opc-viewport-height, 100dvh) - max(12px, env(safe-area-inset-top))) !important; padding: 22px 17px calc(18px + env(safe-area-inset-bottom)) !important; border-width: 1px 0 0 !important; border-radius: 24px 24px 0 0 !important; }
    .opc-guest-card { padding: 28px 22px; border-radius: 22px; }
    body.opc-public-page :where(.wrap, .container, .portal-container) { padding-left: 18px !important; padding-right: 18px !important; }
}

@media (max-width: 370px) {
    .opc-language-select { width: 92px !important; }
    .opc-header-actions { gap: 3px !important; }
    .opc-entry-actions { padding-inline: 16px; }
    .opc-join-row { grid-template-columns: 1fr; }
    .opc-join-row button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .opc-container,
    .opc-room-card-wrap,
    .opc-room-skeleton,
    .opc-chat-loader-ring { animation: none !important; }
}

@media (pointer: coarse) {
    body.opc-public-page :where(button, select, input[type="submit"], input[type="button"], .btn, .button, [role="button"]) {
        min-height: 44px;
    }
    body.opc-public-page :where(.opc-action-button, .opc-back-link, #emoji_btn, #scroll_bottom_btn) {
        min-width: 44px;
    }
}
