:root {
  --bg: #f7f6f3; --card: #ffffff; --line: #e7e4de; --line-strong: #d2cec6;
  --ink: #171b26; --ink2: #4a5060; --ink3: #8a8f9b;
  --red: #c33e43; --red-dark: #a53035; --red-soft: #faecec;
  --ok: #2f7d4f; --ok-soft: #e6f2ea; --warn: #9a6a00; --warn-soft: #fbf1d6; --mute-soft: #efedea;
  --radius: 10px;
  --sans: "Pretendard Variable", Pretendard, "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.55 var(--sans); word-break: keep-all; overflow-wrap: anywhere; }
a { color: inherit; text-decoration: none; }
a.link, .prose a { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
button, input, select, textarea, code, pre { font: inherit; color: inherit; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.top { display: flex; align-items: center; gap: 28px; padding: 14px 32px; border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: baseline; gap: 12px; }
.logo-sub { font-size: 10.5px; letter-spacing: 0.16em; color: var(--ink3); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; color: var(--ink2); font-size: 13px; }
.top-right form { margin: 0; }
.textbtn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink2); }
.textbtn:hover { color: var(--red); }

.titlebar { display: flex; align-items: center; gap: 14px; padding: 18px 32px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.titlebar h1 { font-size: 19px; font-weight: 800; }
.titlebar .who { color: var(--ink3); font-size: 13px; }
.titlebar .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: 0; padding: 0 32px 60px; }
.side { padding: 22px 18px 0 0; border-right: 1px solid var(--line); }
.side h4 { margin: 18px 0 6px 10px; font-size: 11px; font-weight: 700; color: var(--ink3); letter-spacing: 0.06em; }
.side h4:first-child { margin-top: 0; }
.side a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; border: 1px solid transparent; font-weight: 600; color: var(--ink2); }
.side a:hover { color: var(--ink); background: rgba(0, 0, 0, 0.03); }
.side a.on { color: var(--red); background: var(--card); border-color: var(--line); box-shadow: inset 3px 0 0 var(--red); }
main { padding: 22px 0 0 28px; min-width: 0; }

.sec-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; margin-bottom: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sec-head h2 { font-size: 18px; font-weight: 800; }
.sec-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card > h3 { font-size: 14px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card > h3 .more { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--ink3); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: block; }
.stat .k { font-size: 12px; color: var(--ink2); font-weight: 600; }
.stat .v { font-size: 26px; font-weight: 800; line-height: 1.3; font-variant-numeric: tabular-nums; }
.stat .d { font-size: 11.5px; color: var(--ink3); }
a.stat:hover { border-color: var(--line-strong); }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.empty { border: 1px dashed var(--line-strong); border-radius: 8px; padding: 22px; text-align: center; color: var(--ink3); background: rgba(0, 0, 0, 0.012); }
.note { background: var(--red-soft); border: 1px solid #f1c9cf; border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; color: #6d1220; }
.note.ok { background: var(--ok-soft); border-color: #c5e0cf; color: #1f5a37; }
.note.plain { background: var(--mute-soft); border-color: var(--line); color: var(--ink2); }

.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.pill:hover { border-color: var(--ink); }
.pill.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--ink); background: var(--card); font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f1efeb; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 4px 12px rgba(195, 62, 67, 0.22); }
.btn.red:hover { background: var(--red-dark); }
.btn.sm { padding: 3px 10px; font-size: 12px; font-weight: 600; border-color: var(--line-strong); }
.btn.sm.danger:hover { border-color: var(--red); color: var(--red); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--mute-soft); color: var(--ink2); white-space: nowrap; }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }

.tablewrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; color: var(--ink2); font-weight: 700; padding: 8px 10px; background: rgba(0, 0, 0, 0.025); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr:hover td { background: rgba(0, 0, 0, 0.015); }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t td.nowrap { white-space: nowrap; }
table.t form { display: inline; margin: 0; }
.fname { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; }
.fname:hover { color: var(--red); }
.sub { color: var(--ink3); font-size: 12px; }

