:root { color-scheme: dark; --bg: #101315; --panel: #191e21; --line: #30383d; --text: #eef2ee; --muted: #9da8a6; --accent: #c0dfac; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Segoe UI', 'Malgun Gothic', sans-serif; font-size: 14px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
button, input, textarea { border-radius: 10px; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input, textarea { color: var(--text); background: #111719; border: 1px solid var(--line); padding: 14px; }
.primary { border: 0; background: var(--accent); color: #20301b; font-weight: 700; padding: 14px 20px; }
.primary:hover:not(:disabled) { background: #d5edc6; }
.secondary { border: 1px solid var(--accent); color: var(--accent); background: transparent; padding: 14px 20px; margin-top: 12px; font-weight: 600; }
.secondary:hover:not(:disabled) { background: #c0dfac12; }
.text-button { background: none; border: 0; color: var(--muted); padding: 6px; font-size: 12px; }
.text-button:hover { color: var(--accent); }
.muted, .footnote { color: var(--muted); line-height: 1.7; }
.footnote { font-size: 12px; }
.eyebrow { font-size: 10px; letter-spacing: 2px; color: var(--accent); font-weight: 600; }
.brand-mark { display: grid; place-items: center; width: 54px; height: 54px; background: var(--accent); color: #283920; font-size: 25px; font-weight: 700; border-radius: 18px; }
.brand-mark.small { width: 40px; height: 40px; border-radius: 13px; font-size: 20px; }
.login-view { min-height: 100dvh; max-width: 1440px; margin: auto; display: grid; grid-template-columns: minmax(0, 1fr) 240px; align-items: start; gap: 32px; padding: 40px 32px; }
.login-card { width: 100%; background: var(--panel); border: 1px solid var(--line); padding: 18px; border-radius: 12px; position: sticky; top: 24px; margin-top: 64px; }
.login-card form { display: grid; gap: 10px; }
.login-card input, .login-card button { width: 100%; }
.login-card input { padding: 11px 12px; font-size: 16px; }
.login-card .primary { padding: 11px; }
.login-card .error { margin: 0; }
.login-card .error:empty { display: none; }
.video-home { min-width: 0; }
.video-header { display: flex; justify-content: space-between; align-items: center; min-height: 44px; margin-bottom: 20px; }
.video-header h1 { font-size: 22px; letter-spacing: 3px; margin: 0; }
.video-header h1 a { color: inherit; text-decoration: none; }
.video-header h1 a:hover { color: var(--accent); }
.video-header h1 a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 3px; }
.video-header span { color: var(--muted); font-size: 12px; }
.video-stage { margin-bottom: 28px; }
#home-player { width: 100%; aspect-ratio: 16 / 9; display: block; background: #050606; border: 1px solid var(--line); border-radius: 12px; }
#video-title { font-size: 19px; margin: 16px 0 0; overflow-wrap: anywhere; }
#video-error:empty { display: none; }
.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 16px; }
.video-card { display: block; text-align: left; padding: 0; border: 1px solid transparent; color: var(--text); background: transparent; overflow: hidden; border-radius: 10px; }
.video-card[aria-pressed="true"] { border-color: var(--accent); background: var(--panel); }
.video-cover { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; background: linear-gradient(135deg, #293537, #161b20); overflow: hidden; border-radius: 8px; }
.video-cover img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.video-cover span { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: white; background: #0009; font-size: 16px; }
.video-card strong { display: block; padding: 12px 8px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.video-card:hover .video-cover { filter: brightness(1.15); }
.video-empty { min-height: 360px; border: 1px dashed var(--line); border-radius: 12px; display: grid; place-items: center; text-align: center; color: var(--muted); }
@media (max-width: 900px) { .login-view { gap: 20px; padding: 24px 18px; grid-template-columns: minmax(0, 1fr) 200px; } .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
    .login-view { display: flex; flex-direction: column; gap: 24px; }
    .login-card { order: -1; position: static; margin: 0 0 0 auto; width: min(100%, 340px); padding: 12px; }
    .login-card form { grid-template-columns: 1fr 1fr; gap: 8px; }
    .login-card button, .login-card .error { grid-column: 1 / -1; }
    .video-home { width: 100%; }
    .video-grid { gap: 14px 10px; }
}
.error { color: #ffb9aa; font-size: 13px; min-height: 18px; }
.app-shell { max-width: 1440px; margin: auto; display: grid; grid-template-columns: 320px minmax(0, 1fr); height: 100dvh; border-inline: 1px solid var(--line); }
.sidebar { background: var(--panel); border-right: 1px solid var(--line); padding: 28px 22px 16px; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.brand strong { font-size: 20px; }
.brand .eyebrow { display: block; margin-top: 5px; font-size: 8px; color: var(--muted); }
.sidebar-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
h2 { font-size: 13px; font-weight: 600; }
.badge { font-size: 10px; color: var(--muted); border: 1px solid var(--line); padding: 3px 7px; border-radius: 5px; }
.person { padding: 16px 0; border-bottom: 1px solid var(--line); }
.person-top { display: flex; align-items: center; gap: 9px; }
.person-top strong { overflow-wrap: anywhere; }
.person-status { margin-left: auto; font-size: 11px; white-space: nowrap; color: var(--muted); }
.dot { height: 7px; width: 7px; background: #66716f; border-radius: 50%; flex-shrink: 0; }
.person.online .dot { background: var(--accent); box-shadow: 0 0 0 4px #c0dfac12; }
.person.online .person-status { color: var(--accent); }
.person p { margin: 10px 0 0 16px; font-size: 11px; color: var(--muted); line-height: 1.7; white-space: pre-line; }
.activity-section { margin-top: 30px; }
.visits { list-style: none; padding: 0; margin: 18px 0 0; }
.visits li { border-left: 1px solid #3c4840; padding: 0 0 20px 14px; margin-left: 3px; }
.visits strong { font-size: 12px; }
.visits p { font-size: 11px; color: var(--muted); line-height: 1.7; margin: 5px 0 0; }
.account { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; margin-top: auto; color: var(--muted); }
.conversation { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.chat-header { padding: 25px 36px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); gap: 12px; }
.chat-header h1 { font-size: 23px; margin: 8px 0 0; overflow-wrap: anywhere; }
.chat-header .eyebrow { margin: 0; }
.connection { font-size: 11px; color: var(--muted); white-space: nowrap; }
.connection.connected { color: var(--accent); }
.conversation-note { text-align: center; font-size: 11px; color: var(--muted); padding: 16px; }
.message-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 36px 24px; overflow-anchor: none; }
.history-button { display: block; margin: 8px auto 24px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); padding: 9px 15px; font-size: 12px; }
.empty { text-align: center; padding: 80px 0; color: var(--muted); }
.empty > span { color: var(--accent); font: 80px Georgia, serif; }
.empty h2 { color: var(--text); font-size: 20px; }
.empty p { font-size: 12px; }
.messages { list-style: none; padding: 0; margin: 0; }
.message { display: flex; flex-direction: column; align-items: flex-start; margin: 20px 0; }
.message.mine { align-items: flex-end; }
.message-meta { font-size: 11px; color: var(--muted); margin: 0 3px 7px; }
.bubble { background: #242c30; padding: 13px 17px; border-radius: 3px 15px 15px; line-height: 1.7; max-width: 80%; white-space: pre-wrap; overflow-wrap: anywhere; }
.mine .bubble { background: #c0dfac; color: #21301c; border-radius: 15px 3px 15px 15px; }
.composer-wrap { padding: 0 36px 22px; }
.composer { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 10px; }
.composer textarea { flex: 1; min-width: 0; border: 0; background: none; resize: vertical; min-height: 54px; max-height: 160px; }
.composer .primary { white-space: nowrap; font-size: 12px; }
.composer-hint { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 10px; color: var(--muted); }
.new-message { position: absolute; bottom: 170px; align-self: center; border: 1px solid var(--line); background: var(--panel); color: var(--accent); padding: 10px 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.photo-preview { display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 10px; flex-wrap: wrap; }
.photo-preview img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; }
.photo-preview > div { flex: 1; min-width: 100px; overflow-wrap: anywhere; font-size: 12px; }
.photo-preview p { color: var(--muted); font-size: 11px; }
.photo-preview button { padding: 8px 12px; font-size: 12px; }
.photo-bubble { display: block; width: min(300px, 85%); text-decoration: none; }
.message-photo { display: block; width: 100%; height: 220px; object-fit: contain; background: var(--panel); border-radius: 12px; }
.photo-caption { display: block; margin-top: 5px; font-size: 11px; color: var(--muted); }
#photo-choose { white-space: nowrap; padding: 6px; }
.call-panel { margin: 0 18px 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); flex-shrink: 0; max-height: 40dvh; overflow-y: auto; }
.call-heading { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 10px; }
#call-status { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.call-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.call-panel select { min-width: 0; max-width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px; }
.call-actions select { flex: 1 1 130px; }
.call-actions button { padding: 9px 12px; font-size: 12px; }
.call-end { color: #ffb9aa; border: 1px solid #9b6055; background: #382220; }
.call-panel .error:empty { display: none; }
.call-panel details { margin-top: 10px; font-size: 12px; }
.call-panel summary { cursor: pointer; color: var(--accent); margin-bottom: 8px; }
.call-panel details label { display: block; margin: 8px 0 5px; }
.call-panel details select { width: 100%; }
.call-panel[data-state="ringing"] { border-color: var(--accent); }
.call-panel[data-state="active"] #call-status { color: var(--accent); }
@media (max-width: 760px) {
    .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
    .sidebar { padding: 22px 14px; }
    .chat-header { padding: 24px 18px; }
    .message-scroll { padding-inline: 16px; }
    .composer-wrap { padding: 0 14px 16px; }
    .bubble { max-width: 92%; }
}
@media (max-width: 540px) {
    .app-shell { display: flex; flex-direction: column; height: auto; min-height: 100dvh; }
    .sidebar { order: 2; border-right: 0; border-top: 1px solid var(--line); overflow: visible; }
    .sidebar .brand { display: none; }
    .activity-section { margin-top: 18px; }
    .visits { max-height: 260px; overflow-y: auto; }
    .conversation { height: 100dvh; }
    .chat-header h1 { font-size: 20px; }
    .composer-hint { font-size: 9px; }
}
