:root { --green: #22c55e; --bg: #09090b; --card: #18181b; }

body { background: var(--bg); color: #fafafa; font-family: -apple-system, sans-serif; margin: 0; overflow: hidden; height: 100dvh; -webkit-tap-highlight-color: transparent; }

header, footer { position: relative; z-index: 1100; background: #000; border-bottom: 1px solid #18181b; }

.sez-input {
background: #121214;
border: 1px solid #3f3f46;
border-radius: 12px;
padding: 12px 14px;
color: white;
width: 100%;
outline: none;
transition: height 0.05s ease;
resize: none;
font-size: 15px;
line-height: 1.5;
min-height: 44px;
}

.sez-btn-main {
background-color: var(--green) !important;
color: #000 !important;
font-weight: 900 !important;
border-radius: 12px !important;
padding: 16px !important;
width: 100% !important;
border: none !important;
cursor: pointer;
display: block;
text-align: center;
}

.sez-send-btn {
background-color: var(--green) !important;
color: #000 !important;
width: 44px;
height: 44px;
min-width: 44px;
border-radius: 50% !important;
display: flex;
align-items: center;
justify-content: center;
border: none !important;
cursor: pointer;
padding: 0;
}

.msg-nick {
color: #a1a1aa;
font-size: 13px;
font-weight: 700;
margin-bottom: 4px;
padding-left: 4px;
}

.msg-wrap {
width: 100%;
display: flex;
flex-direction: column;
overflow: visible;
position: relative;
}

.msg-bubble {
background: var(--card);
padding: 10px 14px;
border-radius: 18px;
max-width: 85%;
border: 1px solid #27272a;
position: relative;
line-height: 1.5;
font-size: 14px;
transition: all 0.2s;
z-index: 10;
touch-action: none;
-webkit-touch-callout: none;
-webkit-user-select: none;
user-select: none;
}

.msg-bubble.is-me {
background: var(--green);
color: #000;
border-color: #16a34a;
}

.line-clamp-4 {
display: -webkit-box;
-webkit-line-clamp: 4;
-webkit-box-orient: vertical;
overflow: hidden;
max-height: 84px;
}

.msg-bubble.expanded .line-clamp-4 {
-webkit-line-clamp: unset !important;
display: block !important;
max-height: none !important;
}

.msg-bubble.expanded {
max-width: 95% !important;
border-color: white;
z-index: 20;
}

.more-label {
color: #71717a;
font-size: 10px;
font-weight: bold;
margin-top: 4px;
text-align: center;
width: 100%;
cursor: pointer;
}

.side-container {
position: relative;
display: flex;
align-items: flex-end;
min-width: fit-content;
padding: 0 12px;
margin-bottom: 2px;
}

.info-box { display: flex; flex-direction: column; transition: all 0.2s; opacity: 1; gap: 0; }

.is-me .info-box { align-items: flex-end; }

/* hover 메뉴 위치 미세 보정 */
.action-btns { 
position: absolute;
display: flex;
gap: 10px;
opacity: 0;
pointer-events: none;
transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
z-index: 50;
bottom: calc(50% - -11px);
}

.is-me .action-btns { right: 12px; transform: translateX(20px) translateY(50%) translateY(1px); }

.items-start .action-btns { left: 12px; transform: translateX(-20px) translateY(50%) translateY(1px); }

@media (hover: hover) and (pointer: fine) {

.msg-wrap:hover .info-box { opacity: 0; transform: scale(0.8); }

.msg-wrap:hover .action-btns {
opacity: 1;
pointer-events: auto;
}

.msg-wrap:hover .is-me .action-btns,
.msg-wrap.is-me:hover .action-btns {
transform: translateX(0) translateY(50%) translateY(1px);
}

.msg-wrap:hover .items-start .action-btns,
.msg-wrap.items-start:hover .action-btns,
.msg-wrap:hover .action-btns {
transform: translateX(0) translateY(50%) translateY(1px);
}

.msg-wrap.is-deleted:hover .action-btns {
opacity: 0;
pointer-events: none;
}

}

.btn-icon {
width: 32px;
height: 32px;
border-radius: 50%;
background: #1c1c1f;
color: #a1a1aa;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid #3f3f46;
cursor: pointer;
transition: all 0.2s;
}

.btn-icon:hover {
background: #27272a;
color: #fff;
transform: translateY(-2px);
}

.custom-modal,
#action-sheet {
position: fixed;
inset: 0;
z-index: 5000;
display: none;
align-items: center;
justify-content: center;
opacity: 0;
transition: opacity 0.3s ease;
}

.custom-modal.show,
#action-sheet.show {
display: flex !important;
opacity: 1;
pointer-events: auto;
background: rgba(0,0,0,0.85);
}

.modal-box {
background: #18181b;
border-radius: 28px;
padding: 28px;
border: 1px solid #27272a;
transform: scale(0.9);
transition: 0.3s;
width: 90%;
max-width: 340px;
}

.show .modal-box { transform: scale(1); }
.modal-box.wide { max-width: 420px !important; }

#action-sheet { align-items: flex-end; background: rgba(0,0,0,0); }
#action-sheet.show { background: rgba(0,0,0,0.6); }

.action-panel {
background: #18181b;
width: 100%;
max-width: 440px;
border-radius: 28px 28px 0 0;
padding: 24px;
border-top: 1px solid #27272a;
transform: translateY(100%);
transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#action-sheet.show .action-panel { transform: translateY(0); }

#status-dot {
width: 8px;
height: 8px;
border-radius: 50%;
background-color: #ef4444;
margin-right: 8px;
transition: 0.3s;
}

#status-dot.connected {
background-color: var(--green) !important;
box-shadow: 0 0 8px var(--green) !important;
}