.ext { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 22px; padding: 0 5px; border-radius: 5px; font: 700 10px/1 var(--sans); letter-spacing: 0.04em; text-transform: uppercase; background: var(--mute-soft); color: var(--ink2); border: 1px solid var(--line); }
.ext.pdf { background: var(--red-soft); color: var(--red); border-color: #f1c9cf; }
.ext.img { background: #e8f0f7; color: #2c5d86; border-color: #cbdcea; }
.ext.m3d { background: #ece8f6; color: #5a3f99; border-color: #d8cfee; }
.ext.xls { background: var(--ok-soft); color: var(--ok); border-color: #c5e0cf; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 148px; position: relative; }
.tile:hover { border-color: var(--line-strong); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05); }
.tile .thumb { height: 86px; border-radius: 6px; background: var(--bg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tile .thumb img { width: 100%; height: 100%; object-fit: cover; }
.tile .thumb .ext { transform: scale(1.5); }
.tile .thumb svg { width: 42px; height: 42px; stroke: var(--red); stroke-width: 1.2; }
.tile .name { font-weight: 600; font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--ink3); margin-bottom: 14px; font-size: 13px; }
.crumbs a { color: var(--ink2); font-weight: 600; }
.crumbs a:hover { color: var(--red); }
.searchbox { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 12px; background: var(--card); }
.searchbox input { border: 0; outline: 0; background: none; width: 170px; }

.form { display: grid; gap: 12px; max-width: 560px; }
.form.row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); max-width: none; align-items: end; }
label.f { display: grid; gap: 4px; font-size: 12px; font-weight: 700; color: var(--ink2); }
input[type=text], input[type=password], input[type=date], input[type=email], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; font-weight: 400; font-size: 14px; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
textarea { min-height: 96px; resize: vertical; }
input[type=file] { font-size: 13px; }
details.admin { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; background: rgba(255, 255, 255, 0.6); }
details.admin > summary { cursor: pointer; font-weight: 700; color: var(--ink2); }
details.admin[open] > summary { margin-bottom: 12px; }

.preview { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.preview img, .preview video { display: block; max-width: 100%; max-height: 74vh; margin: 0 auto; }
.preview iframe { display: block; width: 100%; height: 76vh; border: 0; }
.preview pre { margin: 0; padding: 16px; overflow: auto; max-height: 74vh; font: 13px/1.7 var(--sans); white-space: pre-wrap; }
.preview .sheet { overflow: auto; max-height: 74vh; }
.preview .sheet table { border-collapse: collapse; font-size: 12.5px; }
.preview .sheet td { border: 1px solid var(--line); padding: 4px 8px; white-space: nowrap; }
.preview .sheet tr:first-child td { background: var(--mute-soft); font-weight: 700; position: sticky; top: 0; }
#viewer3d { width: 100%; height: 70vh; background: linear-gradient(#fbfaf8, #eceae6); position: relative; }
#viewer3d .hint { position: absolute; left: 12px; bottom: 10px; font-size: 12px; color: var(--ink3); }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 18px; }
.meta div span { display: block; font-size: 11.5px; color: var(--ink3); font-weight: 700; }

.cal { overflow-x: auto; }
.cal table { border-collapse: separate; border-spacing: 2px; min-width: 100%; }
.cal th { font-size: 11px; font-weight: 600; color: var(--ink3); padding: 2px 0; text-align: center; min-width: 25px; }
.cal th.unit, .cal td.unit { text-align: left; min-width: 168px; padding-right: 10px; position: sticky; left: 0; background: var(--card); font-size: 13px; color: var(--ink); font-weight: 700; }
.cal td.unit small { display: block; font-weight: 400; color: var(--ink3); }
.cal th.we { color: var(--red); }
.cal td.d { height: 30px; border-radius: 5px; text-align: center; font-size: 11px; }
.d.free { background: var(--ok-soft); cursor: pointer; }
.d.free:hover { outline: 2px solid var(--ok); }
.d.busy { background: #d8d5cf; }
.d.pending { background: repeating-linear-gradient(45deg, #e9dfc4, #e9dfc4 4px, #f7f0dc 4px, #f7f0dc 8px); }
.d.block { background: #b3afa8; }
.d.mine { background: var(--red); }
.d.past { background: transparent; border: 1px solid var(--line); }
.d.sel { outline: 2px solid var(--ink); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink2); margin-top: 12px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 5px; }

.prose { white-space: pre-wrap; line-height: 1.75; }
.thread { display: grid; gap: 10px; }
.bubble { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--card); }
.bubble.staff { border-left: 3px solid var(--red); }
.bubble .by { font-size: 12px; color: var(--ink3); margin-bottom: 4px; }

.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.login-art { padding: 56px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line); background: linear-gradient(160deg, #faf9f7 0%, #f0eeea 100%); }
.login-art .big { font: 800 64px/1.02 var(--sans); letter-spacing: -0.03em; }
.login-art .big b { color: var(--red); }
.login-art p { max-width: 420px; color: var(--ink2); font-size: 15px; }
.login-art ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; color: var(--ink2); }
.login-art li { display: flex; gap: 10px; align-items: center; }
.login-art li::before { content: ""; width: 18px; height: 1px; background: var(--red); }
.login-box { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-box .card { width: 100%; max-width: 380px; padding: 28px; }
.login-box h2 { font-size: 20px; margin-bottom: 4px; }
.login-box .btn { justify-content: center; padding: 10px; }

footer.foot { border-top: 1px solid var(--line); padding: 26px 32px 40px; color: var(--ink3); font-size: 12.5px; display: flex; gap: 24px; flex-wrap: wrap; align-items: baseline; }

@media (max-width: 900px) {
  .top { padding: 12px 16px; gap: 14px; flex-wrap: wrap; }
  .titlebar { padding: 14px 16px; }
  .shell { grid-template-columns: 1fr; padding: 0 16px 40px; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 0; display: flex; gap: 6px; overflow-x: auto; }
  .side h4 { display: none; }
  .side a { white-space: nowrap; border-color: var(--line); background: var(--card); }
  .side a.on { box-shadow: none; border-color: var(--red); }
  main { padding: 16px 0 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { padding: 28px 24px; border-right: 0; border-bottom: 1px solid var(--line); gap: 18px; }
  .login-art .big { font-size: 40px; }
  .login-art ul { display: none; }
  .hide-m { display: none; }
}

.searchbox input[type=search] { border: 0; padding: 4px 2px; background: none; border-radius: 0; }
.searchbox input[type=search]:focus { outline: 0; }
.searchbox:focus-within { border-color: var(--red); }
.ext { white-space: nowrap; flex: none; }
.fname { min-width: 0; }

.logo { align-items: center; }
.logo-img { height: 30px; width: auto; display: block; }
.login-art .logo-img { height: 40px; }
footer.foot .logo-img { height: 20px; align-self: center; }

details.menu { position: relative; }
details.menu > summary { list-style: none; user-select: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu .caret { width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 2px; }
details.menu[open] > summary { border-color: var(--ink); }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 168px; padding: 6px; background: var(--card); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12); }
.menu-pop a { display: flex; align-items: center; gap: 8px; padding: 7px 10px 7px 28px; border-radius: 6px; font-weight: 600; font-size: 13px; position: relative; white-space: nowrap; }
.menu-pop a:hover { background: var(--mute-soft); }
.menu-pop a.on::before { content: ""; position: absolute; left: 11px; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--red); transform: translateY(-50%); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.grid.large { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }
.grid.large .tile { min-height: 232px; }
.grid.large .tile .thumb { height: 164px; }
.grid.large .tile .thumb svg { width: 64px; height: 64px; }
.names { padding: 10px; }
.names .fname { padding: 5px 8px; border-radius: 6px; font-weight: 500; max-width: 100%; }
.names .fname:hover { background: var(--mute-soft); color: var(--ink); }
.names .fname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.names.small { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 10px; }
.names.list { columns: 250px auto; column-gap: 14px; }
.names.list .fname { display: flex; break-inside: avoid; }
.th-sort { display: inline-block; }
.th-sort:hover { color: var(--red); }

.tabbar { display: none; }
@media (max-width: 720px) {
  body { font-size: 15px; padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .top { padding: 10px 16px; flex-wrap: nowrap; gap: 10px; position: sticky; top: 0; z-index: 30; background: var(--bg); }
  .logo-img { height: 24px; }
  .logo-sub, .top-right > a:first-child { display: none; }
  .top-right { gap: 10px; min-width: 0; }
  .top-right b { display: block; max-width: 38vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .titlebar { padding: 10px 16px; border-bottom: 0; }
  .titlebar h1, .titlebar .who { display: none; }
  .titlebar:not(:has(.actions > *)) { display: none; }
  .titlebar .actions { margin-left: 0; width: 100%; }
  .titlebar .actions .btn { flex: 1; justify-content: center; }
  .side { display: none; }
  .shell { padding: 0 14px 24px; }
  main { padding-top: 14px; }
  .card { padding: 14px; margin-bottom: 12px; }
  .stats { gap: 10px; margin-bottom: 12px; }
  .sec-head .right { margin-left: 0; width: 100%; }
  .searchbox { flex: 1 1 100%; padding: 6px 14px; }
  .searchbox input { width: 100%; }
  .menu-pop { right: auto; left: 0; }
  .menu-pop a { padding-top: 11px; padding-bottom: 11px; font-size: 14px; }
  input[type=text], input[type=password], input[type=date], input[type=email], input[type=search], select, textarea { font-size: 16px; }
  .btn, .pill { min-height: 42px; }
  .btn.sm { min-height: 34px; }
  .form.row { grid-template-columns: 1fr; }
  .form.row .btn, .form > .btn { width: 100%; justify-content: center; }
  table.t th, table.t td { padding: 10px 6px; }
  table.t td.nowrap { white-space: normal; }
  .hide-s { display: none; }
  .cal th.unit, .cal td.unit { min-width: 96px; font-size: 12px; padding-right: 6px; }
  .cal td.unit small { font-size: 11px; }
  .cal th { min-width: 30px; }
  .cal td.d { height: 34px; }
  .grid.large { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.large .tile { min-height: 0; }
  .grid.large .tile .thumb { height: 112px; }
  .names.list { columns: auto; }
  .names .fname { padding: 10px 8px; }
  footer.foot { padding: 20px 16px 24px; gap: 10px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--card); border-top: 1px solid var(--line-strong); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar > a, .tabbar summary { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 58px; font-size: 11px; font-weight: 600; color: var(--ink2); cursor: pointer; list-style: none; }
  .tabbar summary::-webkit-details-marker { display: none; }
  .tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar > a.on, .tabbar details[open] > summary { color: var(--red); }
  .more-pop { position: fixed; left: 10px; right: 10px; bottom: calc(66px + env(safe-area-inset-bottom)); background: var(--card); border: 1px solid var(--line-strong); border-radius: 14px; padding: 6px; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18); }
  .more-pop a { display: flex; align-items: center; gap: 12px; padding: 14px 14px; border-radius: 10px; font-weight: 600; font-size: 15px; }
  .more-pop a:active { background: var(--mute-soft); }
}
