/* HERMES SMS 손님 사이트 디자인 시스템 v2 — 앱 셸 + 벤토(10-09 레드 「최신 트렌드로 세련되게」).
   밝은/어두운 테마 둘 다(html[data-theme]). 클래스 이름(hm-*)은 v1 과 같게 두어 화면 템플릿이 그대로 쓴다.
   JS 가 그리는 옛 표(.border-table · .status-label)도 같은 모양. */

:root {
    --font: "Pretendard Variable", "Pretendard", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
    --accent: #f05a1a;
    --accent-2: #ff8a4c;
    --accent-ink: #ffffff;
    --r-sm: 8px;
    --r: 12px;
    --r-lg: 16px;
    --r-xl: 22px;
    --side-w: 248px;
    --ease: cubic-bezier(.2, .8, .2, 1);

    /* 밝은 테마 */
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-2: #f4f4f5;
    --surface-3: #ececee;
    --line: rgba(9, 9, 11, .08);
    --line-2: rgba(9, 9, 11, .05);
    --ink: #09090b;
    --ink-2: #3f3f46;
    --muted: #71717a;
    --faint: #a1a1aa;
    --accent-soft: rgba(240, 90, 26, .09);
    --accent-line: rgba(240, 90, 26, .28);
    --ok: #16a34a; --ok-soft: rgba(22, 163, 74, .1);
    --warn: #d97706; --warn-soft: rgba(217, 119, 6, .1);
    --bad: #dc2626; --bad-soft: rgba(220, 38, 38, .09);
    --shadow-sm: 0 1px 2px rgba(9, 9, 11, .05);
    --shadow: 0 1px 2px rgba(9, 9, 11, .04), 0 8px 24px -8px rgba(9, 9, 11, .08);
    --shadow-lg: 0 24px 60px -20px rgba(9, 9, 11, .25);
    --glow: radial-gradient(600px 300px at 0% 0%, rgba(240, 90, 26, .10), transparent 60%);
    color-scheme: light;
}
html[data-theme="dark"] {
    --bg: #09090b;
    --surface: #111113;
    --surface-2: #18181b;
    --surface-3: #232327;
    --line: rgba(255, 255, 255, .08);
    --line-2: rgba(255, 255, 255, .05);
    --ink: #fafafa;
    --ink-2: #d4d4d8;
    --muted: #a1a1aa;
    --faint: #71717a;
    --accent: #ff6b2c;
    --accent-soft: rgba(255, 107, 44, .12);
    --accent-line: rgba(255, 107, 44, .35);
    --ok: #4ade80; --ok-soft: rgba(74, 222, 128, .12);
    --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .12);
    --bad: #f87171; --bad-soft: rgba(248, 113, 113, .12);
    --shadow-sm: 0 1px 0 rgba(255, 255, 255, .03) inset;
    --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 10px 30px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .8);
    --glow: radial-gradient(700px 360px at 0% 0%, rgba(255, 107, 44, .14), transparent 60%);
    color-scheme: dark;
}
/* v1 이름(템플릿 안 인라인 style 이 쓴다) */
:root, html[data-theme="dark"] {
    --hm-orange: var(--accent);
    --hm-orange-strong: var(--accent);
    --hm-orange-soft: var(--accent-soft);
    --hm-orange-line: var(--accent-line);
    --hm-ink: var(--ink); --hm-ink-2: var(--ink-2); --hm-muted: var(--muted); --hm-faint: var(--faint);
    --hm-line: var(--line); --hm-line-2: var(--line-2); --hm-bg: var(--bg);
    --hm-ok: var(--ok); --hm-warn: var(--warn); --hm-bad-red: var(--bad); --hm-bad-soft: var(--bad-soft);
    --hm-shadow: var(--shadow);
    --hm-serif: var(--font);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { background: var(--bg); }
body.hm {
    margin: 0; min-height: 100vh;
    color: var(--ink); background: var(--bg);
    font-family: var(--font); font-size: 14px; line-height: 1.55; letter-spacing: -.01em;
    font-feature-settings: "tnum" 0, "ss01" 1;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    transition: background-color .25s var(--ease), color .25s var(--ease);
}
body.hm a { color: inherit; }
body.hm ::selection { background: var(--accent); color: #fff; }

/* ================= 앱 셸 ================= */
.hm-shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.hm-side {
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
    padding: 18px 14px; border-right: 1px solid var(--line); background: var(--surface);
    overflow-y: auto; z-index: 50;
}
.hm-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; text-decoration: none; }
.hm-brand-mark { display: block; width: 28px; height: 28px; flex: none; border-radius: 8px; }
.hm-brand-word { font-weight: 800; font-size: 16px; letter-spacing: .14em; color: var(--ink); }
.hm-brand-dot { color: var(--accent); }
.hm-brand-tag {
    margin-left: auto; padding: 2px 7px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .12em;
}
.hm-side-label { margin: 14px 10px 6px; color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hm-nav { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.hm-nav a {
    position: relative; display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: 10px;
    color: var(--ink-2); font-weight: 600; text-decoration: none;
    transition: background-color .15s, color .15s;
}
.hm-nav a .bi { width: 18px; font-size: 16px; color: var(--muted); transition: color .15s; }
.hm-nav a:hover { background: var(--surface-2); color: var(--ink); }
.hm-nav a.active { background: var(--accent-soft); color: var(--accent); }
.hm-nav a.active .bi { color: var(--accent); }
.hm-nav a.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.hm-nav-badge { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; line-height: 20px; text-align: center; }
.hm-side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.hm-side-card {
    padding: 14px; border: 1px solid var(--line); border-radius: var(--r);
    background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface-2);
}
.hm-side-card b { display: block; font-size: 13px; }
.hm-side-card span { color: var(--muted); font-size: 12px; }

.hm-content { min-width: 0; display: flex; flex-direction: column; }
.hm-top {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 28px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
}
.hm-search {
    display: flex; align-items: center; gap: 10px; width: min(420px, 100%); height: 36px; padding: 0 10px 0 12px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
    color: var(--faint); font: inherit; cursor: pointer; text-align: left;
    transition: border-color .15s, box-shadow .15s;
}
.hm-search:hover { border-color: var(--accent-line); }
.hm-search span { flex: 1; }
.hm-kbd { padding: 1px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--muted); font-family: var(--mono); font-size: 11px; }
.hm-top-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.hm-icon-btn {
    display: inline-grid; place-items: center; width: 36px; height: 36px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
    color: var(--ink-2); cursor: pointer; transition: all .15s;
}
.hm-icon-btn:hover { color: var(--accent); border-color: var(--accent-line); }
.hm-user { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 700; font-size: 13px; }
.hm-avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.hm-menu-toggle { display: none !important; }
.hm-main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 28px 28px 56px; }

