/* NeoDunggeunmo Pro */
@font-face {
    font-family: 'NeoDunggeunmo Pro';
    font-weight: normal;
    font-style: normal;
    font-display: block;
    src: url('https://cdn.jsdelivr.net/gh/neodgm/neodgm-pro-webfont@latest/neodgm_pro/neodgm_pro.woff2') format('woff2'),
         url('https://cdn.jsdelivr.net/gh/neodgm/neodgm-pro-webfont@latest/neodgm_pro/neodgm_pro.woff') format('woff'),
         url('https://cdn.jsdelivr.net/gh/neodgm/neodgm-pro-webfont@latest/neodgm_pro/neodgm_pro.ttf') format('truetype');
}

/* RIDIBatang */
@font-face {
    font-family: 'RIDIBatang';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_twelve@1.0/RIDIBatang.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

/* IyagiGGC */
@font-face {
    font-family: 'IyagiGGC';
    src: url('https://cdn.jsdelivr.net/gh/JuwanPark/IyagiGGC@latest/IyagiGGC.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
}

/* 설정 화면 */
.setup-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: var(--bg-primary);
}

.setup-box {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 40px;
    max-width: 900px;
    width: 100%;
    box-shadow: var(--surface-shadow);
}

/* 가이드 섹션 */
.guide-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.guide-section h2 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.guide-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.guide-row.vertical {
    flex-direction: column;
}

.guide-item {
    flex: 1;
    text-align: center;
    position: relative;
}

.guide-item img {
    max-height: 180px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.guide-item img:hover {
    transform: scale(2.5);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    z-index: 100;
    position: relative;
}

.guide-item.wide img {
    max-height: none;
    max-width: 100%;
    height: auto;
}

.guide-item.wide img:hover {
    transform: scale(1.5);
}

.guide-item .caption {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.guide-item .step-num {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--button-primary);
    color: var(--selected-text);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.setup-box h1 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.setup-box .subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.setup-step {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.setup-step.completed {
    background: var(--bg-tertiary);
    border-left: 3px solid #43a047;
}

.setup-step.processing {
    background: var(--bg-tertiary);
    border-left: 3px solid #ff9800;
}

.setup-step.error {
    background: #ffebee;
}

.setup-step label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    margin-bottom: 8px;
}

.setup-step .icon {
    font-size: 20px;
}

/* .setup-step  */
.hint {
    padding-left: 1.25rem;
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 12px;
}

.hint li {
    margin-bottom: 4px;
    overflow-wrap: anywhere;
    word-break: keep-all;
}

/* Android 사용 팁 스타일 */
.guide-step {
    background: var(--bg-tertiary);
    border-left: 4px solid var(--button-primary);
    padding: 16px;
    padding-left: 24px;
    margin: 16px 0;
    border-radius: 4px;
}

.guide-step h3 {
    margin-top: 0;
    color: var(--text-primary);
}

.guide-step ol {
    padding-left: 20px;
    margin: 8px 0;
}

.guide-step code {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.guide-step .note {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 12px;
}

.setup-step input[type="file"] {
    display: none;
}

.file-btn-group {
    display: flex;
    gap: 12px;
}

.file-btn-group .file-btn {
    flex: 1;
}

.file-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--button-primary);
    color: var(--selected-text);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    text-align: center;
}

.file-btn:hover {
    background: var(--button-hover);
}

.file-btn.selected {
    background: #43a047;
}

.file-btn.disabled {
    opacity: 0.55;
    pointer-events: none;
}

.file-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.drop-zone {
    border: 2px dashed var(--border-color, #d0d0d0);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
}

.drop-zone.drag-over {
    border-color: var(--button-primary);
    background: rgba(74, 144, 217, 0.08);
}

.drop-zone.disabled {
    opacity: 0.65;
}

.drop-message {
    color: var(--text-secondary, #888);
    font-size: 13px;
    margin-bottom: 10px;
}

.capability-warning {
    display: none;
    margin: 12px 0 16px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 152, 0, 0.35);
    border-radius: 8px;
    background: rgba(255, 193, 7, 0.12);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.6;
    text-align: left;
}

.capability-warning.active {
    display: block;
}

.drop-or {
    font-size: 12px;
    color: var(--text-secondary, #aaa);
    margin-bottom: 10px;
}

.file-name {
    margin-top: 8px;
    font-size: 13px;
    color: #43a047;
}

.file-name.error {
    color: #d32f2f;
}

/* 프로그레스바 */
.progress-container {
    margin-top: 12px;
    display: none;
}

.progress-container.active {
    display: block;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--button-primary), #43a047);
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.start-btn {
    width: 100%;
    padding: 14px;
    background: var(--button-primary);
    color: var(--selected-text);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.start-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.start-btn:not(:disabled):hover {
    background: var(--button-hover);
}

:root {
    --marker-width: 24px;
    --sidebar-transition-duration: 0.25s;
    --name-column-width: 120px;
    --message-gap: 12px;

    /* 테마 색상 변수 */
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8f9fa;
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --border-color: #e0e0e0;
    --border-light: #ccc;
    --button-primary: #4a90d9;
    --button-hover: #3a7bc8;
    --leader-bg: #fff8e1;
    --leader-border: #ffd54f;
    --leader-text: #8b6914;
    --chat-bg: #e5ddd5;
    --scroll-marker-bg: #f0f0f0;
    --chat-header-bg: #075e54;
    --chat-header-text: #fff;
    --message-name: #075e54;
    --link-color: #039be5;
    --calendar-hover: #f0f0f0;
    --calendar-empty: #ccc;
    --selected-text: #fff;
    --bubble-shadow: 0 1px 1px rgba(0,0,0,0.1);
    --surface-shadow: 0 4px 20px rgba(0,0,0,0.1);
    --modal-shadow: 0 8px 32px rgba(0,0,0,0.3);

    /* 폰트 변수 */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Malgun Gothic", sans-serif;
}

/* 다크 테마 */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3d3d3d;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    --border-color: #404040;
    --border-light: #505050;
    --leader-bg: #3d3520;
    --leader-border: #8b7355;
    --leader-text: #ffd54f;
    --chat-bg: #0d0d0d;
    --scroll-marker-bg: #1a1a1a;
    --calendar-hover: #3d3d3d;
    --calendar-empty: #707070;
}

/* 1995 테마 */
[data-theme="1995"] {
    --bg-primary: #06162d;
    --bg-secondary: #06162d;
    --bg-tertiary: #0a2140;
    --text-primary: #f4f7ff;
    --text-secondary: #c7d8f2;
    --text-muted: #92a9c8;
    --border-color: #3a5f8f;
    --border-light: #6f8fb8;
    --button-primary: #62d6ff;
    --button-hover: #9ce7ff;
    --leader-bg: #162d47;
    --leader-border: #ffd400;
    --leader-text: #ffd400;
    --chat-bg: #071a33;
    --scroll-marker-bg: #041126;
    --chat-header-bg: #031026;
    --chat-header-text: #f4f7ff;
    --message-name: #9ce7ff;
    --link-color: #8be9ff;
    --calendar-hover: #153c6b;
    --calendar-empty: #6f87aa;
    --selected-text: #031026;
    --bubble-shadow: none;
    --surface-shadow: none;
    --modal-shadow: none;
    color-scheme: dark;
}

/* 폰트 클래스 */
[data-font="ridi"] { --font-family: "RIDIBatang", serif; }
[data-font="neodgm"] { --font-family: "NeoDunggeunmo Pro", sans-serif; }
[data-font="iyagi"] { --font-family: "IyagiGGC", "NeoDunggeunmo Pro", ui-monospace, monospace; }

[data-theme="1995"] body {
    background: var(--bg-primary);
}

[data-theme="1995"] .setup-screen {
    background: #008080;
}

[data-theme="1995"] .setup-box,
[data-theme="1995"] .modal-box,
[data-theme="1995"] .diagnostic-toast {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

[data-theme="1995"] .setup-step,
[data-theme="1995"] .drop-zone,
[data-theme="1995"] .file-btn,
[data-theme="1995"] .start-btn,
[data-theme="1995"] .header-btn,
[data-theme="1995"] .capture-btn,
[data-theme="1995"] .leader-filter-panel,
[data-theme="1995"] .leader-filter-controls input,
[data-theme="1995"] .leader-filter-controls button,
[data-theme="1995"] .link-item,
[data-theme="1995"] .message-bubble,
[data-theme="1995"] .attachment .file-link,
[data-theme="1995"] .footer-link-btn,
[data-theme="1995"] .theme-btn,
[data-theme="1995"] .font-btn,
[data-theme="1995"] .cache-clear-btn,
[data-theme="1995"] .report-action-btn,
[data-theme="1995"] .capture-controls label,
[data-theme="1995"] .capture-filter-option,
[data-theme="1995"] .diagnostic-report-text,
[data-theme="1995"] .diagnostic-toast-actions button {
    border-radius: 0;
}

[data-theme="1995"] .guide-item img {
    border: 1px solid var(--border-color);
    border-radius: 3px;
}

[data-theme="1995"] .setup-box,
[data-theme="1995"] .sidebar,
[data-theme="1995"] .link-sidebar,
[data-theme="1995"] .chat-area,
[data-theme="1995"] .modal-box {
    background: var(--bg-primary);
}

[data-theme="1995"] .sidebar-header,
[data-theme="1995"] .link-sidebar-header {
    border: 0;
    border-bottom: 1px solid var(--win31-shadow);
    box-shadow: 0 1px 0 var(--win31-light);
}

[data-theme="1995"] .calendar,
[data-theme="1995"] .search-box,
[data-theme="1995"] .link-group {
    border: 0;
}

[data-theme="1995"] .search-box,
[data-theme="1995"] .calendar {
    border-bottom: 1px solid var(--win31-shadow);
    box-shadow: 0 1px 0 var(--win31-light);
}

[data-theme="1995"] .sidebar-header h2::before,
[data-theme="1995"] .link-sidebar-header h2::before,
[data-theme="1995"] .guide-section h2::before,
[data-theme="1995"] #settingsModalTitle::before,
[data-theme="1995"] #captureModalTitle::before,
[data-theme="1995"] #reportIssueModalTitle::before {
    content: ":: ";
    color: var(--button-primary);
}

[data-theme="1995"] .setup-step,
[data-theme="1995"] .leader-filter-panel,
[data-theme="1995"] .link-item,
[data-theme="1995"] .footer-link-btn,
[data-theme="1995"] .header-btn,
[data-theme="1995"] .capture-btn,
[data-theme="1995"] .leader-filter-controls input,
[data-theme="1995"] .leader-filter-controls button,
[data-theme="1995"] .search-box input,
[data-theme="1995"] .report-action-btn,
[data-theme="1995"] .capture-controls label,
[data-theme="1995"] .capture-filter-option,
[data-theme="1995"] .diagnostic-toast-actions button {
    border: 0;
    background: transparent;
    box-shadow: none;
}

[data-theme="1995"] .setup-step {
    padding: 12px 0;
}

[data-theme="1995"] .setup-step label::before,
[data-theme="1995"] .link-item::before,
[data-theme="1995"] .footer-link-btn::before,
[data-theme="1995"] .capture-btn::before,
[data-theme="1995"] .report-action-btn::before,
[data-theme="1995"] .diagnostic-toast-actions button::before {
    content: "> ";
    color: var(--button-primary);
}

[data-theme="1995"] .search-box input,
[data-theme="1995"] .leader-filter-controls input,
[data-theme="1995"] .diagnostic-report-text {
    color: var(--text-primary);
    caret-color: var(--button-primary);
    border-bottom: 1px solid var(--win31-shadow);
}

[data-theme="1995"] .search-box input::placeholder {
    color: var(--text-muted);
}

[data-theme="1995"] .calendar-grid .day,
[data-theme="1995"] .date-item,
[data-theme="1995"] .link-item,
[data-theme="1995"] .header-btn,
[data-theme="1995"] .capture-btn,
[data-theme="1995"] .footer-link-btn,
[data-theme="1995"] .leader-filter-controls button,
[data-theme="1995"] .report-action-btn,
[data-theme="1995"] .capture-controls label,
[data-theme="1995"] .capture-filter-option,
[data-theme="1995"] .diagnostic-toast-actions button {
    color: var(--text-primary);
}

[data-theme="1995"] .calendar-grid .day.selected,
[data-theme="1995"] .date-item.selected {
    background: rgba(98, 214, 255, 0.08);
    color: var(--leader-text);
}

[data-theme="1995"] .calendar-grid .day.has-messages::after {
    content: "";
    width: 4px;
    height: 4px;
    bottom: 2px;
    background: var(--button-primary);
}

[data-theme="1995"] .link-item:hover,
[data-theme="1995"] .date-item:hover,
[data-theme="1995"] .calendar-grid .day:hover,
[data-theme="1995"] .header-btn:hover,
[data-theme="1995"] .leader-filter-controls button:hover,
[data-theme="1995"] .footer-link-btn:hover,
[data-theme="1995"] .report-action-btn:hover {
    background: transparent;
    color: var(--button-hover);
    text-decoration: underline;
}

[data-theme="1995"] .chat-header {
    background: var(--bg-primary);
    border-bottom: 1px solid #14253c;
    text-shadow: 0 0 5px rgba(156, 231, 255, 0.35);
}

[data-theme="1995"] .chat-header h3::before {
    content: "DATE ";
    color: var(--button-primary);
}

[data-theme="1995"] .chat-header .info::before {
    content: "[";
    color: var(--button-primary);
}

[data-theme="1995"] .chat-header .info::after {
    content: "]";
    color: var(--button-primary);
}

[data-theme="1995"] .scroll-markers {
    background: var(--bg-primary);
    border-right: 1px solid #14253c;
}

[data-theme="1995"] .scroll-marker {
    width: calc(100% - 10px);
    height: 2px;
    background: var(--leader-border);
    border-radius: 0;
    box-shadow: none;
}

[data-theme="1995"] .message-bubble {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

[data-theme="1995"] .message {
    margin-bottom: 10px;
}

[data-theme="1995"] .message .user-name {
    padding-top: 0;
    font-weight: 400;
}

[data-theme="1995"] .message .user-name::before {
    content: "[";
    color: var(--text-secondary);
}

[data-theme="1995"] .message .user-name::after {
    content: "] >";
    color: var(--button-primary);
}

[data-theme="1995"] .message .time {
    display: inline-block;
    color: var(--text-muted);
    text-align: left;
}

[data-theme="1995"] .message .time::before {
    content: "@ ";
}

[data-theme="1995"] .message .content {
    line-height: 1.55;
}

[data-theme="1995"] .message.leader .user-name,
[data-theme="1995"] .message.leader .time,
[data-theme="1995"] .message.leader .content,
[data-theme="1995"] .message.leader .content a,
[data-theme="1995"] .message.leader .content::before {
    color: var(--leader-text);
}

[data-theme="1995"] .message.leader .message-bubble {
    background: transparent;
    border: 0;
    color: #fff6bf;
    text-shadow: none;
    box-shadow: none;
}

[data-theme="1995"] .message.leader .content::before {
    content: "* ";
    color: var(--leader-border);
}

[data-theme="1995"] .drop-zone.drag-over {
    background: rgba(98, 214, 255, 0.12);
}

[data-theme="1995"] .report-action-btn.primary {
    background: transparent;
    border: 0;
    color: var(--leader-text);
}

/* 메인 앱 */
.app {
    display: none;
    height: 100vh;
}

.app.active {
    display: flex;
}

/* 사이드바 */
.sidebar {
    width: 320px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.sidebar-header h2 {
    font-size: 18px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-header .stats {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.leader-filter-panel {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid var(--leader-border);
    border-radius: 8px;
    background: var(--leader-bg);
}

.leader-filter-panel[hidden] {
    display: none;
}

.leader-filter-panel label {
    display: block;
    margin-bottom: 6px;
    color: var(--leader-text);
    font-size: 12px;
    font-weight: 700;
}

.leader-filter-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
    align-items: center;
}

.leader-filter-controls input {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 7px 9px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font: inherit;
    font-size: 13px;
}

.leader-filter-controls input:focus {
    outline: 2px solid var(--button-primary);
    outline-offset: 1px;
}

.leader-filter-controls button {
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    white-space: nowrap;
}

.leader-filter-controls button:hover {
    background: var(--border-color);
}

/* 캘린더 */
.calendar {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.calendar-nav button {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.calendar-nav button:hover {
    background: var(--calendar-hover);
}

.calendar-nav .month-year {
    font-weight: 500;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.calendar-grid .weekday {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 4px;
}

.calendar-grid .day {
    padding: 8px 4px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

.calendar-grid .day:hover {
    background: var(--calendar-hover);
}

.calendar-grid .day.other-month {
    color: var(--calendar-empty);
}

.calendar-grid .day.has-messages {
    font-weight: 500;
}

.calendar-grid .day.has-messages::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--button-primary);
    border-radius: 50%;
}

.calendar-grid .day.selected {
    background: var(--button-primary);
    color: var(--selected-text);
}

.calendar-grid .day.selected::after {
    background: var(--bg-secondary);
}

/* 날짜 목록 */
.date-list {
    flex: 1;
    overflow-y: auto;
}

.date-item {
    padding: 12px 16px;
    border-bottom: 1px solid transparent;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.date-item:hover {
    background: var(--bg-tertiary);
}

.date-item.selected {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--button-primary);
}

.date-item .date {
    font-weight: 500;
}

.date-item .count {
    font-size: 13px;
    color: var(--text-secondary);
}

.date-item .leader-ratio {
    font-size: 12px;
    color: #b8860b;
    margin-right: 6px;
}

/* 대화 영역 */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--chat-bg);
    position: relative;
    min-width: 0;
}

/* 링크 사이드바 */
.link-sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.link-sidebar-header {
    padding: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.link-sidebar-header h2 {
    margin: 0;
    font-size: 18px;
}

.link-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
}

.link-group {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.link-group:first-child {
    padding-top: 0;
}

.link-group:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.link-group-header {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.link-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.link-item {
    display: block;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.4;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.link-button {
    width: 100%;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.link-item:hover {
    border-color: var(--button-primary);
    background: var(--bg-secondary);
    color: var(--button-primary);
}

/* 스크롤 마커 트랙 */
.scroll-markers {
    width: var(--marker-width);
    background: var(--scroll-marker-bg);
    border-right: 1px solid var(--border-color);
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    box-sizing: border-box;
}

.scroll-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 8px);
    height: 4px;
    background: #ffd700;
    border-radius: 2px;
    box-shadow: 0 0 2px rgba(0,0,0,0.3);
    cursor: pointer;
}

.scroll-marker:hover {
    background: #ffb347;
    height: 6px;
    margin-top: -1px;
}

.chat-header {
    padding: 16px 20px;
    padding-left: calc(20px + var(--marker-width));
    background: var(--chat-header-bg);
    color: var(--chat-header-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.chat-header-title {
    min-width: 0;
}

.chat-header h3 {
    font-size: 16px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.chat-header .info {
    font-size: 13px;
    opacity: 0.8;
    overflow-wrap: anywhere;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.capture-btn {
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--chat-header-text);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.capture-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.58);
}

.capture-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sidebar-toggle,
.link-sidebar-toggle {
    display: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: left var(--sidebar-transition-duration) ease,
        box-shadow var(--sidebar-transition-duration) ease,
        border-radius var(--sidebar-transition-duration) ease;
    z-index: 950;
}

.sidebar-toggle:active,
.link-sidebar-toggle:active {
    transform: none;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 60px 16px calc(16px + var(--marker-width));
}

.message {
    display: flex;
    align-items: flex-start;
    gap: var(--message-gap);
    margin-bottom: 8px;
    width: 100%;
}

.message .user-name {
    flex-shrink: 0;
    width: var(--name-column-width);
    font-size: 13px;
    font-weight: 600;
    color: var(--message-name);
    text-align: left;
    padding-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-bubble {
    flex: 0 1 auto;
    width: min(95%, calc(100% - var(--name-column-width) - var(--message-gap)));
    max-width: min(95%, calc(100% - var(--name-column-width) - var(--message-gap)));
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--bg-secondary);
    box-shadow: var(--bubble-shadow);
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    box-sizing: border-box;
    align-self: flex-start;
}

.message .time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: right;
}

.message .content {
    white-space: pre-wrap;
    font-size: 14px;
}

.message .content a {
    color: var(--link-color);
}

.mobile-only {
    display: none;
}

/* 필터 대상 사용자 메시지 */
.message.leader .user-name {
    color: #5c4a00;
}

.message.leader .message-bubble {
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
    border: 1px solid #daa520;
    color: #3d3200;
    text-shadow: 1px 1px 0 rgba(255,215,0,0.3);
}

.message.leader .time {
    color: #5c4a00;
}

/* 첨부파일 */
.attachment {
    margin-top: 8px;
}

.attachment img {
    max-width: 300px;
    max-height: 300px;
    border-radius: 4px;
    cursor: pointer;
}

.attachment .file-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f0f0f0;
    border-radius: 4px;
    color: var(--text-primary);
    text-decoration: none;
}

/* iOS Firefox(WebKit)에서 3D border 방향이 반대로 렌더링되는 현상 완화 */
[data-theme="1995"][data-ios-firefox="true"] .setup-step,
[data-theme="1995"][data-ios-firefox="true"] .leader-filter-panel,
[data-theme="1995"][data-ios-firefox="true"] .link-item,
[data-theme="1995"][data-ios-firefox="true"] .footer-link-btn,
[data-theme="1995"][data-ios-firefox="true"] .header-btn,
[data-theme="1995"][data-ios-firefox="true"] .capture-btn,
[data-theme="1995"][data-ios-firefox="true"] .leader-filter-controls button,
[data-theme="1995"][data-ios-firefox="true"] .report-action-btn,
[data-theme="1995"][data-ios-firefox="true"] .capture-controls label,
[data-theme="1995"][data-ios-firefox="true"] .capture-filter-option,
[data-theme="1995"][data-ios-firefox="true"] .diagnostic-toast-actions button,
[data-theme="1995"][data-ios-firefox="true"] .theme-btn,
[data-theme="1995"][data-ios-firefox="true"] .font-btn,
[data-theme="1995"][data-ios-firefox="true"] .cache-clear-btn,
[data-theme="1995"][data-ios-firefox="true"] .file-btn,
[data-theme="1995"][data-ios-firefox="true"] .start-btn,
[data-theme="1995"][data-ios-firefox="true"] .missing-attachment-help summary {
    border-color: var(--win31-dark) var(--win31-light) var(--win31-light) var(--win31-dark);
}

.attachment .file-link:hover {
    background: var(--border-color);
}

.attachment .emoticon {
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
}

.attachment .no-file {
    font-size: 13px;
    color: var(--text-muted);
}

.attachment.missing-attachment {
    position: relative;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    max-width: min(420px, 100%);
}

.missing-attachment-tooltip {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    z-index: 20;
    width: min(340px, 76vw);
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    font-size: 12px;
    line-height: 1.5;
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.15s, transform 0.15s;
}

@media (hover: hover) and (pointer: fine) {
    .attachment.missing-attachment:hover .missing-attachment-tooltip,
    .attachment.missing-attachment:focus-within .missing-attachment-tooltip {
        opacity: 1;
        transform: translateY(0);
    }
}

.missing-attachment-help {
    display: inline-block;
}

.missing-attachment-help[open] {
    flex-basis: 100%;
}

.missing-attachment-help summary {
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    line-height: 1.2;
    list-style: none;
}

.missing-attachment-help summary::-webkit-details-marker {
    display: none;
}

.missing-attachment-help summary:hover,
.missing-attachment-help summary:focus-visible {
    border-color: var(--button-primary);
    color: var(--button-primary);
    outline: none;
}

.missing-attachment-help p {
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

.attachment .loading-placeholder {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 20px;
    text-align: center;
    background: var(--bg-tertiary);
    border-radius: 8px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* 이미지 모달 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal img {
    max-width: 90%;
    max-height: 90%;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    color: white;
    background: transparent;
    border: 0;
    line-height: 1;
    cursor: pointer;
}

/* 검색 */
.search-box {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.search-box input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.search-box input:focus {
    outline: none;
    border-color: #4a90d9;
}

/* 빈 상태 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 800;
    pointer-events: none;
}

/* 제보 버튼 그룹 */
.setup-footer-btns {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.footer-link-btn {
    flex: 1;
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    font-family: inherit;
    transition: background 0.2s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.footer-link-btn:hover {
    background: var(--bg-secondary);
}

/* 헤더 버튼 공통 */
.header-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.header-btn:hover {
    background: var(--border-color);
}

.header-btns {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* 사용자 필터 버튼 활성화 */
#leaderFilterBtn.active {
    background: #ffd54f;
    border-color: #ffb300;
}

/* 공통 모달 */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 20px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--modal-shadow);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px 8px;
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

/* 오류 보고 */
.report-modal-box {
    width: min(720px, 92vw);
    font-family: var(--font-family);
}

.report-help {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 14px;
}

.report-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.report-action-btn {
    min-height: 38px;
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
}

.report-action-btn.primary {
    background: var(--button-primary);
    border-color: var(--button-primary);
    color: #fff;
}

.report-action-btn:hover {
    border-color: var(--button-primary);
}

.diagnostic-report-text {
    width: 100%;
    min-height: 280px;
    resize: vertical;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre;
}

.report-status {
    min-height: 20px;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 12px;
}

.capture-modal-box {
    width: min(780px, 94vw);
    font-family: var(--font-family);
}

.capture-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.capture-controls label,
.capture-filter-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 13px;
}

.capture-filter-option {
    margin-bottom: 12px;
}

.capture-controls input,
.capture-filter-option input {
    accent-color: var(--button-primary);
}

.capture-output-text {
    min-height: 340px;
}

.diagnostic-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: min(560px, calc(100vw - 36px));
    padding: 14px;
    border: 1px solid var(--border-color);
    border-left: 4px solid #d32f2f;
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 8px 28px rgba(0,0,0,0.22);
}

.diagnostic-toast[hidden] {
    display: none;
}

.diagnostic-toast-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
}

.diagnostic-toast-copy span {
    color: var(--text-secondary);
}

.diagnostic-toast-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.diagnostic-toast-actions button {
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
}

.diagnostic-toast-actions button:hover {
    border-color: var(--button-primary);
    color: var(--button-primary);
}

/* 설정 모달 */
#settingsModal .modal-box {
    width: min(360px, 92vw);
    font-family: var(--font-family);
}

.settings-group {
    margin-top: 16px;
}

.settings-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.settings-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
}

.theme-btn, .font-btn {
    position: relative;
    overflow: hidden;
    min-height: 42px;
    padding: 10px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 12px;
    line-height: 1.25;
    white-space: normal;
    transition: all 0.2s;
}

.theme-btn:hover, .font-btn:hover {
    border-color: var(--button-primary);
}

.theme-btn.active, .font-btn.active {
    border-color: var(--button-primary);
    box-shadow: inset 0 0 0 1px var(--button-primary), 0 0 0 2px rgba(74, 144, 217, 0.2);
}

.theme-btn.active::after,
.font-btn.active::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 5px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--button-primary);
    color: var(--selected-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 10px;
    line-height: 15px;
    text-align: center;
    text-shadow: none;
}

.theme-btn[data-theme="light"] {
    border-color: #d9dee7;
    background: #ffffff;
    color: #333333;
    font-family: "RIDIBatang", serif;
}

.theme-btn[data-theme="dark"] {
    border-color: #505050;
    background: #2d2d2d;
    color: #e0e0e0;
    font-family: "NeoDunggeunmo Pro", sans-serif;
}

.theme-btn[data-theme="1995"] {
    border-color: #62d6ff;
    background: #0a2140;
    color: #f4f7ff;
    font-family: "IyagiGGC", "NeoDunggeunmo Pro", ui-monospace, monospace;
    text-shadow: 0 0 4px rgba(156, 231, 255, 0.45);
}

.theme-btn[data-theme="system"] {
    border-color: #8a94a3;
    background: linear-gradient(135deg, #ffffff 0%, #ffffff 48%, #2d2d2d 52%, #2d2d2d 100%);
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Malgun Gothic", sans-serif;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.settings-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cache-clear-btn {
    flex: 0 0 auto;
    padding: 9px 12px;
    border: 1px solid rgba(220, 53, 69, 0.4);
    border-radius: 6px;
    background: rgba(220, 53, 69, 0.1);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 12px;
}

.cache-clear-btn:hover {
    border-color: #dc3545;
}

.cache-clear-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.settings-status {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 각 폰트 버튼은 자기 자신의 폰트로 표시 */
.font-btn[data-font="default"] {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Malgun Gothic", sans-serif;
}

.font-btn[data-font="ridi"] {
    font-family: "RIDIBatang", serif;
}

.font-btn[data-font="neodgm"] {
    font-family: "NeoDunggeunmo Pro", sans-serif;
}

.font-btn[data-font="iyagi"] {
    font-family: "IyagiGGC", "NeoDunggeunmo Pro", ui-monospace, monospace;
}

@media (max-width: 900px) {
    :root {
        --marker-width: 18px;
    }

    .setup-box {
        padding: 24px;
    }

    .guide-row {
        flex-direction: row;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        gap: 16px;
    }

    .guide-row.vertical {
        flex-direction: column;
        overflow: visible;
        scroll-snap-type: none;
    }

    .guide-item {
        flex: 0 0 auto;
        scroll-snap-align: center;
    }

    .guide-item img {
        width: auto;
        max-width: 80vw;
        max-height: 340px;
        object-fit: contain;
    }

    .guide-item img:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }

    .app {
        position: relative;
        overflow-x: hidden;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(86vw, 320px);
        transform: translateX(-100%);
        transition: transform var(--sidebar-transition-duration) ease;
        z-index: 900;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .link-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(86vw, 320px);
        transform: translateX(100%);
        transition: transform var(--sidebar-transition-duration) ease;
        z-index: 900;
    }

    .link-sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
        pointer-events: auto;
    }

    .scroll-markers {
        display: block;
        width: var(--marker-width);
        background: var(--scroll-marker-bg);
        border-right: 1px solid var(--border-color);
        border-left: none;
        z-index: 100;
    }

    .chat-header {
        position: relative;
        padding: 12px 14px;
        padding-left: calc(52px + var(--marker-width));
    }

    .chat-header-actions {
        padding-right: 38px;
    }

    .capture-btn {
        min-height: 32px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .sidebar-toggle,
    .link-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 50%;
        padding: 10px 12px;
        box-shadow: none;
        z-index: 1001;
    }

    .sidebar-toggle {
        left: 0;
        transform: translateY(-50%);
        border-radius: 0 10px 10px 0;
    }

    .link-sidebar-toggle {
        right: 0;
        transform: translateY(-50%);
        border-radius: 10px 0 0 10px;
    }

    .sidebar-toggle:active,
    .link-sidebar-toggle:active {
        transform: translateY(-50%);
    }

    .app.sidebar-open .sidebar-toggle {
        left: calc(min(86vw, 320px) - 1px);
        border-radius: 0 10px 10px 0;
        box-shadow: none;
    }

    .app.link-sidebar-open .link-sidebar-toggle {
        right: calc(min(86vw, 320px) - 1px);
        border-radius: 10px 0 0 10px;
        box-shadow: none;
    }

    .chat-messages {
        padding: 12px 14px 12px calc(14px + var(--marker-width));
    }

    .message {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        width: 100%;
    }

    .message .user-name.desktop-only {
        display: none;
    }

    .message-bubble {
        width: 95%;
        max-width: 95%;
        margin-right: 0;
        align-self: flex-start;
    }

    .message-bubble .user-name.mobile-only {
        display: block;
        font-size: 12px;
        font-weight: 600;
        color: #075e54;
        margin-bottom: 4px;
    }

    .message.leader .message-bubble .user-name.mobile-only {
        color: #8b6914;
    }

    .attachment img {
        max-width: 100%;
        height: auto;
    }

    .setup-step {
        padding: 12px;
    }

    .file-btn {
        width: 100%;
        text-align: center;
    }

    .start-btn {
        font-size: 15px;
    }

    /* 모바일 모달 */
    .modal-box {
        width: 90vw !important;
    }

    .diagnostic-toast {
        right: 12px;
        bottom: 12px;
        left: 12px;
        max-width: none;
        align-items: stretch;
        flex-direction: column;
    }

    .diagnostic-toast-actions {
        width: 100%;
    }

    .diagnostic-toast-actions button {
        flex: 1;
    }
}

@media (max-width: 900px) {
    [data-theme="1995"] .message-bubble .user-name.mobile-only {
        color: var(--message-name);
        font-weight: 400;
    }

    [data-theme="1995"] .message.leader .message-bubble .user-name.mobile-only {
        color: var(--leader-text);
    }

[data-theme="1995"] .message-bubble {
    width: 100%;
    max-width: 100%;
    }
}

/* 1995 테마의 주변 컨트롤은 Windows 3.1 박스 느낌으로 표시 */
[data-theme="1995"] {
    --win31-face: #c0c0c0;
    --win31-light: #ffffff;
    --win31-shadow: #808080;
    --win31-dark: #000000;
    --win31-title: #000080;
    --win31-title-text: #ffffff;
    --win31-text: #000000;
    --name-column-width: 150px;
}

[data-theme="1995"] .setup-box,
[data-theme="1995"] .modal-box,
[data-theme="1995"] .diagnostic-toast {
    background: var(--win31-face);
    color: var(--win31-text);
    border: 2px solid;
    border-color: var(--win31-light) var(--win31-dark) var(--win31-dark) var(--win31-light);
    border-radius: 0;
    box-shadow: 1px 1px 0 var(--win31-shadow);
    font-family: var(--font-family);
    text-shadow: none;
}

[data-theme="1995"] .sidebar,
[data-theme="1995"] .link-sidebar {
    background: var(--win31-face);
    color: var(--win31-text);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-family: var(--font-family);
    text-shadow: none;
}

[data-theme="1995"] .sidebar {
    border-right: 2px solid var(--win31-dark);
}

[data-theme="1995"] .link-sidebar {
    border-left: 2px solid var(--win31-light);
}

[data-theme="1995"] .setup-box *,
[data-theme="1995"] .sidebar *,
[data-theme="1995"] .link-sidebar *,
[data-theme="1995"] .modal-box *,
[data-theme="1995"] .diagnostic-toast * {
    color: inherit;
    text-shadow: none;
}

[data-theme="1995"] .chat-area,
[data-theme="1995"] .chat-area * {
    font-family: var(--font-family);
}

[data-theme="1995"] .chat-area {
    background: var(--chat-bg);
    color: var(--text-primary);
}

[data-theme="1995"] .sidebar-header-top,
[data-theme="1995"] .link-sidebar-header,
[data-theme="1995"] .modal-header {
    margin: 2px;
    padding: 4px 6px;
    background: var(--win31-title);
    color: var(--win31-title-text);
}

[data-theme="1995"] .sidebar-header-top h2,
[data-theme="1995"] .link-sidebar-header h2,
[data-theme="1995"] .modal-header h3 {
    color: var(--win31-title-text);
}

[data-theme="1995"] .sidebar-header h2::before,
[data-theme="1995"] .link-sidebar-header h2::before,
[data-theme="1995"] .guide-section h2::before,
[data-theme="1995"] #settingsModalTitle::before,
[data-theme="1995"] #captureModalTitle::before,
[data-theme="1995"] #reportIssueModalTitle::before,
[data-theme="1995"] .setup-step label::before,
[data-theme="1995"] .link-item::before,
[data-theme="1995"] .footer-link-btn::before,
[data-theme="1995"] .capture-btn::before,
[data-theme="1995"] .report-action-btn::before,
[data-theme="1995"] .diagnostic-toast-actions button::before {
    content: none;
}

[data-theme="1995"] .setup-step,
[data-theme="1995"] .leader-filter-panel,
[data-theme="1995"] .link-item,
[data-theme="1995"] .footer-link-btn,
[data-theme="1995"] .header-btn,
[data-theme="1995"] .capture-btn,
[data-theme="1995"] .leader-filter-controls button,
[data-theme="1995"] .report-action-btn,
[data-theme="1995"] .capture-controls label,
[data-theme="1995"] .capture-filter-option,
[data-theme="1995"] .diagnostic-toast-actions button,
[data-theme="1995"] .theme-btn,
[data-theme="1995"] .font-btn,
[data-theme="1995"] .cache-clear-btn,
[data-theme="1995"] .file-btn,
[data-theme="1995"] .start-btn,
[data-theme="1995"] .missing-attachment-help summary {
    background: var(--win31-face);
    color: var(--win31-text);
    border: 2px solid;
    border-color: var(--win31-light) var(--win31-dark) var(--win31-dark) var(--win31-light);
    border-radius: 0;
    box-shadow: none;
    text-decoration: none;
}

[data-theme="1995"] .setup-step {
    padding: 14px;
}

[data-theme="1995"] .guide-section {
    border: 0;
    border-bottom: 1px solid var(--win31-shadow);
    box-shadow: 0 1px 0 var(--win31-light);
}

[data-theme="1995"] .guide-item img {
    border: 2px solid;
    border-color: var(--win31-shadow) var(--win31-light) var(--win31-light) var(--win31-shadow);
    border-radius: 0;
    box-shadow: none;
}

[data-theme="1995"] .progress-bar {
    height: 16px;
    background: var(--win31-light);
    border: 2px solid;
    border-color: var(--win31-shadow) var(--win31-light) var(--win31-light) var(--win31-shadow);
    border-radius: 0;
}

[data-theme="1995"] .progress-bar .fill {
    background: #008080;
    box-shadow: none;
}

[data-theme="1995"] .drop-zone {
    background: var(--win31-face);
    color: var(--win31-text);
    border: 2px solid;
    border-color: var(--win31-shadow) var(--win31-light) var(--win31-light) var(--win31-shadow);
    border-radius: 0;
    box-shadow: none;
}

[data-theme="1995"] .drop-zone.drag-over {
    background: var(--win31-face);
    border-color: var(--win31-shadow) var(--win31-light) var(--win31-light) var(--win31-shadow);
}

[data-theme="1995"] .leader-filter-panel {
    background: var(--win31-face);
    border: 2px solid;
    border-color: var(--win31-shadow) var(--win31-light) var(--win31-light) var(--win31-shadow);
    border-radius: 0;
    box-shadow: none;
}

[data-theme="1995"] .leader-filter-panel label {
    color: var(--win31-text);
}

[data-theme="1995"] .leader-filter-controls input,
[data-theme="1995"] .search-box input,
[data-theme="1995"] .diagnostic-report-text {
    background: var(--win31-light);
    color: var(--win31-text);
    border: 2px solid;
    border-color: var(--win31-shadow) var(--win31-light) var(--win31-light) var(--win31-shadow);
    border-radius: 0;
    caret-color: var(--win31-text);
}

[data-theme="1995"] .leader-filter-controls input:focus {
    outline: 1px dotted var(--win31-dark);
    outline-offset: -5px;
    border-color: var(--win31-shadow) var(--win31-light) var(--win31-light) var(--win31-shadow);
}

[data-theme="1995"] .theme-btn[data-theme="1995"] {
    background: #0a2140;
    color: #f4f7ff;
    border-color: var(--win31-light) var(--win31-dark) var(--win31-dark) var(--win31-light);
    font-family: "IyagiGGC", "NeoDunggeunmo Pro", ui-monospace, monospace;
}

[data-theme="1995"] .theme-btn[data-theme="light"] {
    background: #ffffff;
    color: #333333;
    font-family: "RIDIBatang", serif;
}

[data-theme="1995"] .theme-btn[data-theme="dark"] {
    background: #2d2d2d;
    color: #e0e0e0;
    font-family: "NeoDunggeunmo Pro", sans-serif;
}

[data-theme="1995"] .theme-btn[data-theme="system"] {
    background: linear-gradient(135deg, #ffffff 0%, #ffffff 48%, #2d2d2d 52%, #2d2d2d 100%);
    color: #ffffff;
    font-family: "MS Sans Serif", Tahoma, "Segoe UI", sans-serif;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

[data-theme="1995"] .theme-btn.active,
[data-theme="1995"] .font-btn.active {
    border-color: var(--win31-dark) var(--win31-light) var(--win31-light) var(--win31-dark);
    box-shadow: none;
}

[data-theme="1995"] .theme-btn.active::after,
[data-theme="1995"] .font-btn.active::after {
    background: var(--win31-title);
    color: var(--win31-title-text);
}

[data-theme="1995"] .sidebar-toggle,
[data-theme="1995"] .link-sidebar-toggle {
    min-width: 36px;
    min-height: 38px;
    background: var(--win31-face);
    color: var(--win31-text);
    border: 2px solid;
    border-color: var(--win31-light) var(--win31-dark) var(--win31-dark) var(--win31-light);
    border-radius: 0;
    box-shadow: none;
    font-family: var(--font-family);
    line-height: 1;
    transition: none;
}

[data-theme="1995"] .sidebar-toggle:active,
[data-theme="1995"] .link-sidebar-toggle:active {
    border-color: var(--win31-dark) var(--win31-light) var(--win31-light) var(--win31-dark);
}

[data-theme="1995"] .app.sidebar-open .sidebar-toggle,
[data-theme="1995"] .app.link-sidebar-open .link-sidebar-toggle {
    border-radius: 0;
}

[data-theme="1995"] .date-item.selected,
[data-theme="1995"] .calendar-grid .day.selected {
    background: var(--win31-title);
    color: var(--win31-title-text);
}

[data-theme="1995"] .date-item.selected *,
[data-theme="1995"] .calendar-grid .day.selected * {
    color: var(--win31-title-text);
}

[data-theme="1995"] .calendar-grid .day:hover,
[data-theme="1995"] .date-item:hover,
[data-theme="1995"] .link-item:hover,
[data-theme="1995"] .header-btn:hover,
[data-theme="1995"] .capture-btn:hover,
[data-theme="1995"] .leader-filter-controls button:hover,
[data-theme="1995"] .footer-link-btn:hover,
[data-theme="1995"] .report-action-btn:hover,
[data-theme="1995"] .missing-attachment-help summary:hover,
[data-theme="1995"] .missing-attachment-help summary:focus-visible {
    background: var(--win31-title);
    color: var(--win31-title-text);
    text-decoration: none;
}

[data-theme="1995"] .chat-header {
    background: var(--bg-primary);
    color: var(--chat-header-text);
    border-bottom: 1px solid #14253c;
}

[data-theme="1995"] .chat-header h3,
[data-theme="1995"] .chat-header .info,
[data-theme="1995"] .message .content,
[data-theme="1995"] .message .time,
[data-theme="1995"] .message .user-name,
[data-theme="1995"] .message .content a {
    color: inherit;
}

[data-theme="1995"] .message .user-name {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: keep-all;
    line-height: 1.35;
}

[data-theme="1995"] .message .content {
    color: var(--text-primary);
}

[data-theme="1995"] .message .content a {
    color: var(--link-color);
}

[data-theme="1995"] .message .time {
    color: var(--text-muted);
}

[data-theme="1995"] .message .user-name {
    color: var(--message-name);
}

[data-theme="1995"] .message.leader .user-name,
[data-theme="1995"] .message.leader .time,
[data-theme="1995"] .message.leader .content,
[data-theme="1995"] .message.leader .content a,
[data-theme="1995"] .message.leader .content::before {
    color: var(--leader-text);
}

[data-theme="1995"] .modal-overlay,
[data-theme="1995"] .modal-box {
    transition: none;
}

[data-theme="1995"] .modal-overlay.win31-window-hidden .modal-box,
[data-theme="1995"] .modal-overlay.closing .modal-box {
    opacity: 0;
}

[data-theme="1995"] #imageModal.win31-window-hidden img,
[data-theme="1995"] #imageModal.win31-window-hidden .modal-close,
[data-theme="1995"] #imageModal.closing img,
[data-theme="1995"] #imageModal.closing .modal-close {
    opacity: 0;
}

@media (max-width: 900px) {
    [data-theme="1995"] .sidebar,
    [data-theme="1995"] .link-sidebar {
        transition: none;
        will-change: opacity;
    }

    [data-theme="1995"] .sidebar.panel-opening,
    [data-theme="1995"] .link-sidebar.panel-opening,
    [data-theme="1995"] .sidebar.panel-closing,
    [data-theme="1995"] .link-sidebar.panel-closing {
        opacity: 0;
    }

    [data-theme="1995"] .message-bubble .user-name.mobile-only {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: keep-all;
    }
}

[data-theme="1995"] .win31-ghost-box {
    position: fixed;
    inset: 0;
    z-index: 10050;
    pointer-events: none;
}

[data-theme="1995"] .win31-ghost-frame {
    position: fixed;
    left: var(--frame-left);
    top: var(--frame-top);
    width: var(--frame-width);
    height: var(--frame-height);
    box-sizing: border-box;
    background: transparent;
    border: 3px solid var(--win31-dark);
    outline: 0;
    box-shadow: 2px 2px 0 var(--win31-shadow);
    opacity: 0;
    animation: win31-ghost-frame-show 1ms steps(1, end) forwards;
    animation-delay: var(--frame-delay, 0ms);
}

@keyframes win31-ghost-frame-show {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.86;
    }
}

@media (prefers-reduced-motion: reduce) {
    [data-theme="1995"] .win31-ghost-box,
    [data-theme="1995"] .win31-ghost-frame {
        animation: none;
        display: none;
    }

    [data-theme="1995"] .modal-overlay.win31-window-hidden .modal-box,
    [data-theme="1995"] .modal-overlay.closing .modal-box,
    [data-theme="1995"] #imageModal.win31-window-hidden img,
    [data-theme="1995"] #imageModal.win31-window-hidden .modal-close,
    [data-theme="1995"] #imageModal.closing img,
    [data-theme="1995"] #imageModal.closing .modal-close,
    [data-theme="1995"] .sidebar.panel-opening,
    [data-theme="1995"] .link-sidebar.panel-opening,
    [data-theme="1995"] .sidebar.panel-closing,
    [data-theme="1995"] .link-sidebar.panel-closing {
        opacity: 1;
    }
}