#lock-btn.locked { color: #ef4444 !important; }

.menu-pop {
transform: scale(0.95) translateY(10px);
opacity: 0;
pointer-events: none;
transition: 0.2s;
visibility: hidden;
position: absolute;
z-index: 1500;
}

.menu-pop.show {
transform: scale(1) translateY(0);
opacity: 1;
pointer-events: auto;
visibility: visible;
}

#chat {
scroll-behavior: smooth;
position: relative;
z-index: 10;
padding: 16px 16px 100px 16px;
overflow-y: auto;
overflow-x: hidden;
flex: 1;
}

#chat::-webkit-scrollbar,
#u-items::-webkit-scrollbar { width: 10px; }

#chat::-webkit-scrollbar-track,
#u-items::-webkit-scrollbar-track { background: transparent; }

#chat::-webkit-scrollbar-thumb,
#u-items::-webkit-scrollbar-thumb {
background: linear-gradient(180deg, #27272a 0%, #3f3f46 100%);
border-radius: 999px;
border: 2px solid #09090b;
}

#chat::-webkit-scrollbar-thumb:hover,
#u-items::-webkit-scrollbar-thumb:hover {
background: linear-gradient(180deg, #3f3f46 0%, #52525b 100%);
}

#chat,
#u-items {
scrollbar-width: thin;
scrollbar-color: #3f3f46 transparent;
}

.msg-wrap.is-deleted .msg-bubble {
cursor: default;
}

.msg-bubble.deleted {
opacity: 0.72;
}

#toast {
position: fixed;
top: 20px;
left: 50%;
transform: translateX(-50%);
background: var(--green);
color: black;
padding: 8px 20px;
border-radius: 9999px;
font-weight: bold;
z-index: 2000;
opacity: 0;
transition: 0.4s;
pointer-events: none;
}

#toast.show { opacity: 1; }

#new-msg-pill {
cursor: pointer;
position: absolute;
bottom: 85px;
left: 50%;
transform: translateX(-50%) translateY(24px);
background: rgba(39, 39, 42, 0.95);
color: var(--green);
padding: 10px 16px;
border-radius: 9999px;
font-size: 12px;
font-weight: 800;
border: 1px solid rgba(255,255,255,0.08);
box-shadow: 0 12px 30px rgba(0,0,0,0.26);
opacity: 0;
pointer-events: none;
transition: transform 0.26s ease, opacity 0.26s ease;
z-index: 1200;
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
white-space: nowrap;
}

#new-msg-pill.show {
opacity: 1;
transform: translateX(-50%) translateY(0);
pointer-events: auto;
}

#new-msg-pill:hover {
border-color: rgba(255,255,255,0.14);
box-shadow: 0 14px 34px rgba(0,0,0,0.3);
}

.hidden { display: none !important; }

#v-btn {
background: #18181b !important;
color: #a1a1aa !important;
}

body.voice-on #v-btn,
#v-btn.voice-active {
background: #ef4444 !important;
color: #ffffff !important;
box-shadow: 0 8px 22px rgba(239,68,68,0.28);
}

#mic-btn,
#hs-btn {
transition: transform .18s ease, opacity .18s ease, background-color .18s ease, color .18s ease;
transform: translateX(-14px);
opacity: 0;
}

body.voice-on #mic-btn,
body.voice-on #hs-btn {
transform: translateX(0);
opacity: 1;
}

#mic-btn.hidden,
#hs-btn.hidden {
display: none !important;
opacity: 0 !important;
transform: translateX(-10px) !important;
pointer-events: none !important;
}

.sez-off {
color: #ef4444 !important;
position: relative !important;
}

.sez-off::after {
content: "" !important;
position: absolute !important;
left: 50% !important;
top: 50% !important;
width: 72% !important;
height: 3px !important;
background: #ef4444 !important;
transform: translate(-50%, -50%) rotate(-45deg) !important;
transform-origin: center !important;
border-radius: 999px !important;
opacity: .98 !important;
pointer-events: none !important;
}

#v-btn,
#mic-btn,
#hs-btn {
border-radius: 9999px !important;
}

