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

:root {
  color-scheme: light;
  --brand-blue: #005AFF;
  --brand-blue-pressed: #0048CC;
  --blue-10: #F0F5FF;
  --blue-30: #DEE9FD;
  --blue-500: #005AFF;
  --gray-20: #F4F8FB;
  --gray-50: #F1F5F9;
  --gray-100: #E6EDF3;
  --gray-200: #D1DDE9;
  --gray-300: #A9BBCE;
  --gray-400: #7E96B1;
  --gray-900: #060E17;
  --red-10: #F3E2E3;
  --red-50: #E02D3C;
  --green-50: #496A56;
  --green-chip-bg: #D2FFDC;
  --status-processing: #4484F9;
  --status-available: #1EE184;
  --status-warning: #EEDA2A;
  --status-error: #E5414F;
  --status-disabled: #BABABA;
  --bg: var(--gray-50);
  --surface: #ffffff;
  --surface-soft: var(--gray-20);
  --text: var(--gray-900);
  --muted: var(--gray-400);
  --line: var(--gray-100);
  --border-input: var(--gray-300);
  --accent: var(--brand-blue);
  --accent-strong: var(--brand-blue-pressed);
  --blue: var(--blue-500);
  --red: var(--red-50);
  --amber: #8B6F00;
  --green: var(--green-50);
  --shadow: none;
  --font-sans: "Pretendard Variable", Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-numeric: Roboto, var(--font-sans);
  --font-mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius-xs: 4px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-pill: 50px;
  font-family: var(--font-sans);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--gray-50);
}

.login-panel {
  width: min(420px, 100%);
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-md);
  box-shadow: none;
  padding: 30px;
}

/* ============================================================
   셸 — pluglink-csms(Gnb + LNB) 그라운딩
   · Gnb: 상단 고정 81.5px, 흰 배경, 하단 1px gray-100
   · LNB: 좌측 고정 240px, Gnb 아래(top 81.5px)
   · Container: ml 240px, bg gray-50, padding 30px, max 1660px
   출처: pluglink-csms src/theme/theme.ts, components/common/Lnb
   ============================================================ */
:root {
  --gnb-h: 81.5px;
  --lnb-w: 240px;
  --content-max: 1660px;
}

.shell {
  min-height: 100vh;
  max-width: 100%;
}

/* --- Gnb (상단 헤더) --- */
.gnb {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--gnb-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 32px;
  background: #fff;
  border-bottom: 1px solid var(--gray-50);
  z-index: 1100;
}

.gnb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gnb-logo {
  height: 30px;
  width: auto;
  display: block;
}

.gnb-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gnb-scope {
  font-size: 12px;
  color: var(--gray-400);
}

.gnb-scope strong {
  color: var(--gray-900);
  font-weight: 600;
}

.gnb-user {
  font-size: 13px;
  color: var(--gray-400);
}

/* --- LNB (좌측 메뉴) --- */
.lnb {
  position: fixed;
  top: var(--gnb-h);
  left: 0;
  width: var(--lnb-w);
  bottom: 0;
  background: #fff;
  border-right: 1px solid var(--gray-100);
  padding: 12px 0 24px;
  overflow-y: auto;
  z-index: 200;
}

.lnb-group {
  padding: 14px 18px 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-400);
}

.lnb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  font-size: 16px;
  font-weight: 400;
  color: var(--gray-900);
  border-left: 3px solid transparent;
  cursor: pointer;
}

.lnb-item:hover {
  background: var(--gray-20);
}

.lnb-item.active {
  background: rgba(24, 144, 255, 0.1);
  color: var(--brand-blue);
  border-left-color: var(--brand-blue);
  padding-left: 15px;
}

.lnb-item .lnb-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-300);
  flex: none;
}

.lnb-item.active .lnb-dot {
  background: var(--brand-blue);
}

