:root { --primary-color: #5d4037; --accent-color: #d84315; --bg-color: #f0f2f5; --card-bg: #ffffff; --text-color: #333333; --error-color: #d32f2f; --success-color: #388e3c; }
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Noto Sans KR', sans-serif; background-color: var(--bg-color); color: var(--text-color); display: flex; justify-content: center; align-items: center; min-height: 100vh; overscroll-behavior-y: none; }
#app { width: 100%; height: 100dvh; max-width: 100%; background-color: var(--card-bg); position: relative; overflow: hidden; display: flex; flex-direction: column; }
@media (min-width: 500px) { #app { max-width: 420px; height: 85vh; max-height: 850px; border-radius: 24px; box-shadow: 0 20px 40px rgba(0,0,0,0.15); border: 1px solid rgba(0,0,0,0.05); } }
.screen { display: none; flex: 1; height: 100%; width: 100%; overflow-y: auto; padding: 20px; flex-direction: column; -webkit-overflow-scrolling: touch; }
.screen.active { display: flex; animation: fadeIn 0.25s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
h1 { color: var(--primary-color); margin-bottom: 5px; font-size: 1.8rem; }
h2 { font-size: 1.5rem; margin-bottom: 15px; }
.subtitle { color: #757575; margin-bottom: 30px; font-size: 0.95rem; }
.card { background: transparent; padding: 0; text-align: center; width: 100%; margin: 0 auto; }
.input-group { margin-bottom: 20px; text-align: left; }
label { display: block; font-size: 0.9rem; color: #757575; margin-bottom: 8px; font-weight: 500; }
input, select { width: 100%; padding: 14px; border: 1px solid #e0e0e0; border-radius: 12px; font-size: 16px; background-color: #f9f9f9; transition: all 0.2s; appearance: none; }
input:focus, select:focus { outline: none; border-color: var(--accent-color); background-color: #fff; }
.btn { padding: 14px 20px; border: none; border-radius: 12px; font-size: 1rem; font-weight: bold; cursor: pointer; width: 100%; display: inline-flex; justify-content: center; align-items: center; user-select: none; }
.primary-btn { background-color: var(--primary-color); color: white; }
.outline-btn { background-color: transparent; border: 2px solid var(--primary-color); color: var(--primary-color); }
.sm-btn { padding: 8px 16px; font-size: 0.85rem; width: auto; border-radius: 8px; }
.text-btn { background: none; color: #757575; width: auto; padding: 10px; }
.avatars-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 25px; }
.avatar-option { font-size: 2.2rem; background: #f5f5f5; border-radius: 16px; aspect-ratio: 1; display: flex; justify-content: center; align-items: center; cursor: pointer; border: 2px solid transparent; }
.avatar-option.selected { border-color: var(--accent-color); background: #fff3e0; }
.card.centered { display: flex; flex-direction: column; justify-content: center; height: 100%; }
.loader { border: 4px solid #f3f3f3; border-top: 4px solid var(--accent-color); border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite; margin: 20px auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.chat-container { display: flex; flex-direction: column; height: 100%; }
.chat-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 15px; border-bottom: 1px solid #f0f0f0; }
.topic-section { background: #fff8e1; padding: 12px; border-radius: 12px; margin: 10px 0; text-align: center; }
.chat-messages { flex: 1; overflow-y: auto; padding: 10px 5px; background: #fafafa; border-radius: 12px; display: flex; flex-direction: column; gap: 12px; }
.message { max-width: 85%; padding: 12px 16px; border-radius: 16px; font-size: 0.95rem; word-wrap: break-word; }
.message.self { align-self: flex-end; background-color: var(--primary-color); color: white; }
.message.other { align-self: flex-start; background-color: white; border: 1px solid #eee; }
.system-message { text-align: center; font-size: 0.8rem; color: #aaa; margin: 10px 0; background: rgba(0,0,0,0.03); padding: 4px 10px; border-radius: 20px; align-self: center; }
.chat-input-area { display: flex; gap: 10px; padding-top: 15px; background: white; }
.send-btn { width: 48px; height: 48px; border-radius: 50%; padding: 0; flex-shrink: 0; }
.modal-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(2px); display: flex; justify-content: center; align-items: center; z-index: 100; }
.modal-overlay.hidden { display: none; }
.modal { background: white; padding: 25px; border-radius: 20px; width: 90%; max-width: 320px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.tab-menu { display: flex; margin-bottom: 25px; border-bottom: 2px solid #eee; }
.tab-button { flex: 1; padding: 12px 0; background: none; border: none; font-size: 1rem; font-weight: 600; color: #999; cursor: pointer; position: relative; }
.tab-button.active { color: var(--primary-color); }
.tab-button.active::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 100%; height: 2px; background-color: var(--primary-color); }
.auth-form { display: none; }
.auth-form.active { display: block; animation: slideIn 0.2s ease-out; }
@keyframes slideIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }
.auth-footer { margin-top: 20px; text-align: center; }
.auth-footer a { color: #757575; font-size: 0.9rem; text-decoration: none; padding: 10px; }
.password-input-wrapper { position: relative; width: 100%; }
.password-input-wrapper input { padding-right: 50px; }
.password-toggle { position: absolute; right: 0; top: 0; height: 100%; width: 50px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #999; background: none; border: none; }
.error-text { display: none; font-size: 0.8rem; color: var(--error-color); margin-top: 5px; }
.error-text.active { display: block; }
.toast-container { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; z-index: 1000; width: 90%; max-width: 350px; pointer-events: none; }
.toast { padding: 14px 20px; border-radius: 50px; color: white; font-size: 0.95rem; box-shadow: 0 10px 20px rgba(0,0,0,0.15); text-align: center; display: flex; justify-content: center; align-items: center; background: rgba(51, 51, 51, 0.95); backdrop-filter: blur(4px); }
.toast.error { background-color: rgba(211, 47, 47, 0.95); }
.toast.success { background-color: rgba(56, 142, 60, 0.95); }

/* PIPA: Consent Styles */
.consent-container { margin: 20px 0; border: 1px solid #eee; border-radius: 12px; padding: 15px; background: #fafafa; }
.consent-item { display: flex; align-items: center; margin-bottom: 10px; font-size: 0.9rem; color: var(--text-color); cursor: pointer; }
.consent-item:last-child { margin-bottom: 0; }
.consent-item input { width: 18px; height: 18px; margin-right: 10px; accent-color: var(--primary-color); }