@font-face {
  font-family: "Pretendard Variable";
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
  src: url("vendor/PretendardVariable.woff2") format("woff2-variations");
}

/* ---------- 색·크기 규칙 (MSDS 조회 사이트와 같은 규칙) ---------- */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --fill: #f5f5f7;
  --fill-2: rgba(118, 118, 128, 0.12);
  --line: rgba(0, 0, 0, 0.1);
  --line-2: rgba(0, 0, 0, 0.07);
  --text: #1d1d1f;
  --text-2: #55555a;
  --text-3: #76767b;
  --accent: #0071e3;
  --accent-fill: #0071e3;
  --link: #0066cc;
  --accent-weak: color-mix(in srgb, var(--accent) 12%, transparent);
  --danger: #d70015;
  --danger-weak: rgba(215, 0, 21, 0.08);
  --ok: #248a3d;
  --warn: #b64400;
  --nav: rgba(255, 255, 255, 0.8);
  --pop-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 20px 50px rgba(0, 0, 0, 0.16);
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 10px;
  --side-w: 212px;
  --top-h: 52px;
  --ease: cubic-bezier(0.4, 0, 0.6, 1);
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
}
:root[data-theme="dark"] {
  --bg: #000000;
  --surface: #1c1c1e;
  --fill: #2c2c2e;
  --fill-2: rgba(118, 118, 128, 0.24);
  --line: rgba(255, 255, 255, 0.14);
  --line-2: rgba(255, 255, 255, 0.09);
  --text: #f5f5f7;
  --text-2: #b4b4b9;
  --text-3: #98989e;
  --accent: #2997ff;
  --accent-fill: #0a84ff;
  --link: #2997ff;
  --accent-weak: color-mix(in srgb, var(--accent) 20%, transparent);
  --danger: #ff453a;
  --danger-weak: rgba(255, 69, 58, 0.16);
  --ok: #30d158;
  --warn: #ff9f0a;
  --nav: rgba(22, 22, 23, 0.8);
  --pop-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 24px 60px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}