/* ================= 머리글 · 섹션 ================= */
.hm-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.hm-eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.hm-title { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.035em; line-height: 1.2; }
.hm-sub { margin: 6px 0 0; color: var(--muted); }
.hm-sub strong { color: var(--ink); }
.hm-section { margin-top: 28px; }
.hm-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 12px; font-size: 15px; font-weight: 800; letter-spacing: -.02em; }

.hm-grid { display: grid; gap: 16px; }
.hm-grid-send { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.hm-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hm-grid-stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* ================= 카드 · 지표 ================= */
.hm-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.hm-card-body { padding: 20px 22px; }
.hm-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.hm-card-head h2, .hm-card-head h3 { margin: 0; font-size: 14px; font-weight: 700; }
.hm-stat { padding: 18px 20px; overflow: hidden; transition: border-color .2s, transform .2s var(--ease); }
.hm-stat:hover { border-color: var(--accent-line); }
.hm-stat-label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.hm-stat-value { margin-top: 8px; font-size: 26px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.hm-stat-value small { margin-left: 4px; color: var(--faint); font-size: 13px; font-weight: 600; letter-spacing: 0; }
.hm-stat .bi { position: absolute; right: 18px; top: 18px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); color: var(--muted); font-size: 15px; }
.hm-stat.is-accent {
    border-color: transparent; color: #fff;
    background: radial-gradient(120% 120% at 100% 0%, rgba(255, 255, 255, .22), transparent 50%), linear-gradient(135deg, #ff7a33 0%, var(--accent) 50%, #c2410c 100%);
    box-shadow: 0 16px 40px -18px rgba(240, 90, 26, .7);
}
.hm-stat.is-accent .hm-stat-label, .hm-stat.is-accent small { color: rgba(255, 255, 255, .78); }
.hm-stat.is-accent .bi { background: rgba(255, 255, 255, .18); color: #fff; }
.hm-live { display: inline-flex; align-items: center; gap: 7px; color: var(--ok); font-weight: 700; }
.hm-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: hm-pulse 2s infinite; }
@keyframes hm-pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* 벤토(홈) */
.hm-bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: minmax(120px, auto); gap: 14px; }
.hm-bento > * { min-width: 0; }
.hm-b-hero { grid-column: span 4; grid-row: span 2; }
.hm-b-side { grid-column: span 2; }
.hm-b-wide { grid-column: span 3; }
.hm-b-third { grid-column: span 2; }
.hm-b-full { grid-column: 1 / -1; }
.hm-tile { height: 100%; padding: 22px; display: flex; flex-direction: column; overflow: hidden; }
.hm-tile-label { color: var(--muted); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.hm-tile-value { margin-top: auto; font-size: 32px; font-weight: 800; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.hm-tile-value small { margin-left: 4px; color: var(--faint); font-size: 14px; font-weight: 600; letter-spacing: 0; }
.hm-welcome {
    position: relative; height: 100%; padding: 28px; overflow: hidden; border-radius: var(--r-lg);
    background: #0c0a09; color: #fff; border: 1px solid rgba(255, 255, 255, .06);
}
.hm-welcome::before { content: ""; position: absolute; inset: 0; background: radial-gradient(500px 260px at 100% 0%, rgba(255, 107, 44, .55), transparent 60%), radial-gradient(400px 240px at 0% 120%, rgba(255, 138, 76, .25), transparent 60%); }
.hm-welcome::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 28px 28px; mask-image: radial-gradient(ellipse at 80% 20%, #000, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at 80% 20%, #000, transparent 70%); }
.hm-welcome > * { position: relative; z-index: 1; }
.hm-welcome .hm-eyebrow { color: #ffb48a; }
.hm-welcome h1 { margin: 6px 0 8px; font-size: 30px; font-weight: 800; letter-spacing: -.04em; line-height: 1.2; }
.hm-welcome p { margin: 0; color: rgba(255, 255, 255, .68); max-width: 440px; }
.hm-welcome-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.hm-welcome .hm-btn-ghost { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: #fff !important; }
.hm-welcome .hm-btn-ghost:hover { background: rgba(255, 255, 255, .14); }
.hm-ring { --p: 50; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0); }
.hm-ring::before { content: attr(data-label); display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%; background: var(--surface); font-weight: 800; font-size: 15px; }
.hm-bars { display: flex; align-items: flex-end; gap: 6px; height: 64px; margin-top: auto; }
.hm-bars i { flex: 1; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 35%, transparent)); opacity: .85; }
.hm-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.hm-quick a { display: flex; gap: 14px; align-items: center; padding: 16px; text-decoration: none; transition: border-color .15s, transform .15s var(--ease), box-shadow .15s; }
.hm-quick a:hover { transform: translateY(-2px); border-color: var(--accent-line); box-shadow: var(--shadow); }
.hm-ico { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); font-size: 18px; }
.hm-quick b { display: block; font-size: 14px; }
.hm-quick span { color: var(--muted); font-size: 12.5px; }
.hm-hero-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* ================= 정의 목록 ================= */
.hm-dl { display: grid; grid-template-columns: 170px minmax(0, 1fr); margin: 0; }
.hm-dl dt, .hm-dl dd { margin: 0; padding: 13px 22px; border-bottom: 1px solid var(--line-2); }
.hm-dl dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.hm-dl dd { font-weight: 600; word-break: break-all; }
.hm-dl > :nth-last-child(-n+2) { border-bottom: 0; }

/* ================= 폼 ================= */
.hm-field { margin-bottom: 16px; }
.hm-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.hm-count { color: var(--accent); font-weight: 700; }
.hm-hint { color: var(--faint); font-size: 12px; font-weight: 500; }
body.hm .form-control, .hm-input, .hm-textarea, .hm-select {
    width: 100%; min-height: 40px; padding: 9px 12px;
    border: 1px solid var(--line); border-radius: 10px;
    background: var(--surface); color: var(--ink);
    font: inherit; box-shadow: var(--shadow-sm);
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.hm-input::placeholder, .hm-textarea::placeholder { color: var(--faint); }
.hm-textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
body.hm .form-control:focus, .hm-input:focus, .hm-textarea:focus, .hm-select:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.hm-textarea[readonly] { background: var(--surface-2); color: var(--muted); }
.hm-select { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.hm-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hm-row > .hm-grow { flex: 1; min-width: 0; }
.hm-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hm-option { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.hm-option-title { margin-bottom: 8px; font-size: 13px; font-weight: 700; }
.hm-check { display: inline-flex; align-items: center; gap: 8px; margin: 3px 14px 3px 0; font-weight: 600; cursor: pointer; user-select: none; }
.hm-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.hm-file { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px dashed var(--accent-line); border-radius: var(--r); background: var(--accent-soft); }
.hm-file-name { color: var(--ink-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-links { display: flex; gap: 14px; justify-content: flex-end; margin-top: 8px; font-size: 12px; }
.hm-links a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.hm-links a:hover { color: var(--accent); }
/* 치환 발송 안내(10-14) */
.hm-guide { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); padding: 8px 12px; font-size: 13px; color: var(--ink-2); }
.hm-guide summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hm-guide ol { margin: 10px 0 8px; padding-left: 20px; line-height: 1.8; }
.hm-guide-example { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hm-guide-box { margin: 4px 0 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-2); font-size: 12px; line-height: 1.7; word-break: keep-all; }
.hm-guide-title { font-size: 12px; font-weight: 700; color: var(--muted); }
.hm-guide .hm-hint { margin: 8px 0 2px; }
@media (max-width: 720px) { .hm-guide-example { grid-template-columns: 1fr; } }

/* ================= 버튼 ================= */
.hm-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: 10px;
    font: inherit; font-weight: 700; line-height: 1; text-decoration: none; white-space: nowrap;
    cursor: pointer; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .08s;
}
.hm-btn:active { transform: translateY(1px) scale(.99); }
.hm-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.hm-btn[disabled] { opacity: .6; cursor: not-allowed; }
.hm-btn-primary { background: var(--accent); color: var(--accent-ink) !important; box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 8px 20px -10px var(--accent); }
.hm-btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.hm-btn-dark { background: var(--ink); color: var(--bg) !important; }
.hm-btn-dark:hover { opacity: .88; }
.hm-btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2) !important; box-shadow: var(--shadow-sm); }
.hm-btn-ghost:hover { border-color: var(--accent-line); color: var(--accent) !important; }
.hm-btn-danger { background: var(--surface); border-color: color-mix(in srgb, var(--bad) 30%, transparent); color: var(--bad) !important; }
.hm-btn-danger:hover { background: var(--bad-soft); }
.hm-btn-sm { min-height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.hm-btn-lg { min-height: 50px; padding: 0 24px; font-size: 15px; border-radius: 12px; }
.hm-btn-block { width: 100%; }
.hm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hm-chip { padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: all .15s; font-variant-numeric: tabular-nums; }
.hm-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.hm-chip.is-muted { color: var(--muted); }

/* ================= 표 ================= */
.hm-table-wrap { overflow-x: auto; }
.hm-table, body.hm .border-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.hm-table thead th, .hm-table thead td, body.hm .border-table thead td, body.hm .border-table thead th {
    padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line);
    color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; white-space: nowrap;
}
.hm-table thead tr > :first-child, body.hm .border-table thead tr > :first-child { border-top-left-radius: var(--r-lg); }
.hm-table thead tr > :last-child, body.hm .border-table thead tr > :last-child { border-top-right-radius: var(--r-lg); }
.hm-table tbody td, body.hm .border-table tbody td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; text-align: center; background: transparent !important; color: var(--ink-2); }
.hm-table tbody tr:last-child td, body.hm .border-table tbody tr:last-child td { border-bottom: 0; }
.hm-table tbody tr, body.hm .border-table tbody tr { background: transparent !important; transition: background-color .12s; }
.hm-table tbody tr:hover, body.hm .hover-table tbody tr:hover { background: var(--surface-2) !important; }
.hm-table .is-left, body.hm .border-table .is-left { text-align: left; }
.hm-empty { padding: 56px 16px !important; color: var(--faint) !important; text-align: center; font-weight: 500; }
.hm-empty .bi { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 14px; background: var(--surface-2); color: var(--muted); font-size: 22px; }
.hm-msg { min-width: 220px; max-width: 460px; margin: 0 auto; color: var(--ink-2); text-align: left; white-space: normal; word-break: break-all; line-height: 1.55; }
.hm-msg.is-clickable { cursor: pointer; }
.hm-msg.is-clickable:hover { color: var(--accent); }
.hm-num { font-variant-numeric: tabular-nums; }
.hm-mono { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; font-size: 12.5px; }
.hm-inbox-content td { background: var(--surface-2) !important; text-align: left !important; }
.hm-inbox-body { padding: 8px 6px; line-height: 1.7; }

/* ================= 배지 ================= */
.hm-badge, body.hm .status-label {
    display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
    font-size: 12px; font-weight: 700; line-height: 1.7; white-space: nowrap;
    background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.hm-badge::before, body.hm .status-label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.hm-badge.is-ok, body.hm .status-label.success { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.hm-badge.is-warn, body.hm .status-label.warning { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.hm-badge.is-bad, body.hm .status-label.danger { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.hm-badge.is-brand { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.hm-carrier { display: inline-flex; align-items: center; gap: 6px; margin: 2px 6px; font-weight: 700; color: var(--ink-2); }
body.hm .color-crimson { color: var(--accent) !important; font-weight: 800; }

/* ================= 쪽 나눔 ================= */
.hm-pager { display: flex; justify-content: center; gap: 4px; margin: 20px 0 0; padding: 0; list-style: none; }
.hm-pager a { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 10px; border-radius: 9px; color: var(--muted); font-weight: 700; text-decoration: none; font-variant-numeric: tabular-nums; }
.hm-pager a:hover { background: var(--surface-2); color: var(--ink); }
.hm-pager .active a { background: var(--ink); color: var(--bg); }

/* ================= 휴대폰 미리보기 ================= */
.hm-phone { position: relative; padding: 12px; border-radius: 36px; background: linear-gradient(160deg, #27272a, #09090b); box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, .08); }
.hm-phone-screen { position: relative; overflow: hidden; border-radius: 26px; background: var(--surface); }
.hm-phone-notch { width: 86px; height: 22px; margin: 8px auto 0; border-radius: 999px; background: #09090b; }
.hm-phone-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.hm-phone textarea { display: block; width: 100%; height: 360px; padding: 16px 18px; border: 0; background: transparent; resize: none; outline: none; color: var(--ink); font: inherit; font-size: 15px; line-height: 1.65; }
.hm-phone textarea::placeholder { color: var(--faint); }
.hm-phone-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--line); }
.hm-bytes { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.hm-bytes span { color: var(--accent); }
.hm-phone .inner_card.emoji { border-radius: 26px; border: 0; background: var(--surface) !important; color: var(--ink); box-shadow: var(--shadow-lg); max-height: 100%; }
.hm-phone .inner_card.emoji h5 { font-size: 14px; font-weight: 800; }
.hm-phone .emoji_nav { border-bottom-color: var(--line); }

/* ================= 충전 ================= */
.hm-amount { display: flex; align-items: center; gap: 10px; padding: 4px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.hm-amount:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.hm-amount input { flex: 1; min-width: 0; height: 56px; border: 0; outline: none; background: transparent; color: var(--ink); font: inherit; font-size: 30px; font-weight: 800; text-align: right; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.hm-amount span { color: var(--faint); font-size: 18px; font-weight: 700; }
.hm-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.hm-summary strong { font-size: 20px; color: var(--ink); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.hm-notice { padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; line-height: 1.75; }
.hm-notice.is-alert { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.hm-notice .bi { margin-right: 6px; }

/* 받는 번호 */
.hm-recipients { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.hm-recipients li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-variant-numeric: tabular-nums; font-weight: 600; }

/* 바닥 */
.hm-footer { border-top: 1px solid var(--line); }
.hm-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1200px; margin: 0 auto; padding: 18px 28px; color: var(--faint); font-size: 12px; flex-wrap: wrap; }
.hm-footer .hm-brand-word { font-size: 13px; }

/* ================= 명령 창(⌘K) ================= */
.hm-cmd { position: fixed; inset: 0; z-index: 2000; display: none; align-items: flex-start; justify-content: center; padding-top: 14vh; background: rgba(9, 9, 11, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.hm-cmd.is-open { display: flex; animation: hm-fade .15s var(--ease); }
.hm-cmd-box { width: min(560px, calc(100% - 32px)); overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-lg); animation: hm-pop .18s var(--ease); }
.hm-cmd-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.hm-cmd-input input { flex: 1; border: 0; outline: none; background: transparent; color: var(--ink); font: inherit; font-size: 15px; }
.hm-cmd-list { max-height: 340px; margin: 0; padding: 6px; overflow-y: auto; list-style: none; }
.hm-cmd-list a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 600; }
.hm-cmd-list a .bi { color: var(--muted); }
.hm-cmd-list a.is-active, .hm-cmd-list a:hover { background: var(--accent-soft); color: var(--accent); }
.hm-cmd-list a.is-active .bi { color: var(--accent); }
.hm-cmd-list a small { margin-left: auto; color: var(--faint); font-size: 12px; }
@keyframes hm-fade { from { opacity: 0; } }
@keyframes hm-pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }

/* 덮개 · 알림창 */
#blocking { position: fixed; inset: 0; z-index: 1000; display: none; background: rgba(9, 9, 11, .5); cursor: wait; }
#blocking .hm-spinner { position: fixed; left: 50%; top: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px; border: 3px solid rgba(255, 255, 255, .3); border-top-color: #fff; border-radius: 50%; animation: hm-spin .8s linear infinite; }
@keyframes hm-spin { to { transform: rotate(360deg); } }
body.hm .modal-content { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
body.hm .modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); }
.hm-date { position: relative; }
.hm-date .input-group-addon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; z-index: 3; }
body.hm .bootstrap-datetimepicker-widget { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); }

/* 등장 */
.hm-main > * { animation: hm-rise .45s var(--ease) both; }
.hm-main > *:nth-child(2) { animation-delay: .04s; }
.hm-main > *:nth-child(3) { animation-delay: .08s; }
.hm-main > *:nth-child(4) { animation-delay: .12s; }
@keyframes hm-rise { from { opacity: 0; transform: translateY(6px); } }

/* ================= 좁은 화면 ================= */
@media (max-width: 1100px) {
    .hm-grid-send { grid-template-columns: 1fr; }
    .hm-phone { max-width: 380px; margin: 0 auto; }
    .hm-b-hero { grid-column: 1 / -1; grid-row: auto; }
    .hm-b-side, .hm-b-wide, .hm-b-third { grid-column: span 3; }
}
@media (max-width: 900px) {
    .hm-shell { grid-template-columns: 1fr; }
    .hm-side { position: fixed; inset: 0 auto 0 0; width: 280px; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow-lg); }
    body.hm.side-open .hm-side { transform: none; }
    body.hm.side-open::after { content: ""; position: fixed; inset: 0; z-index: 45; background: rgba(9, 9, 11, .4); }
    .hm-menu-toggle { display: inline-grid !important; }
    .hm-top { padding: 0 16px; }
    .hm-search span, .hm-search .hm-kbd { display: none; }
    .hm-search { width: 36px; padding: 0; justify-content: center; }
    .hm-user b { display: none; }
    .hm-main { padding: 20px 16px 48px; }
    .hm-title { font-size: 22px; }
    .hm-options, .hm-grid-2 { grid-template-columns: 1fr; }
    .hm-grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .hm-stat { padding: 14px 16px; }
    .hm-stat-value { font-size: 20px; }
    .hm-stat .bi { display: none; }
    .hm-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hm-b-hero, .hm-b-full { grid-column: 1 / -1; }
    .hm-b-side, .hm-b-wide, .hm-b-third { grid-column: span 1; }
    .hm-tile-value { font-size: 24px; }
    .hm-dl { grid-template-columns: 1fr; }
    .hm-dl dt { border-bottom: 0; padding-bottom: 2px; }
    .hm-dl dd { padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