.brand-logo {
  width: 148px;
  height: 58px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.login-brand .brand-logo {
  width: 210px;
  height: 82px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  background: var(--accent);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.brand-title {
  font-size: 18px;
  font-weight: 600;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.nav {
  display: grid;
  gap: 4px;
  margin-top: 18px;
}

.nav a {
  color: var(--muted);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
}

.nav a.active,
.nav a:hover {
  color: var(--accent);
  background: var(--blue-30);
}

/* --- Container (본문 영역) — csms layout.container --- */
.content {
  min-width: 0;
  margin-left: var(--lnb-w);
  padding-top: var(--gnb-h);
  background: var(--gray-50);
  min-height: 100vh;
}

.mobile-page-title {
  display: none;
}

.main {
  padding: 30px;
  display: grid;
  gap: 20px;
  min-width: 0;
  max-width: var(--content-max);
}

/* ============================================================
   PageTitle — csms Molecules/PageTitle
   h2(22px/600) + 오른쪽 끝까지 흘러나가는 구분선(overflowRightHr)
   ============================================================ */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  position: relative;
  padding-bottom: 16px;
  margin-bottom: 4px;
}

.page-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: calc(100vw - var(--lnb-w) - 60px);
  border-top: 1px solid var(--gray-100);
}

.page-head h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
}

.page-head .muted {
  margin-top: 6px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 20px;
}

.dashboard-hero {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 26px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 22px;
  align-items: center;
  min-width: 0;
}

.hero-copy {
  display: grid;
  gap: 10px;
}

.hero-copy h1 {
  font-size: 30px;
  line-height: 1.22;
  max-width: 720px;
}

.hero-copy p {
  color: var(--muted);
  max-width: 760px;
  line-height: 1.55;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.hero-meter {
  justify-self: end;
}

.meter-ring {
  --value: 0%;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #fff 56%, transparent 57%),
    conic-gradient(var(--accent) var(--value), var(--gray-100) 0);
}

.meter-ring strong {
  font-size: 24px;
  font-weight: 700;
}

.meter-ring span {
  color: var(--muted);
  font-size: 11px;
  margin-top: -28px;
}

.hero-stat-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.hero-stat-grid div {
  min-height: 76px;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: grid;
  align-content: center;
  gap: 4px;
  background: var(--gray-20);
}

.hero-stat-grid strong {
  font-size: 20px;
  font-weight: 700;
}

.hero-stat-grid span {
  color: var(--muted);
  font-size: 12px;
}

.hero-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
}

.dashboard-mobile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 20px;
  min-width: 0;
}

.dashboard-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 22px;
  display: grid;
  gap: 16px;
  min-width: 0;
}

.priority-card {
  border-left: 4px solid var(--accent);
}

.action-stack,
.settlement-card-list,
.agent-flow {
  display: grid;
  gap: 10px;
}

.action-card {
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  background: #fff;
}

.action-card.urgent {
  background: #fff8f7;
  border-color: #ffd7d2;
}

.action-card div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.action-card strong {
  font-size: 16px;
  font-weight: 700;
}

.action-card small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-card-side {
  text-align: right;
  display: grid;
  gap: 4px;
  flex: 0 0 auto;
}

.action-card-side b {
  font-size: 15px;
}

.action-card-side span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.agent-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.step-index {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue-10);
  color: var(--accent);
  font-weight: 800;
  font-size: 12px;
}

.agent-step div:nth-child(2) {
  display: grid;
  gap: 3px;
}

.agent-step strong {
  font-size: 14px;
}

.agent-step span,
.agent-step em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.settlement-card-list {
  grid-template-columns: repeat(4, minmax(220px, 1fr));
}

.settlement-card {
  min-height: 214px;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: grid;
  gap: 12px;
  align-content: start;
  background: #fff;
}

.settlement-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.settlement-card h3 {
  margin-top: 4px;
  font-size: 16px;
}

.settlement-money {
  font-size: 24px;
  font-weight: 800;
  font-family: var(--font-numeric);
}

.settlement-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.settlement-meta span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  background: var(--gray-50);
  padding: 0 8px;
  font-size: 12px;
  color: var(--text);
}

.progress-line {
  height: 6px;
  border-radius: 999px;
  background: var(--gray-100);
  overflow: hidden;
}

.progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.settlement-actions {
  margin-top: auto;
}

.empty-state {
  border: 1px dashed var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 18px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
}

h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}

.muted {
  color: var(--muted);
}

