:root {
  --bg: #f4f4f5;
  --panel: #ffffff;
  --line: #ededef;
  --line-strong: #dfdfe3;
  --text: #17171a;
  --text-2: #55565c;
  --text-3: #8c8d93;
  --hover: #f4f4f6;
  --active: #efeff1;
  --black: #141416;
  --blue: #2f6bff;
  --blue-bg: #e9f0ff;
  --blue-text: #2a5bd7;
  --green: #1fa363;
  --green-bg: #e3f6ea;
  --green-text: #1f8a4c;
  --red-bg: #fde8e8;
  --red-text: #d63a3a;
  --row-red: #fff1f1;
  --yellow-bg: #fff6d6;
  --yellow-text: #a87a00;
  --gray-bg: #f0f0f2;
  --purple-bg: #efeaff;
  --purple-text: #6a45d9;
  --orange-bg: #fff0dc;
  --orange-text: #c26a00;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 20, 30, 0.04);
  --sidebar-w: 256px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* ---------- Progress / boot ---------- */
#progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--blue); z-index: 1000; opacity: 0; pointer-events: none; }
#progress.on { opacity: 1; width: 80%; transition: width 6s cubic-bezier(.1, .7, .2, 1), opacity .1s; }
#progress.done { width: 100%; opacity: 0; transition: width .18s ease-out, opacity .25s .1s; }
.boot-skeleton { max-width: 1080px; margin: 28px auto 0; display: grid; gap: 18px; }
.boot-skeleton div, .skel { border-radius: var(--radius); background: linear-gradient(90deg, #ebebee 0%, #f5f5f7 50%, #ebebee 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
.boot-skeleton div:nth-child(1) { height: 92px; width: 260px; }
.boot-skeleton div:nth-child(2) { height: 150px; }
.boot-skeleton div:nth-child(3) { height: 280px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  transition: width .2s;
  z-index: 40;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 16px 14px 22px; }
.logo { font-weight: 800; font-size: 22px; letter-spacing: -0.04em; display: flex; align-items: center; gap: 7px; }
.logo .mark { width: 24px; height: 24px; border-radius: 50%; background: var(--black); color: #fff; display: grid; place-items: center; font-size: 12px; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 8px; color: var(--text-2); display: grid; place-items: center; }
.icon-btn:hover { background: var(--hover); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.nav { flex: 1; overflow-y: auto; padding: 2px 12px 16px; }
.nav-group { font-size: 12.5px; color: var(--text-3); padding: 18px 12px 6px; font-weight: 500; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 10px; color: var(--text-2);
  font-size: 15px; margin: 1px 0; transition: background .12s;
}
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.active { color: var(--text); background: var(--active); font-weight: 600; }
.nav a svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav .kbd { margin-left: auto; font-size: 12px; color: var(--text-3); }
.nav .badge { margin-left: auto; font-size: 11px; font-weight: 700; min-width: 20px; text-align: center; padding: 2px 7px; border-radius: 99px; background: var(--gray-bg); color: var(--text-2); }
.nav .badge.red { background: #ef4444; color: #fff; }
.user-box { border-top: 1px solid var(--line); padding: 14px 18px; display: flex; align-items: center; gap: 11px; position: relative; cursor: pointer; }
.user-box:hover { background: var(--hover); }
.user-box .meta { flex: 1; min-width: 0; }
.user-box .name { font-weight: 600; font-size: 14.5px; }
.user-box .role { font-size: 12px; color: var(--text-3); }
.user-menu { position: absolute; bottom: 70px; left: 12px; right: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.08); padding: 6px; z-index: 30; }
.user-menu button { width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 10px; }
.user-menu button:hover { background: var(--hover); }

.app.collapsed .sidebar { width: 72px; }
.app.collapsed .nav a span, .app.collapsed .nav .kbd, .app.collapsed .nav .badge,
.app.collapsed .nav-group, .app.collapsed .logo-text, .app.collapsed .user-box .meta, .app.collapsed .user-box .chev { display: none; }
.app.collapsed .sidebar-head { padding: 22px 0 14px; flex-direction: column; gap: 10px; }
.app.collapsed .nav a { justify-content: center; padding: 10px; }

.main { flex: 1; min-width: 0; padding: 36px 44px 80px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.035em; display: flex; align-items: center; gap: 12px; }
.page-head h1 small { font-size: 16px; font-weight: 500; color: var(--text-3); }
.page-sub { color: var(--text-3); margin: -14px 0 26px; }
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mobile-top { display: none; }

/* ---------- Common ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-strong); background: #fff; padding: 9px 15px; border-radius: 10px; font-size: 14.5px; font-weight: 500; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--hover); }
.btn-primary { background: var(--black); color: #fff; border-color: var(--black); font-weight: 600; }
.btn-primary:hover { background: #2a2a2e; }
.btn-danger { color: var(--red-text); border-color: #f3caca; }
.btn-danger:hover { background: #fff5f5; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn svg { width: 17px; height: 17px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px 24px; }
.card h3 { margin: 0 0 14px; font-size: 17px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--gray-bg); color: var(--text-2); white-space: nowrap; border: 0; }
.pill.blue { background: var(--blue-bg); color: var(--blue-text); }
.pill.green { background: var(--green-bg); color: var(--green-text); }
.pill.red { background: var(--red-bg); color: var(--red-text); }
.pill.yellow { background: var(--yellow-bg); color: var(--yellow-text); }
.pill.purple { background: var(--purple-bg); color: var(--purple-text); }
.pill.orange { background: var(--orange-bg); color: var(--orange-text); }
.pill-select { appearance: none; -webkit-appearance: none; padding-right: 26px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; outline: none; }
.tag { font-size: 12px; padding: 3px 9px; border-radius: 7px; font-weight: 500; background: var(--gray-bg); color: var(--text-2); white-space: nowrap; }
.tag.blue { background: var(--blue-bg); color: var(--blue-text); }
.tag.purple { background: var(--purple-bg); color: var(--purple-text); }
.tag.orange { background: var(--orange-bg); color: var(--orange-text); }
.tag.green { background: var(--green-bg); color: var(--green-text); }

.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; color: #fff; background: #bbb; overflow: hidden; }
.avatar.xs { width: 18px; height: 18px; font-size: 9px; }
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.avatar.lg { width: 36px; height: 36px; font-size: 14px; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { border: 2px solid #fff; margin-left: -6px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.person { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; }
.crown { color: #f5b400; font-size: 14px; }

.empty { text-align: center; padding: 70px 20px; color: var(--text-2); }
.empty svg { width: 38px; height: 38px; color: var(--text-3); margin-bottom: 14px; }
.empty strong { display: block; font-size: 17px; color: var(--text); margin-bottom: 6px; }
.empty .btn { margin-top: 18px; }
.dashed { border-style: dashed; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.hint { font-size: 12.5px; color: var(--text-3); margin-top: 6px; line-height: 1.5; }

.segmented { display: inline-flex; background: #e9e9ec; padding: 3px; border-radius: 11px; gap: 2px; }
.segmented button, .segmented a { border: 0; background: none; padding: 7px 15px; border-radius: 8px; font-size: 14.5px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.segmented button.on, .segmented a.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.segmented em { font-style: normal; font-size: 12px; color: var(--text-3); font-weight: 500; }

.switch { position: relative; width: 42px; height: 24px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #e2e2e5; border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--black); }
.switch input:checked + span::after { transform: translateX(18px); }

/* ---------- Table list ---------- */
.list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 16px; padding: 14px 22px; border-bottom: 1px solid var(--line); min-height: 60px; }
.list-row:last-child { border-bottom: 0; }
.list-row.clickable { cursor: pointer; }
.list-row.clickable:hover { background: var(--hover); }
.list-row .title { flex: 1; min-width: 0; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .title.placeholder { color: var(--text-3); }
.list-row .col-tag { width: 90px; flex-shrink: 0; }
.list-row .col-person { width: 140px; flex-shrink: 0; }
.list-row .col-time { width: 170px; flex-shrink: 0; color: var(--text-2); font-size: 14.5px; }
.list-row .del { opacity: 0; transition: .1s; }
.list-row:hover .del { opacity: 1; }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 600; font-size: 14px; color: var(--text-2); padding: 13px 20px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 13px 20px; border-bottom: 1px solid var(--line); font-size: 15px; }
.tbl tr:last-child td { border-bottom: 0; }

/* ---------- Home ---------- */
.home { max-width: 1080px; margin: 0 auto; padding-top: 30px; }
.home-hello { font-size: 34px; line-height: 1.38; font-weight: 800; letter-spacing: -0.04em; margin: 0 0 34px; }
.home-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.home-card { background: #fff; border-radius: var(--radius); padding: 22px 22px 20px; min-height: 152px; display: flex; flex-direction: column; border: 1px solid transparent; transition: box-shadow .18s, transform .18s, border-color .18s; }
.home-card:hover { box-shadow: 0 8px 24px rgba(20, 20, 30, .07); transform: translateY(-1px); }
.home-card:active { transform: none; }
.hc-icon { color: var(--text); margin-bottom: 24px; display: flex; }
.hc-icon svg { width: 24px; height: 24px; stroke-width: 1.6; }
.hc-title { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.hc-badge { font-size: 11.5px; font-weight: 700; padding: 3px 7px; border-radius: 6px; letter-spacing: -0.01em; background: var(--gray-bg); color: var(--text-2); }
.hc-badge.yellow { background: #ffe066; color: #5c4200; }
.hc-badge.black { background: var(--black); color: #fff; }
.hc-badge.blue { background: var(--blue-bg); color: var(--blue-text); }
.hc-badge.red { background: #ef4444; color: #fff; }
.hc-desc { margin-top: 6px; font-size: 14px; color: var(--text-3); line-height: 1.5; }
.home-sec { display: flex; align-items: baseline; justify-content: space-between; margin: 46px 2px 14px; }
.home-sec h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.home-sec a { font-size: 14px; color: var(--text-3); }
.home-sec a:hover { color: var(--text); }
.wk-list { background: #fff; border-radius: var(--radius); padding: 4px 26px; }
.wk-day { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.wk-day:last-child { border-bottom: 0; }
.wk-date { font-size: 15px; color: var(--text-2); display: flex; align-items: baseline; gap: 6px; line-height: 22px; white-space: nowrap; }
.wk-date:hover { color: var(--text); }
.wk-day.today .wk-date { color: var(--text); font-weight: 700; }
.wk-today { color: var(--blue); font-size: 13px; font-weight: 700; }
.wk-items { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.wk-item { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 15px; line-height: 22px; }
.wk-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--blue); }
.wk-dot.hol { background: #ef4444; }
.wk-dot.leave { background: #f5b400; }
.wk-dot.allday { background: #12a594; }
.wk-dot.timed { background: var(--blue); }
.wk-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; min-width: 0; }
.wk-meta { color: var(--text-3); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 2; min-width: 0; }
.wk-empty { padding: 40px 0; text-align: center; color: var(--text-3); }

/* ---------- Projects ---------- */
.section-head { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; margin: 30px 0 14px 4px; cursor: pointer; user-select: none; }
.section-head:first-of-type { margin-top: 6px; }
.section-head .cnt { color: var(--text-3); font-weight: 400; font-size: 17px; }
.section-head svg { width: 18px; height: 18px; transition: .2s; }
.section-head.closed svg { transform: rotate(-90deg); }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.proj-card { padding: 22px; cursor: pointer; min-height: 180px; display: flex; flex-direction: column; transition: box-shadow .15s; border-color: transparent; }
.proj-card:hover { box-shadow: 0 8px 24px rgba(20, 20, 30, .07); }
.proj-card .top { display: flex; justify-content: space-between; align-items: center; }
.proj-card .dates { color: var(--text-3); font-size: 14px; }
.proj-card .ttl { font-size: 19px; font-weight: 700; margin: 18px 0 auto; letter-spacing: -0.025em; line-height: 1.4; }
.proj-card .people { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.proj-card .person { font-size: 14px; }

/* ---------- Tasks ---------- */
.date-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.date-nav strong { font-size: 21px; }
.date-nav .wd { color: var(--text-3); font-weight: 500; }
.user-head { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; margin: 26px 0 12px 6px; }
.me-badge { font-size: 11px; border: 1px solid var(--line-strong); border-radius: 99px; padding: 2px 8px; color: var(--text-2); font-weight: 500; }
.task-row.high:not(.done) { background: var(--row-red); }
.task-row .status { width: 64px; text-align: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.task-row .cat { width: 110px; flex-shrink: 0; font-size: 14.5px; }
.task-row .prio { width: 64px; flex-shrink: 0; justify-content: center; }
.task-row .title input { width: 100%; border: 0; outline: none; font-size: 15.5px; background: transparent; padding: 0; }
.task-row select.inline { border: 0; background: transparent; font-size: 14.5px; outline: none; cursor: pointer; }
.task-row.done .title input { color: var(--text-3); text-decoration: line-through; }
.add-row { color: var(--text-3); cursor: pointer; }
.add-row input { flex: 1; border: 0; outline: none; font-size: 15.5px; background: transparent; }
.add-row select { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; background: #fff; font-size: 13px; }

/* ---------- Calendar ---------- */
.cal { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.cal-head div { text-align: center; padding: 13px 0; font-size: 14px; color: var(--text-2); }
.cal-head div:first-child { color: var(--red-text); }
.cal-head div:last-child { color: var(--blue); }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: min-content; position: relative; border-bottom: 1px solid var(--line); min-height: 140px; padding-bottom: 10px; }
.cal-week:last-child { border-bottom: 0; }
.cal-bg { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-bg div { border-right: 1px solid var(--line); cursor: pointer; }
.cal-bg div:last-child { border-right: 0; }
.cal-bg div:hover { background: #fafafb; }
.cal-bg div.weekend-hl { background: #fbfbfc; }
.cal-day { position: relative; padding: 11px 13px 6px; font-size: 14.5px; pointer-events: none; grid-row: 1; }
.cal-day.other { color: #c4c4c8; }
.cal-day.sun, .cal-day.hol { color: var(--red-text); }
.cal-day.sat { color: var(--blue); }
.cal-day.other.sun, .cal-day.other.sat, .cal-day.other.hol { opacity: .45; }
.cal-day .num.today { background: var(--black); color: #fff; border-radius: 50%; width: 28px; height: 28px; display: inline-grid; place-items: center; margin: -4px 0 -4px -6px; font-weight: 700; }
.cal-item { position: relative; margin: 2px 6px; padding: 5px 9px; border-radius: 6px; font-size: 13.5px; background: var(--blue-bg); color: var(--blue-text); cursor: pointer; overflow: hidden; min-width: 0; z-index: 1; }
.cal-item .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.cal-item .t svg { width: 14px; height: 14px; flex-shrink: 0; }
.cal-item .s { font-size: 12px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-item .s-row { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.cal-item .s-row .s { flex: 1; min-width: 0; }
.cal-item .s-row .avatar { width: 18px; height: 18px; font-size: 9px; }
.cal-item.hol { background: var(--red-bg); color: var(--red-text); font-weight: 500; cursor: default; }
.cal-item.leave { background: var(--yellow-bg); color: #8a6400; cursor: default; }
.cal-item:hover:not(.hol):not(.leave) { filter: brightness(.97); }

/* ---------- Docs ---------- */
.doc-wrap { max-width: 860px; margin: 0 auto; }
.doc-title { width: 100%; border: 0; outline: none; background: transparent; font-size: 34px; font-weight: 800; letter-spacing: -0.035em; margin: 8px 0 14px; }
.doc-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; color: var(--text-3); font-size: 14px; }
.doc-meta select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: #fff; }
.doc-editor { width: 100%; min-height: 60vh; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; font-size: 15.5px; line-height: 1.75; outline: none; resize: vertical; background: #fff; font-family: inherit; }
.doc-view { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 34px; line-height: 1.8; font-size: 15.5px; min-height: 60vh; }
.doc-view h1, .doc-view h2, .doc-view h3 { letter-spacing: -0.02em; }
.doc-view table { border-collapse: collapse; }
.doc-view td, .doc-view th { border: 1px solid var(--line); padding: 6px 10px; }
.doc-view code { background: var(--gray-bg); padding: 2px 6px; border-radius: 4px; }
.doc-view pre { background: #f7f7f8; padding: 14px; border-radius: 10px; overflow: auto; }
.doc-view img { max-width: 100%; }
.save-state { font-size: 13px; color: var(--text-3); white-space: nowrap; }

/* ---------- Stats / approvals ---------- */
.stat { text-align: center; padding: 22px; }
.stat .lbl { font-size: 14px; color: var(--text-2); }
.stat .val { font-size: 28px; font-weight: 800; margin-top: 6px; letter-spacing: -0.03em; }
.sec-title { font-size: 18px; font-weight: 700; margin: 34px 0 14px; display: flex; align-items: center; gap: 10px; }
.approval-card { display: flex; gap: 16px; align-items: center; }
.approval-card .info { flex: 1; min-width: 0; }
.approval-card .info .t { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.approval-card .info .m { font-size: 13px; color: var(--text-3); }

/* ---------- Forms ---------- */
.input, .select, .textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 13px; background: #fff; outline: none; font-size: 15px; transition: border-color .12s, box-shadow .12s; }
.input:focus, .select:focus, .textarea:focus { border-color: #a9a9b2; box-shadow: 0 0 0 3px rgba(20, 20, 30, .05); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-list { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 99px; padding: 5px 12px 5px 6px; cursor: pointer; font-size: 14px; user-select: none; }
.check-chip input { display: none; }
.check-chip:has(input:checked) { background: var(--black); color: #fff; border-color: var(--black); }
.check-line, .toggle-line { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); cursor: pointer; user-select: none; }
.check-line { margin-top: 16px; }
.check-line input, .toggle-line input, .consent input { width: 16px; height: 16px; accent-color: var(--black); margin: 0; flex-shrink: 0; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 15, 20, .38); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px; z-index: 100; overflow-y: auto; animation: fade .12s ease-out; }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 540px; box-shadow: 0 30px 80px rgba(0,0,0,.2); animation: pop .16s ease-out; }
.modal.wide { max-width: 720px; }
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 4px; }
.modal-head h2 { margin: 0; font-size: 19px; letter-spacing: -0.02em; }
.modal-body { padding: 14px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 24px 22px; }

.search-modal .modal { max-width: 640px; }
.search-input { width: 100%; border: 0; outline: none; font-size: 18px; padding: 21px 24px; border-bottom: 1px solid var(--line); border-radius: 20px 20px 0 0; }
.search-results { max-height: 60vh; overflow-y: auto; padding: 8px 12px 14px; }
.search-group { font-size: 12px; color: var(--text-3); padding: 12px 14px 6px; }
.search-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; cursor: pointer; }
.search-item:hover, .search-item.sel { background: var(--hover); }

.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--black); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 14px; z-index: 400; box-shadow: 0 10px 30px rgba(0,0,0,.2); animation: toastIn .2s ease-out; transition: opacity .25s, transform .25s; max-width: calc(100vw - 32px); }
.toast.out { opacity: 0; transform: translate(-50%, 8px); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

/* =================================================================
   전자서명
   ================================================================= */
.back-link { display: inline-flex; align-items: center; gap: 2px; color: var(--text-3); font-size: 14px; margin: 0 0 12px -4px; }
.back-link:hover { color: var(--text); }

/* 목록 */
.es-banner { display: flex; align-items: center; gap: 12px; background: var(--blue-bg); color: var(--blue-text); border-radius: 14px; padding: 14px 18px; margin-bottom: 18px; font-size: 14.5px; }
.es-banner span { flex: 1; }
.es-banner:hover { filter: brightness(.98); }
.es-tabs { margin-bottom: 16px; max-width: 100%; overflow-x: auto; }
.es-list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.es-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; align-items: center; gap: 16px; padding: 15px 22px; border-bottom: 1px solid var(--line); position: relative; transition: background .12s; }
.es-row:last-child { border-bottom: 0; }
.es-row:hover { background: var(--hover); }
.es-row.urgent::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: #ef4444; }
.es-row-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--gray-bg); display: grid; place-items: center; color: var(--text-2); }
.es-row-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.es-row-title { font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.es-row-meta { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.es-row-right { display: flex; align-items: center; gap: 8px; justify-self: end; }
.es-progress { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.es-chips { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; max-width: 340px; }
.es-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 2px 9px 2px 2px; border-radius: 99px; background: var(--gray-bg); color: var(--text-2); white-space: nowrap; }
.es-chip svg { margin-left: -2px; }
.es-chip.signed { background: var(--green-bg); color: var(--green-text); }
.es-chip.declined { background: var(--red-bg); color: var(--red-text); }
.es-chip.turn { background: #fff; box-shadow: inset 0 0 0 1.5px var(--blue); color: var(--blue-text); font-weight: 600; }
.es-chip.wait { opacity: .7; }

/* 업로드 */
.es-steps { display: flex; gap: 6px; margin: -10px 0 20px; flex-wrap: wrap; }
.es-steps span { font-size: 13px; padding: 5px 12px; border-radius: 99px; background: #e9e9ec; color: var(--text-3); font-weight: 500; }
.es-steps span.on { background: var(--black); color: #fff; }
.es-upload { max-width: 780px; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; border: 1.5px dashed #cfcfd6; border-radius: 16px; padding: 40px 20px; cursor: pointer; background: #fafafb; color: var(--text-2); transition: border-color .15s, background .15s; margin-bottom: 20px; }
.drop:hover, .drop.over { border-color: var(--black); background: #f4f4f6; }
.drop svg { color: var(--text-3); margin-bottom: 6px; }
.drop b { font-size: 15.5px; color: var(--text); }
.drop span { font-size: 13px; color: var(--text-3); }
.drop.big { padding: 64px 20px; }
.drop.small { padding: 30px 16px; margin-bottom: 0; }
.es-file { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 12px 12px 16px; margin-bottom: 20px; background: #fafafb; }
.es-file b { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.es-file span { color: var(--text-3); font-size: 13px; }
.es-file .icon-btn { margin-left: auto; }
.es-upload-foot { display: flex; margin-top: 4px; }

/* 전체 화면 작업 영역 (편집기·서명) */
.es-full { margin: -36px -44px -80px; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: #e8e8eb; }
.es-topbar { display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 10px 18px; background: #fff; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.es-title-input { flex: 0 1 460px; min-width: 120px; border: 1px solid transparent; outline: none; background: transparent; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; padding: 6px 10px; border-radius: 8px; }
.es-title-input:hover { background: var(--hover); }
.es-title-input:focus { border-color: var(--line-strong); background: #fff; }
.es-top-title { display: flex; flex-direction: column; min-width: 0; padding-left: 4px; }
.es-top-title b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.02em; }
.es-top-title span { font-size: 12px; color: var(--text-3); }
.es-meter { display: flex; flex-direction: column; gap: 5px; width: 130px; margin-right: 6px; }
.es-meter span { font-size: 12px; color: var(--text-2); font-weight: 600; }
.es-meter-bar { height: 5px; border-radius: 99px; background: var(--gray-bg); overflow: hidden; }
.es-meter-bar i { display: block; height: 100%; width: 0; background: var(--green); border-radius: 99px; transition: width .3s ease; }
.es-note { display: flex; align-items: center; gap: 8px; padding: 10px 20px; background: var(--yellow-bg); color: #7a5a00; font-size: 14px; flex-shrink: 0; white-space: pre-wrap; }
.es-note svg { flex-shrink: 0; }

.es-editor { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr); }
.es-side { background: #fff; border-right: 1px solid var(--line); overflow-y: auto; }
.es-side section { padding: 18px 18px; border-bottom: 1px solid var(--line); }
.es-side section:last-child { border-bottom: 0; }
.es-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.es-side-head h4 { margin: 0; font-size: 14px; font-weight: 700; }
.es-side .toggle-line { font-size: 13px; }
.es-side .form-row { margin-bottom: 12px; }
.es-side .input, .es-side .select, .es-side .textarea { font-size: 14px; padding: 8px 11px; }
.es-side .textarea { min-height: 72px; }
.es-hint { font-size: 12.5px; color: var(--text-3); line-height: 1.55; margin: 0 0 10px; }
.es-signer { display: flex; align-items: center; gap: 8px; padding: 8px 6px 8px 10px; border-radius: 10px; border: 1.5px solid transparent; cursor: pointer; margin-bottom: 4px; transition: background .12s; }
.es-signer:hover { background: var(--hover); }
.es-signer.on { border-color: var(--c); background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.es-signer .icon-btn { padding: 4px; }
.es-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex-shrink: 0; display: inline-block; }
.es-order { font-size: 11px; font-weight: 700; color: var(--text-3); width: 12px; text-align: center; }
.es-signer-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.es-signer-name small { display: block; font-size: 12px; font-weight: 400; color: var(--text-3); }
.es-signer-name em { font-style: normal; font-size: 10.5px; font-weight: 600; background: var(--gray-bg); color: var(--text-2); padding: 1px 5px; border-radius: 4px; vertical-align: 1px; }
.es-add { margin-top: 8px; }
.es-palette { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.es-palette button { display: flex; align-items: center; gap: 8px; padding: 10px 11px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: #fff; font-size: 14px; font-weight: 500; cursor: grab; touch-action: none; user-select: none; transition: border-color .12s, background .12s; }
.es-palette button svg { color: var(--c); flex-shrink: 0; }
.es-palette button:hover, .es-palette button.on { border-color: var(--c); background: var(--hover); }
.es-palette.disabled button { opacity: .45; cursor: not-allowed; }
.es-prop-actions { display: flex; gap: 8px; margin: 14px 0 8px; }
.es-docmeta { font-size: 12px; color: var(--text-3); line-height: 1.6; word-break: break-all; }

.es-canvas { flex: 1; min-height: 0; overflow: auto; padding: 28px 24px 90px; overscroll-behavior: contain; }
.es-pages { max-width: 820px; margin: 0 auto; }
.es-pages.placing, .es-pages.placing .es-page { cursor: crosshair; }
.es-page { position: relative; width: 100%; margin: 0 auto 30px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 8px 28px rgba(0,0,0,.07); user-select: none; -webkit-user-select: none; }
.es-page:not(.ready) { background: linear-gradient(90deg, #fff 0%, #f6f6f8 50%, #fff 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
.es-page canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .2s; }
.es-page.ready canvas { opacity: 1; }
.es-layer { position: absolute; inset: 0; }
.es-page-no { position: absolute; right: 2px; bottom: -22px; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* 서명 항목 */
.es-field { position: absolute; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--c, #888); background: linear-gradient(var(--cbg, rgba(0,0,0,.05)), var(--cbg, rgba(0,0,0,.05))), rgba(255,255,255,.86); border-radius: 4px; color: var(--c, #555); font-size: 11.5px; font-weight: 600; container-type: size; touch-action: none; }
.es-field.t-text, .es-field.t-date, .es-field.t-name { justify-content: flex-start; }
.es-field img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; display: block; }
.ef-in { display: flex; align-items: center; gap: 4px; padding: 0 5px; overflow: hidden; white-space: nowrap; max-width: 100%; pointer-events: none; }
.ef-in svg { flex-shrink: 0; }
.ef-label { overflow: hidden; text-overflow: ellipsis; }
.ef-who { font-weight: 500; opacity: .7; overflow: hidden; text-overflow: ellipsis; }
.ef-who::before { content: '· '; }
@container (max-width: 130px) { .ef-who { display: none; } }
@container (max-width: 56px) { .ef-label { display: none; } }
@container (max-height: 15px) { .ef-in svg { display: none; } }
.t-checkbox .ef-in { padding: 0; justify-content: center; }
.es-field.ed { cursor: move; }
.es-field.ed:hover { box-shadow: 0 0 0 3px var(--cbg); }
.es-field.sel { box-shadow: 0 0 0 3px var(--cbg), 0 2px 10px rgba(0,0,0,.12); z-index: 3; background: #fff; }
.ef-handle { position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; border-radius: 3px; background: #fff; border: 2px solid var(--c); cursor: nwse-resize; display: none; }
.es-field.sel .ef-handle { display: block; }
.es-ghost { position: fixed; z-index: 500; pointer-events: none; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; gap: 4px; border: 1.5px solid var(--c); background: var(--cbg); color: var(--c); border-radius: 4px; font-size: 12px; font-weight: 600; box-shadow: 0 6px 18px rgba(0,0,0,.15); }

.es-field.mine { cursor: pointer; transition: box-shadow .15s, background .15s; }
.es-field.mine:not(.done).req { animation: fieldPulse 2.2s ease-in-out infinite; }
.es-field.mine:hover { box-shadow: 0 0 0 3px var(--cbg); }
.es-field.mine.done { background: transparent; border-style: dashed; border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.es-field.mine.req:not(.done)::after { content: '*'; position: absolute; top: -9px; right: -7px; width: 15px; height: 15px; border-radius: 50%; background: var(--c); color: #fff; font-size: 12px; line-height: 17px; text-align: center; font-weight: 700; }
.es-field.flash { animation: flash .9s ease-out; }
@keyframes fieldPulse { 0%, 100% { box-shadow: 0 0 0 0 var(--cbg); } 50% { box-shadow: 0 0 0 5px var(--cbg); } }
@keyframes flash { 0% { box-shadow: 0 0 0 0 var(--c); } 40% { box-shadow: 0 0 0 7px var(--cbg); } 100% { box-shadow: 0 0 0 0 transparent; } }
.ef-input { width: 100%; height: 100%; border: 0; outline: none; background: transparent; padding: 0 3px; color: #111; font-weight: 400; font-family: inherit; letter-spacing: 0; }
.ef-input::placeholder { color: var(--c); opacity: .8; font-weight: 500; }
.ef-text { color: #111; font-weight: 400; padding: 0 3px; white-space: nowrap; overflow: hidden; letter-spacing: 0; line-height: 1; }
.es-field.t-checkbox svg { color: #111; }
.es-field.other.done { border-color: transparent; background: transparent; }
.es-field.ghost { border-style: dashed; opacity: .8; pointer-events: auto; }

/* 서명 패드·도장 */
.seg-tabs { display: flex; background: #ececef; padding: 3px; border-radius: 11px; gap: 2px; margin-bottom: 16px; overflow-x: auto; }
.seg-tabs button { flex: 1; border: 0; background: none; padding: 8px 10px; border-radius: 8px; font-size: 14px; color: var(--text-2); white-space: nowrap; }
.seg-tabs button.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.sp-pane { display: none; }
.sp-pane.on { display: block; }
.sp-canvas-wrap { position: relative; height: 230px; border: 1.5px dashed #d4d4da; border-radius: 14px; background: #fcfcfd; overflow: hidden; }
.sp-canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; z-index: 1; }
.sp-guide { position: absolute; left: 28px; right: 28px; bottom: 60px; border-bottom: 1.5px solid #e1e1e6; pointer-events: none; }
.sp-guide span { position: absolute; left: 0; bottom: 8px; font-size: 13px; color: #b5b5bc; }
.sp-canvas-wrap.has .sp-guide span { display: none; }
.sp-tools { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.sp-colors { display: flex; gap: 6px; }
.sp-colors button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: var(--sw); box-shadow: 0 0 0 1.5px var(--line-strong); padding: 0; }
.sp-colors button.on { box-shadow: 0 0 0 2px var(--text); }
.sp-styles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.sp-style { position: relative; height: 104px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: #fff; font-size: 40px; color: #111; display: grid; place-items: center; overflow: hidden; white-space: nowrap; padding: 0 8px 14px; }
.sp-style small { position: absolute; left: 0; right: 0; bottom: 7px; font: 500 11.5px Pretendard, sans-serif; color: var(--text-3); }
.sp-style:hover { border-color: #b5b5bc; }
.sp-style.on { border-color: var(--black); box-shadow: 0 0 0 1px var(--black); }
.sp-saved { border: 1px solid var(--line); border-radius: 14px; height: 180px; display: grid; place-items: center; background: #fcfcfd; margin-top: 12px; }
.sp-pane[data-p=saved] .sp-saved { margin-top: 0; }
.sp-saved img { max-width: 88%; max-height: 150px; }
.sp-saved.square { height: 220px; }
.sp-saved.square img { max-height: 180px; }
.st-make { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; }
.st-preview { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fcfcfd; }
.st-preview canvas { width: 100%; height: auto; display: block; }
.st-shapes { display: flex; gap: 6px; flex-wrap: wrap; }
.st-shapes button { border: 1.5px solid var(--line-strong); background: #fff; border-radius: 9px; padding: 7px 12px; font-size: 13.5px; }
.st-shapes button.on { border-color: var(--black); font-weight: 600; }

/* 진위 확인 */
.vf-box { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 14px; margin-top: 16px; background: var(--gray-bg); font-size: 14.5px; }
.vf-box svg { flex-shrink: 0; margin-top: 1px; }
.vf-box p { margin: 4px 0 0; font-size: 13px; line-height: 1.6; opacity: .9; }
.vf-box.ok { background: var(--green-bg); color: var(--green-text); }
.vf-box.warn { background: var(--yellow-bg); color: #7a5a00; }
.vf-box.bad { background: var(--red-bg); color: var(--red-text); }
.vf-hash { font-family: var(--mono); font-size: 11px; color: var(--text-3); word-break: break-all; margin-top: 10px; }

/* 확인 모달 */
.es-confirm-doc { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--hover); border-radius: 12px; }
.es-confirm-doc svg { flex-shrink: 0; color: var(--text-2); }
.es-confirm-doc b { display: block; font-size: 15px; }
.es-confirm-doc span { font-size: 13px; color: var(--text-3); }
.es-confirm-list { margin-top: 10px; }
.es-confirm-list > div { display: flex; align-items: center; gap: 9px; padding: 8px 4px; font-size: 14.5px; border-bottom: 1px solid var(--line); }
.es-confirm-list > div:last-child { border-bottom: 0; }
.es-confirm-list b { font-size: 12px; color: var(--text-3); width: 12px; }
.es-confirm-list .muted { margin-left: auto; }
.es-sig-preview { display: flex; gap: 16px; justify-content: center; align-items: center; margin: 18px 0; min-height: 10px; }
.es-sig-preview img { max-height: 72px; max-width: 45%; }
.consent { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--line-strong); border-radius: 12px; font-size: 13.5px; line-height: 1.6; cursor: pointer; color: var(--text-2); margin-top: 6px; }
.consent:has(input:checked) { border-color: var(--black); color: var(--text); }
.consent input { margin-top: 3px; }

/* 완료 */
.es-done { text-align: center; padding: 90px 20px; max-width: 520px; margin: 0 auto; }
.es-done-icon { width: 84px; height: 84px; border-radius: 50%; background: var(--green-bg); color: var(--green-text); display: grid; place-items: center; margin: 0 auto 22px; animation: pop .3s ease-out; }
.es-done h2 { font-size: 26px; margin: 0 0 10px; letter-spacing: -0.03em; }
.es-done p { color: var(--text-2); margin: 0 0 28px; line-height: 1.65; }

/* 상세 */
.es-detail-head { align-items: flex-start; }
.es-detail-head h1 { font-size: 26px; line-height: 1.35; }
.es-sub { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--text-3); font-size: 13.5px; flex-wrap: wrap; }
.es-alert { display: flex; gap: 10px; align-items: center; padding: 13px 18px; border-radius: 14px; background: #e9e9ec; color: var(--text-2); margin-bottom: 18px; font-size: 14.5px; }
.es-alert svg { flex-shrink: 0; }
.es-alert.bad { background: var(--red-bg); color: var(--red-text); }
.es-detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.es-preview { background: #e8e8eb; border-radius: var(--radius); padding: 24px 24px 4px; max-height: calc(100vh - 150px); overflow: auto; position: sticky; top: 20px; }
.es-preview .es-pages { max-width: 700px; }
.es-panel { display: flex; flex-direction: column; gap: 14px; }
.es-panel .card { border-color: transparent; }
.es-panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.es-panel-head h4 { margin: 0; font-size: 15.5px; }
.es-track-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.es-track-row:last-child { border-bottom: 0; padding-bottom: 0; }
.es-track-main { flex: 1; min-width: 0; }
.es-track-main b { display: block; font-size: 14.5px; }
.es-track-main span { font-size: 12px; color: var(--text-3); }
.es-dl { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 9px 12px; font-size: 13.5px; margin: 0; }
.es-dl dt { color: var(--text-3); }
.es-dl dd { margin: 0; word-break: break-all; }
.es-dl a { color: var(--blue-text); margin-left: 4px; }
.es-msg { margin-top: 14px; background: var(--hover); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; color: var(--text-2); }
.es-timeline { list-style: none; padding: 0; margin: 0; }
.es-timeline li { display: flex; gap: 10px; padding: 8px 0; position: relative; font-size: 13.5px; }
.es-timeline li:not(:last-child)::before { content: ''; position: absolute; left: 11.5px; top: 34px; bottom: -6px; width: 1px; background: var(--line-strong); }
.tl-icon { width: 24px; height: 24px; border-radius: 50%; background: var(--gray-bg); display: grid; place-items: center; flex-shrink: 0; color: var(--text-2); }
.es-timeline b { font-weight: 600; }
.es-timeline span { display: block; font-size: 12px; color: var(--text-3); margin-top: 1px; }
.es-timeline em { display: block; font-style: normal; color: var(--text-2); margin-top: 3px; font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .es-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .es-row .es-chips { display: none; }
  .es-detail { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .es-detail { grid-template-columns: 1fr; }
  .es-preview { position: static; max-height: 70vh; }
  .es-editor { grid-template-columns: 260px minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.15); }
  .app.mobile-open .sidebar { transform: none; }
  .app.collapsed .sidebar { width: var(--sidebar-w); }
  .main { padding: 16px 16px 60px; }
  .mobile-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
  .grid-3, .grid-2, .form-2 { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 25px; }
  .list-row { padding: 13px 14px; gap: 10px; flex-wrap: wrap; }
  .list-row .col-person, .list-row .col-time { width: auto; }
  .task-row .cat { display: none; }
  .cal-item .s-row { display: none; }
  .cal-item { font-size: 11px; padding: 3px 4px; margin: 1px 2px; }
  .cal-day { padding: 8px 6px 4px; font-size: 13px; }
  .proj-grid { grid-template-columns: 1fr; }
  .tbl th, .tbl td { padding: 12px 10px; font-size: 14px; }

  .home { padding-top: 6px; }
  .home-hello { font-size: 27px; margin-bottom: 24px; }
  .home-grid { gap: 10px; }
  .home-card { min-height: 0; padding: 16px; }
  .hc-icon { margin-bottom: 16px; }
  .hc-title { font-size: 15.5px; }
  .hc-desc { font-size: 13px; }
  .wk-list { padding: 2px 18px; }
  .wk-day { grid-template-columns: 1fr; gap: 10px; padding: 16px 0; }
  .wk-item { flex-wrap: wrap; row-gap: 0; }
  .wk-meta { flex-basis: 100%; padding-left: 18px; }

  .es-row { grid-template-columns: 36px minmax(0, 1fr); padding: 14px 16px; gap: 12px; }
  .es-row-icon { width: 36px; height: 36px; }
  .es-row-right { grid-column: 2; justify-self: start; }
  .es-full { margin: 0 -16px -60px; height: calc(100dvh - 68px); }
  .es-topbar { flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
  .es-top-title { flex: 1 1 calc(100% - 50px); }
  .es-signing .es-topbar .spacer { display: none; }
  .es-meter { flex: 1; width: auto; }
  .es-editor { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .es-side { max-height: 38vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .es-canvas { padding: 16px 10px 70px; }
  .es-page { margin-bottom: 26px; }
  .st-make { grid-template-columns: 1fr; }
  .st-preview { max-width: 220px; margin: 0 auto; }
  .sp-styles { grid-template-columns: 1fr; }
  .sp-style { height: 84px; }
  .es-detail-head h1 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