/* 강조색 (설정에서 고름) */
:root[data-accent="indigo"] { --accent: #4f4bd8; --accent-fill: #4f4bd8; --link: #4f4bd8; }
:root[data-accent="purple"] { --accent: #8e44c9; --accent-fill: #8e44c9; --link: #8e44c9; }
:root[data-accent="pink"] { --accent: #d92b6a; --accent-fill: #d92b6a; --link: #d92b6a; }
:root[data-accent="green"] { --accent: #1f8a4c; --accent-fill: #1f8a4c; --link: #1f8a4c; }
:root[data-accent="graphite"] { --accent: #48484d; --accent-fill: #48484d; --link: #48484d; }
:root[data-theme="dark"][data-accent="indigo"] { --accent: #8e8bff; --accent-fill: #5e5ce6; --link: #8e8bff; }
:root[data-theme="dark"][data-accent="purple"] { --accent: #c77dff; --accent-fill: #9f52e0; --link: #c77dff; }
:root[data-theme="dark"][data-accent="pink"] { --accent: #ff6b96; --accent-fill: #e83e79; --link: #ff6b96; }
:root[data-theme="dark"][data-accent="green"] { --accent: #34c768; --accent-fill: #23974f; --link: #34c768; }
:root[data-theme="dark"][data-accent="graphite"] { --accent: #b4b4bc; --accent-fill: #6a6a72; --link: #b4b4bc; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-width: thin; scrollbar-color: var(--fill-2) transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums;
}
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 40px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; }
h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.025em; }
.muted { color: var(--text-2); }
.grow { flex: 1; }
.ic { width: 18px; height: 18px; flex: none; }
kbd {
  font: 500 11px/1 inherit; letter-spacing: 0; color: var(--text-3);
  border: 1px solid var(--line); border-radius: 5px; padding: 3px 5px;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---------- 버튼: 둥근 알약 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 17px;
  border: 0; border-radius: 980px;
  background: var(--fill-2); font-size: 16px; font-weight: 500; white-space: nowrap;
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease), opacity 0.2s;
}
.btn:hover { background: color-mix(in srgb, var(--text) 14%, transparent); }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.35; cursor: default; transform: none; }
.btn.icon { width: 40px; padding: 0; }
.btn.primary { background: var(--accent-fill); color: #fff; font-weight: 600; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent-fill) 88%, #fff); }
.btn.primary.danger { background: var(--danger); }
.btn.primary.danger:hover { background: color-mix(in srgb, var(--danger) 88%, #000); }
.btn.block { width: 100%; height: 54px; font-size: 18px; border-radius: 14px; }
.btn.block kbd { color: rgba(255, 255, 255, 0.75); border-color: rgba(255, 255, 255, 0.35); }
.btn-group { display: inline-flex; gap: 6px; }
.link { border: 0; background: none; color: var(--link); padding: 4px 6px; border-radius: 6px; font-size: 16px; font-weight: 500; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.iconbtn {
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  border: 0; border-radius: 50%; background: none; color: var(--text-2);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.iconbtn:hover { background: var(--fill-2); color: var(--text); }
.iconbtn:active { transform: scale(0.92); }
.iconbtn.danger:hover { background: var(--danger-weak); color: var(--danger); }

/* ---------- 입력칸 ---------- */
input, select, textarea {
  width: 100%;
  border: 0; border-radius: var(--r-sm);
  background: var(--fill-2); padding: 10px 12px; outline: none;
  transition: box-shadow 0.2s var(--ease), background-color 0.2s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus { background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); }
textarea { resize: none; min-height: 108px; line-height: 1.55; display: block; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%238e8e93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2.5 4.5 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 12px;
}
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 22px; height: 22px; padding: 0; margin: 0; flex: none; cursor: pointer;
  border: 1.5px solid color-mix(in srgb, var(--text-3) 70%, transparent); border-radius: 50%; background: transparent;
  display: inline-grid; place-items: center; transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
input[type="checkbox"]:focus { box-shadow: none; }
input[type="checkbox"]:checked { background: var(--accent-fill); border-color: var(--accent-fill); }
input[type="checkbox"]:checked::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }
input[type="checkbox"]:active { transform: scale(0.88); }
.field { margin-top: 20px; }
.flabel { display: block; font-size: 15px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.flabel em { font-style: normal; font-weight: 400; color: var(--text-3); margin-left: 4px; }
.hint { font-size: 14px; color: var(--text-3); margin-top: 8px; line-height: 1.45; word-break: keep-all; }
.suffix { position: relative; }
.suffix input { padding-right: 36px; text-align: right; }
.suffix span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--text-2); pointer-events: none; }
.row { display: flex; gap: 10px; align-items: center; }

/* 눌러서 고르는 알약 */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  border: 0; background: var(--fill-2); border-radius: 980px;
  padding: 8px 16px; font-size: 16px; font-weight: 500; white-space: nowrap;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.chip:hover { background: color-mix(in srgb, var(--text) 14%, transparent); }
.chip:active { transform: scale(0.95); }
.chip.on { background: var(--text); color: var(--bg); }
.chip .n { margin-left: 5px; font-weight: 400; opacity: 0.6; }
.chips.sm { gap: 6px; }
.chips.sm .chip { padding: 5px 13px; font-size: 15px; }
.chips.lg { gap: 8px; }
.chips.lg .chip { padding: 10px 20px; font-size: 17px; font-weight: 600; }

/* 판: 선·그림자 없이 바탕 위에 흰 판 */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 24px; }

/* 미끄러지는 선택 막대 */
.seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; border-radius: 9px; background: var(--fill-2); }
.seg button { position: relative; z-index: 1; border: 0; background: none; border-radius: 7px; padding: 6px 14px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.seg button.on { font-weight: 600; }
.seg .thumb { position: absolute; top: 2px; bottom: 2px; left: 0; width: 0; border-radius: 7px; background: var(--surface); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04); }
:root[data-theme="dark"] .seg .thumb { background: #636366; }
.seg.ready .thumb { transition: transform 0.35s var(--spring), width 0.35s var(--spring); }

/* ---------- 로그인 ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; background: var(--surface); border-radius: 28px; padding: 36px 32px 32px; }
.login-box .brand { flex-direction: column; align-items: flex-start; gap: 20px; font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.login-box .mark { width: 52px; height: 52px; border-radius: 14px; }
.login-box .mark svg { width: 26px; height: 26px; }
.login-box p { font-size: 17px; }
.login-box input { height: 50px; font-size: 17px; border-radius: 14px; margin-top: 8px; }
.msg { min-height: 20px; font-size: 14px; color: var(--danger); }
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.spin { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--fill-2); border-top-color: var(--text-2); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 이름표 ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; white-space: nowrap; }
.brand .over { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: var(--text-3); }
.mark { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--text); color: var(--bg); }
.mark svg { width: 15px; height: 15px; }

/* ---------- 전체 틀: 위 막대 + 왼쪽 메뉴 + 내용 ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100%; }
.gnav {
  grid-column: 1 / -1; position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px; height: var(--top-h); padding: 0 18px 0 22px;
  background: var(--nav); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line-2);
}
.gnav .brand { width: calc(var(--side-w) - 22px + 14px); flex: none; }
.gnav .brand .over { display: none; }
.gsearch {
  display: flex; align-items: center; gap: 9px; width: 100%; max-width: 440px; height: 36px; padding: 0 12px;
  border: 0; border-radius: 10px; background: var(--fill-2); color: var(--text-3); font-size: 15px; text-align: left;
  transition: background-color 0.2s var(--ease);
}
.gsearch:hover { background: color-mix(in srgb, var(--text) 14%, transparent); color: var(--text-2); }
.gsearch kbd { margin-left: auto; }
.undo {
  display: inline-flex; align-items: center; gap: 6px; max-width: 240px; height: 32px; padding: 0 13px;
  border: 0; border-radius: 980px; background: var(--fill-2); font-size: 14px; font-weight: 500;
}
.undo:hover { background: color-mix(in srgb, var(--text) 14%, transparent); }
.undo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.undo .ic { width: 16px; height: 16px; }
.sync { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.sync.bad i { background: var(--danger); }
.sync.bad { color: var(--danger); }

.side {
  position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h));
  display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; overflow-y: auto;
  border-right: 1px solid var(--line-2);
}
#nav { display: flex; flex-direction: column; gap: 2px; }
.navbtn {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%;
  border: 0; background: none; padding: 9px 12px; border-radius: 10px;
  text-align: left; font-size: 16px; color: var(--text);
  transition: background-color 0.2s var(--ease);
}
.navbtn .ic { width: 20px; height: 20px; color: var(--text-2); }
.navbtn:not(.on):hover { background: var(--fill-2); }
.navbtn.on { background: var(--surface); font-weight: 600; box-shadow: 0 0 0 1px var(--line-2); }
.navbtn.on .ic { color: var(--accent); }
.navbtn .badge { margin-left: auto; font-size: 13px; color: var(--text-3); }
.sidelink { margin-top: auto; border: 0; background: none; padding: 8px 12px; font-size: 13px; color: var(--text-3); text-align: left; border-radius: 8px; }
.sidelink:hover { color: var(--text); background: var(--fill-2); }
main { padding: 36px 40px 64px; min-width: 0; }
.view { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; animation: viewin 0.35s var(--spring); }
@keyframes viewin { from { opacity: 0; transform: translateY(8px); } }
.tabbar { display: none; }
.fab { display: none; }

/* ---------- 화면 머리 ---------- */
.vhead { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-top: 4px; }
.vhead .over { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.vhead .sub { font-size: 17px; color: var(--text-2); margin-top: 8px; }
.vhead .sub b { color: var(--link); font-weight: 600; }
.vtools { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rel { position: relative; }
.pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  background: var(--surface); border-radius: 16px; box-shadow: var(--pop-shadow); padding: 14px;
  transform-origin: top right; animation: popin 0.35s var(--spring);
}
@keyframes popin { from { opacity: 0; transform: scale(0.95) translateY(-4px); } }

/* 날짜 띠 */
.strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.strip.w5 { grid-template-columns: repeat(5, 1fr); }
.day {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  border: 0; border-radius: 14px; background: var(--surface);
  padding: 11px 6px 10px; min-width: 0;
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.day:hover { background: color-mix(in srgb, var(--text) 5%, var(--surface)); }
.day:active { transform: scale(0.96); }
.day .w { font-size: 14px; font-weight: 600; color: var(--text-2); }
.day .n { font-size: 21px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.25; }
.day .c { font-size: 13px; color: var(--text-3); min-height: 18px; }
.day.off .w, .day.off .n { color: var(--text-3); }
.day.today .w, .day.today .n { color: var(--accent); }
.day.on { background: var(--accent-fill); }
.day.on .w, .day.on .n, .day.on .c { color: #fff; }
.day.on .c { opacity: 0.85; }
.strip.w5 .day .n { font-size: 16px; }

/* 달력 */
.cal { width: 300px; }
.calhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.calhead b { font-size: 16px; }
.calgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.calgrid > span { text-align: center; font-size: 12px; font-weight: 600; color: var(--text-3); padding: 4px 0; }
.cd { position: relative; height: 38px; border: 0; border-radius: 50%; background: none; font-size: 15px; }
.cd:hover { background: var(--fill-2); }
.cd.out { color: var(--text-3); }
.cd.today { color: var(--accent); font-weight: 700; }
.cd.on { background: var(--accent-fill); color: #fff; font-weight: 600; }
.cd i { position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--text-3); }
.cd.on i { background: #fff; }

/* ---------- 입력 + 목록 2단 ---------- */
.split { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 22px; align-items: start; }
.composer { position: sticky; top: calc(var(--top-h) + 22px); }
.chead { display: flex; align-items: center; justify-content: space-between; }
.composer .btn.block { margin-top: 24px; }
.menu { width: 300px; padding: 6px; max-height: 360px; overflow: auto; }
.menu button { display: block; width: 100%; border: 0; background: none; text-align: left; padding: 10px 12px; border-radius: 10px; font-size: 15px; }
.menu button:hover { background: var(--fill-2); }
.menu button small { display: block; color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu hr { border: 0; border-top: 1px solid var(--line-2); margin: 6px 4px; }
.menu .save { color: var(--link); }

.listcard { padding: 0; overflow: clip; }
.lhead { display: flex; align-items: baseline; gap: 10px; padding: 22px 24px 0; }
.lhead .count { font-weight: 500; color: var(--text-3); margin-left: 6px; font-size: 17px; }
.lhead .total { font-size: 17px; font-weight: 600; }
.lhead .total small { font-weight: 400; color: var(--text-2); font-size: 14px; margin-right: 6px; }
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 24px; }
.searchbox { position: relative; width: 230px; }
.searchbox .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-3); }
.searchbox input { padding: 9px 10px 9px 34px; font-size: 16px; }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }

/* 목록 줄: 아이폰 설정처럼 왼쪽을 띄운 가는 선 */
.ghead { display: flex; align-items: baseline; gap: 8px; padding: 22px 24px 6px; font-size: 15px; color: var(--text-3); }
.ghead b { font-size: 18px; color: var(--text); font-weight: 700; letter-spacing: -0.02em; }
.item {
  position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 13px 24px; min-height: 52px;
  cursor: pointer; transition: background-color 0.2s var(--ease);
}
.item + .item::before { content: ""; position: absolute; top: 0; right: 0; left: 24px; border-top: 1px solid var(--line-2); }
.item:hover { background: color-mix(in srgb, var(--text) 4%, var(--surface)); }
.item:active { background: color-mix(in srgb, var(--text) 8%, var(--surface)); }
.item.sel { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.item .check { padding-top: 1px; flex: none; display: grid; }
.tag { display: inline-flex; align-items: center; gap: 6px; flex: none; width: 60px; font-size: 15px; font-weight: 500; color: var(--text-2); padding-top: 1px; }
.tag i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.item .text { flex: 1; min-width: 0; white-space: pre-wrap; word-break: break-word; }
.item .amt { flex: none; font-weight: 600; white-space: nowrap; }
.item .meta { font-size: 14px; color: var(--text-2); margin-top: 2px; }
.item .go { flex: none; align-self: center; color: var(--text-3); display: flex; transition: transform 0.2s var(--ease), color 0.2s var(--ease); }
.item .go .ic { width: 15px; height: 15px; stroke-width: 2.2; }
.item:hover .go { transform: translateX(3px); color: var(--text); }
.acts { display: flex; gap: 2px; flex: none; margin: -5px -10px -5px 0; opacity: 0; transition: opacity 0.2s var(--ease); }
.item:hover .acts, .item:focus-within .acts { opacity: 1; }
@media (hover: none) { .acts { opacity: 1; } }
.item.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); } }
.empty { text-align: center; padding: 60px 24px 64px; color: var(--text-2); font-size: 15px; }
.empty b { display: block; font-size: 17px; color: var(--text); margin-bottom: 4px; font-weight: 600; }
.empty .eic { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 50%; background: var(--fill-2); color: var(--text-3); }
.empty .eic .ic { width: 24px; height: 24px; }
.lfoot { height: 12px; }

.selbar {
  position: sticky; bottom: 18px; margin: 6px auto 18px; width: fit-content; max-width: calc(100% - 24px);
  display: flex; align-items: center; gap: 2px; padding: 6px 6px 6px 18px;
  background: rgba(29, 29, 31, 0.94); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  color: #fff; border-radius: 980px; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.26);
  animation: barin 0.45s var(--spring); z-index: 5;
}
@keyframes barin { from { opacity: 0; transform: translateY(14px) scale(0.96); } }
:root[data-theme="dark"] .selbar { background: rgba(58, 58, 60, 0.94); }
.selbar b { font-weight: 600; margin-right: 8px; white-space: nowrap; font-size: 16px; }
.selbar button { border: 0; background: none; color: #fff; padding: 9px 14px; border-radius: 980px; font-size: 16px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.selbar button:hover { background: rgba(255, 255, 255, 0.16); }
.selbar button.danger { color: #ff8a80; }
.selbar .ic { width: 16px; height: 16px; }

/* 수리 */
.stat { width: auto; flex: none; padding: 5px 28px 5px 12px; border-radius: 980px; font-size: 14px; font-weight: 600; background-color: var(--fill-2); cursor: pointer; }
.stat.wait { color: var(--danger); }
.stat.doing { color: var(--warn); }
.stat.done { color: var(--text-2); font-weight: 500; }
.item.m { align-items: center; }
.item.m .days { flex: none; font-size: 14px; color: var(--text-2); white-space: nowrap; width: 66px; text-align: right; }
.item.m.done .text { color: var(--text-2); }
.item.m.pick { background: var(--accent-weak); }

/* 잔업 */
.item.o { align-items: center; }
.item.o .when { flex: none; width: 150px; font-size: 14px; }
.item.o .when small { display: block; color: var(--text-2); font-size: 13px; }
.item.o .hours { flex: none; font-weight: 600; width: 66px; text-align: right; }
.sums { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 24px 6px; }
.sums span { background: var(--fill-2); border-radius: 980px; padding: 4px 12px; font-size: 14px; }
.sums b { font-weight: 600; margin-left: 5px; }

/* ---------- 홈 ---------- */
.ctitle { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.who { display: flex; align-items: center; gap: 14px 20px; flex-wrap: wrap; padding: 20px 24px; }
.who-q { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.who-q small { display: block; font-size: 15px; font-weight: 400; color: var(--text-2); }
.who .chips { margin-left: auto; }
.bigacts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.bigbtn {
  display: flex; align-items: center; gap: 18px; min-width: 0; padding: 24px 24px 24px 22px;
  border: 0; border-radius: var(--r-lg); background: var(--surface); text-align: left;
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.bigbtn:hover { background: color-mix(in srgb, var(--text) 4%, var(--surface)); }
.bigbtn:active { transform: scale(0.98); }
.bigbtn .bi { display: grid; place-items: center; flex: none; width: 54px; height: 54px; border-radius: 50%; background: var(--accent-weak); color: var(--accent); }
.bigbtn .bi .ic { width: 26px; height: 26px; }
.bigbtn .bt { flex: 1; min-width: 0; }
.bigbtn b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.bigbtn small { display: block; margin-top: 2px; font-size: 15px; color: var(--text-2); }
.bigbtn > .ic { width: 20px; height: 20px; color: var(--text-3); transition: transform 0.2s var(--ease); }
.bigbtn:hover > .ic { transform: translateX(3px); }
.bigbtn.main { background: var(--accent-fill); color: #fff; }
.bigbtn.main:hover { background: color-mix(in srgb, var(--accent-fill) 90%, #fff); }
.bigbtn.main .bi { background: rgba(255, 255, 255, 0.2); color: #fff; }
.bigbtn.main small, .bigbtn.main > .ic { color: rgba(255, 255, 255, 0.85); }
.home-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.mini { margin: 12px -24px -12px; }
.mini .item { padding: 12px 24px; }
.mini .who { flex: none; font-size: 14px; color: var(--text-3); white-space: nowrap; }
.mini .empty { padding: 30px 24px 34px; }
.period { display: flex; align-items: center; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.period .label { font-weight: 600; font-size: 17px; margin: 0 6px; }
.period input[type="date"] { width: auto; padding: 7px 11px; }
.nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; }
.nums div { font-size: 14px; color: var(--text-2); }
.nums b { display: block; font-size: 24px; font-weight: 700; color: var(--text); letter-spacing: -0.03em; }
.nums p { grid-column: 1 / -1; }
.stat-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line-2); }
.stat-two h3 { font-size: 14px; font-weight: 600; color: var(--text-2); }
.bars { margin-top: 14px; display: flex; flex-direction: column; gap: 11px; }
.bar { display: grid; grid-template-columns: 78px 1fr 52px; gap: 12px; align-items: center; font-size: 15px; }
.bar > span { display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; }
.bar .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.bar .track { height: 6px; border-radius: 3px; background: var(--fill-2); overflow: hidden; }
.bar .track i { display: block; height: 100%; border-radius: 3px; background: var(--text-2); transition: width 0.6s var(--spring); }
.bar b { text-align: right; font-weight: 600; }
.bar.zero { color: var(--text-3); }

/* ---------- 설정 ---------- */
.settings { max-width: 720px; }
.sect h2 { margin-bottom: 4px; }
.sect > p { font-size: 15px; color: var(--text-2); }
.srow { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.srow:first-of-type { margin-top: 16px; }
.srow .name { flex: 1; min-width: 120px; font-weight: 500; }
.srow .name small { display: block; font-weight: 400; color: var(--text-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 440px; }
.srow input[type="date"] { width: auto; }
.log { font-size: 14px; color: var(--text-2); margin-top: 10px; line-height: 1.7; }
.swatches { display: flex; gap: 10px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0; background: var(--c); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px transparent; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.swatch:hover { transform: scale(1.1); }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 12px 18px; margin-top: 18px; align-items: center; font-size: 15px; }
.keys kbd { font-size: 12px; padding: 4px 7px; color: var(--text-2); background: var(--fill-2); border-color: transparent; }
.keys span { display: flex; gap: 4px; }

/* ---------- 창·알림 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px;
  background: rgba(0, 0, 0, 0.25); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  animation: dim 0.25s var(--ease);
}
@keyframes dim { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 540px; max-height: 90vh; overflow: auto;
  background: var(--surface); border-radius: 24px; padding: 26px 28px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.22);
  animation: sheetin 0.5s var(--spring);
}
@keyframes sheetin { from { opacity: 0; transform: scale(0.95) translateY(10px); } }
.sheet h2 { font-size: 22px; }
.sheet.small { max-width: 400px; }
.sheet.small h2 { font-size: 19px; line-height: 1.4; }
.sheet.small p { margin-top: 6px; font-size: 15px; }
.sheet label.flabel { margin-top: 18px; }
.actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 26px; }
.sheet.palette { max-width: 640px; padding: 0; align-self: start; margin-top: 10vh; overflow: hidden; }
.palette .pin { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.palette .pin .ic { color: var(--text-3); width: 20px; height: 20px; }
.palette input { border: 0; background: none; padding: 0; font-size: 19px; }
.palette input:focus { box-shadow: none; background: none; }
.presults { max-height: 56vh; overflow: auto; padding: 6px; }
.pres { display: flex; gap: 12px; align-items: baseline; width: 100%; border: 0; background: none; text-align: left; padding: 10px 14px; border-radius: 10px; }
.pres.on, .pres:hover { background: var(--fill-2); }
.pres .k { flex: none; width: 64px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.pres .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pres .d { flex: none; font-size: 14px; color: var(--text-2); }
.pres mark { background: none; color: var(--link); font-weight: 600; }
.pnote { padding: 28px; text-align: center; color: var(--text-2); font-size: 15px; }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 14px;
  background: rgba(29, 29, 31, 0.92); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  color: #fff; padding: 12px 20px; border-radius: 980px; font-size: 15px; font-weight: 500;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.26); animation: toastin 0.45s var(--spring); max-width: calc(100vw - 32px);
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 14px) scale(0.96); } }
:root[data-theme="dark"] .toast { background: rgba(58, 58, 60, 0.94); }
.toast.bad { background: var(--danger); }
.toast button { border: 0; background: none; color: #6cb6ff; font-weight: 600; padding: 0; white-space: nowrap; }

/* ---------- 좁은 화면 ---------- */
/* 노트북: 왼쪽 메뉴를 아이콘만 */
@media (max-width: 1240px) {
  :root { --side-w: 68px; }
  .navbtn { justify-content: center; padding: 10px 0; }
  .navbtn span, .sidelink { display: none; }
  .navbtn .badge { position: absolute; margin: -14px 0 0 22px; font-size: 11px; }
  .gnav .brand { width: auto; margin-right: 16px; }
}
@media (max-width: 1000px) {
  .split, .home-two, .bigacts { grid-template-columns: 1fr; }
  .composer { position: static; }
}
/* 휴대폰 */
@media (max-width: 820px) {
  :root { --top-h: 50px; }
  .app { display: block; }
  .side { display: none; }
  .gnav { padding: 0 10px 0 16px; gap: 4px; background: var(--bg); border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease); }
  .gnav.scrolled { background: var(--nav); border-bottom-color: var(--line-2); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
  .gnav .brand { flex: 1; margin: 0; font-size: 17px; }
  .gnav > .grow { display: none; }
  .gsearch { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 50%; background: none; color: var(--text); }
  .gsearch span, .gsearch kbd, .sync span { display: none; }
  .gsearch .ic { width: 21px; height: 21px; }
  .undo { width: 36px; padding: 0; justify-content: center; background: none; }
  .undo span { display: none; }
  .undo .ic { width: 19px; height: 19px; }
  .sync { gap: 2px; }
  main { padding: 6px 16px calc(100px + env(safe-area-inset-bottom)); }
  .view { gap: 16px; }
  h1 { font-size: 32px; }
  .vhead .sub { font-size: 15px; margin-top: 6px; }
  .card { padding: 20px; }
  .listcard { padding: 0; }
  .lhead, .filters, .ghead, .item, .sums { padding-left: 16px; padding-right: 16px; }
  .item + .item::before { left: 16px; }
  .mini { margin-left: -20px; margin-right: -20px; }
  .mini .item { padding-left: 20px; padding-right: 20px; }
  .searchbox { width: 100%; }
  .strip { gap: 5px; }
  .day { padding: 8px 2px 7px; border-radius: 12px; }
  .day .n { font-size: 18px; }
  .strip.w5 { grid-template-columns: repeat(3, 1fr); }
  .strip.w5 .day:first-child, .strip.w5 .day:last-child { display: none; }
  .tag { width: 54px; font-size: 14px; }
  .stat-two { grid-template-columns: 1fr; gap: 26px; }
  .bigacts { grid-template-columns: 1fr; gap: 12px; }
  .bigbtn { padding: 18px 18px 18px 16px; gap: 14px; }
  .bigbtn .bi { width: 46px; height: 46px; }
  .bigbtn b { font-size: 20px; }
  .bigbtn small { font-size: 14px; }
  .who { padding: 18px 20px; }
  .who .chips { margin-left: 0; }
  .chips.lg .chip { padding: 9px 16px; font-size: 16px; }
  .nums b { font-size: 20px; }
  .login-box { padding: 30px 22px 24px; border-radius: 24px; }
  /* 휴대폰에서는 줄을 눌러 선택한 뒤 아래 막대에서 복사·수정·삭제 */
  #daily-body .acts, #weekly-body .acts { display: none; }
  .selbar { padding-left: 14px; max-width: calc(100% - 16px); }
  .selbar b { margin-right: 2px; font-size: 14px; }
  .selbar button { padding: 8px 9px; font-size: 14px; }
  .selbar .ic { display: none; }
  .selbar button[data-act="none"] .ic { display: block; }
  .item.o .when { width: 96px; }
  .item.m { flex-wrap: wrap; }
  .item.m .mmain { flex-basis: 100%; }
  .item.m .days { width: auto; margin-right: auto; }
  .vtools { margin-left: 0; width: 100%; }
  .pop { position: fixed; left: 14px; right: 14px; top: auto; bottom: calc(84px + env(safe-area-inset-bottom)); width: auto; transform-origin: bottom center; }
  /* 창은 아래에서 올라오는 판 */
  .modal { place-items: end center; padding: 0; }
  .sheet { max-width: none; border-radius: 28px 28px 0 0; padding: 28px 22px calc(22px + env(safe-area-inset-bottom)); max-height: 92vh; animation: sheetup 0.5s var(--spring); }
  .sheet::before { content: ""; display: block; width: 36px; height: 5px; margin: -14px auto 16px; border-radius: 3px; background: var(--fill-2); }
  .sheet.small { max-width: none; }
  @keyframes sheetup { from { transform: translateY(100%); } }
  .sheet.palette { align-self: stretch; margin: 0; border-radius: 0; max-height: none; padding-top: env(safe-area-inset-top); animation: dim 0.25s var(--ease); }
  .sheet.palette::before { display: none; }
  .presults { max-height: none; }
  .actions .muted { display: none; }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    padding: 5px 0 calc(5px + env(safe-area-inset-bottom));
    background: var(--nav); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--line-2);
  }
  .tabbar button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; font-size: 11px; font-weight: 500; color: var(--text-3); }
  .tabbar button.on { color: var(--accent); }
  .tabbar .ic { width: 25px; height: 25px; transition: transform 0.2s var(--ease); }
  .tabbar button:active .ic { transform: scale(0.9); }
  .toast { bottom: calc(90px + env(safe-area-inset-bottom)); }
  .selbar { bottom: calc(82px + env(safe-area-inset-bottom)); }
  /* 내역을 먼저 보여주고, 입력칸은 아래 + 오른쪽 아래 버튼으로 바로 이동 */
  .split .composer { order: 2; }
  .fab:not([hidden]) {
    display: grid; place-items: center; position: fixed; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 24;
    width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--accent-fill); color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24); transition: transform 0.2s var(--ease);
  }
  .fab:active { transform: scale(0.92); }
  .fab .ic { width: 24px; height: 24px; }
  .app:has(.selbar:not([hidden])) .fab { display: none; }
  /* 16px보다 작으면 아이폰이 입력할 때 화면을 확대합니다 */
  input, select, textarea, .searchbox input { font-size: 16px; }
}
@media (hover: none) { .btn.block kbd { display: none; } }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* 목록 위 안내 한 줄 */
.lhint { margin: 0; padding: 0 24px 4px; font-size: 15px; color: var(--text-2); }
@media (max-width: 820px) { .lhint { padding: 0 16px 4px; font-size: 14px; } }

/* ---------- 홈 다듬기 ---------- */
.hhead { padding: 6px 0 2px; }
.hhead .over { font-size: 16px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.hhead h1 { font-size: 40px; }
.wholine { margin-top: 10px; font-size: 16px; color: var(--text-2); }
.wholine .link { padding: 2px 4px; }
.who { animation: viewin 0.35s var(--spring); }
.who-q small { margin-top: 2px; }
.ctitle h2 .count { margin-left: 8px; font-size: 17px; font-weight: 600; color: var(--accent); }
.hlist { padding-bottom: 14px; }
.hlist .mini { margin: 10px -24px 0; }
.hwho { display: flex; align-items: center; gap: 6px; padding: 12px 24px 2px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.hwho em { font-style: normal; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 980px; background: var(--accent-weak); color: var(--accent); }
.hlist .item { padding: 9px 24px; min-height: 0; }
.hlist .item + .item::before { left: 24px; }
.hlist .item .text { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; }
.hempty { padding: 26px 24px 16px; color: var(--text-3); font-size: 16px; }
.hmore { display: flex; align-items: center; gap: 4px; margin: 6px 24px 0; padding: 8px 0 0; border: 0; border-top: 1px solid var(--line-2); width: calc(100% - 48px); background: none; color: var(--link); font-size: 15px; font-weight: 500; }
.hmore .ic { width: 15px; height: 15px; }
.hmore:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 820px) {
  .hhead .over { font-size: 15px; }
  .hhead h1 { font-size: 30px; }
  .hlist .mini { margin-left: -20px; margin-right: -20px; }
  .hwho, .hlist .item, .hempty { padding-left: 20px; padding-right: 20px; }
  .hlist .item + .item::before { left: 20px; }
  .hmore { margin-left: 20px; margin-right: 20px; width: calc(100% - 40px); }
}

/* 회사 엠블럼 */
.emblem { width: 26px; height: 26px; flex: none; display: block; }
.login-box .emblem { width: 52px; height: 52px; }
.login-box .flabel { margin: 8px 0 -4px; }
.wholine b { color: var(--text); font-weight: 600; margin: 0 6px 0 4px; }
.bigbtn { padding: 24px 24px 24px 26px; }

/* 홈 머리: 왼쪽 인사, 오른쪽 위 날씨 */
.hhead { display: flex; align-items: flex-start; gap: 24px; }
.hh-main { flex: 1; min-width: 0; padding-top: 6px; }
.wx { flex: none; width: 300px; background: var(--surface); border-radius: var(--r-lg); padding: 16px 18px 12px; }
.wx-now { display: flex; align-items: center; gap: 12px; }
.wx-now .wxi { width: 44px; height: 44px; }
.wx-t { font-size: 38px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.wx-s { display: flex; flex-direction: column; font-size: 14px; color: var(--text-2); line-height: 1.35; }
.wx-s b { font-size: 16px; color: var(--text); font-weight: 600; }
.wx-row { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); font-size: 14px; }
.wx-row + .wx-row { margin-top: 0; padding-top: 7px; border-top: 0; }
.wx-row > span:first-child { font-weight: 600; color: var(--text-2); }
.wx-row > span:nth-child(2) { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.wx-row > span:last-child { color: #2f7fd8; font-weight: 500; }
.wx-row .wxi { width: 18px; height: 18px; }
.wx-at { margin-top: 8px; font-size: 12px; color: var(--text-3); }
.wx > .wx-at:only-child { margin: 0; padding: 18px 0; text-align: center; font-size: 14px; }
.wxi { color: var(--text-2); }
.wxi.sun, .wxi.part { color: #f7941d; }
.wxi.rain, .wxi.storm { color: #2f7fd8; }
.wxi.snow { color: #5aa9d6; }
:root[data-theme="dark"] .wx-row > span:last-child, :root[data-theme="dark"] .wxi.rain { color: #5fa8ff; }
@media (max-width: 820px) {
  .hhead { flex-direction: column; gap: 14px; }
  .wx { width: 100%; padding: 14px 16px 10px; }
  .wx-t { font-size: 32px; }
}
