/* 사와바라 디자인 토큰 — 로고(네이비 #1B2A3D · 블루 #1E7BE0) 기준. 값을 바꾸면 전 화면에 반영된다. */
:root {
  --sb-navy: #1B2A3D;
  --sb-navy-700: #243B55;
  --sb-blue: #1E7BE0;
  --sb-blue-600: #1668C2;
  --sb-blue-50: #EAF3FD;
  --sb-ink: #17202B;
  --sb-ink-2: #4E5D6E;
  --sb-ink-3: #8593A3;
  --sb-line: #DCE3EB;
  --sb-bg: #F4F6F9;
  --sb-card: #FFFFFF;
  --sb-ok: #2FB67C;
  --sb-warn: #F2A900;
  --sb-danger: #C8102E;
  --sb-ceo: #0E5A63;      /* 입점사(ceo) 메뉴 바탕: 운영자 화면과 바로 구분 */
  --sb-radius: 10px;
  --sb-font: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sb-font); font-size: 14px; color: var(--sb-ink); background: var(--sb-bg); line-height: 1.5; }
a { color: var(--sb-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--sb-blue-50); padding: 1px 5px; border-radius: 4px; }

/* 레이아웃: 좌측 네비 232px + 본문 */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; }
.nav { background: var(--sb-navy); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.nav .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 800; letter-spacing: .08em; font-size: 15px; }
.nav .brand .mark { width: 28px; height: 28px; border-radius: 7px; background: var(--sb-blue); display: grid; place-items: center; }
.nav .brand .mark i { display: block; width: 4px; height: 10px; background: #fff; border-radius: 2px; box-shadow: 8px 0 0 #fff; }
.nav a { color: rgba(255,255,255,.78); padding: 9px 10px; border-radius: 8px; display: flex; align-items: center; gap: 10px; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; color: #fff; }
.nav a.active { background: var(--sb-blue); color: #fff; }
.nav .sect { font-size: 11px; letter-spacing: .12em; color: rgba(255,255,255,.4); padding: 14px 10px 4px; text-transform: uppercase; }
.nav .foot { margin-top: auto; font-size: 12px; color: rgba(255,255,255,.55); padding: 12px 10px 10px; border-top: 1px solid rgba(255,255,255,.12); display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.nav .foot > * { white-space: nowrap; }
.nav .foot a { display: inline; }
.nav .foot button { background: none; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 6px; padding: 3px 9px; cursor: pointer; font: inherit; font-size: 12px; }

.main { padding: 24px 32px 48px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.topbar .crumbs { color: var(--sb-ink-3); font-size: 13px; }
.topbar .actions { display: flex; gap: 8px; }

/* 카드·표 */
.card { background: var(--sb-card); border: 1px solid var(--sb-line); border-radius: var(--sb-radius); padding: 18px 20px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; } /* 나란히 놓인 카드는 위 끝을 맞춘다 */
.card h2 { margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: var(--sb-card); border: 1px solid var(--sb-line); border-radius: var(--sb-radius); padding: 16px 18px; }
.stat .k { font-size: 12px; color: var(--sb-ink-3); }
.stat .v { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 13px; color: var(--sb-ink-2); font-weight: 500; margin-left: 4px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--sb-ink-2); padding: 8px 10px; border-bottom: 1px solid var(--sb-line); white-space: nowrap; font-size: 12px; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--sb-line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #FAFBFD; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .muted { color: var(--sb-ink-3); }
.table-wrap { overflow-x: auto; }

/* 배지 */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--sb-blue-50); color: var(--sb-blue-600); white-space: nowrap; }
.badge.ok { background: #E6F7EF; color: #1E7F55; }
.badge.warn { background: #FFF4D6; color: #8A6100; }
.badge.danger { background: #FBE7EA; color: var(--sb-danger); }
.badge.muted { background: #EEF1F5; color: var(--sb-ink-2); }

/* 폼 */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.form-grid .full { grid-column: 1 / -1; }
label.f { display: block; font-size: 12px; color: var(--sb-ink-2); margin-bottom: 4px; font-weight: 600; }
.in, select.in, textarea.in { width: 100%; font: inherit; font-size: 13.5px; padding: 8px 10px; border: 1px solid var(--sb-line); border-radius: 8px; background: #fff; color: var(--sb-ink); }
.in:focus { outline: 2px solid var(--sb-blue); outline-offset: 0; border-color: var(--sb-blue); }
textarea.in { min-height: 80px; resize: vertical; }
.in[readonly] { background: #F7F9FB; color: var(--sb-ink-2); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding-top: 6px; }
.hint { font-size: 12px; color: var(--sb-ink-3); margin-top: 4px; }
.err { color: var(--sb-danger); font-size: 12px; margin-top: 4px; }
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; font-size: 13.5px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--sb-line); background: #fff; color: var(--sb-ink); cursor: pointer; }
.btn:hover { background: #F7F9FB; text-decoration: none; }
.btn.primary { background: var(--sb-blue); border-color: var(--sb-blue); color: #fff; }
.btn.primary:hover { background: var(--sb-blue-600); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.danger { background: #fff; border-color: var(--sb-danger); color: var(--sb-danger); }
.btn.danger:hover { background: #FBE7EA; }
.reject-banner { border: 2px solid var(--sb-danger); background: #FFF6F7; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .in { width: auto; min-width: 140px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13.5px; background: #E6F7EF; color: #1E7F55; border: 1px solid #BFEBD5; }
.flash.error { background: #FBE7EA; color: var(--sb-danger); border-color: #F3C2CA; }
.pager { display: flex; gap: 6px; margin-top: 14px; font-size: 13px; }
.pager a, .pager span { padding: 4px 9px; border: 1px solid var(--sb-line); border-radius: 6px; background: #fff; }
.pager .current { background: var(--sb-navy); color: #fff; border-color: var(--sb-navy); }
.empty { color: var(--sb-ink-3); text-align: center; padding: 28px; }

/* 로그인 */
.login { min-height: 100%; display: grid; place-items: center; background: var(--sb-navy); }
.login .box { width: 360px; background: #fff; border-radius: 14px; padding: 32px 30px; }
.login .box .brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 22px; }
.login .box .brand .mark { width: 44px; height: 44px; border-radius: 11px; background: var(--sb-navy); display: grid; place-items: center; }
.login .box .brand .mark i { display: block; width: 5px; height: 14px; background: #fff; border-radius: 3px; box-shadow: 11px 0 0 #fff; }
.login .box .brand b { letter-spacing: .14em; font-size: 15px; }
.login .box .brand small { color: var(--sb-ink-3); font-size: 12px; }
.login .f-row { margin-bottom: 12px; }

/* ── 휴대폰 전용 요소: PC에서는 숨김 ── */
.appbar, .mtab, .navclose, .filters-toggle { display: none; }

/*
 * 휴대폰 (900px 이하) — PC와 다른 구성, 기능은 같다.
 * 위: 화면 제목 띠 · 아래: 탭 5개(홈·주문·문의·상품·전체 메뉴) · 전체 메뉴는 화면을 덮는 서랍
 * 표는 한 건씩 카드로(app-mobile.js가 머리글을 칸 이름으로 붙임), 검색 조건은 접었다 펴기, 버튼·입력칸은 손가락 크기
 */
@media (max-width: 900px) {
  html { -webkit-text-size-adjust: 100%; }
  .card { overflow-x: auto; }   /* 좁은 화면: 표가 넓으면 카드 안에서 옆으로 밀기 */
  body { font-size: 15px; background: #EEF1F5; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .shell { display: block; }

  /* 위쪽 제목 띠 */
  .appbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 40; height: 52px; padding: 0 6px 0 14px; background: var(--sb-navy); color: #fff; }
  .shell.ceo ~ .appbar, body:has(.shell.ceo) .appbar { background: var(--sb-ceo); }
  .appbar .mark { width: 26px; height: 26px; border-radius: 7px; background: var(--sb-blue); display: grid; place-items: center; flex: none; }
  .appbar .mark i { display: block; width: 4px; height: 10px; background: #fff; border-radius: 2px; box-shadow: 7px 0 0 #fff; }
  .appbar .t { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .appbar .navbtn { display: grid; place-items: center; width: 44px; height: 44px; font-size: 20px; cursor: pointer; border: 0; margin: 0; padding: 0; }

  /* 전체 메뉴 = 화면을 덮는 서랍 */
  .nav { position: fixed; inset: 0; z-index: 60; padding: 10px 14px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; -webkit-overflow-scrolling: touch;
    transform: translateX(-102%); transition: transform .18s ease; display: flex; flex-direction: column; gap: 2px; }
  .navtoggle:checked ~ .shell .nav { transform: none; }
  .nav .brand { padding: 6px 4px 12px; position: sticky; top: -10px; background: inherit; z-index: 1; }
  .navclose { display: inline-flex; margin-left: auto; padding: 9px 14px; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; font-size: 13px; letter-spacing: 0; font-weight: 600; cursor: pointer; }
  .nav a { padding: 13px 12px; font-size: 16px; }
  .nav .sect { padding: 16px 12px 4px; font-size: 12px; }
  .nav .foot { margin-top: 16px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 13px; }
  .nav .foot button { padding: 8px 14px; font-size: 13px; }
  .shell.ceo .nav .store { margin: 0 0 8px; }

  /* 아래 탭 */
  .mtab { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: #fff; border-top: 1px solid var(--sb-line);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); box-shadow: 0 -2px 10px rgba(23,32,43,.06); }
  .mtab a, .mtab label { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px 4px; font-size: 11px; font-weight: 600; color: var(--sb-ink-2);
    text-decoration: none; border-radius: 10px; position: relative; cursor: pointer; white-space: nowrap; }
  .mtab i { font-style: normal; font-size: 20px; line-height: 1.15; filter: grayscale(1) opacity(.75); }
  .mtab a.on { color: var(--sb-blue-600); background: var(--sb-blue-50); }
  .mtab.ceo a.on { color: var(--sb-ceo); background: #E3F1F2; }
  .mtab a.on i { filter: none; }
  .mtab em { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--sb-danger); color: #fff; font-style: normal; font-size: 10.5px; line-height: 17px; text-align: center; }

  /* 본문 */
  .main { padding: 12px 10px 24px; }
  .topbar { margin-bottom: 10px; gap: 8px; }
  .topbar h1 { display: none; }                      /* 제목은 위쪽 띠에 */
  .topbar > div:first-child:not(:has(a)) { display: none; }
  .topbar .crumbs { font-size: 13px; }
  .topbar .actions { width: 100%; display: flex; gap: 8px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .topbar .actions:empty { display: none; }
  .topbar .actions .btn { flex: 1 0 auto; justify-content: center; }
  .card { padding: 14px 12px; border-radius: 12px; border-color: #E3E8EF; }
  .card + .card { margin-top: 10px; }
  .card h2 { font-size: 15.5px; display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; margin-bottom: 10px; }
  .card h2 .hint, .card h2 a.hint { float: none !important; margin: 0; }
  .card h2 > .hint:not(a) { flex-basis: 100%; }
  .grid { gap: 10px; }
  .grid.cols-2, .grid.cols-3, .form-grid { grid-template-columns: 1fr; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3:has(> a.card) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }   /* 숫자 요약 카드 */
  .grid:has(> a.card) > a.card { padding: 10px; }
  .grid:has(> a.card) > a.card .muted { font-size: 11.5px; line-height: 1.3; }
  .stat { padding: 12px; border-radius: 12px; }
  .stat .v { font-size: 22px; }
  .stat .v small { display: block; margin: 0; font-size: 12px; }
  [style*="margin-bottom:16px"] { margin-bottom: 10px !important; }
  [style*="margin-top:16px"] { margin-top: 10px !important; }

  /* 버튼·입력칸: 손가락 크기 */
  .btn { min-height: 44px; padding: 9px 14px; font-size: 14.5px; border-radius: 10px; }
  .btn.sm { min-height: 36px; padding: 6px 12px; font-size: 13.5px; }
  label.f { font-size: 13px; margin-bottom: 5px; }
  .in, select.in, textarea.in { font-size: 16px; padding: 11px 12px; border-radius: 10px; min-height: 46px; }   /* 16px 미만이면 아이폰이 화면을 확대한다 */
  .in[style*="width"], select.in[style*="width"] { width: 100% !important; max-width: 100% !important; }
  .main [style*="width:"] { max-width: 100%; }   /* 화면마다 고정 폭으로 둔 칸이 휴대폰 폭을 넘지 않게 */
  .main [style*="min-width:"]:not(table) { min-width: 0 !important; }
  input[type="file"].in { padding: 9px; font-size: 14px; }
  .check { padding: 8px 0; font-size: 15px; }
  input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; flex: none; }
  .hint { font-size: 12.5px; line-height: 1.45; }
  .badge { font-size: 12px; padding: 3px 9px; white-space: normal; }
  .flash { border-radius: 10px; margin-bottom: 10px; }
  form[style*="display:flex"], div[style*="display:flex"] { flex-wrap: wrap; }
  form[style*="margin-left:auto"] { margin-left: 0 !important; width: 100%; }
  span[style*="flex:1"]:empty { display: none; }

  /* 할 일·자주 쓰는 메뉴: 한 줄에 하나씩 큰 버튼 / 3칸 아이콘 */
  .card > div[style*="display:flex"] > a.btn:not(.sm) { flex: 1 1 100%; justify-content: flex-start; text-align: left; }
  .hub-hello { font-size: 14px; margin-bottom: 10px; }
  .hub-favs > div[style*="display:flex"] { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .card.hub-favs > div[style*="display:flex"] > a.btn:not(.sm) { flex: initial; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 2px; padding: 8px 4px; font-size: 13px; min-height: 56px; line-height: 1.25; }
  .hub-favs h2 > .hint:not(a) { flex: 1; flex-basis: auto; }
  .hub-favs .fav-form { position: static; width: 100%; box-shadow: none; margin-top: 8px; }
  .hub-favs .fav-edit { margin-left: auto; }
  .hub-favs .fav-edit[open] { width: 100%; }

  /* 검색 조건: 접었다 펴기 */
  .filters-toggle { display: flex; width: 100%; justify-content: space-between; margin-bottom: 8px; }
  .filters.collapsed { display: none; }
  .filters { gap: 8px; padding: 12px; background: #fff; border: 1px solid #E3E8EF; border-radius: 12px; margin-bottom: 10px; }
  .filters .in { width: 100%; min-width: 0; }
  .filters .btn { flex: 1; justify-content: center; }

  /* 표 → 한 건씩 카드 (app-mobile.js가 .cards를 붙인 표). 제목 한 줄 + 나머지는 두 칸으로 「이름 위·값 아래」 */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap:not(:has(.cards, .fit)) { margin: 0 -12px; padding: 0 12px; }
  table.tbl:not(.cards):not(.fit) { min-width: 540px; }
  table.tbl.fit th { white-space: normal; }
  table.tbl.fit th, table.tbl.fit td { padding: 8px 6px; }
  table.tbl.cards, table.tbl.cards > tbody { display: block; width: 100%; min-width: 0; }
  table.tbl.cards tr.c-head { display: none; }
  table.tbl.cards tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; position: relative; padding: 12px 2px; border-bottom: 1px solid var(--sb-line); }
  table.tbl.cards tr:last-child { border-bottom: 0; }
  table.tbl.cards tr:hover td { background: none; }
  table.tbl.cards td { display: block; padding: 0; border: 0; text-align: left; font-size: 14px; min-width: 0; max-width: none !important; word-break: break-word; white-space: normal !important; }
  table.tbl.cards td::before { content: attr(data-label); display: block; color: var(--sb-ink-3); font-size: 11.5px; line-height: 1.5; }
  table.tbl.cards td[data-label=""]::before, table.tbl.cards td.c-title::before, table.tbl.cards td.c-sub::before, table.tbl.cards td[colspan]::before { display: none; }
  table.tbl.cards td.c-title { order: -2; grid-column: 1 / -1; font-size: 15.5px; font-weight: 600; line-height: 1.35; padding-right: 34px; }
  table.tbl.cards td.c-title > div { font-weight: 400; }
  table.tbl.cards td.c-sub { order: -1; grid-column: 1 / -1; margin-top: -4px; }
  table.tbl.cards td.c-wide, table.tbl.cards td[colspan] { grid-column: 1 / -1; }
  table.tbl.cards td.c-empty { display: none; }
  table.tbl.cards td.c-check { position: absolute; top: 10px; right: 0; }
  table.tbl.cards td.c-check::before, table.tbl.cards td.c-img::before { display: none; }
  table.tbl.cards td.c-img { position: absolute; top: 12px; left: 2px; }
  table.tbl.cards td.c-img img { width: 44px !important; height: 44px !important; }
  table.tbl.cards tr.has-img td.c-title, table.tbl.cards tr.has-img td.c-sub { padding-left: 54px; }
  table.tbl.cards tr.has-img td.c-title { min-height: 40px; }
  table.tbl.cards td[colspan] { text-align: center; }
  table.tbl.cards td form { display: inline-flex; }

  .pager { flex-wrap: wrap; gap: 8px; }
  .pager a, .pager span { padding: 9px 14px; border-radius: 10px; }
  .agent .ic { width: 28px; height: 28px; }
  .flow { flex-direction: column; gap: 2px; }
  .flow .step { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 10px 12px; }
  .flow .step small { flex-basis: 100%; }
  .flow .arrow { transform: rotate(90deg); line-height: 1; }
  .agent-card summary { gap: 4px; }
  details > summary { padding: 4px 0; }
  pre { max-width: 100%; overflow-x: auto; }
  img { max-width: 100%; height: auto; }
  ol, ul { padding-left: 20px; }
}

/* 계약서·약관 본문 */
.doc { max-width: 820px; margin: 0 auto; font-size: 14px; line-height: 1.75; color: var(--sb-ink); }
.doc h1 { font-size: 18px; margin: 28px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--sb-navy); }
.doc h1:first-child { margin-top: 0; text-align: center; border: 0; font-size: 22px; }
.doc h2 { font-size: 15px; margin: 18px 0 6px; }
.doc p { margin: 6px 0; }
.doc table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.doc th, .doc td { border: 1px solid var(--sb-line); padding: 7px 10px; vertical-align: top; text-align: left; }
.doc th { background: #F7F9FB; width: 150px; font-weight: 600; white-space: nowrap; }
.doc .blank { color: var(--sb-danger); font-weight: 700; }
.watermark { background: #FFF4D6; color: #8A6100; border: 1px solid #F2D27A; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 14px; }
.sig-box { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.sig-box .sig { border: 1px solid var(--sb-line); border-radius: 8px; padding: 12px 14px; font-size: 13px; }
.sig-box img { max-height: 70px; display: block; margin: 6px 0; }
canvas.pad { width: 100%; height: 160px; border: 1px dashed var(--sb-ink-3); border-radius: 8px; background: #fff; touch-action: none; }
.public { max-width: 880px; margin: 0 auto; padding: 24px 16px 60px; }
.public .bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.public .bar b { letter-spacing: .14em; color: var(--sb-navy); }
@media print { .noprint { display: none !important; } body { background: #fff; } .card { border: 0; padding: 0; } }
@media (max-width: 700px) { .sig-box { grid-template-columns: 1fr; } .doc th { width: auto; white-space: normal; } }

/* 입점사(ceo.sawabara.com) */
.shell.ceo .nav { background: var(--sb-ceo); }
.shell.ceo .nav .store { margin: 4px 0 12px; padding: 10px 12px; border-radius: 8px; background: rgba(255,255,255,.08); display: grid; gap: 2px; }
.shell.ceo .nav .store small { opacity: .7; font-size: 11.5px; }
.shell.ceo .nav .store code { background: rgba(255,255,255,.14); color: #fff; justify-self: start; }

/* 허브 (대시보드): 인사 · 자주 쓰는 메뉴 · 에이전트 팀 */
.hub-hello { margin: 0 0 12px; font-size: 15px; }
.hub-favs h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hub-favs .fav-edit { margin-left: auto; font-size: 14px; font-weight: 400; position: relative; }
.hub-favs .fav-edit summary { list-style: none; cursor: pointer; }
.hub-favs .fav-edit summary::-webkit-details-marker { display: none; }
.hub-favs .fav-form { position: absolute; right: 0; top: 34px; z-index: 5; width: min(560px, 86vw); background: var(--sb-card); border: 1px solid var(--sb-line); border-radius: var(--sb-radius); box-shadow: 0 8px 24px rgba(23,32,43,.12); padding: 12px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.fav-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.fav-tiles a { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: 1px solid var(--sb-line); border-radius: var(--sb-radius); color: var(--sb-ink); font-weight: 600; background: #fff; }
.fav-tiles a:hover { border-color: var(--sb-blue); background: var(--sb-blue-50); text-decoration: none; }
.fav-tiles a span { font-size: 18px; }
.agent { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--sb-line); }
.agent:first-of-type { border-top: 0; }
.agent .ic { width: 32px; height: 32px; border-radius: 8px; background: var(--sb-blue-50); display: grid; place-items: center; font-size: 17px; flex: none; }
.agent.off { opacity: .6; }

/* 에이전트 관리: 흐름도 */
.flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; }
.flow .arrow { align-self: center; color: var(--sb-ink-3); font-weight: 700; }
.flow .step { width: 148px; padding: 10px; border: 1px solid var(--sb-line); border-radius: var(--sb-radius); background: var(--sb-bg); display: flex; flex-direction: column; gap: 2px; color: var(--sb-ink); }
.flow .step .ic { font-size: 18px; }
.flow .step small { font-size: 11.5px; color: var(--sb-ink-2); line-height: 1.35; }
.flow .step.ai { background: var(--sb-blue-50); border-color: #BFD9F6; }
.flow .step.ai:hover { border-color: var(--sb-blue); text-decoration: none; }
.flow .step .eng { color: var(--sb-blue-600); font-weight: 600; margin-top: 2px; }
.agent-card { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--sb-line); border-radius: var(--sb-radius); }
.agent-card summary { cursor: pointer; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }


/* 검수 지적 칸 (상품 글) */
.in.bad { border-color: var(--sb-danger); background: #FFF7F8; box-shadow: 0 0 0 1px var(--sb-danger) inset; }
.flagbox { margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: #FBE7EA; color: var(--sb-danger); font-size: 12.5px; line-height: 1.55; }
.flagbox mark { background: #FFD5DC; color: inherit; padding: 0 2px; border-radius: 3px; }

.flagrow { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; cursor: pointer; }
.flagrow + .flagrow { border-top: 1px dashed #F3C2CA; }
.flagrow input { margin-top: 3px; flex: none; }
.flagrow .flagok { display: inline-block; margin-left: 6px; font-weight: 600; white-space: nowrap; }
.flagrow.ok { color: #1E7F55; }
.flagrow.ok mark { background: #DDF3E8; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* 상품 등록 흐름도 (일자) — 지금 단계는 파란 테두리, 멈춘 단계는 빨강 */
.track { position: relative; display: flex; overflow-x: auto; padding: 6px 0 4px; scrollbar-width: thin; }
.track .tk { flex: 1 0 88px; position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1px; padding: 0 4px; }
.track .tk::before { content: ""; position: absolute; z-index: 0; top: 18px; left: -50%; width: 100%; height: 3px; background: var(--sb-line); }
.track .tk:first-child::before { display: none; }
.track:not(.cnt) .tk.done::before, .track:not(.cnt) .tk.now::before, .track:not(.cnt) .tk.stop::before { background: var(--sb-ok); }
.track .dot { position: relative; width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--sb-card); border: 2px solid var(--sb-line); font-size: 16px; z-index: 1; }
.track .tk.wait .dot { filter: grayscale(1); opacity: .9; }
.track .tk b { margin-top: 5px; font-size: 12.5px; color: var(--sb-ink-3); }
.track .tk small { font-size: 11px; color: var(--sb-ink-3); }
.track .tk em { font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; margin-top: 3px; background: var(--sb-bg); color: var(--sb-ink-2); }
.track .tk.done .dot { background: #E6F7EF; border-color: var(--sb-ok); color: #1E8A5B; font-weight: 800; }
.track .tk.done b { color: var(--sb-ink-2); }
.track .tk.now .dot { background: var(--sb-blue-50); border-color: var(--sb-blue); box-shadow: 0 0 0 4px rgba(30, 123, 224, .18); animation: tkpulse 1.6s ease-in-out infinite; }
.track .tk.now b, .track .tk.stop b { color: var(--sb-ink); font-weight: 800; }
.track .tk.now em { background: var(--sb-blue); color: #fff; }
.track .tk.stop .dot { background: #FDECEF; border-color: var(--sb-danger); color: var(--sb-danger); font-weight: 900; box-shadow: 0 0 0 4px rgba(200, 16, 46, .14); }
.track .tk.stop em { background: var(--sb-danger); color: #fff; }
.track.sm .tk { flex-basis: 66px; }
.track.sm .tk::before { top: 13px; }
.track.sm .dot { width: 28px; height: 28px; font-size: 12px; }
.track.sm .tk small { display: none; }
.track.sm .tk b { font-size: 11.5px; margin-top: 3px; }
.agent-working { display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 14px 18px; border-radius: 12px; background: linear-gradient(90deg, var(--sb-blue-50), #fff); border: 2px solid var(--sb-blue); box-shadow: 0 2px 10px rgba(30, 123, 224, .12); }
.agent-working .aw-spin { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 4px solid rgba(30, 123, 224, .2); border-top-color: var(--sb-blue); animation: awspin .9s linear infinite; }
.agent-working .aw-title { font-size: 18px; font-weight: 800; color: var(--sb-blue-600); line-height: 1.3; }
.agent-working .aw-sub { font-size: 14px; color: var(--sb-ink); margin-top: 2px; }
.agent-working .aw-time { font-variant-numeric: tabular-nums; color: var(--sb-blue-600); }
.agent-working .aw-hint { font-size: 12px; color: var(--sb-ink-2); margin-top: 3px; }
.agent-working.wait { border-color: var(--sb-warn); background: linear-gradient(90deg, #FFF6DD, #fff); box-shadow: 0 2px 10px rgba(242, 169, 0, .14); }
.agent-working.wait .aw-spin { border-color: rgba(242, 169, 0, .25); border-top-color: var(--sb-warn); }
.agent-working.wait .aw-title, .agent-working.wait .aw-time { color: #9A6B00; }
.agent-working.sm { margin-top: 6px; padding: 8px 12px; gap: 10px; border-width: 1px; box-shadow: none; }
.agent-working.sm .aw-spin { width: 20px; height: 20px; border-width: 3px; }
.agent-working.sm .aw-title { font-size: 14px; }
.agent-working.sm .aw-sub { font-size: 12.5px; }
.audit-answer { margin-top: 12px; padding: 14px 18px; border-radius: 12px; border: 2px solid var(--sb-danger); background: #FFF7F8; }
.audit-answer .aa-head { font-size: 17px; font-weight: 800; color: var(--sb-danger); }
.audit-answer .aa-item { background: #fff; border: 1px solid var(--sb-line); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.audit-answer .aa-q { font-size: 14px; }
.audit-answer .aa-claim { color: var(--sb-ink-2); }
.audit-answer .aa-p { font-size: 13px; color: var(--sb-danger); margin: 3px 0 6px; }
.audit-answer .aa-a { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.audit-answer .aa-a .in { flex: 1; min-width: 240px; }
.agent-stopped { display: flex; align-items: flex-start; gap: 12px; margin-top: 12px; padding: 14px 18px; border-radius: 12px; background: #FFF1F2; border: 2px solid var(--sb-danger); box-shadow: 0 2px 10px rgba(200, 16, 46, .10); }
.agent-stopped .as-icon { font-size: 26px; line-height: 1; }
.agent-stopped .as-title { font-size: 18px; font-weight: 800; color: var(--sb-danger); line-height: 1.3; }
.agent-stopped .as-why { font-size: 14px; color: var(--sb-ink); margin-top: 3px; }
.agent-stopped .as-hint { font-size: 12px; color: var(--sb-ink-2); margin-top: 3px; }
.agent-stopped.sm { margin-top: 6px; padding: 8px 12px; border-width: 1px; box-shadow: none; }
.agent-stopped.sm .as-icon { font-size: 18px; }
.agent-stopped.sm .as-title { font-size: 14px; }
.agent-stopped.sm .as-why { font-size: 12.5px; }
.agent-stopped .as-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--sb-danger); color: #fff; vertical-align: middle; }
.agent-done { display: flex; align-items: flex-start; gap: 12px; margin-top: 12px; padding: 14px 18px; border-radius: 12px; background: #EEFBF3; border: 2px solid var(--sb-ok, #1F9D55); }
.agent-done .ad-icon { font-size: 26px; line-height: 1; }
.agent-done .ad-title { font-size: 18px; font-weight: 800; color: #17703F; line-height: 1.3; }
.agent-done .ad-why { font-size: 14px; color: var(--sb-ink); margin-top: 3px; }
.agent-done .ad-hint { font-size: 12px; color: var(--sb-ink-2); margin-top: 3px; }
.agent-done.sm { margin-top: 6px; padding: 8px 12px; border-width: 1px; }
.agent-done.sm .ad-icon { font-size: 18px; }
.agent-done.sm .ad-title { font-size: 14px; }
.agent-done.sm .ad-why { font-size: 12.5px; }
.agent-changed { margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: #FFF6DD; border: 2px solid var(--sb-warn); font-weight: 700; color: #7A5500; }
.agent-working.stale { opacity: .45; }
.agent-working.stale .aw-spin { animation: none; }
.pending-photos { margin-top: 12px; padding: 14px 18px; border-radius: 12px; border: 2px solid var(--sb-warn); background: #FFFBEB; }
.pending-photos .pp-head { font-size: 17px; font-weight: 800; color: #9A6B00; }
.pending-photos .pp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.pending-photos .pp-card { background: #fff; border: 1px solid var(--sb-line); border-radius: 10px; padding: 8px; }
.pending-photos .pp-card img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--sb-bg); border-radius: 6px; display: block; }
.pending-photos .pp-meta { margin-top: 6px; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.pending-photos .pp-goes { margin: 4px 0 0; color: #1d4ed8; font-weight: 600; }
.pending-photos .pp-act { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
@keyframes awspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .agent-working .aw-spin { animation: none; } }
@keyframes tkpulse { 50% { box-shadow: 0 0 0 8px rgba(30, 123, 224, .06); } }
@media (prefers-reduced-motion: reduce) { .track .tk.now .dot { animation: none; } }
@media (max-width: 900px) { .track .tk { flex-basis: 70px; } .track .dot { width: 32px; height: 32px; font-size: 14px; } .track .tk::before { top: 15px; } }

/* 메뉴 안 탭 (상품: 전체·묶음·승인할 일 / AI 상품등록: 진행·온라인 판매 관리) */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--sb-line); margin: 0 0 14px; overflow-x: auto; scrollbar-width: thin; }
.tabs a { padding: 9px 16px; font-weight: 700; color: var(--sb-ink-3); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; text-decoration: none; }
.tabs a.on { color: var(--sb-blue); border-bottom-color: var(--sb-blue); }

/* 상품 작업대: 마스터(남색)·온라인(초록) 구분 */
.tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 4px; vertical-align: middle; }
.tag.m { background: var(--sb-navy); color: #fff; }
.tag.o { background: #1E8A5B; color: #fff; }
/* 상품 작업대 탭: 화면 폭을 다섯 칸으로 나눠 넓게, 지금 화면은 색을 채워 표시 */
.ptabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.ptabs a { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 10px; background: var(--sb-card); border: 1px solid var(--sb-line);
  border-top: 4px solid var(--sb-line); color: var(--sb-ink-2); text-decoration: none; min-width: 0; }
.ptabs a small { font-size: 11px; font-weight: 800; letter-spacing: .02em; color: var(--sb-ink-3); }
.ptabs a b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptabs a.m { border-top-color: var(--sb-navy); } .ptabs a.m small { color: var(--sb-navy); }
.ptabs a.o { border-top-color: #1E8A5B; } .ptabs a.o small { color: #1E8A5B; }
.ptabs a:hover { background: var(--sb-bg); }
.ptabs a.on { background: var(--sb-blue); border-color: var(--sb-blue); color: #fff; box-shadow: 0 4px 12px rgba(30, 123, 224, .25); }
.ptabs a.m.on { background: var(--sb-navy); border-color: var(--sb-navy); box-shadow: 0 4px 12px rgba(27, 42, 61, .25); }
.ptabs a.o.on { background: #1E8A5B; border-color: #1E8A5B; box-shadow: 0 4px 12px rgba(30, 138, 91, .25); }
.ptabs a.on small { color: rgba(255, 255, 255, .8); }
.ptabs a.on b { font-size: 15.5px; }
@media (max-width: 900px) { .ptabs { display: flex; overflow-x: auto; scrollbar-width: thin; } .ptabs a { flex: 0 0 150px; } }
.pname { margin: -4px 0 14px; font-size: 13.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* 제조사 자료 목록 (한 줄 요약 → 눌러서 펼침) */
.maker-row { border-top: 1px solid var(--sb-line); }
.maker-row:first-of-type { border-top: 0; }
.maker-row > summary { cursor: pointer; padding: 10px 4px; list-style: none; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.maker-row > summary::-webkit-details-marker { display: none; }
.maker-row > summary::before { content: '▸'; color: var(--sb-ink-2); }
.maker-row[open] > summary::before { content: '▾'; }
.maker-row > summary b { font-size: 15px; }
.maker-row .mr-sum { font-size: 13px; color: var(--sb-ink-2); }
.maker-row .mr-body { padding: 4px 4px 14px 20px; }
.maker-row .mr-h { margin-top: 14px; font-weight: 700; font-size: 14px; }
.maker-row .mr-line { font-size: 13.5px; margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pending-photos .pp-upload { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: #fff; border: 1px dashed var(--sb-warn); }
/* 필수 입력 칸 표시 (예전 「*」) */
.req { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--sb-danger); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; vertical-align: 1px; letter-spacing: -.2px; }
/* 상품명 3안 고르기 */
.title-pick { margin-top: 12px; padding: 14px 18px; border-radius: 12px; border: 2px solid var(--sb-blue); background: #F4F8FE; }
.title-pick .tp-head { font-size: 17px; font-weight: 800; color: var(--sb-blue-600); }
.title-pick .tp-opt { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid var(--sb-line); border-radius: 10px; padding: 10px 12px; margin-top: 8px; cursor: pointer; }
.title-pick .tp-opt:has(input:checked) { border-color: var(--sb-blue); box-shadow: 0 0 0 2px rgba(30, 123, 224, .15); }
.title-pick .tp-opt input { margin-top: 4px; }
.title-pick .tp-name { font-size: 16px; font-weight: 700; margin: 2px 0; word-break: keep-all; }

/* 자주 쓰는 한 줄 스타일 (화면 파일의 style="…"을 옮긴 것 — 같은 모양을 지키려고 !important) */
.u-inline{display:inline!important}
.u-mt16{margin-top:16px!important}
.u-right{text-align:right!important}
.u-m0{margin:0!important}
.u-mt6{margin-top:6px!important}
.u-mb16{margin-bottom:16px!important}
.u-m0-0-8{margin:0 0 8px!important}
.u-mt8{margin-top:8px!important}
.u-mt10{margin-top:10px!important}
.u-mt12{margin-top:12px!important}
.u-m8-0-0{margin:8px 0 0!important}
.u-nowrap{white-space:nowrap!important}
.u-mb12{margin-bottom:12px!important}
.u-fs13{font-size:13px!important}
.u-flex1{flex:1!important}
.u-fs12{font-size:12px!important}
.u-fs11_5{font-size:11.5px!important}
.u-pointer{cursor:pointer!important}
.u-blue{color:var(--blue)!important}
.u-mt4{margin-top:4px!important}
.u-w120{width:120px!important}
.u-m0-0-12{margin:0 0 12px!important}
.u-x1{display:flex!important;gap:8px!important;align-items:center!important;flex-wrap:wrap!important}
.u-x2{display:flex!important;gap:6px!important}
.u-m0-0-10{margin:0 0 10px!important}
.u-m10-0-0{margin:10px 0 0!important}
.u-cinherit{color:inherit!important}
.u-w110{width:110px!important}
.u-fs14{font-size:14px!important}
.u-iblock{display:inline-block!important}
.u-w90{width:90px!important}
.u-wauto{width:auto!important}
.u-fs12_5{font-size:12.5px!important}
.u-w100{width:100%!important}
.u-w140{width:140px!important}
.u-x3{flex:1!important;min-width:260px!important}
.u-x4{display:flex!important;gap:8px!important;align-items:center!important}
.u-x5{font-size:22px!important;font-weight:700!important}
.u-x6{font-weight:400!important;font-size:13px!important}
.u-w100b{width:100px!important}
.u-nodeco{text-decoration:none!important}
.u-x7{margin:6px 0 0!important;padding-left:18px!important}
.u-x8{display:inline!important;float:right!important}
.u-w200{width:200px!important}
.u-ml6{margin-left:6px!important}
.u-mb10{margin-bottom:10px!important}
.u-mt18{margin-top:18px!important}
.u-mn8-0-14{margin:-8px 0 14px!important}
.u-w150{width:150px!important}
.u-w220{width:220px!important}
.u-mono{font-family:monospace!important}
.u-x9{display:flex!important;gap:8px!important;flex-wrap:wrap!important;align-items:center!important}
.u-xscroll{overflow-x:auto!important}