.tiny {
  color: var(--muted);
  font-size: 12px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ============================================================
   CardSection — csms box.ts (allCardSection: white / radius 16 / padding 20)
   top·bottom 을 붙여 쌓으면 이음매 없는 하나의 카드가 된다(필터+목록).
   ============================================================ */
.card,
.section,
.table-wrap,
.form-panel {
  background: var(--surface);
  border: 0;
  border-radius: 16px;
  box-shadow: none;
}

.card,
.section {
  padding: 20px;
  display: grid;
  gap: 12px;
}

.card--top {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.card--mid {
  border-radius: 0;
}

.card--bottom {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* 카드 안 섹션 제목 — csms textH3(18px/600) */
.card > h2,
.section > h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.card > h3,
.section > h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-400);
  margin: 0;
}

.metric {
  font-family: var(--font-numeric);
  font-size: 28px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* 목록 카드 헤더 — 제목 + 우측 액션 (csms Flex betweenCenter) */
.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.list-head h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.list-count {
  font-size: 14px;
  color: var(--gray-400);
  font-weight: 500;
}

/* 필터 바 — csms Filters 카드(top) 안에 놓인다 */
.list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.list-toolbar input {
  width: min(420px, 100%);
}

.table-wrap {
  overflow: auto;
  padding: 0;
  border-radius: 0;
}

/* 필터 카드(top) 바로 뒤에 오는 테이블/섹션 = 목록 카드(bottom).
   두 카드가 맞물려 하나의 카드처럼 보인다 — csms top/bottomCardSection 재현. */
.card--top + .table-wrap,
.card--top + .section {
  background: #fff;
  border-radius: 0 0 16px 16px;
  padding: 0 20px 12px;
  margin-top: 0;
}

.card--top + .section {
  padding: 4px 20px 12px;
}

/* .main 은 grid(gap 20px)라 두 카드 사이 간격이 생긴다 — 상쇄해 맞물린다 */
.card--top {
  margin-bottom: -20px;
}

/* ============================================================
   Table — csms styles.defaultTable
   thead: sticky, 흰 배경, inset 하단선 / th 500·#7E96B1 / td 600·16px
   tbody tr: 위쪽 1px gray-50 구분선(첫 행 제외)
   ============================================================ */
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 760px;
  font-size: 16px;
  /* csms 는 break-all 이지만 컨테이너가 1720px 이상이라 문제가 없다.
     여기선 폭이 좁아 숫자·짧은 단어가 쪼개지므로 한국어 단어 단위로 끊는다. */
  word-break: keep-all;
}

th,
td {
  text-align: left;
  vertical-align: middle;
}

thead tr th {
  position: sticky;
  /* .table-wrap 이 스크롤 컨테이너이므로 그 기준 0 에 붙인다.
     (csms 는 페이지 스크롤이라 82px 를 쓰지만, 여기선 컨테이너 기준) */
  top: 0;
  background: #fff;
  z-index: 1;
  box-shadow: inset 0 -1px 1px 0 rgba(241, 245, 249, 1);
  padding: 20px 5px 20px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--gray-400);
  white-space: nowrap;
}

tbody tr {
  border-top: 1px solid var(--gray-50);
}

tbody tr:first-child {
  border-top: 0;
}

tbody td {
  padding: 16px 5px 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

tfoot tr {
  border-top: 1px solid var(--gray-50);
}

tfoot th {
  padding: 8px 5px 8px 0;
  font-weight: 600;
}

/* 금액 컬럼은 우측 정렬 + 자릿수 정렬 */
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-right: 12px;
}

/* 숫자·기간·배지·버튼 셀은 쪼개지지 않게 */
tbody td:has(.badge),
tbody td:has(.button),
tbody td:has(button) {
  white-space: nowrap;
}

tbody td .button,
tbody td button {
  white-space: nowrap;
}

/* 금액(₩)·기간(YYYYMM) 처럼 숫자로만 된 셀 */
tbody td {
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Chip(배지) — csms box.ts chip (pill / 14px / 600 / padding 6·12)
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--gray-50);
  color: var(--gray-400);
}

.badge.blue {
  background: var(--blue-30);
  color: var(--blue-500);
}

.badge.gray {
  background: var(--gray-20);
  color: var(--gray-300);
}

.badge.red {
  background: var(--red-10);
  color: var(--red-50);
}

.badge.green {
  background: var(--green-chip-bg);
  color: var(--green-50);
}

.badge.amber {
  background: #fdf3d8;
  color: #8b6f00;
}

/* ============================================================
   Button — csms buttons.ts
   save(주요)=흰글씨/blue500 · primary(보조)=blue500글씨/blue50 · cancel=투명 · danger=red
   공통: radius 4px, fontSize 14, padding 8·16
   ============================================================ */
.button,
button {
  min-height: 39px;
  border: 0;
  border-radius: 4px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--blue-500);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.button:hover,
button:hover {
  filter: brightness(0.96);
}