.sez-mic-icon { margin-left: 2px; }
.sez-mic-red { color: #ef4444 !important; }
.sez-mic-green { color: #22c55e !important; }

@keyframes sezSlideInLeft {
0% { transform: translateX(-18px); opacity: 0; }
100% { transform: translateX(0); opacity: 1; }
}

@keyframes sezSlideOutLeft {
0% { transform: translateX(0); opacity: 1; }
100% { transform: translateX(-18px); opacity: 0; }
}

.sez-voice-enter #mic-btn,
.sez-voice-enter #hs-btn { animation: sezSlideInLeft .20s ease-out; }

.sez-voice-leave #mic-btn,
.sez-voice-leave #hs-btn { animation: sezSlideOutLeft .16s ease-in; }

@keyframes sezLockTap {
0% { transform: scale(1) rotate(0deg); }
35% { transform: scale(1.08) rotate(-8deg); }
70% { transform: scale(1.03) rotate(6deg); }
100% { transform: scale(1) rotate(0deg); }
}

.sez-lock-bounce { animation: sezLockTap .28s ease-out; }

.upload-progress {
position: fixed;
left: 50%;
bottom: 86px;
transform: translateX(-50%) translateY(24px);
width: min(330px, calc(100vw - 34px));
background: rgba(24, 24, 27, 0.96);
border: 1px solid rgba(255,255,255,0.07);
box-shadow: 0 12px 32px rgba(0,0,0,0.32);
border-radius: 999px;
padding: 8px 12px;
z-index: 1800;
backdrop-filter: blur(14px);
-webkit-backdrop-filter: blur(14px);
opacity: 0;
transition: transform 0.26s ease, opacity 0.26s ease;
pointer-events: none;
}

.upload-progress.hidden {
display: block !important;
opacity: 0;
transform: translateX(-50%) translateY(24px);
visibility: hidden;
}

.upload-progress.show {
opacity: 1;
transform: translateX(-50%) translateY(0);
visibility: visible;
}

.upload-progress-line {
display: grid;
grid-template-columns: minmax(0, 1fr) 96px 40px;
align-items: center;
gap: 10px;
}

.upload-progress-name {
color: #fafafa;
font-size: 12px;
font-weight: 700;
min-width: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.upload-progress-percent {
color: var(--green);
font-size: 12px;
font-weight: 800;
flex-shrink: 0;
text-align: right;
}

.upload-progress-bar {
width: 100%;
height: 5px;
border-radius: 999px;
background: #27272a;
overflow: hidden;
border: 1px solid rgba(255,255,255,0.03);
}

.upload-progress-fill {
width: 0%;
height: 100%;
border-radius: inherit;
background: linear-gradient(90deg, #22c55e 0%, #3b82f6 100%);
transition: width 0.16s ease;
}

.file-link {
color: #fafafa;
font-weight: 700;
text-decoration-line: underline;
text-decoration-color: #60a5fa;
text-decoration-thickness: 2.5px;
text-underline-offset: 4px;
}

.file-link:hover {
color: #ffffff;
text-decoration-color: #93c5fd;
}

.msg-wrap.is-deleted .msg-bubble,
.msg-wrap.is-deleted [id^="inner-"] {
white-space: nowrap !important;
line-height: 1.2 !important;
}

.msg-wrap.is-deleted .more-label {
display: none !important;
}

#drag-overlay {
position: fixed;
inset: 0;
z-index: 1900;
display: none;
align-items: center;
justify-content: center;
background: rgba(10, 10, 12, 0.62);
backdrop-filter: blur(6px);
-webkit-backdrop-filter: blur(6px);
}

#drag-overlay.show { display: flex; }

.drag-card {
width: min(420px, calc(100vw - 32px));
border-radius: 24px;
padding: 22px 20px;
background: rgba(24, 24, 27, 0.96);
border: 1px solid rgba(255,255,255,0.08);
box-shadow: 0 16px 44px rgba(0,0,0,0.4);
text-align: center;
}

.drag-card-title {
font-size: 18px;
font-weight: 800;
color: #fafafa;
margin-top: 12px;
}

.drag-card-sub {
font-size: 13px;
color: #a1a1aa;
margin-top: 6px;
}

#m-in {
scrollbar-width: thin;
scrollbar-color: #52525b transparent;
}

#m-in::-webkit-scrollbar { width: 8px; }
#m-in::-webkit-scrollbar-track { background: transparent; }

#m-in::-webkit-scrollbar-thumb {
background: linear-gradient(180deg, #3f3f46 0%, #52525b 100%);
border-radius: 999px;
border: 2px solid transparent;
background-clip: padding-box;
}

#m-in::-webkit-scrollbar-thumb:hover {
background: linear-gradient(180deg, #52525b 0%, #71717a 100%);
}

.info-box span,
[id^="time-"] {
font-size: 10px !important;
}

