/* Warm paper, quiet blue accents, native Korean typography. */
:root {
  --primary: #2879b7; --primary-hover: #20689f; --primary-light: #edf5fb;
  --bg-main: #f7f7f5; --bg-surface: #ffffff;
  --border-color: #e4e5df; --border-focus: #389bf2;
  --text-primary: #353530; --text-secondary: #6c6d65; --text-muted: #77796f;
  --success: #3e753a; --success-bg: #f0f6ee;
  --warning: #806321; --warning-bg: #faf5e5;
  --danger: #b4453d; --danger-bg: #fcf0ed;
  --shadow-sm: 0 2px 8px rgba(53,53,48,.025);
  --shadow: 0 12px 40px rgba(53,53,48,.04);
  --shadow-lg: 0 20px 70px rgba(53,53,48,.14);
  --radius-sm: 12px; --radius-md: 18px; --radius-lg: 24px;
  --font: Roboto, "Noto Sans KR", "Noto Sans CJK KR", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.6; letter-spacing: -.025em; background: var(--bg-main); color: var(--text-primary); min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
:focus-visible { outline: 3px solid #389bf2; outline-offset: 3px; }
header { min-height: 76px; padding: 16px max(24px,calc((100vw - 1120px)/2)); display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--border-color); background: #fbfbf9; position: sticky; top: 0; z-index: 50; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 16px; letter-spacing: -.04em; color: var(--text-primary); text-decoration: none; }
.brand-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 11px; background: #edf2f5; color: #47738f; }
.brand-tag { font-size: 10px; line-height: 17px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: #f4efdf; color: #806d3c; }
.container { width: 100%; max-width: 1168px; margin: 0 auto; padding: 36px 24px 64px; flex: 1; }
.unlock-wrapper { display: flex; justify-content: center; align-items: center; min-height: calc(100svh - 176px); padding: 28px 0; }
.card { width: 100%; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); }
.card-center { max-width: 440px; padding: 38px 34px 28px; text-align: left; }
.card-center > .brand-icon { width: 52px !important; height: 52px !important; border-radius: 16px; margin: 0 0 26px !important; background: #edf5fb; color: #2879b7; }
.card-title { font-size: 28px; font-weight: 700; line-height: 1.35; letter-spacing: -.05em; margin-bottom: 10px; }
.card-subtitle { font-size: 14px; line-height: 23px; color: var(--text-secondary); margin-bottom: 28px; word-break: keep-all; }
.auth-note { font-size: 11px; color: var(--text-muted); border-top: 1px solid #efefe9; margin-top: 26px; padding-top: 18px; text-align: center; }
.form-group { margin-bottom: 20px; text-align: left; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: #55574f; margin-bottom: 8px; }
.input-wrapper { position: relative; display: flex; align-items: center; min-width: 0; }
input[type="text"], input[type="password"], input[type="number"], input[type="datetime-local"], select, textarea { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid #dddfd8; border-radius: var(--radius-sm); font-size: 15px; color: var(--text-primary); background: #fff; transition: border-color .15s, box-shadow .15s, background .15s; }
input[type="password"] { padding-right: 60px; }
input::placeholder, textarea::placeholder { color: #85867e; opacity: 1; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(56,155,242,.11); background: #fbfdff; }
input[readonly] { background: #f7f8f5 !important; }
.input-wrapper input { min-width: 0; }
.input-wrapper .btn { flex-shrink: 0; }
.toggle-password { position: absolute; right: 10px; min-height: 34px; min-width: 40px; padding: 4px; background: none; border: 0; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 12px 20px; min-height: 48px; border: 1px solid transparent; border-radius: 12px; font-size: 14px; line-height: 20px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s, transform .15s; white-space: nowrap; }
.btn-primary { color: #fff; background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-secondary { color: #55574f; background: #fff; border-color: #dddfd8; }
.btn-secondary:hover { background: #f5f6f1; border-color: #c8cbc0; }
.btn-danger { color: var(--danger); background: var(--danger-bg); border-color: #f0d6cf; }
.btn-danger:hover { background: #f9e2dc; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 7px 11px; border-radius: 9px; font-size: 12px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: wait; transform: none; }
.share-header { background: #fff; border: 1px solid var(--border-color); border-radius: 22px; padding: 30px; margin-bottom: 22px; }
.share-header-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.eyebrow { font-size: 11px; font-weight: 600; color: #658197; margin-bottom: 9px; letter-spacing: .015em; }
.share-title { font-size: 28px; line-height: 36px; letter-spacing: -.045em; font-weight: 700; overflow-wrap: anywhere; }
.share-desc { font-size: 14px; line-height: 22px; color: var(--text-secondary); white-space: pre-wrap; margin-top: 7px; }
.share-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; padding-top: 18px; border-top: 1px solid #edeee8; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 6px; font-size: 11px; line-height: 17px; font-weight: 600; }
.badge-blue { background: var(--primary-light); color: #2879b7; }
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-amber { background: var(--warning-bg); color: var(--warning); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.upload-box { background: #f2f7fa; border: 1.5px dashed #b9cdd9; border-radius: 20px; padding: 30px 26px; margin-bottom: 22px; text-align: center; cursor: pointer; transition: background .2s, border-color .2s; }
.upload-box:hover, .upload-box.dragover { background: #eaf3fa; border-color: #2879b7; }
.upload-icon { display: flex; justify-content: center; color: var(--primary); margin-bottom: 12px; }
.upload-text-main { font-size: 16px; font-weight: 600; margin-bottom: 5px; }
.upload-text-sub { max-width: 650px; margin: 6px auto 0; font-size: 12px; line-height: 20px; color: var(--text-secondary); word-break: keep-all; }
.transfers-container { margin-bottom: 24px; }
.transfer-item { background: #fff; border: 1px solid var(--border-color); border-radius: 14px; padding: 17px 18px; margin-bottom: 10px; }
.transfer-info { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 10px; font-size: 13px; }
.transfer-name { font-weight: 600; max-width: 58%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer-stats { color: var(--text-secondary); font-size: 11px; overflow-wrap: anywhere; }
.transfer-item > .btn { margin-top: 12px; }
.progress-bar-bg { height: 5px; width: 100%; background: #eeefe9; border-radius: 5px; overflow: hidden; }
.progress-bar-fill { height: 100%; width: 0%; background: #389bf2; border-radius: 5px; transition: width .15s; }
.progress-bar-fill.success { background: #7dbb76; }
.progress-bar-fill.failed { background: #e76b61; }
.section-header { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin: 28px 0 14px; }
.section-title { font-size: 17px; line-height: 24px; font-weight: 700; }
.list-controls { display: flex; align-items: center; gap: 8px; }
input.search-input, select.search-input { max-width: 200px; min-height: 38px; padding: 8px 12px; border-radius: 10px; font-size: 12px; }
.table-responsive { background: #fff; border: 1px solid var(--border-color); border-radius: 16px; overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 17px 18px; border-bottom: 1px solid #eeefe9; font-size: 13px; vertical-align: middle; }
th { background: #f6f7f3; padding-top: 13px; padding-bottom: 13px; font-size: 11px; font-weight: 600; color: var(--text-secondary); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfcf9; }
.file-name-cell { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text-primary); min-width: 0; }
.file-name-cell > span:not(.ui-icon), .file-name-cell strong { overflow-wrap: anywhere; }
.mobile-file-cards { display: none; }
.mobile-card { background: #fff; border: 1px solid var(--border-color); border-radius: 16px; padding: 18px; margin-bottom: 10px; }
.mobile-card-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 14px; }
.mobile-card-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: var(--text-secondary); margin: 10px 0 16px; }
.empty-box { border: 1px solid var(--border-color); border-radius: 16px; background: #fff; padding: 42px 22px; color: var(--text-secondary); text-align: center; font-size: 13px; }
.alert { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 18px; }
.alert-danger { background: var(--danger-bg); border: 1px solid #f0d6cf; color: var(--danger); }
.alert-success { background: var(--success-bg); border: 1px solid #d1e3cb; color: var(--success); }
.alert-warning { background: var(--warning-bg); border: 1px solid #e8dab0; color: var(--warning); }
.modal-overlay { position: fixed; inset: 0; background: rgba(53,53,48,.32); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100; opacity: 0; pointer-events: none; visibility: hidden; transition: opacity .15s, visibility .15s; }
.modal-overlay.active { opacity: 1; pointer-events: auto; visibility: visible; }
.modal { position: relative; background: #fff; border: 1px solid var(--border-color); border-radius: 24px; padding: 28px; width: 100%; max-width: 540px; max-height: 90svh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.modal-title { font-size: 21px; line-height: 29px; font-weight: 700; letter-spacing: -.04em; }
.modal-close { flex-shrink: 0; width: 34px; height: 34px; border: 0; border-radius: 10px; background: #f4f5f0; color: var(--text-secondary); font-size: 25px; line-height: 1; cursor: pointer; }
.page-heading { margin-bottom: 26px; }
.page-heading h1 { font-size: 28px; line-height: 36px; letter-spacing: -.045em; }
.page-heading p { margin-top: 7px; font-size: 13px; color: var(--text-secondary); }
.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 30px; }
.stat-card { padding: 22px !important; border-radius: 18px; box-shadow: none; }
.stat-card [id^="stat-"] { font-variant-numeric: tabular-nums; letter-spacing: -.04em; line-height: 1.4; margin-top: 12px; }
.stat-card #stat-active-rooms { color: var(--text-primary) !important; }
.stat-card:first-child { border-top: 3px solid #8cbce0; }
.admin-upload-panel { background: #f6f8f8; border: 1px solid #e1e7e8; border-radius: 16px; padding: 18px; margin-bottom: 22px; }
.admin-upload-panel p { color: var(--text-secondary); line-height: 20px; margin: 8px 0 14px; }
input[type="file"] { max-width: 100%; min-width: 0; color: var(--text-secondary); }
input[type="file"]::file-selector-button { border: 1px solid #d9dfdf; border-radius: 9px; background: #fff; padding: 9px 11px; margin-right: 9px; font: inherit; font-weight: 600; color: #55574f; cursor: pointer; }
.ui-icon { display: inline-block; position: relative; flex-shrink: 0; width: 22px; height: 24px; vertical-align: middle; }
.ui-icon-file { width: 19px; height: 23px; border: 1.5px solid #9db9cd; border-radius: 4px; background: #f0f6fa; }
.ui-icon-file::after { content: ''; position: absolute; left: 4px; right: 4px; top: 8px; height: 1.5px; background: #9db9cd; box-shadow: 0 5px 0 #9db9cd; }
.ui-icon-folder { width: 20px; height: 15px; border: 1.5px solid currentColor; border-radius: 4px; margin-top: 4px; }
.ui-icon-folder::before { content: ''; position: absolute; left: 1px; top: -6px; width: 9px; height: 5px; border: 1.5px solid currentColor; border-bottom: 0; border-radius: 3px 3px 0 0; }
.ui-icon-lock { width: 20px; height: 16px; border: 1.7px solid currentColor; border-radius: 5px; margin-top: 8px; }
.ui-icon-lock::before { content: ''; position: absolute; width: 10px; height: 9px; top: -10px; left: 3px; border: 1.7px solid currentColor; border-bottom: 0; border-radius: 8px 8px 0 0; }
.ui-icon-lock::after { content: ''; position: absolute; width: 3px; height: 5px; background: currentColor; left: 7px; top: 4px; border-radius: 2px; }
.ui-icon-up { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 13px; background: #e3eef6; font-size: 27px; line-height: 1; }
.ui-icon-alert { width: 24px; height: 24px; border: 1.7px solid currentColor; border-radius: 50%; text-align: center; font-size: 17px; font-weight: 700; line-height: 21px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 768px) {
  header { min-height: 66px; padding: 14px 16px; gap: 10px; flex-wrap: wrap; }
  .brand { gap: 8px; font-size: 14px; flex-wrap: wrap; }
  .brand-tag { font-size: 9px; }
  .container { padding: 24px 16px 40px; }
  .unlock-wrapper { min-height: calc(100svh - 154px); padding: 18px 0; }
  .card-center { padding: 30px 24px 24px; }
  .card-title, .share-title, .page-heading h1 { font-size: 25px; line-height: 33px; }
  .share-header { padding: 22px; }
  .share-header-top { flex-wrap: wrap; gap: 14px; }
  .share-meta { margin-top: 18px; }
  .section-header { align-items: stretch; }
  .list-controls { width: 100%; flex-wrap: wrap; }
  input.search-input, select.search-input { max-width: none; flex: 1 1 120px; }
  #files-section .table-responsive { display: none; }
  .mobile-file-cards { display: block; }
  #admin-dashboard-view .table-responsive, .modal .table-responsive { display: block; overflow-x: auto; }
  #admin-dashboard-view table { min-width: 760px; }
  .modal .table-responsive table { min-width: 500px; }
  .stats-grid { gap: 10px; }
  .stat-card { padding: 17px !important; }
  .modal-overlay { padding: 12px; }
  .modal { padding: 22px; max-height: 92svh; }
  .modal-title { font-size: 19px; }
  .upload-box { padding: 24px 18px; }
  .transfer-info { display: block; }
  .transfer-name, .transfer-stats { display: block; max-width: 100%; white-space: normal; }
}