.button:disabled,
button:disabled {
  color: var(--blue-200);
  background: var(--blue-10);
  cursor: not-allowed;
  filter: none;
}

/* 보조 액션 — csms buttons.primary */
.button.secondary,
button.secondary {
  background: var(--blue-10);
  color: var(--blue-500);
}

/* 취소 — csms buttons.cancel */
.button.cancel,
button.cancel {
  background: transparent;
  color: var(--gray-900);
  border: 1px solid var(--gray-200);
}

.button.danger,
button.danger {
  background: var(--red-10);
  color: var(--red-50);
}

.button.small,
button.small {
  min-height: 32px;
  padding: 4px 12px;
}

.link {
  color: var(--accent);
  font-weight: 500;
}

form.inline {
  display: inline;
}

.form-panel {
  padding: 30px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  min-height: 39px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-xs);
  padding: 9px 12px;
  color: var(--text);
  background: white;
  font: inherit;
  font-size: 14px;
}

input::placeholder,
textarea::placeholder {
  color: var(--gray-300);
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border: 2px solid var(--gray-300);
  padding: 8px 11px;
}

textarea {
  min-height: 108px;
  resize: vertical;
}

.span-2 {
  grid-column: span 2;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ============================================================
   Modal — csms PModal
   radius 20px · 배경 gray-50(#F1F5F9) · padding 50/30/32 · overlay #00000083
   내부 폼은 흰 카드로 올려 대비를 만든다.
   ============================================================ */
dialog {
  width: min(800px, calc(100vw - 32px));
  max-height: 80vh;
  border: 0;
  border-radius: 20px;
  padding: 0;
  background: var(--gray-50);
  box-shadow: none;
  overflow: auto;
}

dialog::backdrop {
  background: #00000083;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 50px 30px 0;
  border-bottom: 0;
}

.modal-head h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
}

.modal-body {
  padding: 28px 30px 32px;
}

/* 모달 안 폼은 흰 카드 위에 */
.modal-body .form-grid {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
}

.icon-button {
  width: 32px;
  min-height: 32px;
  padding: 0;
  background: var(--gray-50);
  color: var(--text);
}

.notice {
  border-left: 4px solid var(--accent);
  background: #eef8f6;
  padding: 12px 14px;
  border-radius: 7px;
  color: #143d38;
}

.error {
  border-left-color: var(--red);
  background: #fff0ed;
  color: #6d1d16;
}

.sample {
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: pre-wrap;
  background: var(--gray-900);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 14px;
  max-height: 300px;
  overflow: auto;
}

.workflow-editor {
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  overflow: auto;
  background: #fff;
}

.workflow-node {
  min-height: 78px;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  background: var(--gray-20);
  padding: 10px;
  display: grid;
  gap: 6px;
  align-content: start;
}

.workflow-node strong {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.workflow-node span,
.mini-flow span {
  color: var(--muted);
  font-size: 12px;
}

.mini-flow {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.mini-flow span {
  border-radius: var(--radius-pill);
  padding: 4px 8px;
  background: var(--blue-10);
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.charger-picker {
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: grid;
  gap: 12px;
  background: #fff;
}

.picker-head {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 420px);
  gap: 12px;
  align-items: start;
}

.picker-search {
  display: flex;
  gap: 8px;
}

.picker-results,
.selected-list {
  display: grid;
  gap: 8px;
}

.result-row {
  width: 100%;
  min-height: auto;
  justify-content: flex-start;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  text-align: left;
  background: var(--gray-20);
  color: var(--text);
  border: 1px solid var(--gray-100);
  padding: 10px 12px;
}

.result-row:hover {
  background: var(--blue-10);
}

.result-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.selected-chip {
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: var(--gray-20);
  color: var(--text);
}

.selected-chip strong {
  font-weight: 600;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 10px;
  color: inherit;
}

.timeline-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-item span:last-child {
  display: grid;
  gap: 3px;
}

.timeline-item strong {
  font-size: 14px;
  font-weight: 600;
}

.timeline-item small,
.timeline-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.station-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.station-list span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  background: var(--gray-50);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.numeric,
td:nth-child(n + 4) {
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 920px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .side {
    position: static;
    height: auto;
  }

  .nav {
    display: flex;
    gap: 6px;
    overflow-x: visible;
    flex-wrap: wrap;
    padding-bottom: 4px;
  }

  .nav a {
    white-space: normal;
  }

  .grid.cols-4,
  .grid.cols-3,
  .grid.cols-2,
  .form-grid,
  .dashboard-grid,
  .dashboard-mobile-grid {
    grid-template-columns: 1fr;
  }

  .settlement-card-list {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .span-2 {
    grid-column: span 1;
  }

  .picker-head,
  .workflow-editor {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  html,
  body {
    max-width: 100vw;
    overflow-x: hidden;
  }

  body {
    background: #fff;
  }

  .shell,
  .content,
  .main,
  .dashboard-hero,
  .dashboard-mobile-grid,
  .dashboard-card,
  .card,
  .table-wrap,
  dialog {
    max-width: 100vw;
    min-width: 0;
  }

  .side {
    padding: 10px 12px 8px;
    border-right: 0;
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px 10px;
    align-items: center;
  }

  .brand {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    border-bottom: 0;
    min-width: 0;
  }

  .brand-logo {
    width: 78px;
    height: 31px;
  }

  .brand-subtitle {
    display: none;
  }

  .nav {
    margin-top: 0;
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
    padding-bottom: 0;
  }

  .nav a {
    flex: 0 1 auto;
    min-height: 32px;
    padding: 7px 8px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
  }

  .topbar {
    position: sticky;
    top: 50px;
    height: auto;
    min-height: 40px;
    padding: 6px 12px 8px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid var(--gray-100);
    z-index: 19;
  }

  .topbar-scope {
    display: none;
  }

  .mobile-page-title {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 700;
  }

  .user-actions {
    width: auto;
    margin-left: auto;
    display: flex;
    grid-template-columns: none;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
  }

  .user-actions .tiny {
    max-width: 48vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
  }

  .user-actions button {
    width: auto;
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  .main {
    padding: 14px;
    gap: 14px;
  }

  .dashboard-hero {
    border-radius: 0;
    padding: 14px 16px 16px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    background: #fff;
  }

  .hero-copy {
    align-content: center;
  }

  .hero-copy h1 {
    font-size: 21px;
    line-height: 1.28;
  }

  .hero-detail {
    display: none;
  }

  .hero-meter {
    justify-self: end;
  }

  .meter-ring {
    width: 92px;
    height: 92px;
  }

  .meter-ring strong {
    font-size: 20px;
  }

  .meter-ring span {
    margin-top: -22px;
  }

  .hero-stat-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-x: visible;
    padding-bottom: 0;
    gap: 8px;
  }

  .hero-stat-grid div {
    min-width: 0;
    min-height: 64px;
    padding: 10px;
  }

  .hero-stat-grid strong {
    font-size: 16px;
  }

  .hero-stat-grid span {
    font-size: 11px;
  }

  .hero-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .dashboard-card {
    border-radius: 0;
    padding: 16px;
  }

  .priority-card {
    border-left: 0;
    border-top: 4px solid var(--accent);
  }

  .action-card {
    align-items: flex-start;
    display: grid;
    grid-template-columns: 1fr;
  }

  .action-card-side {
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .agent-step {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .agent-step em {
    grid-column: 2;
  }

  .settlement-card-list {
    grid-template-columns: 1fr;
  }

  .settlement-card {
    min-height: auto;
  }

  .page-head,
  .section-head,
  .list-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .actions:not(.user-actions),
  .page-head .actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .actions:not(.user-actions) .button,
  .actions:not(.user-actions) button,
  .page-head .button,
  .page-head button {
    width: 100%;
  }

  .card,
  .form-panel,
  .login-panel {
    border-radius: 0;
    padding: 16px;
  }

  .grid {
    gap: 10px;
  }

  .metric {
    font-size: 26px;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 16px;
  }

  .table-wrap {
    padding: 0;
    overflow: visible;
    background: transparent;
  }

  table {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    display: block;
    font-size: 13px;
  }

  thead {
    display: none;
  }

  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  tr {
    background: #fff;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 10px;
  }

  td {
    border: 0;
    padding: 8px 0;
    display: grid;
    grid-template-columns: minmax(82px, 32%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    font-size: 13px;
    overflow-wrap: anywhere;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
  }

  td[colspan] {
    display: block;
  }

  td[colspan]::before {
    content: "";
  }

  .workflow-editor,
  .charger-picker {
    padding: 10px;
    overflow: visible;
  }

  .picker-search {
    display: grid;
    grid-template-columns: 1fr;
  }

  dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .modal-head,
  .modal-body {
    padding-left: 16px;
    padding-right: 16px;
  }
}
