:root {
  --bg: #ffffff; --bg2: #f7f7f8; --bg3: #f0f0f3; --line: #e6e7eb; --line2: #d9dbe3;
  --text: #1f2330; --muted: #6b7083; --accent: #5b5bd6; --accent-soft: #eeeefc; --accent-ink: #3f3fb0;
  --ok: #1a7f37; --ok-soft: #e7f6ec; --warn: #b35c00; --warn-soft: #fff3e0; --danger: #c0392b; --danger-soft: #fdecea;
  --D: #f5d76e; --E: #f4a26a; --N: #7d93ff; --O: #c6c9d2;
  --r: 12px; --r-s: 8px; --shadow: 0 1px 2px rgba(20,22,40,.06), 0 6px 20px rgba(20,22,40,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1 { font-size: 26px; line-height: 1.35; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 0; } h3 { font-size: 15px; margin: 0 0 8px; } h3.mt { margin-top: 22px; }
p { margin: 6px 0; } .muted { color: var(--muted); } .small { font-size: 13px; } code { background: var(--bg3); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
a { color: var(--accent); text-decoration: none; }

/* ---------- header ---------- */
.hdr { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.hdr-in { max-width: 1360px; margin: 0 auto; padding: 10px 32px; display: flex; align-items: center; gap: 18px; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 800; font-size: 18px; }
.logo svg { width: 34px; height: 34px; }
.nav { display: flex; gap: 4px; }
.nav-b { background: none; border: 0; padding: 8px 14px; border-radius: 999px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.nav-b:hover { background: var(--bg2); color: var(--text); } .nav-b.active { background: var(--bg3); color: var(--text); }
.hdr-r { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.menu { position: relative; }
.mbtn { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--text); max-width: 220px; }
.mbtn:hover { border-color: var(--line2); background: var(--bg2); }
.mbtn.icon { width: 36px; height: 36px; justify-content: center; padding: 0; font-size: 16px; }
.mbtn .avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.mbtn .chev { color: var(--muted); font-size: 11px; } .mbtn #userName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mlist { display: none; position: absolute; right: 0; top: calc(100% + 6px); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 230px; padding: 6px; z-index: 30; }
.menu.open .mlist { display: block; }
.mlist button, .mlist .mitem { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: var(--r-s); font: inherit; font-size: 14px; cursor: pointer; color: var(--text); }
.mlist button:hover, .mlist .mitem:hover { background: var(--bg2); }
.mlist button.danger { color: var(--danger); } .mlist .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.mlist button.cur { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.mlist .mh { font-size: 11px; color: var(--muted); padding: 6px 12px 2px; font-weight: 700; letter-spacing: .04em; }

/* ---------- layout ---------- */
main.main { max-width: 1360px; margin: 0 auto; padding: 28px 32px 60px; min-height: calc(100vh - 180px); }
@media (max-width: 720px) { .hdr-in, main.main { padding-left: 16px; padding-right: 16px; } }
.view { display: none; } .view.active { display: block; }
.panel { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 16px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }
.sec-t { margin: 28px 0 10px; display: flex; align-items: baseline; gap: 10px; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.inline { display: inline-flex; align-items: center; gap: 6px; } .inline.wrap { flex-wrap: wrap; } .inline.end { justify-content: flex-end; } .mt { margin-top: 14px; }
.w60 { width: 64px; } .full { width: 100%; }

/* ---------- controls ---------- */
label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
label .hint { font-weight: 400; font-size: 11.5px; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; font-weight: 500; }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=month], select, textarea {
  background: var(--bg); color: var(--text); border: 1px solid var(--line2); border-radius: var(--r-s); padding: 8px 10px; font: inherit; font-size: 14px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input[type=range] { accent-color: var(--accent); width: 100%; } input[type=checkbox] { accent-color: var(--accent); width: 17px; height: 17px; }
textarea { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.btn { background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 999px; padding: 9px 18px; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--accent-ink); }
.btn.ghost { background: var(--bg); color: var(--text); border-color: var(--line2); } .btn.ghost:hover { background: var(--bg2); }
.btn.small { padding: 6px 13px; font-size: 13px; } .btn.danger { color: var(--danger); border-color: var(--danger); background: var(--bg); }
.ib { background: var(--bg); border: 1px solid var(--line2); border-radius: var(--r-s); width: 36px; height: 38px; font: inherit; cursor: pointer; color: var(--text); flex: 0 0 auto; }
.ib.txt { width: auto; padding: 0 10px; font-size: 12px; font-weight: 600; }
.form { display: grid; gap: 12px; } .form.grid3 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.seg { display: inline-flex; background: var(--bg3); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 16px; border-radius: 999px; font: inherit; font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.active { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.1); }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 150px 1fr auto; gap: 20px; align-items: center; padding: 8px 0 20px; }
.hero-char svg { width: 150px; height: 150px; animation: float 4s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-6px) } }
.hero-sub { color: var(--muted); margin: 8px 0 0; font-size: 15px; }
.status-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--bg3); cursor: help; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.normal { background: var(--ok-soft); color: var(--ok); } .status.normal::before { background: var(--ok); }
.status.caution { background: var(--warn-soft); color: var(--warn); } .status.caution::before { background: var(--warn); }
.status.safety { background: var(--danger-soft); color: var(--danger); } .status.safety::before { background: var(--danger); }
@media (max-width: 720px) { .hero { grid-template-columns: 1fr; text-align: center; } .hero-char { display: flex; justify-content: center; } .hero-char svg { width: 120px; height: 120px; } .status-row { justify-content: center; } .seg { justify-self: center; } h1 { font-size: 22px; } }

.nowbar { display: flex; flex-wrap: wrap; gap: 14px 28px; background: var(--bg2); border-radius: var(--r); padding: 16px 20px; align-items: flex-end; }
.nb-group { display: flex; flex-direction: column; gap: 6px; } .nb-group.grow { flex: 1 1 260px; } .nb-note { align-self: center; margin-left: auto; }
.nb-label { font-size: 13px; font-weight: 700; color: var(--text); } .nb-label b { color: var(--accent-ink); font-size: 15px; margin-left: 4px; }
.nb-date { display: inline-flex; align-items: center; background: var(--bg); border: 1px solid var(--line2); border-radius: var(--r-s); overflow: hidden; }
.nb-date .ib { border: 0; border-radius: 0; height: 40px; width: 38px; font-size: 18px; } .nb-date .ib:hover { background: var(--bg3); }
.nb-date input[type=date] { border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; height: 40px; width: 160px; text-align: center; }
.nowbar input[type=time] { height: 40px; width: 130px; }
.nb-range { display: flex; align-items: center; gap: 10px; } .nb-range input[type=range] { flex: 1; height: 28px; }
.nowbar a { font-weight: 700; }
@media (max-width: 720px) { .nb-note { margin-left: 0; } }

/* ---------- flow ---------- */
.risk { background: var(--danger-soft); border: 1px solid #f3c2bc; color: var(--danger); border-radius: var(--r); padding: 12px 16px; margin-top: 24px; font-size: 14px; }
.risk b { display: block; } .risk + .risk { margin-top: 8px; }
.flow { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.flow li { display: grid; grid-template-columns: 130px 36px 1fr; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); align-items: center; }
.flow li:last-child { border-bottom: 0; }
.flow li.past { opacity: .45; } .flow li.now { background: var(--bg2); }
.flow .t { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; line-height: 1.3; } .flow .t small { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; }
.flow .ic { font-size: 22px; text-align: center; }
.flow .ttl { font-weight: 700; } .flow .dsc { color: var(--muted); font-size: 13.5px; }
.flow li.main { background: var(--accent-soft); } .flow li.main .ttl { font-size: 18px; color: var(--accent-ink); }
.flow li.split .ttl { color: #a3562a; } .flow li.warn .ttl { color: var(--warn); }
.flow li.empty { color: var(--muted); display: block; text-align: center; }
@media (max-width: 560px) { .flow li { grid-template-columns: 84px 28px 1fr; padding: 12px; } }

.more { margin-top: 24px; border: 1px solid var(--line); border-radius: var(--r); }
.more > summary { cursor: pointer; padding: 14px 18px; font-weight: 700; list-style: none; display: flex; gap: 10px; align-items: baseline; }
.more > summary::-webkit-details-marker { display: none; } .more > summary::before { content: "▸"; color: var(--accent); } .more[open] > summary::before { content: "▾"; }
.more-in { padding: 4px 18px 18px; border-top: 1px solid var(--line); } .more-in h3 { margin-top: 18px; }

/* timeline */
.timeline-wrap { overflow-x: auto; } #timeline svg { display: block; min-width: 760px; width: 100%; height: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i, .legend .chip { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.chip.D { background: var(--D);} .chip.E { background: var(--E);} .chip.N { background: var(--N);} .chip.O { background: var(--O);}
.rows { display: grid; gap: 6px; margin: 8px 0; }
.row { display: grid; grid-template-columns: minmax(128px, 1fr) minmax(128px, 1fr) 90px auto; gap: 6px; align-items: center; } .row.ev { grid-template-columns: minmax(170px, 1.2fr) minmax(170px, 1.2fr) 1fr auto; } .row input { height: 38px; }

/* tables / evidence */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 6px; }
.tbl th, .tbl td { padding: 8px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; vertical-align: middle; }
.tbl th { color: var(--muted); font-weight: 600; font-size: 12px; } .tbl tr.best td { background: var(--accent-soft); font-weight: 700; }
.tbl-wrap { overflow-x: auto; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin: 8px 0; }
.kv div { background: var(--bg2); border-radius: var(--r-s); padding: 8px 10px; font-size: 12.5px; color: var(--muted); } .kv b { display: block; font-size: 15px; color: var(--text); }
.ev-sec { margin-top: 16px; } .ev-sec h4 { color: var(--accent-ink); font-size: 14px; margin: 0 0 6px; } ul.plain { margin: 4px 0; padding-left: 18px; font-size: 13px; }
.code { display: inline-block; padding: 2px 8px; border-radius: 7px; font-weight: 800; font-size: 12px; color: #1f2330; }
.code.D { background: var(--D);} .code.E { background: var(--E);} .code.N { background: var(--N); color: #fff; } .code.O { background: var(--O); }
.st { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.st.normal { background: var(--ok-soft); color: var(--ok);} .st.caution { background: var(--warn-soft); color: var(--warn);} .st.safety { background: var(--danger-soft); color: var(--danger);}

/* ---------- users ---------- */
.users-layout { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; }
@media (max-width: 760px) { .users-layout { grid-template-columns: 1fr; } }
.ulist { position: sticky; top: 76px; } .ulist-t { font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .04em; margin: 4px 0 8px; }
.ulist ul { list-style: none; margin: 0 0 10px; padding: 0; }
.ulist li { padding: 9px 12px; border-radius: var(--r-s); cursor: pointer; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ulist li:hover { background: var(--bg2); } .ulist li.cur { background: var(--accent-soft); color: var(--accent-ink); }
.ulist li .m { font-size: 11px; color: var(--muted); font-weight: 500; }
.udetail-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.subtab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; margin-bottom: -1px; }
.subtab.active { color: var(--text); border-bottom-color: var(--accent); }
.subpane { display: none; } .subpane.active { display: block; }

/* calendar */
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 12px; }
.calendar .wd { text-align: center; font-size: 12px; color: var(--muted); font-weight: 700; }
.cell { background: var(--bg2); border-radius: var(--r-s); min-height: 60px; padding: 6px 8px; cursor: pointer; border: 2px solid transparent; user-select: none; position: relative; }
.cell.empty { background: transparent; cursor: default; } .cell:hover { border-color: var(--line2); }
.cell.today { border-color: var(--accent); } .cell.range { box-shadow: inset 0 0 0 1px var(--accent); }
.cell .d { font-size: 12px; color: var(--muted); } .cell.sun .d { color: var(--danger); }
.cell .code { margin-top: 4px; font-size: 13px; padding: 2px 8px; }
.cell .tag { position: absolute; right: 6px; top: 5px; font-size: 10px; color: var(--accent-ink); font-weight: 700; }

/* lab */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.preset { background: var(--bg2); border-radius: var(--r); padding: 14px; border: 1px solid var(--line); }
.preset .em { font-size: 22px; } .preset b { display: block; margin: 4px 0; } .preset p { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; }
ul.saved { list-style: none; padding: 0; margin: 0; } ul.saved li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.param-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; max-height: 520px; overflow: auto; }
.param-form label { font-size: 11px; } .param-form .grp { grid-column: 1 / -1; color: var(--accent-ink); font-weight: 800; font-size: 12px; margin-top: 8px; }

/* modal / toast */
.modal { position: fixed; inset: 0; background: rgba(20,22,40,.45); z-index: 60; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.on { display: flex; }
.modal-box { background: var(--bg); border-radius: 16px; padding: 24px; width: 100%; max-width: 440px; box-shadow: var(--shadow); } .modal-box h2 { margin-bottom: 4px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--text); color: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 80; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); } .toast.err, .toast.err.show { background: var(--danger); color: #fff; }
.err { color: var(--danger); font-weight: 700; }

/* ---------- tutorial & help ---------- */
.tut-ov { position: fixed; inset: 0; z-index: 100; display: none; } .tut-ov.on { display: block; } .tut-ov.dim { background: rgba(20,22,40,.55); }
.tut-ring { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(20,22,40,.55), 0 0 0 3px var(--accent); pointer-events: none; transition: all .25s; }
.tut-card { position: fixed; background: #fff; color: var(--text); border-radius: 16px; padding: 18px 20px; display: grid; grid-template-columns: 90px 1fr; gap: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.3); transition: top .25s, left .25s; max-height: calc(100vh - 24px); overflow: auto; }
.tut-card .tut-char svg { width: 90px; height: 90px; }
.tut-card h3 { margin: 2px 0 6px; font-size: 17px; } .tut-card p { margin: 0 0 12px; font-size: 14px; line-height: 1.65; }
.tut-step { font-size: 11px; color: var(--muted); font-weight: 700; } .tut-btns { display: flex; gap: 6px; align-items: center; } .tut-btns .spacer { flex: 1; }
@media (max-width: 520px) { .tut-card { grid-template-columns: 1fr; } .tut-card .tut-char { display: none; } }
.help-modal { position: fixed; inset: 0; background: rgba(20,22,40,.45); z-index: 90; display: none; align-items: center; justify-content: center; padding: 16px; }
.help-modal.on { display: flex; }
.help-box { background: var(--bg); border-radius: 16px; padding: 24px; max-width: 820px; width: 100%; max-height: 90vh; overflow: auto; position: relative; box-shadow: var(--shadow); }
.help-box h2 { margin: 0 0 10px; } .help-box h3 { margin: 20px 0 6px; color: var(--accent-ink); }
.help-box .tbl th { color: var(--text); white-space: nowrap; vertical-align: top; width: 150px; } .help-box .tbl td { white-space: normal; }
.help-box ol, .help-box ul { padding-left: 20px; font-size: 14px; } .help-box li { margin: 4px 0; } .help-x { position: sticky; top: 0; float: right; }

/* footer */
.ftr { border-top: 1px solid var(--line); background: var(--bg2); }
.ftr-in { max-width: 1360px; margin: 0 auto; padding: 18px 32px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }

.ulist-btns { display: grid; gap: 6px; }
.modal-box.wide { max-width: 860px; }
#mgTable input[type=text] { height: 34px; font-size: 14px; min-width: 160px; }
#mgTable tr.cur td:first-child::before { content: "● "; color: var(--accent); }

/* flow columns: CSS 다단으로 왼쪽 열을 채운 뒤 오른쪽으로 이어짐 (공백 없음) */
.flow-2col { column-count: 2; column-gap: 20px; border: 0; border-radius: 0; overflow: visible; }
.flow-2col li { break-inside: avoid; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; padding: 12px 14px; grid-template-columns: 112px 32px 1fr; background: var(--bg); }
.flow-2col li.main { background: var(--accent-soft); border-color: #d6d4f7; } .flow-2col li.now { background: var(--bg2); }
.flow-2col li.main .ttl { font-size: 17px; }
.flow-2col li.hdr { display: flex; justify-content: space-between; align-items: baseline; border: 0; background: transparent; padding: 10px 4px 4px; margin: 0 0 4px; font-weight: 800; font-size: 15px; opacity: 1; }
.flow-2col li.hdr + li { break-before: avoid; }
@media (max-width: 1000px) { .flow-2col { column-count: 1; } }

/* ---------- day view ---------- */
.flow-head { margin-top: 28px; margin-bottom: 10px; } .flow-head .sec-t { margin: 0; }
.dv { position: relative; margin-left: 64px; border-left: 1px solid var(--line2); }
.dv-h { position: absolute; left: -64px; right: 0; border-top: 1px solid var(--line); pointer-events: none; }
.dv-h span { position: absolute; left: 0; top: -9px; width: 56px; text-align: right; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; background: var(--bg); line-height: 18px; }
.dv-h.mid { border-top: 2px solid var(--line2); } .dv-h.mid span { color: var(--text); font-weight: 700; width: 60px; }
.dv-past { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0,0,0,.025) 6px 7px); pointer-events: none; }
.dv-block { position: absolute; left: 12px; width: 27%; z-index: 2; border-radius: 10px; padding: 8px 12px; overflow: hidden; border: 1px solid transparent; animation: dvin .45s ease both; animation-delay: calc(var(--i) * 60ms); }
.dv-block.nap { background: #e6f7f0; border-color: #bfe9d8; } .dv-block.main { background: var(--accent-soft); border-color: #d6d4f7; }
.dv-block.split { background: #fff0e5; border-color: #f7d4bd; } .dv-block.warn { background: var(--warn-soft); border-color: #f3d9b3; }
.dv-block.now { box-shadow: 0 0 0 2px var(--accent); } .dv-block.past { opacity: .5; }
.dv-bt { display: flex; align-items: center; gap: 6px; font-size: 13.5px; } .dv-bt .ic { font-size: 16px; } .dv-bt .tm { color: var(--muted); font-size: 12px; margin-left: auto; font-variant-numeric: tabular-nums; }
.dv-block.main .dv-bt b { color: var(--accent-ink); font-size: 15px; }
.dv-ul { margin: 6px 0 0; padding-left: 14px; font-size: 12px; color: var(--muted); line-height: 1.5; } .dv-ul li { margin: 1px 0; }
.dv-block.main .dv-ul { color: var(--accent-ink); }
.dv-pill { position: absolute; height: 30px; max-width: 188px; display: flex; align-items: center; gap: 6px; padding: 0 10px 0 8px; background: var(--bg); border: 1px solid var(--line2); border-radius: 999px; font-size: 13px; white-space: nowrap; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.04); animation: dvin .45s ease both; animation-delay: calc(var(--i) * 60ms); cursor: default; }
.dv-pill .tm { font-weight: 700; font-variant-numeric: tabular-nums; } .dv-pill .ic { font-size: 14px; } .dv-pill .ttl { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.dv-pill .dsc { display: none; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.dv-pill:hover { height: auto; min-height: 30px; max-width: 340px; white-space: normal; z-index: 5; flex-wrap: wrap; padding: 6px 10px; box-shadow: var(--shadow); border-color: var(--accent); }
.dv-pill:hover .dsc { display: block; flex-basis: 100%; }
.dv-pill.warn { border-color: #f3d9b3; background: var(--warn-soft); } .dv-pill.warn .ttl { color: var(--warn); }
.dv-pill.past { opacity: .45; }
.dv-sim { position: absolute; left: -8px; right: 0; border-top: 2px dashed var(--accent); z-index: 3; pointer-events: none; }
.dv-sim span { position: absolute; right: 8px; top: 3px; white-space: nowrap; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.dv-real { position: absolute; left: -8px; right: 0; border-top: 2px solid var(--danger); z-index: 4; pointer-events: none; }
.dv-real i { position: absolute; left: -2px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1.6s ease-out infinite; }
.dv-real span { position: absolute; right: 8px; top: -24px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
@keyframes dvin { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(192,57,43,.45) } 100% { box-shadow: 0 0 0 12px rgba(192,57,43,0) } }
@media (max-width: 760px) { .dv-block { width: 36%; } .dv-pill .ttl { display: none; } }

.dv-band { position: absolute; left: 0; right: 0; pointer-events: none; }
.dv-band.work { background: rgba(245,215,110,.18); border-top: 1px dashed rgba(0,0,0,.12); border-bottom: 1px dashed rgba(0,0,0,.12); }
.dv-band.work.N { background: rgba(125,147,255,.16); } .dv-band.work.E { background: rgba(244,162,106,.16); }
.dv-band.commute, .dv-band.prep { background: repeating-linear-gradient(135deg, rgba(0,0,0,.05) 0 4px, transparent 4px 9px); }
.dv-band.event { background: rgba(224,123,123,.16); } .dv-band.log { background: rgba(185,189,212,.25); left: 12px; right: auto; width: 30%; border-radius: 8px; }
.dv-band span { position: absolute; left: 33%; top: 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.dv-band.commute span, .dv-band.prep span { display: none; } .dv-band.log span { left: 8px; right: auto; }

/* bell + drawer */
.mbtn.bell { position: relative; }
.mbtn .badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--bg); border-left: 1px solid var(--line); box-shadow: -10px 0 30px rgba(20,22,40,.12); z-index: 70; transform: translateX(100%); transition: transform .25s ease; overflow: auto; padding: 18px 20px 30px; }
.drawer.on { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; } .drawer-head h2 { margin: 0; font-size: 18px; }
.dr-sec { margin-top: 16px; } .dr-sec h3 { font-size: 12px; color: var(--muted); letter-spacing: .04em; margin: 0 0 6px; }
.dr-item { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 10px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--bg); }
.dr-item.past { opacity: .45; } .dr-item.next { border-color: var(--accent); background: var(--accent-soft); }
.dr-item.danger { border-color: #f3c2bc; background: var(--danger-soft); }
.dr-item .t { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 14px; } .dr-item .t small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.dr-item .ttl { font-weight: 700; font-size: 14px; } .dr-item .msg { font-size: 13px; color: var(--muted); margin-top: 2px; }
.dr-item .cat { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--bg3); margin-right: 6px; color: var(--muted); }
.dr-item.next .cat { background: var(--accent); color: #fff; }

.dv-sim.merged { display: none; }
.dv-real.merged { border-top-style: solid; }
.dv-real.merged span { background: linear-gradient(90deg, var(--danger), var(--accent)); }

/* timeline v2 */
.tl-panel { margin-top: 12px; }
.tl-grid { display: grid; grid-template-columns: 56px 1fr; align-items: start; }
.tl-rows { padding-top: var(--top, 18px); } .tl-row { height: var(--rh, 34px); display: flex; align-items: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.timeline-wrap { overflow-x: auto; border-left: 1px solid var(--line); scroll-behavior: smooth; }
#timeline svg { display: block; min-width: 0; width: auto; height: auto; }
.legend-grp { gap: 18px; margin: 4px 0 10px; } .lg-grp { display: inline-flex; gap: 10px; align-items: center; } .lg-grp b { color: var(--text); margin-right: 2px; }
/* evidence cards */
.ev-cards { display: grid; gap: 10px; }
.ev-card { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.ev-card > summary { list-style: none; display: flex; gap: 10px; align-items: center; padding: 12px 14px; cursor: pointer; white-space: nowrap; }
.ev-card > summary::-webkit-details-marker { display: none; } .ev-card > summary::after { content: "▾"; color: var(--muted); font-size: 12px; margin-left: 8px; } .ev-card[open] > summary::after { content: "▴"; }
.ev-n { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.ev-t { font-weight: 800; flex: 0 0 auto; } .ev-lead { color: var(--muted); font-size: 13px; text-align: right; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ev-card[open] > summary { border-bottom: 1px solid var(--line); background: var(--bg2); border-radius: 10px 10px 0 0; }
.ev-body { padding: 10px 14px 14px; }
@media (max-width: 720px) { .ev-lead { display: none; } }
/* push panel */
.push-panel { border: 1px solid var(--line); border-radius: 10px; margin-top: 10px; background: var(--bg2); }
.push-panel > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; }
.push-panel > summary::-webkit-details-marker { display: none; } .push-panel > summary::after { content: "▾"; color: var(--muted); font-size: 12px; } .push-panel[open] > summary::after { content: "▴"; }
.push-in { padding: 0 12px 12px; } .push-panel .inline { margin: 2px 0 6px; } .ok { color: var(--ok); font-weight: 700; }

.push-diag { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); margin: 4px 0; } .push-diag b { color: var(--text); font-weight: 600; margin-right: 4px; }
.push-diag p { flex-basis: 100%; margin: 4px 0 0; }
.inapp { position: fixed; top: 70px; right: 16px; z-index: 95; display: grid; gap: 8px; width: min(340px, calc(100vw - 32px)); }
.inapp-n { background: var(--bg); border: 1px solid var(--line2); border-left: 4px solid var(--accent); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); animation: dvin .3s ease both; }
.inapp-h { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 14px; } .inapp-h button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 14px; }
.inapp-b { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------- 수면 설정 v2 ---------- */
.frow { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; margin-bottom: 10px; }
.frow label { flex: 0 0 auto; } .frow label.f-grow { flex: 1 1 180px; } .frow label.f-grow input { width: 100%; }
.frow select { width: 120px; height: 40px; }
.unit { display: inline-flex; align-items: center; border: 1px solid var(--line2); border-radius: var(--r-s); overflow: hidden; background: var(--bg); }
.unit input { border: 0; width: 64px; height: 38px; text-align: right; padding-right: 6px; } .unit input:focus { outline: none; }
.unit i { font-style: normal; font-size: 12px; color: var(--muted); padding: 0 8px 0 2px; background: var(--bg2); height: 38px; display: inline-flex; align-items: center; border-left: 1px solid var(--line); }
.unit.bad { border-color: var(--danger); } .unit.bad i { color: var(--danger); background: var(--danger-soft); }
.rangebar { position: relative; height: 54px; margin: 8px 4px 0; }
.rangebar .track { position: absolute; left: 0; right: 0; top: 20px; height: 8px; background: var(--bg3); border-radius: 999px; }
.rangebar .seg { position: absolute; top: 20px; height: 8px; border-radius: 999px; background: var(--accent-soft); }
.rangebar .seg.anchor { background: #c9c6f5; }
.rangebar .mark { position: absolute; top: 14px; width: 2px; height: 20px; background: var(--muted); transform: translateX(-1px); }
.rangebar .mark.target { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); top: 17px; transform: translateX(-7px); box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--accent); }
.rangebar .lbl { position: absolute; top: 38px; font-size: 11px; color: var(--muted); transform: translateX(-50%); white-space: nowrap; } .rangebar .lbl.target { color: var(--accent-ink); font-weight: 800; }
.rangebar .lbl.up { top: -2px; }
.rangebar.bad .track { background: var(--danger-soft); }
.rangebar .err-msg { position: absolute; left: 0; top: 36px; color: var(--danger); font-size: 12px; font-weight: 700; }
.pref-tbl input[type=time] { width: 126px; height: 36px; } .pref-tbl { width: auto; min-width: 520px; } .pref-tbl input[type=number] { width: 64px; height: 36px; }
.pref-tbl .wake { font-weight: 700; font-variant-numeric: tabular-nums; } .pref-tbl .wake small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.shift-tbl input[type=time] { width: 126px; height: 36px; } .shift-tbl td:last-child { width: 100%; }
.sbar { position: relative; width: 100%; min-width: 160px; max-width: 420px; height: 14px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.sbar i { position: absolute; top: 0; height: 100%; } .sbar.D i { background: var(--D);} .sbar.E i { background: var(--E);} .sbar.N i { background: var(--N);}
.sbar b { position: absolute; top: 0; height: 100%; width: 1px; background: rgba(0,0,0,.12); }
.sbar-axis { display: flex; justify-content: space-between; width: 100%; max-width: 420px; font-size: 9.5px; color: var(--muted); margin-top: 2px; }

/* 수면 목표 / 출퇴근 높이 맞춤 */
.two-col.eq > div { display: flex; } .two-col.eq > div > .panel { flex: 1; display: flex; flex-direction: column; margin-bottom: 16px; }
.two-col.eq .frow { margin-bottom: 8px; } .two-col.eq .frow label .unit input { width: 56px; }
.commute-bar .seg { background: var(--bg3); } .commute-bar .seg.prep { background: #e8e7fb; } .commute-bar .seg.go { background: #d9d7f7; } .commute-bar .seg.work { background: var(--D); } .commute-bar .seg.back { background: #d9d7f7; }
.commute-bar .lbl.up { top: -2px; }

/* ? 툴팁 */
.q { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--bg3); color: var(--muted); font-size: 11px; font-weight: 800; cursor: help; position: relative; vertical-align: 1px; }
.q:hover { background: var(--accent); color: #fff; }
.q::after { content: attr(data-tip); position: absolute; left: 0; top: 22px; width: 260px; background: var(--text); color: #fff; font-size: 12px; font-weight: 500; line-height: 1.5; padding: 8px 10px; border-radius: 8px; box-shadow: var(--shadow); z-index: 30; display: none; white-space: normal; }
.q:hover::after { display: block; }
/* 출퇴근 상대 바 + 근무별 시각 */
.commute-rows { display: grid; gap: 4px; margin-top: 6px; font-size: 12.5px; }
.commute-rows div { display: grid; grid-template-columns: 56px 1fr; align-items: center; } .commute-rows span { color: var(--muted); } .commute-rows b { font-weight: 600; color: var(--text); }

.lt { display: inline-flex; align-items: center; gap: 5px; }
.commute-bar { margin-left: 44px; margin-right: 40px; }
.commute-rows + .muted { margin-top: 6px; }

.commute-bar { height: 64px; } .commute-bar .lbl.low { top: 52px; }

/* 네 칸을 행 끝까지 균등 배치 */
.frow.four { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.frow.four label { display: flex; flex-direction: column; } .frow.four .unit { width: 100%; } .frow.four .unit input { width: 100%; min-width: 0; }
.two-col.eq .frow.four label .unit input { width: 100%; }
h3.lt { display: flex; }
/* 근무별 선호 수면: 전체 폭 */
.pref-tbl { width: 100%; min-width: 0; table-layout: fixed; }
.pref-tbl th:nth-child(1) { width: 22%; } .pref-tbl th:nth-child(2) { width: 24%; } .pref-tbl th:nth-child(3) { width: 18%; } .pref-tbl th:nth-child(4) { width: 14%; } .pref-tbl th:nth-child(5) { width: 22%; }
.pref-tbl input[type=time] { width: 100%; max-width: 160px; } .pref-tbl .unit { width: 100%; max-width: 120px; } .pref-tbl .unit input { width: 100%; min-width: 0; }
.pref-tbl td, .pref-tbl th { white-space: normal; }

/* 근무 시간대 표 전체 폭 */
.shift-tbl { width: 100%; table-layout: fixed; }
.shift-tbl th:nth-child(1) { width: 14%; } .shift-tbl th:nth-child(2), .shift-tbl th:nth-child(3) { width: 20%; } .shift-tbl th:nth-child(4) { width: 46%; }
.shift-tbl input[type=time] { width: 100%; max-width: 200px; } .shift-tbl td:last-child { width: auto; }
.sbar, .sbar-axis { max-width: 100%; }
.pref-tbl input[type=time] { max-width: 200px; } .pref-tbl .unit { max-width: 140px; }
.frow select { width: 100%; min-width: 150px; }

/* ---------- 근무표 v2 ---------- */
.cal-tools { display: grid; gap: 8px; margin: 6px 0 10px; }
.pat-in { width: 190px; } .w150 { width: 150px; } .inline.small { font-size: 12px; color: var(--muted); gap: 4px; }
#patPresets .chip-btn { background: var(--bg2); border: 1px solid var(--line2); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
#patPresets .chip-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.calendar.compact { gap: 4px; } .calendar.compact .cell { min-height: 46px; padding: 4px 6px; border-radius: 8px; }
.calendar.compact .cell .d { font-size: 11px; } .calendar.compact .cell .code { margin-top: 2px; font-size: 12px; padding: 1px 7px; }
.calendar.compact .cell .tag { font-size: 9.5px; top: 4px; right: 5px; }
.calendar.compact .cell.other { opacity: .35; }
.small-more { margin-top: 8px; border: 0; } .small-more > summary { padding: 4px 0; font-weight: 600; } .small-more > summary::before { content: "▸ "; } .small-more[open] > summary::before { content: "▾ "; }
.small-more textarea { margin: 6px 0; }
#upResult { margin-top: 8px; } #upResult b { color: var(--text); }
.btn.file input { display: none; }
.cal-tools .pat-in { width: 200px; flex: 0 0 auto; }
.cal-tools label.inline.small { flex-direction: row; align-items: center; font-weight: 600; } .cal-tools label.inline.small input { width: auto; }
.cal-tools .inline.wrap { gap: 8px 10px; }
.inline.small input[type=month] { width: 150px; }

/* 근무표 도구/양식 행 정렬 */
.tools-row { margin-bottom: 12px; } .tools-row label { gap: 6px; } .tools-row .inline { align-self: flex-end; }
.tools-row .inline .btn, .frow .inline .btn { height: 40px; }
#patPresets .chip-btn { height: 40px; }
.frow .w150, .frow input[type=month], .frow input[type=date] { height: 40px; }
.frow .unit input { width: 56px; } .frow .unit, .frow .unit i { height: 40px; }
.frow label.btn.file { flex-direction: row; height: 40px; display: inline-flex; align-items: center; color: #fff; }
.frow .inline { align-self: flex-end; gap: 8px; }

.cal-tools { gap: 4px; } .tools-row:first-of-type { margin-bottom: 2px; }
.two-col.eq .panel p.muted.small { min-height: 42px; }

/* 주말·공휴일 */
.calendar .cell.sat .d { color: #2f6fd6; } .calendar .cell.hol .d { color: var(--danger); font-weight: 700; }
.calendar .cell .hn { position: absolute; left: 6px; bottom: 4px; font-size: 9.5px; color: var(--danger); max-width: calc(100% - 10px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar.compact .cell { min-height: 54px; }
.tools-row label.check.skip-off { align-self: flex-end; height: 40px; white-space: nowrap; }
.hol-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
.hol-list span { background: var(--danger-soft); color: var(--danger); border-radius: 999px; padding: 3px 8px 3px 10px; font-size: 12px; display: inline-flex; gap: 6px; align-items: center; }
.hol-list span button { border: 0; background: none; color: var(--danger); cursor: pointer; font-size: 12px; padding: 0; }
.hol-list span.custom { background: var(--warn-soft); color: var(--warn); } .hol-list span.custom button { color: var(--warn); }
.calendar .cell .hn { left: auto; right: 5px; bottom: 6px; max-width: 58%; text-align: right; }
.calendar.compact .cell { min-height: 56px; }

/* 휴일 이름을 날짜 옆에 */
.calendar .cell .d { display: inline-flex; align-items: baseline; gap: 4px; max-width: calc(100% - 4px); }
.calendar .cell .d em { font-style: normal; font-size: 9.5px; color: var(--danger); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 64px; }
.calendar .cell.range .d em { max-width: 36px; }
.calendar .cell .hn { display: none; }

#patPresets .chip-btn { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 6px; }
.pat-code { display: inline-flex; gap: 1px; } .pat-code i { font-style: normal; width: 14px; height: 18px; border-radius: 4px; font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; color: #1f2330; }
.pat-code i.D { background: var(--D); } .pat-code i.E { background: var(--E); } .pat-code i.N { background: var(--N); color: #fff; } .pat-code i.O { background: var(--O); }
.frow label.full { flex: 1 1 100%; } #patPresets { display: flex; flex-wrap: wrap; gap: 6px; }
#patPresets .chip-btn { height: auto; min-height: 36px; white-space: normal; text-align: left; }

/* 추천 패턴: 같은 크기 칸, 한 줄 */
#patPresets { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; width: 100%; }
#patPresets .chip-btn { height: 40px; min-height: 40px; white-space: nowrap; justify-content: flex-start; overflow: hidden; }
#patPresets .chip-btn span.txt { overflow: hidden; text-overflow: ellipsis; }
#patPresets .chip-btn { height: auto; min-height: 54px; flex-direction: column; align-items: flex-start; gap: 4px; padding: 7px 12px; border-radius: 10px; }
#patPresets .chip-btn span.txt { font-size: 12.5px; font-weight: 700; white-space: nowrap; }

#patPresets { display: flex; flex-wrap: wrap; width: auto; }
#patPresets .chip-btn { flex-direction: row; align-items: center; min-height: 40px; height: 40px; padding: 4px 14px 4px 8px; border-radius: 999px; gap: 10px; }
#patPresets .chip-btn span.txt { font-size: 13px; }
#patPresets { align-self: flex-start; }

.apply-bar { position: sticky; top: 64px; z-index: 15; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--warn-soft); border: 1px solid #f3d9b3; color: var(--warn); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; font-size: 13px; font-weight: 700; }

.head-actions { gap: 8px; } .dirty-badge { font-size: 12.5px; font-weight: 700; color: var(--warn); background: var(--warn-soft); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.apply-bar { display: none; }

/* ---------- 수면 기록 v2 ---------- */
.w130 { width: 130px; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chips button { background: var(--bg2); border: 1px solid var(--line2); border-radius: 999px; padding: 0 11px; height: 32px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text); }
.chips button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chips input { width: 58px; height: 32px; font-size: 13px; padding: 0 8px; }
.log-preview { font-size: 14px; } .log-preview b { font-size: 16px; color: var(--accent-ink); } .log-preview .bad { color: var(--danger); font-weight: 700; }
.sleep-strips { display: grid; gap: 4px; margin-top: 8px; }
.strip { display: grid; grid-template-columns: 54px 28px 1fr 230px; gap: 8px; align-items: center; font-size: 12.5px; }
.strip .day { font-weight: 700; font-variant-numeric: tabular-nums; } .strip .day small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 500; }
.strip .bar { position: relative; height: 22px; background: var(--bg2); border-radius: 6px; overflow: hidden; }
.strip .bar b { position: absolute; top: 0; height: 100%; width: 1px; background: rgba(0,0,0,.08); }
.strip .bar i { position: absolute; top: 3px; height: 16px; border-radius: 4px; cursor: pointer; }
.strip .bar i.main { background: #5b5bd6; } .strip .bar i.split { background: #f4a26a; } .strip .bar i.nap { background: #5cc8a3; }
.strip .bar i.work { top: 0; height: 100%; background: repeating-linear-gradient(135deg, rgba(0,0,0,.06) 0 4px, transparent 4px 9px); border-radius: 0; cursor: default; }
.strip .bar i.sel { outline: 2px solid var(--text); outline-offset: 1px; }
.strip .info { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .strip .info b { color: var(--text); }
.strip.axis { color: var(--muted); font-size: 10.5px; } .strip.axis .ax { display: flex; justify-content: space-between; }
.strip-edit { background: var(--bg2); border-radius: 10px; padding: 10px 12px; margin: 4px 0 6px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
@media (max-width: 760px) { .strip { grid-template-columns: 48px 24px 1fr; } .strip .info { grid-column: 1 / -1; } }
.strip-edit label.inline.small { flex-direction: row; align-items: center; gap: 6px; white-space: nowrap; font-weight: 600; }
.strip-edit input[type=datetime-local] { width: 200px; height: 36px; } .strip-edit input[type=number] { width: 64px; height: 36px; } .strip-edit select { width: auto; height: 36px; }
.strip-edit > span.inline { margin-left: auto; }



/* 띠에서 클릭으로 추가 */
.inline-sel { display: inline-block; width: auto; height: 30px; padding: 2px 6px; font-size: 14px; font-weight: 700; margin: 0 4px; }
.pick-hint { margin: 0 0 4px; }
.strip .bar { cursor: crosshair; }
.strip .bar .cur { position: absolute; top: 0; height: 100%; width: 1px; background: var(--accent); pointer-events: none; display: none; }
.strip .bar .cur span { position: absolute; top: -18px; left: 4px; font-size: 10.5px; color: var(--accent-ink); font-weight: 700; background: var(--bg); padding: 0 3px; border-radius: 3px; white-space: nowrap; }
.strip .bar:hover .cur { display: block; }
.strip .bar .pk { position: absolute; top: -4px; height: calc(100% + 8px); width: 4px; margin-left: -2px; background: var(--accent-ink); border-radius: 2px; z-index: 3; }
.strip .bar .pk.end { background: var(--danger); }
.strip .bar .pk span { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 10.5px; font-weight: 800; color: #fff; background: var(--accent-ink); padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
.strip .bar .pk.end span { background: var(--danger); }
.strip .bar .pk-range { position: absolute; top: 2px; height: 18px; background: rgba(91,91,214,.3); border: 1.5px dashed var(--accent-ink); border-radius: 4px; pointer-events: none; z-index: 2; }
.strip .bar { overflow: visible; }
.pick-pop { background: var(--bg); border: 1px solid var(--accent); border-radius: 12px; padding: 10px 12px; margin: 4px 0 6px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13.5px; box-shadow: var(--shadow); }
.pick-pop b { color: var(--accent-ink); } .pick-pop .seg button { height: 32px; }

#sub-logs .nb-date { margin-right: 6px; } #sub-logs .nb-date input[type=date] { width: 150px; height: 36px; } #sub-logs .nb-date .ib { height: 36px; }
#logSummary { margin-left: 8px; }

#logTable input[type=datetime-local] { width: 190px; height: 34px; font-size: 13px; } #logTable input[type=number] { height: 34px; font-size: 13px; } #logTable select { height: 34px; width: auto; font-size: 13px; }
#logTable td { padding: 5px 6px; }
#logTable input[type=number] { width: 74px; padding: 0 6px; text-align: right; }
#logTable input[type=datetime-local] { width: 182px; padding: 0 6px; }

/* ---------- 수면 기록 추가 양식 정리 ---------- */
.logform h3 { margin-bottom: 12px; }
.lf-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 860px) { .lf-grid { grid-template-columns: 1fr; } }
.lf-sec { background: var(--bg2); border-radius: 12px; padding: 14px; }
.lf-title { font-size: 12.5px; font-weight: 800; color: var(--accent-ink); letter-spacing: .02em; margin-bottom: 10px; display: flex; gap: 8px; align-items: baseline; }
.type-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.type-tiles button { background: var(--bg); border: 2px solid var(--line); border-radius: 12px; padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; font: inherit; color: var(--text); }
.type-tiles button .ic { font-size: 20px; } .type-tiles button b { font-size: 13.5px; } .type-tiles button small { font-size: 11px; color: var(--muted); }
.type-tiles button.active { border-color: var(--accent); background: var(--accent-soft); } .type-tiles button.active b { color: var(--accent-ink); }
.lf-sec .frow { margin-bottom: 0; } .lf-sec .frow label { flex: 1 1 110px; } .lf-sec .frow label input { width: 100%; }
.opt-row { display: grid; grid-template-columns: 118px 1fr; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.opt-row:last-child { border-bottom: 0; } .opt-lbl { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.lf-sec .chips button { background: var(--bg); border: 1px solid var(--line2); color: var(--muted); height: 30px; padding: 0 10px; font-weight: 600; }
.lf-sec .chips button.on { background: var(--bg); border-color: var(--accent); color: var(--accent-ink); font-weight: 800; }
.lf-sec .chips button.on::before { content: "✓ "; }
.lf-sec .chips input { width: 64px; height: 30px; border-style: dashed; }
.lf-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.btn.lg { height: 44px; padding: 0 22px; font-size: 15px; }

#lgTypeSeg.type-tiles { height: auto; } #lgTypeSeg.type-tiles button { height: auto; min-height: 78px; }
.lf-sec .frow { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 8px; } .lf-sec .frow label { flex: none; }

.sleep-strips { padding-top: 6px; } .sleep-strips .strip:not(.axis) { margin-bottom: 14px; }
.strip .bar:hover .pk ~ .cur { display: block; }

.strip-ctl { margin-left: auto; justify-content: flex-end; gap: 10px; } .strip-ctl #logSummary { margin: 0; }
.bulk { display: inline-flex; align-items: center; gap: 6px; padding-right: 12px; margin-right: 4px; border-right: 1px solid var(--line); }

.pick-hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.warn-box { background: var(--danger-soft); border: 1px solid #f3c2bc; border-radius: 10px; padding: 8px 12px; margin-top: 8px; display: grid; gap: 4px; font-size: 13px; }
.warn-box b { color: var(--danger); }
.warn-item { text-align: left; background: none; border: 0; padding: 2px 0; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; text-decoration: underline dotted; }
.warn-item:hover { color: var(--danger); }
.pick-warn { flex-basis: 100%; color: var(--danger); font-size: 12.5px; font-weight: 700; }
.strip .bar .pk.start span { left: auto; right: 0; transform: none; border-top-right-radius: 2px; }
.strip .bar .pk.end span { left: 0; transform: none; border-top-left-radius: 2px; }

/* 수면 띠 헤더 높이 통일 */
.strip-ctl #logToday, .strip-ctl .nb-date, .strip-ctl .nb-date .ib, .strip-ctl .nb-date input[type=date] { height: 38px; }
.strip-ctl .nb-date { align-items: stretch; }
/* 확인 필요 기록 카드 */
.warn-card { margin-top: 10px; border: 1px solid #f3c2bc; border-left: 4px solid var(--danger); border-radius: 10px; background: #fff; overflow: hidden; }
.warn-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--danger-soft); font-size: 13px; }
.warn-head b { color: var(--danger); } .warn-ic { color: var(--danger); font-size: 14px; }
.warn-row { display: grid; grid-template-columns: 150px 64px 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 13px; }
.wtime { font-weight: 700; font-variant-numeric: tabular-nums; }
.wtype { display: inline-block; text-align: center; font-size: 11.5px; font-weight: 700; padding: 2px 6px; border-radius: 999px; color: #fff; }
.wtype.main { background: #5b5bd6; } .wtype.split { background: #f4a26a; } .wtype.nap { background: #5cc8a3; }
.wmsg { color: var(--text); }
@media (max-width: 720px) { .warn-row { grid-template-columns: 1fr auto; } .wmsg { grid-column: 1 / -1; } }

/* 로고 워드마크: '리'는 그라데이션 네모에 흰 글자 */
.logo-t { display: inline-flex; align-items: center; gap: 3px; }
.logo-box { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #8a7dff 0%, #5b5bd6 60%, #4747b8 100%); color: #fff; font-weight: 900; font-size: 17px; line-height: 1; box-shadow: 0 2px 6px rgba(91,91,214,.35); letter-spacing: 0; }
.logo-rest { font-weight: 900; font-size: 19px; letter-spacing: -.02em; color: var(--text); }
.logo:hover .logo-box { filter: brightness(1.08); }
/* 로고 글자 크기·높이 통일 */
.logo-t { gap: 4px; height: 30px; }
.logo-box { width: 30px; height: 30px; font-size: 18px; font-weight: 800; border-radius: 9px; padding-bottom: 1px; }
.logo-rest { font-size: 18px; font-weight: 800; line-height: 30px; height: 30px; display: inline-flex; align-items: center; letter-spacing: -.01em; }
.logo svg { width: 32px; height: 32px; }
/* 로고: 네모 없이 '리'만 보라 그라데이션 글자 */
.logo-t { gap: 0; }
.logo-box { width: auto; height: 30px; padding: 0; border-radius: 0; box-shadow: none; background: linear-gradient(135deg, #8a7dff, #5b5bd6); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; font-size: 20px; font-weight: 900; }
.logo-rest { font-size: 20px; font-weight: 900; }
.logo:hover .logo-box { filter: none; }

/* ---------- 오늘 상태 v2 ---------- */
.awake-preview { background: var(--bg2); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin: 4px 0 12px; } .awake-preview b { color: var(--accent-ink); } .awake-preview .bad { color: var(--danger); font-weight: 700; }
.switches { display: grid; gap: 8px; }
.switch { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; cursor: pointer; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.switch input { display: none; }
.switch .sw { width: 44px; height: 24px; border-radius: 999px; background: var(--line2); position: relative; transition: .2s; }
.switch .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .sw { background: var(--accent); } .switch input:checked + .sw::after { left: 23px; }
.switch .sw-t b { display: block; font-size: 14px; color: var(--text); } .switch .sw-t small { color: var(--muted); font-size: 12px; }
.mini-strip { position: relative; height: 26px; background: var(--bg2); border-radius: 6px; margin: 8px 0 4px; overflow: hidden; }
.mini-strip i { position: absolute; top: 0; height: 100%; } .mini-strip b { position: absolute; top: 0; height: 100%; width: 1px; background: rgba(0,0,0,.08); }
.mini-strip span.ax { position: absolute; bottom: 0; font-size: 9.5px; color: var(--muted); transform: translateX(-50%); }
.mini-strip i.ev { background: rgba(224,123,123,.55); } .mini-strip i.now { width: 2px; background: var(--accent); }
.mini-strip i.ev span { position: absolute; left: 4px; top: 5px; font-size: 10.5px; font-weight: 700; color: #7a2e2e; white-space: nowrap; }
.lux-presets { margin-bottom: 4px; } .lux-presets .chip-btn { height: 32px; padding: 0 10px; font-size: 12.5px; }
.row.lux { grid-template-columns: 120px 120px 1fr auto; } .row.lux .chips button { height: 30px; padding: 0 9px; font-size: 12.5px; } .row.lux .chips input { width: 64px; height: 30px; }
.row.ev { grid-template-columns: 1.2fr 1.2fr 1fr auto; }
.row.lux { grid-template-columns: 1fr 1fr auto; row-gap: 4px; padding: 8px 10px; background: var(--bg2); border-radius: 10px; }
.row.lux .chips { grid-column: 1 / -1; flex-wrap: wrap; } .row.lux .chips button { height: 28px; padding: 0 9px; font-size: 12px; } .row.lux .chips input { width: 60px; height: 28px; font-size: 12px; }
.row.lux input[type=time] { height: 36px; }
#luxRows { gap: 8px; }

.clock { font-size: 13px; color: var(--muted); text-align: right; line-height: 1.4; } .clock b { color: var(--text); font-variant-numeric: tabular-nums; font-size: 15px; } .clock small { display: block; }
.sw-t .q { vertical-align: 0; }

.awake-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.awake-lbl { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; }
.awake-row input[type=datetime-local] { width: 220px; height: 40px; flex: 0 0 auto; }
.awake-auto { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.awake-auto .tag-auto { background: var(--ok-soft); color: var(--ok); font-weight: 700; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; }
.awake-auto .tag-manual { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; }
.awake-auto button { background: none; border: 0; color: var(--accent-ink); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; text-decoration: underline; padding: 0; }
@media (max-width: 560px) { .awake-row input[type=datetime-local] { width: 100%; } }

.awake-row { flex-wrap: nowrap; } .awake-row input[type=datetime-local] { width: 230px; }
.awake-preview .awake-auto { margin-bottom: 4px; }

/* 미니 띠 클릭 선택 */
.mini-strip.pickable { cursor: crosshair; overflow: visible; height: 30px; margin-top: 18px; }
.mini-strip .cur { position: absolute; top: 0; height: 100%; width: 1px; background: var(--accent); pointer-events: none; display: none; }
.mini-strip .cur span { position: absolute; top: -17px; left: 4px; font-size: 10.5px; color: var(--accent-ink); font-weight: 700; background: var(--bg); padding: 0 3px; border-radius: 3px; white-space: nowrap; }
.mini-strip.pickable:hover .cur { display: block; }
.mini-strip .pk { position: absolute; top: -4px; height: calc(100% + 8px); width: 4px; margin-left: -2px; border-radius: 2px; background: var(--accent-ink); z-index: 3; }
.mini-strip .pk.end { background: var(--danger); }
.mini-strip .pk span { position: absolute; bottom: -20px; font-size: 10.5px; font-weight: 800; color: #fff; background: var(--accent-ink); padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
.mini-strip .pk.start span { right: 0; } .mini-strip .pk.end span { left: 0; background: var(--danger); }
.mini-strip .pk-range { position: absolute; top: 2px; height: calc(100% - 4px); background: rgba(91,91,214,.3); border: 1.5px dashed var(--accent-ink); border-radius: 4px; pointer-events: none; z-index: 2; }
.mini-strip.pickable span.ax { bottom: auto; top: 100%; margin-top: 2px; }
.mini-strip i.ev { pointer-events: none; }
.pick-pop input[type=text] { width: 200px; height: 34px; }
#eventPop .pick-pop, #luxPop .pick-pop { margin-top: 26px; }
#eventRows, #luxRows { margin-top: 12px; }

.mini-strip.pickable { margin-top: 22px; margin-bottom: 28px; }
.mini-strip.pickable span.ax { top: auto; bottom: 100%; margin: 0 0 2px; }
.row.ev { grid-template-columns: 1fr 1fr auto; row-gap: 6px; padding: 8px 10px; background: var(--bg2); border-radius: 10px; }
.row.ev input[type=text] { grid-column: 1 / -1; } .row.ev input { height: 36px; }
#eventRows { gap: 8px; }

/* 48시간 스크롤 띠 */
.strip-scroll { overflow-x: auto; overflow-y: visible; padding: 22px 0 30px; margin: 0 -4px; }
.strip-scroll .mini-strip.wide { width: 190%; min-width: 720px; margin: 0 4px; }
.mini-strip b.day { width: 2px; background: rgba(0,0,0,.25); }
.mini-strip span.ax.day { font-weight: 800; color: var(--text); }

/* 리듬이가 전하는 위험 알림 말풍선 */
.char-bubble { position: relative; margin-top: 14px; background: #fff; border: 2px solid var(--danger); border-radius: 16px; padding: 12px 16px; box-shadow: 0 6px 20px rgba(192,57,43,.12); animation: dvin .4s ease both; }
.char-bubble::before { content: ""; position: absolute; left: -14px; top: 18px; border: 8px solid transparent; border-right-color: var(--danger); border-left: 0; }
.char-bubble::after { content: ""; position: absolute; left: -10px; top: 20px; border: 6px solid transparent; border-right-color: #fff; border-left: 0; }
.char-bubble .cb-head { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--danger); font-size: 14px; }
.char-bubble .cb-item { margin-top: 6px; font-size: 14px; } .char-bubble .cb-item b { display: block; color: var(--danger); } .char-bubble .cb-item span { color: var(--text); }
.char-bubble .cb-item + .cb-item { border-top: 1px dashed var(--line); padding-top: 6px; }
.char-bubble .cb-foot { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.hero-char.alert svg { animation: float 4s ease-in-out infinite, nudge .6s ease 2; }
@keyframes nudge { 0%,100% { transform: translateX(0) } 25% { transform: translateX(-5px) rotate(-3deg) } 75% { transform: translateX(5px) rotate(3deg) } }
@media (max-width: 720px) { .char-bubble::before, .char-bubble::after { left: 30px; top: -10px; border: 8px solid transparent; border-bottom-color: var(--danger); border-top: 0; } .char-bubble::after { top: -6px; left: 32px; border: 6px solid transparent; border-bottom-color: #fff; border-top: 0; } }

/* ---------- 히어로 2패널 ---------- */
.hero2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.hero-l { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: center; margin-bottom: 0; }
.hero-l .hero-char svg { width: 140px; height: 140px; }
.hero-l h1 { font-size: 24px; }
.hero-r { margin-bottom: 0; }
.kv2 { display: grid; gap: 8px; }
.kv2 > div { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 10px; font-size: 14px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.kv2 > div:last-child { border-bottom: 0; } .kv2 > div > span:first-child { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kv2 b { font-weight: 700; }
.shiftvec { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; } .shiftvec .sv { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--muted); }
.shiftvec .sv.today .code { outline: 2px solid var(--accent); outline-offset: 1px; }
.hero-r .char-bubble { margin-top: 12px; }
.hero-r .char-bubble::before, .hero-r .char-bubble::after { display: none; }
@media (max-width: 900px) { .hero2 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .hero-l { grid-template-columns: 1fr; text-align: center; } .hero-l .hero-char { display: flex; justify-content: center; } }

/* 원래 히어로로 복귀 + 캐릭터가 알림을 주는 표현 */
.hero2, .hero-l, .hero-r, .kv2 { display: none; }
.hero-char { position: relative; }
.char-badge { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: var(--danger); color: #fff; font-weight: 900; font-size: 16px; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px #fff, 0 4px 10px rgba(192,57,43,.35); animation: badgePop .5s cubic-bezier(.3,1.6,.5,1) both, badgePulse 1.8s ease-in-out .5s infinite; }
@keyframes badgePop { from { transform: scale(0) } to { transform: scale(1) } }
@keyframes badgePulse { 0%,100% { box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(192,57,43,.35) } 50% { box-shadow: 0 0 0 3px #fff, 0 0 0 10px rgba(192,57,43,0) } }
.char-bubble { animation: bubblePop .45s cubic-bezier(.3,1.4,.5,1) both; transform-origin: left top; }
@keyframes bubblePop { from { opacity: 0; transform: scale(.85) translateX(-8px) } to { opacity: 1; transform: none } }
.char-bubble .cb-who { display: inline-block; background: var(--danger); color: #fff; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; margin-right: 2px; }
.hero .char-bubble::before, .hero .char-bubble::after { display: block; }

.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line2); display: inline-block; }
.sync-dot.ok { background: var(--ok); } .sync-dot.busy { background: var(--warn); } .sync-dot.err { background: var(--danger); }

/* ---------- 로그인 게이트 (배포본, Cognito) ---------- */
body.gated > :not(#authGate) { display: none; }
#authGate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--bg2); }
.gate-card { background: var(--bg); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); max-width: 400px; width: 100%; padding: 32px 28px; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.gate-char { width: 120px; margin: 0 auto 4px; }
.gate-card h1 { font-size: 22px; margin: 0; }
.gate-card p { color: var(--muted); font-size: 14px; margin: 0 0 10px; line-height: 1.5; }
.gate-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 16px; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; background: var(--bg); color: var(--text); border: 1px solid var(--line2); transition: background .15s, box-shadow .15s; }
.gate-btn:hover { background: var(--bg2); }
.gate-btn.google { border-color: #dadce0; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.gate-btn.google:hover { background: #f8f9fa; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.gate-btn .gate-ico { width: 20px; height: 20px; flex: none; }
.gate-btn:not(.google) .gate-ico { color: var(--accent); }
.gate-card .gate-foot { font-size: 12px; margin: 8px 0 0; }
