/* 약속 — 첫 화면 모양. 글꼴은 PC에 있는 것만(밖에서 받지 않음). 색은 @jayoo/look 제품색과 맞춘다. */
:root {
  --bg: #f5f7fa; --panel: #ffffff; --line: #e1e6ed; --text: #1c2430; --muted: #667085;
  --accent: #1f5fbf; --accent-weak: #e8f0fc; --danger: #c0392b; --warn-bg: #fff6db; --warn-line: #f0d68a;
  --word: #2b6cd4; --cell: #1f9d55; --slide: #e8772e; --pdf: #d64545; --hwp: #3fa9e0;
  --radius: 8px;
  font-family: "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  color: var(--text); background: var(--bg); font-size: 14px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14181f; --panel: #1b2029; --line: #2c3340; --text: #e6e9ee; --muted: #98a2b3; --accent: #6ea0f0; --accent-weak: #22324d; --warn-bg: #3a3218; --warn-line: #6b5a23; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 6px 12px; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.link { border: none; background: none; padding: 4px 6px; color: var(--accent); }
button.danger { color: var(--danger); }
input[type=text], input[type=password], input[type=search] { border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; background: var(--panel); min-width: 0; }
input:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* 시험 서버 띠 */
.fake { background: var(--warn-bg); border-bottom: 1px solid var(--warn-line); padding: 4px 16px; font-size: 12px; text-align: center; }

/* 로그인 */
.login-wrap { min-height: 90vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px; display: grid; gap: 12px; }
.login h1 { margin: 0 0 4px; font-size: 22px; display: flex; align-items: center; gap: 10px; }
.login h1 img { width: 36px; height: 36px; }
.login label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.login .err { color: var(--danger); min-height: 1.2em; font-size: 13px; }
.login .hint, .login .tm { color: var(--muted); font-size: 12px; }
.login .row { display: flex; justify-content: space-between; align-items: center; }

/* 틀 */
.shell { display: grid; grid-template-columns: 220px 1fr; grid-template-rows: auto 1fr; min-height: calc(100vh - 26px); }
header.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
header.top .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; white-space: nowrap; }
header.top .brand img { width: 28px; height: 28px; }
header.top .search { flex: 1; max-width: 480px; }
header.top .search input { width: 100%; }
header.top .me { margin-left: auto; display: flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--muted); }
nav.side { background: var(--panel); border-right: 1px solid var(--line); padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
nav.side button { border: none; text-align: left; padding: 8px 12px; border-radius: 6px; background: none; display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; }
nav.side button.on { background: var(--accent-weak); color: var(--accent); font-weight: 600; }
nav.side button:disabled { color: var(--muted); cursor: default; }
nav.side .soon { font-size: 11px; color: var(--muted); }
nav.side .quota { margin-top: auto; padding: 12px; font-size: 12px; color: var(--muted); }
nav.side .bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 6px; }
nav.side .bar i { display: block; height: 100%; background: var(--accent); }
main { padding: 16px 20px; min-width: 0; position: relative; }
.tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.crumbs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; font-size: 15px; margin-right: auto; }
.crumbs button { border: none; background: none; padding: 4px 6px; font-weight: 600; }
.crumbs span { color: var(--muted); }

table.files { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.files th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
table.files td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.files tr:last-child td { border-bottom: none; }
table.files tr:hover td { background: var(--accent-weak); }
td.name .nm { display: flex; align-items: center; gap: 10px; min-width: 0; }
td.name button { max-width: 100%; border: none; background: none; padding: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.name button:hover { text-decoration: underline; }
td.acts { text-align: right; white-space: nowrap; }
td.small, th.small { font-size: 12px; color: var(--muted); white-space: nowrap; }
.badge { flex: none; width: 26px; height: 26px; border-radius: 5px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; position: relative; }
.badge::before { content: "K"; position: absolute; top: 1px; left: 3px; font-size: 7px; }
.badge.jayooword { background: var(--word); } .badge.jayoosheet { background: var(--cell); } .badge.jayooslide { background: var(--slide); }
.badge.jayoopdf { background: var(--pdf); } .badge.jayoohwp { background: var(--hwp); }
.badge.folder { background: #c9a227; } .badge.folder::before, .badge.other::before { content: ""; }
.badge.other { background: #8a94a6; }
.lock { font-size: 11px; color: var(--danger); }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }
.dropping::after { content: attr(data-drop); position: absolute; inset: 8px; border: 2px dashed var(--accent); border-radius: 12px; background: color-mix(in srgb, var(--accent-weak) 80%, transparent); display: grid; place-items: center; font-size: 18px; color: var(--accent); pointer-events: none; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #243447; color: #fff; padding: 10px 16px; border-radius: 8px; max-width: min(560px, calc(100vw - 32px)); opacity: 0; transition: opacity .2s; pointer-events: none; font-size: 13px; }
#toast.on { opacity: 1; }
#toast.bad { background: var(--danger); }

/* 파일 정보 창 */
dialog.info { border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; width: min(640px, calc(100vw - 32px)); max-height: 85vh; background: var(--panel); color: var(--text); }
dialog.info::backdrop { background: rgba(0,0,0,.35); }
.info-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 16px; word-break: break-all; }
dialog.info h3, .admin h3 { font-size: 14px; margin: 18px 0 8px; }
.sec .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.sec select { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); }
table.mini { width: 100%; border-collapse: collapse; }
table.mini td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.mini tr.dim td { opacity: .5; }
td.mono { font-family: Consolas, "D2Coding", monospace; word-break: break-all; }
.tag { margin-left: 6px; font-size: 11px; padding: 1px 6px; border-radius: 9px; background: var(--accent-weak); color: var(--accent); }
a.link { color: var(--accent); text-decoration: none; padding: 4px 6px; }
.admin table.files { margin-bottom: 8px; }

.pwform { display: grid; gap: 10px; }
.pwform label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.pwform label.check { display: flex; align-items: center; gap: 6px; }
.pwform .err, .login .err { color: var(--danger); min-height: 1.2em; font-size: 13px; }
.pwform .hint { color: var(--muted); font-size: 12px; }
.pwform .row { display: flex; justify-content: flex-end; }
table.files tr.dim td { opacity: .5; }

.ai-admin { max-width: 560px; margin-top: 8px; }
.ai-admin input[type=text] { width: 100%; }

.found .row { margin: 2px 0; }
.sec input[type=search] { border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; background: var(--panel); color: var(--text); }

/* 좁은 화면 (휴대폰) */
@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
  nav.side { flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--line); padding: 6px; }
  nav.side .quota { display: none; }
  header.top { flex-wrap: wrap; }
  header.top .search { order: 3; max-width: none; flex-basis: 100%; }
  main { padding: 12px 16px; }
  .col-mod, .col-size, .col-ed { display: none; }
  td.acts { white-space: nowrap; }
  td.acts button { display: block; margin-left: auto; padding: 2px 0; }
  td.name .nm button { white-space: normal; word-break: break-all; }
}
.admin h3 .small { font-weight: 400; color: var(--muted); }
