/* MODINEX On-Site 웹. 색은 앱(Ui.kt Palette)과 같다. */
:root {
  color-scheme: light;
  --navy: #182348;
  --navy-2: #24305a;
  --navy-soft: #2a3a6b;
  --navy-tint: #e9ecf4;
  --brand: #006ab6;
  --brand-tint: #e3f0fa;
  --safety: #1f9d6b;
  --safety-tint: #e2f4ec;
  --project: #5b6cd6;
  --project-tint: #eceefb;
  --personal: #0e8fb0;
  --personal-tint: #e0f2f7;
  --bg: #eef1f6;
  --surface: #ffffff;
  --container: #f3f6fb;
  --border: #dde2eb;
  --outline: #c9d0dc;
  --text: #1a2233;
  --muted: #5f6b80;
  --warn: #e8a33d;
  --warn-bg: #fff1dc;
  --warn-text: #8a5200;
  --danger: #b3261e;
  --danger-bg: #fdeceb;
  --notice-bg: #fff4d6;
  --notice-text: #6b4e00;
  --on-navy: #c9d0e0;
  --radius: 14px;
  --radius-sm: 9px;
  --font: "Pretendard", "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --side-w: 236px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --navy-tint: #26304f;
    --brand: #2f8fd6;
    --brand-tint: #16314a;
    --safety-tint: #143a2c;
    --project-tint: #262c55;
    --personal-tint: #123843;
    --bg: #0f1420;
    --surface: #1a2130;
    --container: #232b3d;
    --border: #364055;
    --outline: #4a5568;
    --text: #e7eaf1;
    --muted: #a3adbe;
    --warn-bg: #3a2e15;
    --warn-text: #ffc266;
    --danger: #ff9c92;
    --danger-bg: #3d1d1b;
    --notice-bg: #3a2f10;
    --notice-text: #f5d67a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
img { max-width: 100%; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
.boot { padding: 40px; color: var(--muted); text-align: center; }
.pre { white-space: pre-wrap; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- 틀 ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; width: var(--side-w); flex: none;
  display: flex; flex-direction: column;
  background: var(--navy); color: #fff;
  padding: 22px 14px 16px;
}
.brand { display: flex; align-items: baseline; gap: 8px; padding: 0 10px 22px; text-decoration: none; color: #fff; }
.brand-word { height: 19px; width: auto; }
.brand-sub { font-size: 13px; color: var(--on-navy); letter-spacing: .02em; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-item {
  --c: #8fa0d8;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 10px;
  color: var(--on-navy); text-decoration: none; font-weight: 600; font-size: 15px;
  position: relative;
}
.nav-item .icon { color: var(--c); display: inline-flex; }
.nav-item.c-safety { --c: #4cc596; }
.nav-item.c-brand { --c: #4aa6e8; }
.nav-item.c-project { --c: #8e9bf0; }
.nav-item.c-personal { --c: #3fbcdb; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.on { background: rgba(255,255,255,.11); color: #fff; }
.nav-item.on::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c); }
.side-foot { border-top: 1px solid rgba(255,255,255,.1); padding: 14px 10px 0; display: grid; gap: 10px; }
.who { display: grid; }
.who strong { font-size: 15px; }
.who span { font-size: 12px; color: var(--on-navy); }
.ver { margin: 0; font-size: 11px; color: rgba(201,208,224,.6); }
.side-dim { display: none; }

.body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: 14px 28px; min-height: 68px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.top-text { min-width: 0; }
.top-title { font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.top-crumbs { font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.top-crumbs a { color: var(--muted); text-decoration: none; }
.top-crumbs a:hover { color: var(--brand); text-decoration: underline; }
.top .menu-btn { display: none; }
.main { padding: 24px 28px 64px; max-width: 1240px; width: 100%; }
.main:focus { outline: none; }
.page { display: grid; gap: 18px; }

@media (max-width: 900px) {
  .side { position: fixed; left: 0; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .side { transform: none; }
  body.nav-open .side-dim { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.35); }
  .top .menu-btn { display: inline-flex; }
  .top { padding: 10px 14px; }
  .main { padding: 16px 14px 48px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- 기본 부품 ---------- */
.icon { display: inline-flex; line-height: 0; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: 0; border-radius: 10px;
  background: transparent; color: inherit; font-size: 24px; cursor: pointer;
}
.icon-btn:hover { background: var(--container); }
.back-btn { font-size: 30px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 999px;
  font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn-sm { min-height: 34px; padding: 0 13px; font-size: 14px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-safety { background: var(--safety); color: #fff; }
.btn-project { background: var(--project); color: #fff; }
.btn-personal { background: var(--personal); color: #fff; }
.btn-danger { background: #b3261e; color: #fff; }
.btn-outline { background: var(--surface); border-color: var(--outline); color: var(--text); }
.btn-outline:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover:not(:disabled) { background: var(--brand-tint); }
.btn-ghost-light { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.18); }
.btn-ghost-light:hover { background: rgba(255,255,255,.16); }
.btn-text-danger { background: transparent; color: var(--danger); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-row.end { justify-content: flex-end; }
.btn-row.stretch > .btn { flex: 1; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px;
}
.card.flush { padding: 0; overflow: hidden; }
.card > h2, .section-head h2 { font-size: 17px; font-weight: 800; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-note { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }

.empty, .loading { color: var(--muted); margin: 8px 0; }
.error-box { background: var(--danger-bg); color: var(--danger); border-radius: var(--radius-sm); padding: 14px 16px; display: grid; gap: 10px; justify-items: start; }
.error-box p { margin: 0; }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn-text); font-weight: 700; text-decoration: none; }
.banner .grow { flex: 1; }
.banner.info { background: var(--brand-tint); color: var(--brand); }
.notice-box { background: var(--notice-bg); color: var(--notice-text); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; }

.badge { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-muted { background: var(--container); color: var(--muted); }
.badge-warn { background: var(--warn-bg); color: var(--warn-text); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-ok { background: var(--safety-tint); color: var(--safety); }
.badge-brand { background: var(--brand-tint); color: var(--brand); }
.badge-project { background: var(--project-tint); color: var(--project); }
.badge-solid { background: var(--warn); color: #3b2500; }

/* 입력 */
.form { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.field { display: grid; gap: 5px; align-content: start; }
.field > label { font-size: 13px; font-weight: 700; color: var(--muted); }
.hint { margin: 0; font-size: 12px; color: var(--muted); }
.input {
  width: 100%; min-height: 42px; padding: 8px 12px;
  border: 1px solid var(--outline); border-radius: var(--radius-sm);
  background: var(--surface);
}
.input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.input:disabled { background: var(--container); color: var(--muted); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.select { appearance: auto; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 15px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline > .input { flex: 1; min-width: 120px; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.segmented button {
  min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--outline); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px;
}
.segmented button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.filters .field { min-width: 160px; }

/* 목록 */
.list { display: grid; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px; border-top: 1px solid var(--border);
  color: inherit; text-decoration: none; background: none; border-left: 0; border-right: 0; border-bottom: 0;
  text-align: left; width: 100%; font: inherit;
}
.list > .row:first-child { border-top: 0; }
a.row:hover, button.row:hover { background: var(--container); cursor: pointer; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 700; display: block; }
.row .sub { font-size: 13px; color: var(--muted); display: block; }
.row .chev { color: var(--muted); font-size: 20px; }
.row.dim { opacity: .55; }
.row.sel { background: var(--brand-tint); }
.group-label { padding: 12px 18px 6px; font-size: 13px; font-weight: 800; color: var(--muted); background: var(--container); border-top: 1px solid var(--border); }
.list > .group-label:first-child { border-top: 0; }

table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { font-size: 12px; color: var(--muted); font-weight: 800; background: var(--container); position: sticky; top: 0; }
.table tr.clickable:hover td { background: var(--container); cursor: pointer; }
.table-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 허브 칸 */
.hub-head { border-left: 5px solid var(--hub, var(--brand)); padding: 4px 0 4px 14px; }
.hub-head h2 { font-size: 19px; }
.hub-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.tile {
  display: grid; gap: 6px; align-content: start;
  padding: 16px; min-height: 108px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: inherit; text-decoration: none; position: relative;
}
.tile:hover { border-color: var(--hub, var(--brand)); }
.tile .tile-icon { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--hub, var(--brand)); color: #fff; }
.tile strong { font-size: 16px; }
.tile span.sub { font-size: 13px; color: var(--muted); }
.tile .badge { position: absolute; top: 14px; right: 14px; }
.tile-group-title { font-size: 13px; font-weight: 800; color: var(--muted); margin: 6px 0 -4px; }

/* 홈 */
.hero {
  background: var(--navy); color: #fff; border-radius: 20px; padding: 22px 24px;
  display: grid; gap: 16px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: auto -80px -120px auto; width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,106,182,.55), transparent 65%); pointer-events: none;
}
.hero-top { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-date { color: var(--on-navy); font-size: 14px; }
.hero h2 { font-size: 26px; font-weight: 800; }
.hero-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; position: relative; z-index: 1; }
.hero-panel { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 14px 16px; display: grid; gap: 6px; align-content: start; }
.hero-panel h3 { font-size: 14px; display: flex; gap: 7px; align-items: center; }
.hero-panel .line { display: flex; justify-content: space-between; color: var(--on-navy); font-size: 14px; background: none; border: 0; padding: 2px 0; cursor: pointer; text-align: left; width: 100%; }
.hero-panel .line strong.warn { color: #ffc266; }
.hero-panel .foot { justify-self: end; font-size: 13px; color: var(--on-navy); background: none; border: 0; cursor: pointer; padding: 0; }
.hero-panel .news { color: #fff; font-size: 14px; background: none; border: 0; padding: 2px 0; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.hero-panel .news.read { color: var(--on-navy); font-weight: 400; }
.hero-panel .news.unread { font-weight: 700; }
.proj-row .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--outline); flex: none; }
.proj-row .dot.warn { background: var(--warn); }
.proj-row .sub.warn { color: var(--warn-text); font-weight: 600; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 760px) { .hero-panels, .quick { grid-template-columns: 1fr; } }

/* 미작성 창 */
.todo-tabs { margin-bottom: 12px; }
.todo-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; display: grid; gap: 8px; }
.todo-card.dim { opacity: .45; }
.todo-card .head { display: flex; gap: 10px; align-items: baseline; }
.todo-card .head strong { font-size: 15px; }
.todo-card .head .name { flex: 1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-list { display: grid; gap: 10px; max-height: 60vh; overflow: auto; }

/* 창 */
.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(12,18,36,.5); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--surface); color: var(--text); border-radius: 18px; width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.modal-wide { width: min(980px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px 22px; }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 6px 22px 12px; overflow: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px 18px; flex-wrap: wrap; }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; z-index: 90; background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 12px; max-width: min(560px, calc(100vw - 32px)); transition: .2s; pointer-events: none; font-weight: 600; white-space: pre-wrap; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.toast-error { background: #8c1d17; }

/* 사진 */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--container); border: 1px solid var(--border); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb img.clickable { cursor: zoom-in; }
.thumb .x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 16px; line-height: 1; }
.thumb .cap { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); padding: 10px 6px 4px; }
img.broken { opacity: .3; }
.viewer { position: relative; display: flex; justify-content: center; align-items: center; min-height: 50vh; background: #0d1222; border-radius: 12px; }
.viewer-img { max-height: 72vh; max-width: 100%; object-fit: contain; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 64px; border: 0; border-radius: 10px; background: rgba(255,255,255,.12); color: #fff; font-size: 34px; cursor: pointer; }
.viewer-nav.prev { left: 8px; }
.viewer-nav.next { right: 8px; }
.drop { border: 2px dashed var(--outline); border-radius: var(--radius-sm); padding: 18px; text-align: center; color: var(--muted); }
.drop.over { border-color: var(--brand); background: var(--brand-tint); }

/* 상세 보기 */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: 14px; }
.kv dd { margin: 0; white-space: pre-wrap; }
@media (max-width: 600px) { .kv { grid-template-columns: 1fr; } .kv dt { margin-top: 6px; } }
.comment { border-top: 1px solid var(--border); padding: 10px 0; display: grid; gap: 2px; }
.comment .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.post-body { white-space: pre-wrap; font-size: 15px; line-height: 1.7; }

/* 달력 */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cal-head h3 { font-size: 18px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.cal .dow { font-size: 12px; font-weight: 800; color: var(--muted); text-align: center; padding: 6px 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--container); }
.cal .dow.sun, .cal .day.sun .dnum { color: #d0453a; }
.cal .dow.sat, .cal .day.sat .dnum { color: #2f6fd0; }
.cal .day { min-height: 92px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 4px 5px; font-size: 12px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); text-align: left; cursor: pointer; border-top: 0; border-left: 0; }
.cal .day:hover { background: var(--container); }
.cal .day.out { background: var(--container); opacity: .55; }
.cal .day.today .dnum { background: var(--navy); color: #fff; border-radius: 999px; padding: 0 7px; }
.cal .day.sel { box-shadow: inset 0 0 0 2px var(--brand); }
.cal .dnum { font-weight: 700; align-self: flex-start; }
.cal .tag { border-radius: 5px; padding: 0 5px; font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 로그인 */
body.on-login { background: var(--navy); }
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 16px; gap: 14px;
  background: radial-gradient(circle at 85% 15%, rgba(0,106,182,.55), transparent 45%), radial-gradient(circle at 10% 85%, rgba(59,79,168,.55), transparent 50%), var(--navy); }
.login-card { width: min(400px, 100%); background: var(--surface); border-radius: 22px; padding: 28px 26px 22px; display: grid; gap: 16px; box-shadow: 0 30px 70px rgba(0,0,0,.35); }
.login-brand { background: var(--navy); border-radius: 14px; padding: 18px; text-align: center; }
.login-word { height: 26px; width: auto; }
.login-brand p { margin: 8px 0 0; color: var(--on-navy); font-size: 13px; }
.login-title { font-size: 20px; }
.login-form { display: grid; gap: 12px; }
.login-form .btn { width: 100%; min-height: 46px; }
.login-msg { margin: 0; min-height: 1.2em; color: var(--danger); font-size: 14px; }
.login-foot { color: var(--on-navy); font-size: 12px; margin: 0; }
.lamp { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }
.lamp.ok { color: var(--safety); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }

/* 서명 */
.sign-pad { width: 100%; height: 200px; border: 1px dashed var(--outline); border-radius: var(--radius-sm); background: #fff; touch-action: none; cursor: crosshair; }

@media print {
  .side, .top, .btn, .no-print { display: none !important; }
  .main { padding: 0; }
  body { background: #fff; }
}

/* 전체 프로젝트 일정 (주마다 막대를 쌓는다, 하루 3줄 뒤 +n) */
.timeline { display: grid; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.tl-dows { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--container); border-bottom: 1px solid var(--border); }
.tl-dow { text-align: center; font-size: 12px; font-weight: 800; color: var(--muted); padding: 6px 0; }
.tl-dow.sun, .tl-day.sun .dnum { color: #d0453a; }
.tl-dow.sat, .tl-day.sat .dnum { color: #2f6fd0; }
.tl-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: 26px 22px 22px 22px 18px; row-gap: 3px; border-bottom: 1px solid var(--border); position: relative; padding-bottom: 4px; }
.tl-week:last-child { border-bottom: 0; }
.tl-day { border: 0; border-right: 1px solid var(--border); background: transparent; cursor: pointer; text-align: left; padding: 4px 6px; display: flex; align-items: flex-start; }
.tl-day:nth-child(7) { border-right: 0; }
.tl-day:hover { background: var(--container); }
.tl-day.out .dnum { opacity: .35; }
.tl-day .dnum { font-size: 12px; font-weight: 700; color: var(--muted); }
.tl-day.today .dnum { background: var(--navy); color: #fff; border-radius: 999px; padding: 0 7px; }
.tl-bar { position: relative; z-index: 1; pointer-events: none; margin: 0 2px; border-radius: 5px; background: var(--c); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 22px; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-bar.paused { background: transparent; border: 2px dashed var(--c); color: var(--c); line-height: 18px; }
.tl-bar.planned { background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--c); }
.tl-more { font-size: 11px; color: var(--muted); text-align: center; pointer-events: none; z-index: 1; }
.cal .day:disabled { cursor: default; }

/* 안전 문서 양식 */
.chips { display: grid; grid-template-columns: repeat(var(--per, 3), minmax(0, 1fr)); gap: 6px; }
.chip { min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--outline); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px; line-height: 1.3; }
.chip:hover { border-color: var(--brand); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
@media (max-width: 600px) { .chips { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sub-box { background: var(--container); border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: grid; gap: 10px; }
.sub-box > .head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sub-box > .head strong { flex: 1; }
.law { font-size: 12px; color: var(--muted); margin: 0; }
.doc-form { display: grid; gap: 14px; }
.doc-form .card { display: grid; gap: 10px; align-content: start; }
.photo-row { display: flex; gap: 10px; align-items: center; }
.photo-row img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.check-item { border-top: 1px solid var(--border); padding-top: 10px; display: grid; gap: 6px; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); padding: 12px 0; border-top: 1px solid var(--border); }
.thumb.sign img { object-fit: contain; }

/* ===== 웹 1.1.0: 항상 어두운 디자인 — 움직이는 그라데이션 배경 + 글래스모피즘 ===== */
:root {
  color-scheme: dark;
  --bg: #0f1730; --surface: rgba(255,255,255,.065); --container: rgba(255,255,255,.08);
  --border: rgba(255,255,255,.13); --outline: rgba(255,255,255,.22);
  --text: #eef1f8; --muted: #aab4c8; --brand: #3d9fe6; --brand-tint: rgba(61,159,230,.16);
  --navy-tint: rgba(255,255,255,.08); --warn-bg: rgba(232,163,61,.16); --warn-text: #ffc266;
  --danger: #ff9c92; --danger-bg: rgba(179,38,30,.22); --notice-bg: rgba(245,214,122,.12); --notice-text: #f5d67a;
  --safety-tint: rgba(31,157,107,.2); --project-tint: rgba(91,108,214,.22);
  --glass: rgba(255,255,255,.065); --glass-strong: rgba(255,255,255,.1); --glass-line: rgba(255,255,255,.14);
}
body { background: #0c1430; }
body::before {
  content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 45% at 20% 25%, rgba(0,106,182,.55), transparent 70%),
    radial-gradient(35% 40% at 80% 20%, rgba(59,79,168,.6), transparent 70%),
    radial-gradient(45% 45% at 70% 80%, rgba(14,143,176,.45), transparent 70%),
    radial-gradient(35% 35% at 25% 85%, rgba(91,108,214,.45), transparent 70%),
    #101a3a;
  animation: drift 28s ease-in-out infinite alternate;
}
@keyframes drift {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  33% { transform: translate(4%, -3%) rotate(6deg) scale(1.05); }
  66% { transform: translate(-3%, 4%) rotate(-5deg) scale(1.08); }
  100% { transform: translate(2%, 2%) rotate(3deg) scale(1.02); }
}
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } }
.side { background: rgba(14,22,52,.55); backdrop-filter: blur(22px) saturate(140%); border-right: 1px solid var(--glass-line); }
.top { background: rgba(14,22,52,.35); backdrop-filter: blur(18px); border-bottom: 1px solid var(--glass-line); }
.main { max-width: none; }
.card, .tile, .hero, .hero-panel, .modal, .sub-box, .table-wrap {
  background: var(--glass); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--glass-line); box-shadow: 0 8px 32px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.08);
}
.hero { background: linear-gradient(135deg, rgba(255,255,255,.1), rgba(255,255,255,.035)); }
.hero::after { display: none; }
.hero-panel { background: rgba(255,255,255,.06); }
.tile:hover, a.row:hover, button.row:hover { background: var(--glass-strong); }
.group-label, .table th, .tl-dows, .cal .dow { background: rgba(255,255,255,.05); }
.input, .btn-outline, .chip, .segmented button { background: rgba(255,255,255,.06); color: var(--text); }
.cal .day, .tl-day { background: transparent; }
.modal { background: rgba(20,30,64,.82); }
.modal-backdrop { background: rgba(5,10,25,.45); backdrop-filter: blur(4px); }
.tl-day.today .dnum, .cal .day.today .dnum { background: var(--brand); }
/* 홈: 넓은 화면은 좌우 반씩 */

/* 웹 1.1.0: 현장 지도(시·군·구 경계 + 핀) */
.rmap-wrap { position: relative; border-radius: 12px; overflow: hidden; background: rgba(8, 14, 32, .35); }
.rmap { display: block; width: 100%; height: auto; max-height: 820px; touch-action: none; cursor: grab; user-select: none; }
.rmap:active { cursor: grabbing; }
.rmap-regions path { fill: #2b3445; stroke: rgba(200, 214, 240, .22); stroke-width: .35; vector-effect: non-scaling-stroke; transition: fill .15s; }
.rmap-regions path:hover { fill: #384459; }
.rmap-regions path.on { fill: #4f8fe6; stroke: rgba(225, 236, 255, .55); }
.rmap-regions path.on:hover { fill: #6aa3f0; cursor: pointer; }
.rmap-sido { fill: none; stroke: rgba(220, 230, 250, .7); stroke-width: 1.1; vector-effect: non-scaling-stroke; pointer-events: none; }
.rmap-controls { position: absolute; top: 10px; right: 10px; display: grid; gap: 6px; }
.rmap-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--glass-line, rgba(255,255,255,.15)); background: rgba(20, 28, 52, .75); color: #fff; font-size: 18px; cursor: pointer; backdrop-filter: blur(8px); }
.rmap-btn:hover { background: rgba(40, 54, 92, .9); }
.rmap-tip { position: absolute; z-index: 3; pointer-events: none; max-width: 300px; padding: 8px 11px; border-radius: 10px; background: rgba(14, 20, 40, .92); border: 1px solid rgba(255,255,255,.14); color: #eef1f8; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.rmap-tip strong { display: block; margin-bottom: 3px; }
.rmap-tip-row { padding-left: 14px; position: relative; line-height: 1.45; }
.rmap-tip-row i { position: absolute; left: 0; top: 6px; width: 8px; height: 8px; border-radius: 50%; }
.rmap-tip .warn { color: #ffc266; }
/* 현장 지도: 핀·필터, 프로젝트 목록 강조 */
.rmap-regions path.has { fill: #34405a; }
.rmap-pin { cursor: pointer; }
.rmap-pin .drop { stroke: #fff; stroke-width: 1.3; filter: drop-shadow(0 1.5px 2px rgba(0,0,0,.55)); }
.rmap-pin:hover .drop { stroke-width: 2; }
.rmap-pin.done .drop { opacity: .7; }
.rmap-pin .hole { fill: #fff; pointer-events: none; }
.rmap-pin .count { font-size: 7.5px; font-weight: 800; fill: #fff; text-anchor: middle; pointer-events: none; }
.rmap-filter { margin-top: 10px; }
.row.focus { background: var(--brand-tint); box-shadow: inset 4px 0 0 var(--brand); }

/* 입력 양식 화면은 칸이 너무 길어지지 않게 */
.page:has(> .card .form), .page:has(.doc-form) { max-width: 1080px; }

/* ===== 웹 1.1.2 홈: 위 띠(홈 · 인사 + 세 칸) / 아래 달력 | 지도. 화면 폭과 상관없이 가로 배치 ===== */
@media (min-width: 901px) { body.is-home .top { display: none; } body.is-home .main { padding-top: 24px; } }
.home-hero { padding: 16px 20px; gap: 12px; margin-bottom: 4px; }
.greet-line { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.home-label { font-size: 22px; font-weight: 800; color: #fff; margin-right: 28px; }
.hero-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; position: relative; z-index: 1; }
.home-hero .hero-panel { height: 128px; padding: 12px 14px; overflow: hidden; align-content: start; }
.hp-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hp-title .foot { justify-self: auto; }
.todo-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.todo-row .line { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.06); }
.todo-row .line strong { font-size: 20px; }
.hero-projects .hp-head { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; }
.hero-projects .hp-head h3 { flex: 1; }
.hero-projects .hp-head .small, .hero-projects .hp-head .muted { color: var(--on-navy); }
.hero-projects .list { max-height: 86px; overflow: auto; margin: 4px -14px -12px; }
.hero-projects .row { padding: 8px 14px; border-top-color: rgba(255,255,255,.08); }
.hero-projects .row .title { font-size: 14px; }
.hero-projects .row .sub { font-size: 12px; }
.home-main { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; margin-top: 4px; }
.home-main > .card { display: flex; flex-direction: column; min-height: 0; aspect-ratio: 5 / 4; overflow: hidden; }
.home-cal .cal-head { margin-bottom: 6px; }
.home-cal .card-note { display: none; }
.home-cal .timeline { flex: 1; grid-auto-rows: 1fr; grid-template-rows: auto; }
.home-cal .tl-week { grid-template-rows: 18px repeat(3, minmax(15px, 1fr)) 12px; row-gap: 2px; padding-bottom: 2px; }
.home-cal .tl-bar { font-size: 10.5px; line-height: 15px; height: 15px; padding: 0 5px; }
.home-cal .tl-bar.paused { line-height: 11px; }
.home-cal .tl-day { padding: 2px 5px; }
.home-cal .tl-more { font-size: 10px; line-height: 12px; }
.home-map .card-note { margin-top: 6px; }
.home-main .rmap-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.home-main .rmap { height: 100%; width: 100%; max-height: none; }

/* ===== 웹 1.2.1 글자·배경 대비 보정 ===== */
/* 고르기 칸(select)의 펼친 목록: 브라우저가 흰 바탕을 쓰는데 글자가 흰색으로 물려받아 안 보이던 문제 */
select.input, select.input option, select.input optgroup { background-color: #18213d; color: #eef1f8; }
select.input optgroup { color: #9fbbe8; font-weight: 700; font-style: normal; }
select.input option { font-weight: 400; }
select.input option:checked { background-color: #1d74c4; color: #fff; }
select.input option:disabled { color: #8794ad; }
select.input { background-color: rgba(24, 33, 61, .85); }
input[type="date"], input[type="datetime-local"], input[type="time"], input[type="month"] { color-scheme: dark; }
.input::placeholder, textarea::placeholder { color: rgba(214, 224, 242, .55); }
/* 흰 글자 버튼: 밝은 파랑·초록·청록 위 흰 글자 대비가 낮아(약 3:1) 색을 진하게(4.5:1 이상) */
.btn-primary { background: #1d74c4; }
.btn-safety { background: #15805a; }
.btn-personal { background: #0b7493; }
.btn-danger { background: #b3261e; }
/* 고른 칸(알약·칩)은 남색 대신 파랑으로 확실히 구분 */
.segmented button.on, .chip.on { background: #1d74c4; border-color: #1d74c4; color: #fff; }
.tl-day.today .dnum, .cal .day.today .dnum { background: #1d74c4; color: #fff; }
/* 흐린 글자(보조 설명)를 조금 밝게 */
:root { --muted: #b9c3d6; }
.badge-muted { color: #d3dae7; }
.cal .day.out, .row.dim { opacity: .65; }
