:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-strong: #eef3f7;
  --line: #d7e0ea;
  --line-strong: #b3c0cf;
  --text: #161d27;
  --heading: #0f1720;
  --muted: #617084;
  --muted-strong: #435164;
  --nav: #151b22;
  --nav-soft: #202a35;
  --blue: #2b5d84;
  --blue-dark: #184664;
  --blue-soft: #eef6fc;
  --green: #08745f;
  --green-soft: #e7f5ef;
  --green-line: #b9dccc;
  --amber: #9b6d13;
  --amber-dark: #6f4b0b;
  --amber-soft: #fff7e4;
  --amber-line: #ead6a5;
  --gold-accent: #c79a3a;
  --gold-deep: #8a6010;
  --red: #b42318;
  --red-soft: #fff0ed;
  --silver: #edf1f4;
  --gold: #fff8dd;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.045);
  --shadow-md: 0 12px 30px rgba(16, 24, 40, 0.07);
  --shadow-lift: 0 18px 44px rgba(16, 24, 40, 0.12);
  --shadow-hairline: inset 0 0 0 1px rgba(16, 24, 40, 0.04);
  --base-font: "Pretendard", "Segoe UI Variable", "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --num-font: "Segoe UI Variable", "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  --mono: var(--num-font);
  font-family:
    var(--base-font);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--base-font);
  font-size: 14.5px;
  line-height: 1.48;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(36, 93, 143, 0.18);
  outline-offset: 2px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: sticky;
  top: 0;
  z-index: 12;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  backdrop-filter: blur(8px);
}

.brand-home {
  display: block;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-home:hover h1 {
  color: var(--blue-dark);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--gold-deep);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  color: var(--heading);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 7px;
  color: var(--heading);
  font-size: 22px;
  font-weight: 850;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  color: var(--heading);
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 100%;
}

.auth-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.user-pill.signed-in {
  border-color: rgba(155, 109, 19, 0.3);
  background: var(--amber-soft);
  color: var(--amber-dark);
}

.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.app-header .status-pill {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--muted-strong);
}

.status-pill.saved {
  border-color: #b7d9cf;
  background: var(--green-soft);
  color: var(--green);
}

.app-header .status-pill.saved {
  border-color: rgba(8, 116, 95, 0.22);
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.error {
  border-color: #f3b7ae;
  background: var(--red-soft);
  color: var(--red);
}

.edit-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 11px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 800;
}

.edit-toggle input {
  width: 18px;
  height: 18px;
  accent-color: #d7a43f;
}

.edit-toggle:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.55;
}

.edit-toggle {
  display: none;
}

.tabbar {
  position: sticky;
  top: 61px;
  z-index: 9;
  display: flex;
  gap: 6px;
  padding: 8px 28px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.035);
  backdrop-filter: blur(8px);
}

.tab {
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  white-space: nowrap;
}

.tabbar .tab[data-tab="totalValue"] {
  margin-left: auto;
}

.tabbar .tab[data-tab="totalValue"][hidden] + .tab[data-tab="profitLoss"] {
  margin-left: auto;
}

@media (max-width: 960px) {
  .tabbar .tab[data-tab="totalValue"],
  .tabbar .tab[data-tab="totalValue"][hidden] + .tab[data-tab="profitLoss"] {
    margin-left: 0;
  }
}

.tab:hover {
  background: #f7fafc;
  color: var(--heading);
}

.tab.active {
  border-color: var(--amber-line);
  background: var(--amber-soft);
  color: var(--heading);
  box-shadow: inset 0 -2px 0 var(--amber);
}

.app-main {
  width: min(100%, 1660px);
  margin: 0 auto;
  padding: 22px 28px 40px;
}

.section-eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr) auto;
  gap: 18px;
  align-items: stretch;
  min-width: 0;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid #263241;
  border-radius: 8px;
  background: var(--nav);
  color: #ffffff;
  box-shadow: var(--shadow-md);
}

.dashboard-hero-copy {
  align-self: center;
  min-width: 0;
}

.dashboard-hero .section-eyebrow {
  color: #9ba8b8;
}

.dashboard-hero h2 {
  margin-bottom: 7px;
  color: #ffffff;
  font-size: 27px;
}

.dashboard-hero p {
  margin-bottom: 0;
  color: #cbd5e1;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.hero-meta span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #e3e8ef;
  font-size: 12px;
  font-weight: 850;
}

.hero-stock-card {
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 138px;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(37, 163, 117, 0.42);
  border-radius: 8px;
  background: #f7fff9;
  color: #0c2b23;
}

.hero-stock-card > span {
  color: #13725d;
  font-size: 12px;
  font-weight: 950;
}

.hero-stock-card > strong {
  color: #071b16;
  font-size: 34px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hero-stock-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.hero-stock-detail small {
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e7f6ef;
  color: #245445;
  font-size: 12px;
  font-weight: 850;
}

.hero-stock-detail .is-negative {
  background: #fff0ed;
  color: var(--red);
}

.hero-stock-detail .is-positive {
  color: var(--green);
}

.hero-stock-strip {
  display: grid;
  gap: 6px;
  padding-top: 2px;
}

.hero-stock-strip span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  color: #426153;
  font-size: 12px;
  font-weight: 850;
}

.hero-stock-strip b {
  color: #071b16;
  font-weight: 950;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.dashboard-hero-actions {
  align-self: center;
  display: grid;
  grid-template-columns: repeat(2, minmax(118px, 1fr));
  gap: 8px;
  min-width: 260px;
}

.dashboard-hero-actions .primary-button,
.dashboard-hero-actions .secondary-button {
  min-height: 40px;
}

.hero-button {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.hero-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.dashboard-topline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.priority-board {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.priority-board-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.priority-board-header::-webkit-details-marker {
  display: none;
}

.priority-board[open] .priority-board-header {
  margin-bottom: 10px;
}

.priority-board-header h3 {
  margin-bottom: 0;
}

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

.priority-group {
  min-width: 0;
  min-height: 258px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.priority-trade {
  border-top: 4px solid var(--blue);
}

.priority-flow {
  border-top: 4px solid var(--amber);
}

.priority-stock {
  border-top: 4px solid var(--green);
}

.priority-value {
  border-top: 4px solid #7b5b2a;
}

.priority-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 54px;
  margin-bottom: 10px;
}

.priority-group-head h4 {
  margin: 0 0 4px;
  color: var(--heading);
  font-size: 15px;
  font-weight: 950;
  line-height: 1.22;
}

.priority-group-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.priority-metrics {
  display: grid;
  gap: 7px;
}

.priority-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 7px 9px;
  border-bottom: 1px solid #e8edf3;
}

.priority-metric:last-child {
  border-bottom: 0;
}

.priority-metric span {
  min-width: 0;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
}

.priority-metric strong {
  color: var(--heading);
  font-size: 14px;
  font-weight: 950;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.priority-metric.is-primary {
  border-radius: 7px;
  border-bottom-color: transparent;
  background: #f4f7fa;
}

.priority-metric.is-primary strong {
  color: var(--blue-dark);
  font-size: 17px;
}

.signal-card {
  display: grid;
  min-height: 112px;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
}

.signal-card:hover {
  border-color: #b8c6d4;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.08);
}

.signal-card span {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 900;
}

.signal-card strong {
  color: var(--heading);
  font-size: 24px;
  font-weight: 950;
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
}

.signal-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.signal-issue {
  border-left: 4px solid var(--red);
}

.signal-factory {
  border-left: 4px solid var(--green);
}

.signal-sell {
  border-left: 4px solid var(--blue);
}

.signal-buy {
  border-left: 4px solid var(--green);
}

.signal-value {
  border-left: 4px solid #aa6b18;
}

.dashboard-kpis {
  margin-bottom: 14px;
}

.workflow-panel {
  margin-bottom: 14px;
}

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

.pipeline-card {
  display: grid;
  gap: 8px;
  min-height: 102px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  text-align: left;
}

.pipeline-card:hover {
  border-color: #b8c6d4;
  background: #ffffff;
}

.pipeline-card strong {
  color: var(--heading);
  font-size: 22px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.pipeline-card small {
  color: var(--muted);
  font-size: 12px;
}

.pipeline-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4eaf0;
}

.pipeline-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.38fr);
  gap: 14px;
  align-items: start;
}

.dashboard-main-stack,
.dashboard-side-stack {
  display: grid;
  gap: 14px;
}

.health-list {
  display: grid;
  gap: 8px;
}

.health-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.health-item strong,
.health-item span {
  display: block;
}

.health-item strong {
  color: var(--heading);
  font-size: 13px;
}

.health-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.health-item b {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.health-item.is-ok b {
  color: var(--green);
}

.health-item.is-warning {
  border-color: #efc3bb;
  background: #fff9f7;
}

.health-item.is-warning b {
  color: var(--red);
}

.queue-list {
  display: grid;
  gap: 8px;
}

.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
}

.queue-item:hover {
  border-color: #b8c6d4;
  background: #f7fafc;
}

.queue-item strong,
.queue-item small {
  display: block;
}

.queue-item strong {
  color: var(--heading);
  font-size: 13px;
}

.queue-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.queue-item b {
  color: var(--red);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 950;
}

.compact-table table {
  min-width: 720px;
}

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.view-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.view-header p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-card,
.panel,
.table-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.kpi-card {
  min-height: 118px;
  padding: 15px 15px 14px;
  border-left: 4px solid var(--blue);
}

.kpi-card:nth-child(2) {
  border-left-color: #87919d;
}

.kpi-card:nth-child(3) {
  border-left-color: var(--green);
}

.kpi-card:nth-child(4) {
  border-left-color: #aa6b18;
}

.kpi-card strong {
  display: block;
  margin-bottom: 9px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 850;
}

.kpi-value {
  color: var(--heading);
  font-size: 26px;
  font-weight: 900;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.kpi-note {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.workflow-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
}

.workflow-card:hover {
  border-color: #b8c6d4;
  box-shadow: 0 6px 16px rgba(16, 24, 40, 0.07);
}

.workflow-card strong {
  color: var(--heading);
  font-size: 19px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 14px;
}

.panel {
  padding: 15px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.panel-header h3 {
  margin: 0;
}

.panel-caption {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.anomaly-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 13px 14px;
  border: 1px solid #e7c37d;
  border-left: 4px solid #c58b18;
  border-radius: 10px;
  background: #fffaf0;
  box-shadow: var(--shadow-sm);
}

.anomaly-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.anomaly-panel header span,
.profit-explain-main span,
.sales-day-compare-head span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.anomaly-panel h3,
.profit-explain-main h3 {
  margin: 2px 0 0;
  color: var(--heading);
  font-size: 15px;
}

.anomaly-panel button {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #d1a95c;
  border-radius: 8px;
  background: #fff;
  color: #8b5d09;
  font-size: 12px;
  font-weight: 900;
}

.anomaly-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.anomaly-item {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(197, 139, 24, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.anomaly-item strong,
.anomaly-item small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anomaly-item strong {
  color: var(--heading);
  font-size: 12.5px;
  font-weight: 900;
}

.anomaly-item small {
  margin-top: 3px;
  color: #9a6100;
  font-size: 11.5px;
  font-weight: 800;
}

.anomaly-panel > p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
}

.table-shell {
  overflow: auto;
}

.dollar-confirmation-panel {
  margin-bottom: 14px;
}

.dollar-dropzone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 82px;
  margin: 0 0 12px;
  padding: 14px 16px;
  border: 1.5px dashed #aebfd1;
  border-radius: 10px;
  background: #f5f9fd;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.dollar-dropzone.is-dragover {
  border-color: var(--blue);
  background: #eaf5ff;
  box-shadow: inset 0 0 0 1px rgba(32, 101, 156, 0.16);
}

.dollar-dropzone strong {
  display: block;
  color: var(--heading);
  font-size: 14px;
  font-weight: 900;
}

.dollar-dropzone span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}

.dollar-due-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.dollar-due-strip > div {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.dollar-due-strip > div:first-child {
  border-color: var(--green-line);
  background: var(--green-soft);
}

.dollar-due-strip span {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 850;
}

.dollar-due-strip b {
  color: var(--heading);
  font-family: var(--num-font);
  font-size: 20px;
  font-weight: 950;
}

.dollar-due-strip small {
  color: var(--muted);
  font-size: 12px;
}

.dollar-confirmation-table {
  min-width: 860px;
}

.dollar-confirmation-table tr.is-due-today td {
  background: #edf9f3;
}

.dollar-confirmation-table tr.is-due-today td:first-child {
  border-left: 4px solid var(--green);
}

.transactions-shell {
  overflow-x: auto;
  overflow-y: auto;
  max-width: 100%;
  scrollbar-gutter: stable;
}

table {
  width: 100%;
  min-width: 1080px;
  border-collapse: separate;
  border-spacing: 0;
}

.transactions-table {
  min-width: 1080px;
  table-layout: fixed;
}

.transactions-table th,
.transactions-table td {
  padding: 9px 7px;
}

.transactions-table th {
  white-space: nowrap;
}

.transactions-table th:nth-child(1),
.transactions-table td:nth-child(1) {
  width: 78px;
  white-space: nowrap;
}

.transactions-table th:nth-child(2),
.transactions-table td:nth-child(2) {
  width: 56px;
}

.transactions-table th:nth-child(3),
.transactions-table td:nth-child(3) {
  width: 76px;
}

.transactions-table th:nth-child(4),
.transactions-table td:nth-child(4) {
  width: 76px;
}

.transactions-table th:nth-child(5),
.transactions-table td:nth-child(5) {
  width: 190px;
}

.transactions-table th:nth-child(6),
.transactions-table td:nth-child(6) {
  width: 72px;
}

.transactions-table th:nth-child(7),
.transactions-table td:nth-child(7) {
  width: 96px;
}

.transactions-table th:nth-child(8),
.transactions-table td:nth-child(8) {
  width: 92px;
}

.transactions-table th:nth-child(10),
.transactions-table td:nth-child(10) {
  width: 106px;
}

.transactions-table th:nth-child(9),
.transactions-table td:nth-child(9) {
  width: 104px;
}

.transactions-table th:nth-child(11),
.transactions-table td:nth-child(11) {
  position: sticky;
  right: 0;
  z-index: 2;
  width: 136px;
  min-width: 136px;
  background: var(--surface);
  box-shadow: -10px 0 16px rgba(16, 24, 40, 0.06);
}

.transactions-table th:nth-child(11) {
  z-index: 4;
  background: var(--surface-strong);
}

.transactions-table tbody tr:nth-child(even) td:nth-child(11) {
  background: #fbfcfd;
}

.transactions-table tbody tr:hover td:nth-child(11) {
  background: #f3f7fa;
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
  line-height: 1.35;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-strong);
  color: #243041;
  font-size: 12px;
  font-weight: 900;
}

th:first-child,
td:first-child {
  padding-left: 14px;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:nth-child(even) td {
  background: #fbfcfd;
}

tbody tr:hover td {
  background: #f3f7fa;
}

td.number,
th.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.amount-cell strong {
  display: inline-block;
  color: var(--heading);
  font-size: 13.5px;
  font-weight: 900;
  white-space: nowrap;
}

.profit-positive,
.profit-positive strong {
  color: var(--green);
}

.profit-negative,
.profit-negative strong {
  color: var(--red);
}

.profit-neutral,
.profit-neutral strong {
  color: var(--muted-strong);
}

.profit-kpi-grid .kpi-card:nth-child(3) {
  border-color: rgba(4, 120, 87, 0.22);
  background: linear-gradient(180deg, #ffffff 0%, #f0fbf6 100%);
}

.profit-grid {
  align-items: stretch;
  margin-bottom: 14px;
}

.profit-basis-panel {
  display: flex;
  flex-direction: column;
}

.profit-basis-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.profit-basis-list > div {
  display: grid;
  grid-template-columns: minmax(120px, 0.55fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px dashed var(--line-strong);
}

.profit-basis-list > div:last-child {
  border-bottom: 0;
}

.profit-basis-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.profit-basis-list strong {
  color: var(--heading);
  font-size: 14px;
  font-weight: 950;
  text-align: right;
}

.profit-basis-list small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
}

.profit-table td.number {
  white-space: nowrap;
}

.profit-table .row-muted {
  white-space: nowrap;
}

.profit-inventory-panel {
  border-color: rgba(155, 109, 19, 0.22);
  background: linear-gradient(180deg, #ffffff 0%, #fffdf6 100%);
}

.profit-inventory-panel .table-shell {
  max-height: 285px;
  overflow: auto;
}

.profit-valuation-panel {
  border-color: rgba(43, 93, 138, 0.22);
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
}

.profit-valuation-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line, #e4ddd0);
}

.profit-valuation-control label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.profit-valuation-control input {
  width: 160px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong, #d2c8b4);
  border-radius: 8px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.profit-valuation-control .panel-caption {
  flex: 1 1 240px;
  min-width: 200px;
}

.profit-lot-table th,
.profit-lot-table td {
  padding: 10px 11px;
}

.profit-lot-table th:first-child,
.profit-lot-table td:first-child {
  width: 94px;
  white-space: nowrap;
}

.profit-lot-table th:nth-child(2),
.profit-lot-table td:nth-child(2) {
  min-width: 140px;
}

.profit-lot-table .amount-cell strong {
  font-size: 13px;
}

.profit-summary-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.profit-summary-table th,
.profit-summary-table td {
  padding: 10px 9px;
}

.profit-summary-table th:first-child,
.profit-summary-table td:first-child {
  width: 34%;
}

.profit-summary-table th:nth-child(2),
.profit-summary-table td:nth-child(2) {
  width: 18%;
}

.profit-summary-table th:nth-child(3),
.profit-summary-table td:nth-child(3),
.profit-summary-table th:nth-child(4),
.profit-summary-table td:nth-child(4) {
  width: 24%;
}

.profit-summary-table .amount-cell strong {
  font-size: 12.8px;
}

.unit-suffix {
  margin-left: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.issue-balance strong {
  white-space: nowrap;
}

.source-cell strong {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 11.5px;
  font-weight: 850;
  white-space: nowrap;
}

.source-cell .row-muted {
  font-size: 11px;
  white-space: nowrap;
}

td strong {
  color: var(--heading);
  font-weight: 850;
}

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

.metal-chip,
.type-chip,
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.metal-gold {
  border-color: #ead57d;
  background: var(--gold);
  color: #705600;
}

.metal-silver {
  border-color: #d4dae0;
  background: var(--silver);
  color: #4b5969;
}

.metal-platinum {
  border-color: #c5d9ec;
  background: #e8f3ff;
  color: #275b89;
}

.metal-other {
  border-color: #d9cdea;
  background: #f1edf8;
  color: #5e4785;
}

.type-sell {
  border-color: #efc3bb;
  background: var(--red-soft);
  color: #a53a2a;
}

.type-buy {
  border-color: #b7d9cf;
  background: var(--green-soft);
  color: var(--green);
}

.type-factory {
  border-color: #c8d9ea;
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.status-sale {
  border-color: #bfd1e1;
  background: #eef4ff;
  color: var(--blue-dark);
}

.status-confirmed {
  border-color: #ead59b;
  background: var(--amber-soft);
  color: var(--amber);
}

.status-partIssued {
  border-color: #efc3bb;
  background: var(--red-soft);
  color: #a53a2a;
}

.status-issued,
.status-buy {
  border-color: #b7d9cf;
  background: var(--green-soft);
  color: var(--green);
}

.status-buyCompleted {
  border-color: #9ccfbf;
  background: #dcf4ea;
  color: #045c4c;
}

.status-factoryOutflow {
  border-color: #c8d9ea;
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.status-deleted {
  border-color: #d4dae0;
  background: #f1f3f5;
  color: #667085;
}

.transaction-deleted td {
  background: #f8fafc;
  color: #8a94a6;
}

.transaction-deleted td strong {
  color: #667085;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.toolbar input,
.toolbar select,
.krx-form-grid input,
.krx-form-grid select,
.form-grid input,
.form-grid select {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

.toolbar input {
  min-width: 260px;
  flex: 1 1 280px;
}

.toolbar select {
  flex: 0 0 auto;
}

.purchase-sim-panel {
  margin-bottom: 12px;
  border-color: rgba(155, 109, 19, 0.24);
  background: linear-gradient(180deg, #fff, #fffaf0);
}

.purchase-sim-dialog {
  width: min(1180px, calc(100vw - 28px));
}

#purchaseSimDialog.small-modal {
  width: min(1180px, calc(100vw - 28px));
  max-width: none;
}

.purchase-sim-dialog .purchase-sim-panel {
  margin-bottom: 0;
  border: 0;
  box-shadow: none;
}

.purchase-sim-summary {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(460px, 1.2fr);
  gap: 10px;
  align-items: stretch;
  margin-bottom: 10px;
}

.purchase-sim-current,
.purchase-sim-result {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.purchase-sim-current span,
.purchase-sim-result span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.purchase-sim-rows {
  display: grid;
  gap: 8px;
}

.purchase-sim-row {
  display: grid;
  grid-template-columns: 32px minmax(170px, 0.78fr) minmax(230px, 1fr) minmax(230px, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.purchase-sim-row-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-bottom: 4px;
  border-radius: 999px;
  background: #fff8dd;
  color: var(--gold-deep, #8a6010);
  font-size: 12px;
  font-weight: 900;
}

.purchase-sim-row label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.purchase-sim-row input {
  min-width: 0;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--heading);
  font-size: 15px;
  font-weight: 800;
}

.purchase-sim-current strong,
.purchase-sim-result strong {
  color: var(--heading);
  font-size: 18px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.purchase-sim-current small,
.purchase-sim-result small {
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.35;
}

.purchase-sim-result {
  border-color: rgba(4, 120, 87, 0.24);
  background: var(--green-soft);
}

.primary-button,
.secondary-button,
.mini-button,
.danger-button,
.icon-button {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-weight: 850;
}

.primary-button,
.secondary-button,
.danger-button {
  padding: 7px 12px;
}

.primary-button {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(36, 93, 143, 0.18);
}

.primary-button:hover {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
}

.secondary-button {
  background: var(--surface);
  color: var(--text);
}

.app-header .secondary-button {
  min-height: 32px;
  padding: 5px 10px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.app-header .secondary-button:hover {
  background: var(--surface-soft);
}

.secondary-button:hover,
.mini-button:hover,
.icon-button:hover {
  background: var(--surface-soft);
}

.link-button {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  text-decoration: none;
}

.danger-button {
  border-color: #efc3bb;
  background: var(--red-soft);
  color: var(--red);
}

.modal-delete-button {
  margin-right: auto;
}

.mini-button {
  min-height: 29px;
  padding: 4px 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
}

.mini-button[data-action="set-status"] {
  border-color: #b7d9cf;
  background: #f0faf6;
  color: var(--green);
}

.mini-button[data-action="issue-transaction"] {
  border-color: #ead59b;
  background: #fff9e8;
  color: var(--amber);
}

.mini-button[data-action="edit-transaction"] {
  border-color: #cbd5df;
  background: #f8fafc;
  color: var(--muted-strong);
}

.mini-button[data-action="delete-transaction"],
.mini-button[data-action="delete-factory-outflow"] {
  border-color: #efc3bb;
  background: #fff4f2;
  color: var(--red);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  min-width: 0;
}

.row-actions.compact {
  justify-content: flex-end;
  gap: 4px;
}

.progress-track {
  width: 100%;
  min-width: 92px;
  height: 7px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4eaf0;
}

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

.issue-history {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.issue-history summary {
  cursor: pointer;
  color: var(--muted-strong);
  font-weight: 850;
}

.issue-history ul {
  margin: 5px 0 0;
  padding-left: 16px;
}

.issue-log-list {
  display: grid;
  gap: 8px;
}

.issue-log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.issue-log-item strong,
.issue-log-item span,
.issue-log-meta b,
.issue-log-meta small {
  display: block;
}

.issue-log-item strong {
  color: var(--heading);
  font-size: 13px;
}

.issue-log-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.issue-log-meta {
  text-align: right;
}

.issue-log-meta b {
  color: var(--heading);
  font-size: 13px;
  font-weight: 950;
}

.issue-log-meta small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.mini-button:disabled,
.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.icon-button {
  width: 34px;
  padding: 0;
  background: var(--surface);
  color: var(--muted-strong);
  font-size: 18px;
  line-height: 1;
}

.audit-list {
  display: grid;
  gap: 8px;
}

.audit-item {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-left: 4px solid #aa6b18;
  border-radius: 8px;
  background: #fbfcfd;
}

.audit-item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--heading);
}

.audit-item span {
  color: var(--muted);
  font-size: 12px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.settings-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.settings-section h3 {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.settings-section label {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.settings-section input {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
}

.setting-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 10px;
  flex-wrap: wrap;
}

.setting-actions span {
  color: var(--muted);
  font-size: 12px;
}

.krx-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 14px;
}

.krx-upload {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.krx-upload input[type="file"] {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
}

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

.krx-preview-table table {
  min-width: 560px;
}

.krx-copy-box {
  width: 100%;
  min-height: 156px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  resize: vertical;
  color: var(--text);
  background: #fbfcfd;
  font:
    13px "Malgun Gothic",
    "Segoe UI",
    system-ui,
    sans-serif;
  line-height: 1.5;
}

.krx-approval-preview {
  max-height: 360px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.krx-approval-preview p {
  margin: 0 0 10px;
}

.krx-approval-preview table {
  min-width: 760px;
  margin-bottom: 14px;
}

.modal {
  width: min(860px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.transaction-modal {
  width: min(840px, calc(100vw - 24px));
}

.issue-modal {
  width: min(840px, calc(100vw - 24px));
}

.factory-modal {
  width: min(840px, calc(100vw - 24px));
}

.sales-chat-modal {
  width: min(900px, calc(100vw - 24px));
}

.pure-sales-modal {
  width: min(980px, calc(100vw - 24px));
}

.pure-sales-summary {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--amber-line);
  border-left: 3px solid var(--gold-accent);
  border-radius: 8px;
  background: var(--gold);
}

.pure-sales-summary span,
.pure-sales-summary small {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 850;
}

.pure-sales-summary b {
  color: var(--heading);
  font-family: var(--num-font);
  font-size: 24px;
  font-weight: 950;
}

.pure-sales-table-wrap {
  overflow: auto;
  max-height: min(58vh, 560px);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pure-sales-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.pure-sales-table th,
.pure-sales-table td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.pure-sales-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef4f8;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 900;
}

.pure-sales-table td {
  color: var(--heading);
  font-size: 12px;
  font-weight: 750;
}

.pure-sales-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.pure-sales-table .number {
  text-align: right;
  font-family: var(--num-font);
  white-space: nowrap;
}

.pure-sales-table .empty-cell {
  padding: 28px 12px;
  color: var(--muted);
  text-align: center;
}

.sales-chat-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.sales-chat-steps button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-weight: 900;
}

.sales-chat-steps button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  border-radius: 999px;
  background: #dfe7ee;
  color: var(--muted-strong);
  font-family: var(--mono);
  font-size: 12px;
}

.sales-chat-steps button.active {
  border-color: #9b6d13;
  background: #fff7df;
  color: var(--heading);
}

.sales-chat-steps button.active span {
  background: #9b6d13;
  color: #ffffff;
}

.sales-chat-modal[data-step="paste"] .sales-chat-review-step,
.sales-chat-modal[data-step="paste"] .sales-chat-review-action,
.sales-chat-modal[data-step="review"] .sales-chat-paste-step,
.sales-chat-modal[data-step="review"] .sales-chat-paste-action {
  display: none;
}

.small-modal {
  width: min(520px, calc(100vw - 28px));
}

.modal::backdrop {
  background: rgba(16, 24, 40, 0.46);
}

.modal form {
  padding: 18px;
}

.modal-header,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header {
  margin-bottom: 15px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-size: 19px;
}

.modal-kicker {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.transaction-entry {
  display: grid;
  gap: 12px;
}

.issue-entry {
  display: grid;
  gap: 12px;
}

.factory-modal textarea,
.sales-chat-modal textarea {
  width: 100%;
  min-height: 150px;
  padding: 10px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  resize: vertical;
  color: var(--text);
  background: #ffffff;
  line-height: 1.5;
}

.factory-modal.is-manual .factory-kakao-section {
  display: none;
}

.factory-modal.is-kakao .factory-manual-section {
  display: none;
}

.factory-parse-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.factory-preview {
  margin-top: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.factory-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.sales-review-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.sales-review-summary div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.sales-review-summary div.warn {
  border-color: #e5be71;
  background: #fff8e8;
}

.sales-review-summary strong,
.sales-review-summary span {
  display: block;
}

.sales-review-summary strong {
  color: var(--heading);
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 950;
}

.sales-review-summary span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 850;
}

.sales-day-compare {
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.sales-day-compare-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.sales-day-compare-head strong {
  color: var(--heading);
  font-size: 13px;
  font-weight: 950;
}

.sales-day-compare-table {
  overflow: auto;
}

.sales-day-compare table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 12px;
}

.sales-day-compare th,
.sales-day-compare td {
  padding: 7px 8px;
  border-top: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.sales-day-compare th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.sales-day-compare td.number {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.sales-day-compare tr.needs-check td {
  background: #fff8e8;
  color: #8b5d09;
  font-weight: 850;
}

.sales-ai-box {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
  padding: 10px 11px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fbfcfd;
}

.sales-ai-box strong {
  color: var(--heading);
  font-size: 13px;
}

.sales-ai-box span,
.sales-ai-box li {
  color: var(--muted-strong);
  font-size: 12.5px;
  line-height: 1.45;
}

.sales-ai-box ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.ledger-anomaly-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 6px;
  border: 1px solid #e4b56b;
  border-radius: 999px;
  background: #fff8e8;
  color: #925d00;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 950;
  vertical-align: middle;
}

.profit-explain-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 14px;
  align-items: stretch;
  border-left: 4px solid #c58b18;
  background: linear-gradient(180deg, #ffffff 0%, #fffaf0 100%);
}

.profit-explain-main {
  display: grid;
  align-content: center;
  gap: 5px;
}

.profit-explain-main p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 12.5px;
  line-height: 1.55;
}

.profit-explain-lots {
  display: grid;
  gap: 7px;
}

.profit-explain-lots div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid rgba(197, 139, 24, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.profit-explain-lots strong,
.profit-explain-lots b {
  color: var(--heading);
  font-size: 12px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.profit-explain-lots span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-ai-box.is-result {
  border-style: solid;
  border-color: #bcd0e3;
  background: #f4f8fc;
}

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

.kakao-review-card {
  min-width: 0;
}

.kakao-review-card.is-ready {
  border-top: 2px solid #c58b18;
}

.mini-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: #8a6010;
  font-size: 10.5px;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.kakao-review-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.kakao-review-stats div,
.kakao-review-note {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.kakao-review-stats span,
.kakao-review-stats small,
.kakao-review-note span {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
}

.kakao-review-stats strong {
  display: block;
  margin: 4px 0 2px;
  color: var(--heading);
  font-family: var(--num-font);
  font-size: 20px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.kakao-review-note {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.kakao-review-note strong {
  color: var(--heading);
  font-size: 12.5px;
  font-weight: 950;
}

.kakao-review-note.muted {
  border-style: dashed;
  background: #fbfcfd;
}

.kakao-review-placeholder {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.kakao-review-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.kakao-review-placeholder label {
  display: grid;
  gap: 7px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 900;
}

.kakao-review-placeholder textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  padding: 10px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--heading);
  font: inherit;
  line-height: 1.45;
}

.factory-preview-head strong,
.factory-preview-head span {
  font-size: 13px;
  font-weight: 950;
}

.factory-preview-list {
  display: grid;
  gap: 7px;
}

.factory-preview-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.factory-preview-item.is-warning {
  border-color: #f2b84b;
  background: #fff8e8;
}

.factory-preview-item input {
  margin-top: 3px;
}

.factory-preview-item strong,
.factory-preview-item small {
  display: block;
}

.factory-preview-item strong {
  color: var(--heading);
  font-size: 13px;
}

.factory-preview-item small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.review-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #8a4b00;
  color: #ffffff;
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
  vertical-align: 1px;
}

.factory-preview-item .parse-evidence {
  color: #516070;
}

.factory-preview-item .warning-line {
  color: #8a4b00;
  font-weight: 850;
}

/* Claude IA dashboard adaptation */
.app-main {
  width: min(100%, 1240px);
  padding: 18px 24px 52px;
}

.ops-dashboard {
  display: grid;
  gap: 16px;
}

.ops-dashboard-shell {
  display: block;
  min-width: 0;
}

.ops-dashboard-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.ops-actionbar {
  position: sticky;
  top: 113px;
  z-index: 8;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: -6px -8px 0;
  padding: 8px;
  border: 1px solid rgba(215, 224, 234, 0.9);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.95);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
  backdrop-filter: blur(8px);
}

.ops-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid #cfd9e4;
  border-radius: 8px;
  background: #f7fafc;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.05s;
}

.ops-btn:hover {
  border-color: var(--line-strong);
  background: #edf3f7;
}

.ops-btn:active {
  transform: translateY(1px);
}

.ops-btn.primary {
  border-color: var(--amber);
  background: var(--amber);
  color: #ffffff;
}

.ops-btn.primary:hover {
  background: #845a0f;
}

.ops-btn span {
  min-width: 20px;
  padding: 1px 5px;
  border: 1px solid #c2ceda;
  border-radius: 4px;
  background: #ffffff;
  color: var(--muted-strong);
  font-family: var(--mono);
  font-size: 11px;
  text-align: center;
}

.ops-btn.primary span {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
}

.ops-btn.ledger {
  margin-left: auto;
  position: relative;
}

.ops-btn.ledger::before {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: -16px;
  width: 1px;
  background: rgba(178, 190, 204, 0.9);
}

.approval-panel {
  display: grid;
  gap: 10px;
  margin: 0 -8px 2px;
  padding: 14px;
  border: 1px solid var(--amber-line);
  border-left: 4px solid var(--gold-accent);
  border-radius: 12px;
  background: linear-gradient(180deg, #fffdf7, var(--amber-soft));
  box-shadow: var(--shadow-sm), var(--shadow-hairline);
}

.approval-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.approval-panel header div {
  display: grid;
  gap: 2px;
}

.approval-panel header span {
  color: var(--gold-deep);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.approval-panel header strong {
  color: var(--heading);
  font-size: 15px;
  font-weight: 900;
}

.approval-panel header b {
  min-width: 40px;
  padding: 5px 10px;
  border: 1px solid var(--amber-line);
  border-radius: 999px;
  background: #fff;
  color: var(--gold-deep);
  font-family: var(--mono);
  font-size: 13px;
  text-align: center;
}

.approval-list {
  display: grid;
  gap: 8px;
}

.approval-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(199, 154, 58, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
}

.approval-card-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 5px 9px;
  min-width: 0;
}

.approval-card-main strong {
  overflow: hidden;
  color: var(--heading);
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval-card-main small {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--amber);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.approval-card-actions {
  display: flex;
  gap: 6px;
}

.approval-card-actions button,
.approval-pending {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--green-line);
  border-radius: 7px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12.5px;
  font-weight: 900;
}

.approval-card-actions button.reject {
  border-color: #f2b8b5;
  background: var(--red-soft);
  color: var(--red);
}

.ops-hero + .approval-panel {
  margin: 12px 0 18px;
  border-radius: 10px;
}

/* 승인 탭 전용 보드 */
.approval-board {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 14px;
  align-items: start;
  margin-top: 12px;
}

.approval-col {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 12px;
  border: 1px solid var(--line, #e4ddd0);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
}

.approval-col-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 12.5px;
  font-weight: 900;
  color: var(--heading);
}

.approval-col-title b {
  font-variant-numeric: tabular-nums;
  color: var(--amber);
}

.approval-count-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line, #e4ddd0);
  background: #fff;
  font-size: 12.5px;
  font-weight: 900;
  color: var(--muted);
}

.approval-count-pill.has {
  border-color: var(--amber);
  background: var(--amber);
  color: #fff;
}

.approval-status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 900;
  white-space: nowrap;
}

.approval-status-chip.approved {
  border: 1px solid var(--green-line);
  background: var(--green-soft);
  color: var(--green);
}

.approval-status-chip.rejected {
  border: 1px solid #f2b8b5;
  background: var(--red-soft);
  color: var(--red);
}

.approval-status-chip.pending {
  border: 1px solid var(--line, #e4ddd0);
  background: #fff;
  color: var(--muted);
}

.approval-reject-reason {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  margin-left: 2px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red, #b3392f);
  color: #fff;
  font-size: 10.5px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .approval-board {
    grid-template-columns: 1fr;
  }
}

.ops-hero {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #cfdae6;
  border-top: 2px solid var(--gold-accent);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-soft) 100%);
  box-shadow: var(--shadow-lift), var(--shadow-hairline);
}

.ops-hero-main {
  display: grid;
  align-content: start;
  gap: 13px;
  min-width: 0;
  padding: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #fffaf0 100%);
}

.ops-stock-primary {
  min-width: 0;
  padding: 24px;
  border-right: 1px solid #d7e0ea;
  background: linear-gradient(180deg, #ffffff 0%, #fcfdfd 100%);
}

.ops-hero-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  margin: 0;
  color: var(--muted-strong);
  font-size: 11.5px;
  font-weight: 850;
}

.ops-hero-heading span {
  color: var(--gold-accent);
  font-size: 15px;
  line-height: 1;
}

.ops-stock-primary .ops-hero-heading span {
  color: var(--green);
}

.ops-hero-side .ops-hero-heading span {
  color: var(--gold-accent);
}

.ops-hero-main .ops-hero-heading span {
  color: var(--blue);
}

.ops-hero-figure {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 9px 0 0;
}

.ops-hero-figure strong {
  color: var(--heading);
  font-family: var(--mono);
  font-size: 54px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
}

.ops-hero-figure em {
  color: var(--muted);
  font-style: normal;
  font-size: 21px;
  font-weight: 850;
}

.ops-hero-sub {
  display: flex;
  gap: 18px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.ops-hero-sub span {
  color: var(--muted);
  font-size: 12.5px;
}

.ops-hero-sub b,
.ops-hero-side b {
  color: var(--heading);
  font-family: var(--mono);
  font-weight: 850;
}

.ops-hero-sub .down,
.ops-hero-side .down {
  color: var(--red);
}

.ops-hero-sub .up,
.ops-hero-side .up {
  color: var(--green);
}

.ops-stock-delta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 28px;
  margin-top: 13px;
  padding: 5px 11px;
  border: 1px solid var(--green-line);
  border-radius: 999px;
  background: #e8f7f0;
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
}

.ops-stock-delta.down {
  border-color: #efc3bb;
  background: var(--red-soft);
  color: var(--red);
}

.ops-stock-formula {
  display: flex;
  align-items: stretch;
  gap: 6px;
  margin-top: 15px;
  flex-wrap: nowrap;
}

.ops-stock-formula span,
.ops-stock-formula .ops-formula-node {
  flex: 1 1 0;
  min-width: 0;
  padding: 7px 6px;
  border: 1px solid #cfdae6;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-hairline);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ops-stock-formula .ops-formula-node {
  appearance: none;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.ops-stock-formula span.current {
  border-color: var(--gold-accent);
  background: var(--gold);
}

.ops-stock-formula .ops-formula-node.is-clickable:hover,
.ops-xls-metric.is-clickable:hover {
  border-color: var(--gold-accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.ops-stock-formula small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  white-space: normal;
  word-break: keep-all;
  line-height: 1.2;
}

.ops-stock-formula b {
  display: block;
  margin-top: 3px;
  color: var(--heading);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 950;
}

.ops-stock-formula span.current b {
  color: var(--gold-deep);
}

.ops-stock-formula i {
  flex: 0 0 auto;
  width: 9px;
  color: var(--muted-strong);
  font-style: normal;
  font-weight: 950;
  font-size: 14px;
  text-align: center;
}

.ops-hero-side {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
  min-width: 0;
  padding: 24px;
  border-right: 1px solid #d7e0ea;
  background: linear-gradient(180deg, #ffffff 0%, #fcfdfd 100%);
}

.ops-hero-side > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.ops-hero-side span {
  color: var(--muted);
  font-size: 12.5px;
}

.ops-hero-side b {
  font-size: 14.5px;
  white-space: nowrap;
}

.ops-hero-rollup {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
}

.ops-sticky-sidebar {
  position: sticky;
  top: 184px;
  display: grid;
  align-content: start;
  gap: 6px;
  max-height: calc(100vh - 202px);
  min-width: 0;
  overflow: auto;
  padding-right: 2px;
}

.ops-side-card {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid #d2dce7;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(16, 24, 40, 0.03);
  color: inherit;
  font: inherit;
  text-align: left;
}

button.ops-side-card {
  cursor: pointer;
}

button.ops-side-card:hover {
  border-color: #aebdca;
  box-shadow: 0 5px 14px rgba(16, 24, 40, 0.055);
}

.ops-side-card.dollar {
  border-color: #c7d8e8;
  background: #f3f8fc;
}

.ops-side-card.maturity {
  border-color: #b9cfe2;
  background: #f3f8fc;
}

.ops-side-card.purchase,
.ops-side-card.buy {
  border-color: var(--green-line);
  background: #f2fbf7;
}

.ops-side-card.due-today {
  border-color: #87cbb6;
  background: #e5f6ef;
}

.ops-side-card.maturity.due-today {
  border-color: #8bb9d8;
  background: #eef7ff;
}

.ops-side-card.compact {
  gap: 8px;
}

.ops-side-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.ops-side-card-head span {
  min-width: 0;
  color: #46586b;
  font-size: 10.2px;
  font-weight: 900;
}

.ops-side-card-head b {
  color: var(--heading);
  font-family: var(--num-font);
  font-size: 11.8px;
  font-weight: 950;
  white-space: nowrap;
}

.ops-side-list {
  display: grid;
  gap: 0;
  min-width: 0;
}

.ops-side-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 21px;
  border-top: 1px dashed rgba(180, 194, 209, 0.78);
}

.ops-side-line:first-child {
  border-top: 0;
}

.ops-side-line span {
  min-width: 0;
  overflow: hidden;
  color: #516174;
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-side-line span em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.ops-side-line b {
  color: var(--heading);
  font-family: var(--num-font);
  font-size: 10.6px;
  font-weight: 950;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ops-side-line.is-done span,
.ops-side-line.is-done b {
  color: var(--muted);
}

.ops-side-empty,
.ops-side-more {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.ops-rollup-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid #d2dce7;
  border-radius: 8px;
  background: #ffffff;
}

button.ops-rollup-card {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
}

button.ops-rollup-card:hover {
  border-color: #aebdca;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.06);
}

.ops-rollup-card.confirmed {
  border-color: var(--amber-line);
  background: var(--amber-soft);
}

.ops-rollup-card.buy {
  border-color: var(--green-line);
  background: #f2fbf7;
}

.ops-rollup-card.dollar {
  border-color: #c7d8e8;
  background: #f3f8fc;
}

.ops-rollup-card.dollar.due-today {
  border-color: #87cbb6;
  background: #e5f6ef;
}

.ops-rollup-card h4 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0 8px;
  border-right: 1px solid rgba(178, 190, 204, 0.66);
  background: rgba(255, 255, 255, 0.34);
  color: var(--amber-dark);
  font-size: 11.5px;
  font-weight: 900;
  line-height: 1.25;
  white-space: nowrap;
}

.ops-rollup-card h4 i {
  width: 9px;
  height: 2px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--amber);
}

.ops-rollup-card h4 span {
  min-width: 0;
}

.ops-rollup-card.buy h4 {
  color: var(--green);
}

.ops-rollup-card.buy h4 i {
  background: var(--green);
}

.ops-rollup-card.dollar h4 {
  color: var(--blue-dark);
}

.ops-rollup-card.dollar h4 i {
  background: var(--blue);
}

.ops-rollup-card.dollar.due-today h4 {
  color: var(--green);
}

.ops-rollup-card.dollar.due-today h4 i {
  background: var(--green);
}

.ops-rollup-list {
  display: grid;
  gap: 0;
  min-width: 0;
  padding: 7px 12px;
}

.ops-rollup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 25px;
  border-top: 1px dashed rgba(180, 194, 209, 0.78);
}

.ops-rollup-row:first-child {
  border-top: 0;
}

.ops-rollup-row span {
  min-width: 0;
  color: var(--muted-strong);
  font-size: 11.5px;
  font-weight: 850;
  white-space: nowrap;
}

.ops-rollup-row b {
  color: var(--heading);
  font-family: var(--num-font);
  font-size: 13.5px;
  font-weight: 950;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ops-rollup-due {
  display: flex;
  align-items: center;
  gap: 6px;
  grid-column: 1 / -1;
  min-width: 0;
  flex-wrap: wrap;
  padding: 6px 8px;
  border: 1px solid rgba(199, 154, 58, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.ops-rollup-due > span {
  flex: 0 0 auto;
  color: var(--muted-strong);
  font-size: 10.5px;
  font-weight: 900;
  white-space: nowrap;
}

.ops-rollup-due button {
  min-width: 0;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid #d7e0ea;
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.ops-rollup-due button:hover {
  border-color: var(--gold-accent);
  color: var(--gold-deep);
  box-shadow: var(--shadow-hairline);
}

.ops-rollup-due button b {
  color: var(--heading);
  font-family: var(--num-font);
  font-size: 11.5px;
  font-weight: 950;
}

.ops-unit-cost {
  display: grid;
  gap: 0;
  margin-top: 2px;
}

.ops-cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px dashed #cfd9e4;
}

.ops-cost-row:last-child {
  border-bottom: 0;
}

.ops-cost-row.is-emphasis {
  margin-top: 8px;
  padding: 14px 14px;
  border: 1px solid var(--green-line);
  border-radius: 8px;
  background: linear-gradient(180deg, #e9f8f1 0%, #dff2eb 100%);
  box-shadow: var(--shadow-hairline);
}

.ops-cost-row.is-emphasis b {
  color: #064e3b;
  font-weight: 950;
}

.ops-cost-row b {
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
  line-height: 1.2;
}

.ops-cost-main,
.ops-cost-row small {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.ops-cost-main em {
  font-family: var(--base-font);
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
}

.ops-cost-row small {
  margin-left: 0;
  color: var(--muted-strong);
  font-size: 11px;
  font-family: var(--base-font);
  font-weight: 800;
}

.ops-cost-row > span small {
  display: block;
  justify-content: flex-start;
  margin-top: 3px;
  color: var(--muted-strong);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.25;
  white-space: normal;
}

.ops-cost-row small em {
  margin-left: 0;
  font-style: normal;
  font-weight: 950;
}

.ops-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #d2dce7;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.ops-strip-cell {
  min-width: 0;
  padding: 14px 18px;
  border: 0;
  border-right: 1px solid #d7e0ea;
  background: transparent;
  text-align: left;
}

.ops-strip-cell:last-child {
  border-right: 0;
}

.ops-strip-cell:hover {
  background: #f7fafc;
}

.ops-strip-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 850;
}

.ops-tag {
  width: 7px;
  height: 7px;
  border-radius: 2px;
}

.ops-tag.confirm {
  background: var(--blue);
}

.ops-tag.issue {
  background: #9b6d13;
}

.ops-tag.buy {
  background: var(--green);
}

.ops-tag.factory {
  background: var(--amber);
}

.ops-strip-cell strong {
  display: block;
  margin-top: 5px;
  color: var(--heading);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 950;
  letter-spacing: 0;
}

.ops-strip-cell strong small {
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 750;
}

.ops-strip-cell > span:last-child {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
}

.ops-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  margin: 12px 0 6px;
  color: #46576a;
  font-size: 13.5px;
  font-weight: 850;
  white-space: nowrap;
}

.ops-section-label i {
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: var(--amber);
}

.ops-current-status {
  display: grid;
  gap: 12px;
}

.ops-current-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  color: #46576a;
  font-size: 13.5px;
  font-weight: 850;
  white-space: nowrap;
}

.ops-current-heading i {
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: var(--amber);
}

.ops-current-heading::after,
.ops-section-label::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, rgba(155, 109, 19, 0.42), rgba(205, 216, 228, 0.78) 30%, rgba(205, 216, 228, 0));
}

.ops-current-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.92fr);
  overflow: hidden;
  border: 1px solid #d2dbe5;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.06);
}

.ops-current-group {
  min-width: 0;
  padding: 14px 18px 13px;
}

.ops-current-group.buy {
  border-right: 1px solid #d2dbe5;
  background: #ffffff;
}

.ops-current-group.confirmed {
  background: #fff8e7;
}

.ops-current-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 11px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.ops-current-group-title i {
  width: 10px;
  height: 2px;
  border-radius: 999px;
  background: var(--green);
}

.ops-current-group.confirmed .ops-current-group-title {
  color: #7a5511;
}

.ops-current-group.confirmed .ops-current-group-title i {
  background: #9b6d13;
}

.ops-current-grid {
  display: grid;
  gap: 0 24px;
}

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

.ops-current-grid.confirmed {
  grid-template-columns: 1fr;
}

.ops-current-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 6px 0;
  border-bottom: 1px dashed #d4dde7;
}

.ops-current-metric span {
  color: var(--heading);
  font-size: 11.5px;
  font-weight: 850;
  white-space: nowrap;
}

.ops-current-metric b {
  color: var(--heading);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.ops-current-metric.is-highlight {
  background: transparent;
}

.ops-current-metric.is-highlight span {
  color: #7a5511;
}

.ops-current-metric.is-highlight b {
  color: #6f4b0b;
  font-size: 15.5px;
}

.ops-current-grid.buy .ops-current-metric:nth-last-child(-n + 2),
.ops-current-grid.confirmed .ops-current-metric:last-child {
  border-bottom: 0;
}

.ops-supply-balance {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 10px;
}

.ops-match-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 190px;
  overflow: hidden;
  min-height: 78px;
  border: 1px solid #cfdae6;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--shadow-sm), var(--shadow-hairline);
}

.ops-match-card,
.ops-match-diff,
.ops-match-maturity {
  min-width: 0;
  padding: 14px 18px;
}

.ops-match-card {
  display: grid;
  align-content: center;
  gap: 4px;
  background: #ffffff;
}

.ops-match-card.sell {
  border-left: 3px solid var(--blue);
  background: linear-gradient(180deg, #f8fbff 0%, #eef6fc 100%);
}

.ops-match-card.buy {
  border-left: 1px solid #c9ded5;
  background: linear-gradient(180deg, #fbfefd 0%, #edf9f3 100%);
}

.ops-match-card span,
.ops-match-diff span {
  color: var(--muted-strong);
  font-size: 11.5px;
  font-weight: 900;
}

.ops-match-card b {
  color: var(--heading);
  font-family: var(--num-font);
  font-size: 22px;
  font-weight: 950;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.ops-match-card.sell b {
  color: var(--blue-dark);
}

.ops-match-card.buy b {
  color: var(--green);
}

.ops-match-card small {
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-match-diff {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 4px;
  border-left: 1px solid var(--amber-line);
  border-right: 0;
  background: linear-gradient(180deg, #fffaf0 0%, var(--amber-soft) 100%);
  text-align: left;
}

.ops-match-diff-main {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 4px;
}

.ops-match-diff-main b {
  color: var(--green);
  font-family: var(--num-font);
  font-size: 21px;
  font-weight: 950;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.ops-match-diff.down .ops-match-diff-main b {
  color: var(--amber-dark);
}

.ops-match-diff-main small {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 850;
}

.ops-match-maturity {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 4px;
  min-height: 78px;
  border: 1px solid #ead6a5;
  border-left: 3px solid var(--gold-accent);
  border-radius: 10px;
  background: linear-gradient(180deg, #fffbf0 0%, #fff5db 100%);
  box-shadow: var(--shadow-sm), var(--shadow-hairline);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ops-match-maturity:hover {
  background: #fff1ce;
}

.ops-match-maturity span {
  color: var(--gold-deep);
  font-size: 11.5px;
  font-weight: 900;
}

.ops-match-maturity b {
  color: var(--amber-dark);
  font-family: var(--num-font);
  font-size: 14px;
  font-weight: 950;
  white-space: nowrap;
}

.ops-match-maturity small {
  overflow: hidden;
  color: var(--muted);
  max-width: 100%;
  font-size: 10.5px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-supply-balance > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.ops-supply-balance h3 {
  margin: 0;
  color: var(--heading);
  font-size: 15px;
  font-weight: 900;
}

.ops-supply-balance > header strong {
  color: var(--muted-strong);
  font-size: 13.5px;
}

.ops-supply-balance > header b,
.ops-supply-balance .up {
  color: var(--green);
}

.ops-supply-balance .down {
  color: var(--red);
}

.ops-balance-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr);
}

.ops-balance-card {
  min-width: 0;
  padding: 16px 20px 13px;
}

.ops-balance-card.sell {
  background: #eef6ff;
}

.ops-balance-card.buy {
  background: #eaf8f1;
}

.ops-balance-card p {
  margin: 0;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 900;
}

.ops-balance-card.buy p {
  color: var(--green);
}

.ops-balance-card > strong {
  display: block;
  margin-top: 12px;
  color: var(--heading);
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 950;
}

.ops-balance-card > strong small {
  color: var(--muted);
  font-size: 13px;
}

.ops-balance-lines {
  display: grid;
  gap: 0;
  margin-top: 10px;
}

.ops-balance-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 31px;
  border-top: 1px solid rgba(196, 207, 220, 0.78);
  color: var(--muted-strong);
  font-size: 12px;
}

.ops-balance-line b {
  color: var(--heading);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 950;
}

.ops-balance-diff {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: #ffffff;
  text-align: center;
}

.ops-balance-diff span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.ops-balance-diff b {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 6px 0;
  place-items: center;
  border: 1px solid #9fd6bf;
  border-radius: 50%;
  background: #ddf5ea;
  color: var(--green);
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 950;
}

.ops-balance-diff small {
  color: var(--green);
  font-size: 11px;
  font-weight: 950;
}

.ops-xls-details {
  display: none;
}

.ops-excel-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 12px;
}

.ops-xls-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.ops-xls-panel header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: #f5f7fa;
}

.ops-xls-panel header span {
  color: var(--muted-strong);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 950;
}

.ops-xls-panel header strong {
  color: var(--heading);
  font-size: 13px;
  font-weight: 950;
}

.ops-xls-panel header > b {
  margin-left: auto;
  color: var(--heading);
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 950;
}

.ops-xls-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
}

.ops-xls-panel:first-child .ops-xls-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ops-xls-metric {
  display: flex;
  min-height: 56px;
  padding: 12px 14px;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid #c6d0dc;
  border-bottom: 1px solid #c6d0dc;
  background: #ffffff;
}

.ops-xls-metric.is-clickable {
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.ops-xls-metric:nth-child(4n) {
  border-right: 0;
}

.ops-xls-panel:first-child .ops-xls-metric:nth-child(4n) {
  border-right: 1px solid #c6d0dc;
}

.ops-xls-panel:first-child .ops-xls-metric:nth-child(3n) {
  border-right: 0;
}

.ops-xls-metric span,
.ops-xls-metric b {
  display: block;
}

.ops-xls-metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.ops-xls-metric b {
  margin-top: 4px;
  color: var(--heading);
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ops-xls-metric.is-highlight {
  border-left: 3px solid var(--gold-accent);
  background: #fff8e7;
}

.ops-xls-metric.is-highlight span {
  color: var(--gold-deep);
}

.ops-xls-metric.is-highlight b {
  color: var(--gold-deep);
  font-size: 18px;
}

.ops-metal-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--amber-line);
  border-radius: 10px;
  background: #fffdf8;
  box-shadow: var(--shadow-sm), var(--shadow-hairline);
}

.ops-metal-section.silver {
  border-color: #cbd7e4;
  background: #f5f8fb;
}

.ops-metal-section.gold {
  border-color: #ead6a5;
}

.ops-metal-tab {
  justify-self: start;
  min-width: 104px;
  padding: 8px 30px;
  border: 1px solid var(--gold-accent);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold-accent) 0%, var(--amber) 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.ops-metal-section.silver .ops-metal-tab {
  border-color: #9fb3c8;
  background: #5d6f82;
  color: #ffffff;
}

.ops-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.ops-panel,
.ops-detail {
  overflow: hidden;
  border: 1px solid #d2dce7;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), var(--shadow-hairline);
}

.ops-panel {
  display: flex;
  flex-direction: column;
}

.ops-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid #d7e0ea;
  background: #fbfcfe;
}

.ops-panel header span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ops-panel header h3 {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 900;
}

.ops-panel header small {
  min-height: 25px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.ops-panel-total {
  display: grid;
  justify-items: end;
  gap: 1px;
  min-width: 86px;
}

.ops-panel-total b {
  color: var(--amber-dark);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
}

.ops-panel-total small {
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  font-family: var(--base-font);
  font-size: 11px;
}

.ops-panel:nth-child(2) .ops-panel-total b {
  color: var(--green);
}

.ops-queue {
  display: grid;
  gap: 2px;
  padding: 6px;
  flex: 1;
  align-content: start;
}

.ops-qitem {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 14px 13px;
  border: 1px solid transparent;
  border-bottom-color: rgba(215, 224, 234, 0.72);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.ops-qitem:hover {
  border-color: #d2dce7;
  background: #f8fafc;
}

.ops-qtag {
  padding: 3px 8px;
  border-radius: 5px;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 900;
  white-space: nowrap;
}

.ops-qtag.unissued {
  background: #9b6d13;
}

.ops-qtag.partial {
  background: var(--amber);
}

.ops-qtag.review {
  background: var(--blue);
}

.ops-qtag.factory {
  background: var(--amber);
}

.ops-qtag.buy {
  background: var(--green);
}

.ops-qmain {
  min-width: 0;
}

.ops-qmain strong,
.ops-qmain small {
  display: block;
}

.ops-qmain strong {
  overflow: hidden;
  color: var(--heading);
  font-size: 13.5px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-qmain small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-qitem b {
  color: var(--heading);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 950;
  white-space: nowrap;
}

.ops-qitem b small {
  color: var(--muted);
  font-size: 11px;
}

.ops-more-list {
  margin: 4px 0 0;
  border: 1px dashed #cbd7e4;
  border-radius: 8px;
  background: #fbfcfe;
}

.ops-more-list > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--muted-strong);
  font-size: 12.5px;
  font-weight: 850;
  list-style: none;
}

.ops-more-list > summary::-webkit-details-marker {
  display: none;
}

.ops-more-list > summary::after {
  content: "▾";
  color: var(--amber);
  font-size: 12px;
  transition: transform 0.15s;
}

.ops-more-list[open] > summary {
  border-bottom: 1px solid #d7e0ea;
  background: #fffdf8;
}

.ops-more-list[open] > summary::after {
  transform: rotate(180deg);
}

.ops-more-list > summary b {
  color: var(--heading);
  font-family: var(--num-font);
  font-weight: 950;
}

.ops-more-close {
  display: none;
}

.ops-more-list[open] .ops-more-open {
  display: none;
}

.ops-more-list[open] .ops-more-close {
  display: inline;
}

.ops-more-items {
  display: grid;
  gap: 2px;
  padding: 4px;
}

.ops-qactions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.ops-qactions button {
  min-width: 46px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 850;
}

.ops-qactions button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.ops-qactions button.complete {
  border-color: #8db59c;
  background: var(--green-soft);
  color: var(--green);
}

.ops-sale-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 9px 12px;
  border-color: #d6e0ea;
  border-bottom-color: #d6e0ea;
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
}

.ops-sale-card.partial {
  border-color: #e7c77d;
  background: linear-gradient(180deg, #fffdf6, #ffffff);
}

.ops-qhead {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.ops-qamount {
  display: grid;
  justify-items: end;
  gap: 1px;
  min-width: 104px;
}

.ops-qamount > span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 900;
}

.ops-qamount > small {
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}

.ops-qamount b {
  color: var(--amber-dark);
  font-size: 18px;
}

.ops-sale-card .ops-qprogress {
  grid-column: 1 / -1;
  display: block;
  overflow: hidden;
  height: 6px;
  border-radius: 999px;
  background: #eef2f7;
}

.ops-sale-card .ops-qprogress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-accent, #c79a3a), var(--green));
}

.ops-sale-card .ops-qactions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(74px, 0.7fr) minmax(120px, 1.3fr);
}

.ops-sale-card .ops-qactions button {
  min-height: 36px;
}

.ops-sale-card .ops-qactions button.complete {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.ops-qgo {
  min-width: 42px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.ops-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 128px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.ops-check-list {
  display: grid;
  gap: 0;
  padding: 6px;
}

.ops-check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 8px;
}

.ops-check-row + .ops-check-row {
  border-top: 1px solid var(--line);
}

.ops-check-row.mismatch {
  background: var(--red-soft);
}

.ops-check-row span {
  color: var(--heading);
  font-size: 13px;
  font-weight: 800;
}

.ops-check-row small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
}

.ops-check-row small b {
  color: var(--heading);
}

.ops-check-row > strong {
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12.5px;
}

.ops-check-row > strong.ok {
  background: var(--green-soft);
  color: var(--green);
}

.ops-check-row > strong.bad {
  background: var(--red-soft);
  color: var(--red);
}

.ops-detail > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.ops-detail > summary::-webkit-details-marker {
  display: none;
}

.ops-detail > summary span {
  color: var(--heading);
  font-size: 13.5px;
  font-weight: 900;
}

.ops-detail > summary small {
  margin-left: 6px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.ops-detail > summary b {
  color: var(--muted);
  font-size: 18px;
  transition: transform 0.2s;
}

.ops-detail[open] > summary {
  border-bottom: 1px solid var(--line);
}

.ops-detail[open] > summary b {
  transform: rotate(180deg);
}

.ops-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.ops-dgroup {
  min-width: 0;
  padding: 14px 16px;
  background: var(--surface);
}

.ops-dgroup h4 {
  margin: 0 0 9px;
  color: #9b6d13;
  font-size: 11px;
  font-weight: 950;
}

.ops-dline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  font-size: 12.5px;
}

.ops-dline span {
  color: var(--muted);
}

.ops-dline b {
  color: var(--heading);
  font-family: var(--mono);
  font-weight: 850;
  text-align: right;
}

.ops-dline b.hi {
  color: #9b6d13;
}

.entry-section {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.entry-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--heading);
  font-size: 13px;
  font-weight: 900;
}

.entry-section-title span {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--nav);
  color: #ffffff;
  font-size: 12px;
}

.mode-section {
  padding: 0;
  border: 0;
  background: transparent;
}

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

.mode-option,
.metal-toggle button,
.status-toggle button {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-weight: 850;
}

.mode-option {
  min-height: 62px;
  padding: 10px 12px;
  text-align: left;
}

.mode-option strong,
.mode-option span {
  display: block;
}

.mode-option strong {
  color: var(--heading);
  font-size: 17px;
}

.mode-option span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.mode-option.active,
.metal-toggle button.active,
.status-toggle button.active {
  border-color: var(--blue);
  background: #edf5fb;
  color: var(--blue-dark);
  box-shadow: inset 0 0 0 1px rgba(36, 93, 143, 0.12);
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.quick-entry-section {
  border-color: #d8b15a;
  background: linear-gradient(180deg, #fffaf0 0%, #fffdf8 100%);
  box-shadow: inset 0 2px 0 rgba(199, 154, 58, 0.22), 0 10px 24px rgba(16, 24, 40, 0.06);
}

.quick-entry-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.quick-entry-title strong {
  color: var(--heading);
  font-size: 14px;
  font-weight: 950;
}

.quick-entry-title span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 750;
}

.quick-entry-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.95fr) minmax(230px, 1.45fr) minmax(108px, 0.72fr) minmax(130px, 0.9fr) minmax(64px, auto);
  align-items: end;
  gap: 10px;
}

.issue-quick-entry .quick-entry-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px 12px;
}

.issue-quick-entry .quick-entry-grid > .field:nth-child(1) {
  grid-column: span 2;
}

.issue-quick-entry .quick-entry-grid > .quick-counterparty-field {
  grid-column: span 4;
}

.issue-quick-entry .quick-entry-grid > .field:nth-child(3) {
  grid-column: span 2;
}

.issue-quick-entry .quick-entry-grid > .field:nth-child(4) {
  grid-column: span 3;
}

.issue-quick-entry .quick-submit-button {
  grid-column: span 1;
  width: 100%;
  min-width: 62px;
}

.quick-entry-grid .field {
  min-width: 0;
  color: #6f4b08;
}

.quick-entry-grid .field input {
  min-width: 0;
  min-height: 44px;
  border-color: #cda44a;
  background: #ffffff;
  color: var(--heading);
  font-size: 15px;
  font-weight: 900;
}

.quick-entry-grid .quick-counterparty-field input {
  font-size: 16px;
}

.quick-submit-button {
  align-self: end;
  min-height: 44px;
  padding-inline: 16px;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .quick-entry-grid {
    grid-template-columns: minmax(150px, 0.9fr) minmax(220px, 1.35fr) minmax(108px, 0.8fr);
  }

  .quick-entry-grid .field:nth-child(4) {
    grid-column: span 2;
  }

  .quick-submit-button {
    width: 100%;
  }
}

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

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

.opening-stock-ocr {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.opening-stock-dropzone {
  min-height: 72px;
  margin: 0;
  background: #fffdf8;
}

.opening-stock-dropzone.is-dragover {
  border-color: var(--gold-accent);
  background: #fff7e4;
}

.opening-stock-image-status[hidden] {
  display: none;
}

.opening-stock-image-status.is-success {
  border-color: var(--green-line);
  background: var(--green-soft);
  color: var(--green);
}

.opening-stock-image-status.is-error {
  border-color: #efc3bb;
  background: var(--red-soft);
  color: var(--red);
}

.dollar-calculator-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-top: 10px;
}

.dollar-calculator-grid .field {
  flex: 1 1 130px;
  min-width: 118px;
}

#dollarCalculatorDialog.small-modal {
  width: min(900px, calc(100vw - 28px));
}

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

.compact-mode button {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--heading);
  font-weight: 900;
}

.compact-mode button.active {
  border-color: var(--blue);
  background: #eef6ff;
  color: var(--blue);
}

#dollarCalculatorDialog.is-ls .dollar-counterparty-field {
  display: none;
}

#dollarCalculatorDialog.is-import .dollar-counterparty-field,
#dollarCalculatorDialog.is-export .dollar-counterparty-field {
  display: grid;
}

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

.buy-pricing-grid {
  grid-template-columns: 1fr 1.25fr 0.8fr 1.25fr;
  margin: 10px 0;
}

.field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.field-head small {
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.premium-field input {
  color: var(--blue-dark);
  font-weight: 900;
}

.field input,
.field select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

.field input::placeholder {
  color: #98a2b3;
}

.field-wide {
  grid-column: span 1;
}

.hero-field input {
  border-color: #92acc3;
  background: #fbfdff;
  font-size: 18px;
  font-weight: 900;
}

.calc-field input {
  background: #f8fafc;
}

.metal-toggle,
.status-toggle {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.metal-toggle button,
.status-toggle button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.metal-toggle button[data-metal] {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.metal-toggle button[data-metal]::after,
.issue-metal-toggle button[data-issue-metal]::after {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 18px;
  padding: 0 5px;
  border: 1px solid rgba(125, 96, 35, 0.28);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted-strong);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.metal-toggle button[data-metal="gold"]::after,
.issue-metal-toggle button[data-issue-metal="gold"]::after {
  content: "F1";
}

.metal-toggle button[data-metal="silver"]::after,
.issue-metal-toggle button[data-issue-metal="silver"]::after {
  content: "F2";
}

.metal-toggle button.active::after,
.issue-metal-toggle button.active::after {
  border-color: rgba(125, 96, 35, 0.42);
  background: #ffffff;
  color: inherit;
}

.issued-field {
  max-width: 220px;
}

.transaction-modal.is-buy .sell-only {
  display: none;
}

.transaction-modal.is-sell .buy-only {
  display: none;
}

.transaction-modal.is-sell .buy-only-field {
  display: none;
}

.transaction-modal.is-sell .buy-pricing-grid {
  grid-template-columns: minmax(0, 1fr);
}

.transaction-modal.is-sell.is-silver .category-field,
.transaction-modal.is-sell.is-silver .product-group-field {
  display: none;
}

.market-premium-grid {
  margin-top: 10px;
}

.market-hint {
  margin: 7px 0 0;
  padding: 9px 10px;
  border: 1px solid #d7e4ef;
  border-radius: 8px;
  background: #f8fbfe;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
}

.issue-market-grid {
  margin-top: 10px;
}

.buy-calc-preview {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #b8d7c9;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
}

.buy-calc-preview strong,
.buy-calc-preview span,
.buy-calc-preview small {
  display: block;
}

.buy-calc-preview strong {
  font-size: 13px;
}

.buy-calc-preview .buy-calc-main {
  color: var(--heading);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 900;
}

.buy-calc-preview .buy-calc-main b {
  color: #064e3b;
  font-size: 15px;
  font-weight: 950;
}

.buy-calc-preview .buy-calc-sub {
  color: #6b7f77;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 650;
}

.buy-calc-preview small {
  color: var(--muted);
  font-size: 11.5px;
}

.issue-modal.is-linked .standalone-issue-section {
  display: none;
}

.issue-modal.is-standalone .linked-issue-section {
  display: none;
}

.advanced-section {
  padding: 0;
  background: transparent;
}

.advanced-section summary {
  padding: 11px 12px;
  cursor: pointer;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 900;
}

.advanced-section .entry-grid {
  padding: 0 12px 12px;
}

.memo-section {
  padding: 0;
  border: 0;
  background: transparent;
}

.memo-section .field input {
  min-height: 42px;
}

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

.form-grid.single {
  grid-template-columns: 1fr;
}

.form-grid label,
.krx-form-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.wide {
  grid-column: 1 / -1;
}

.checkbox-label {
  align-content: end;
  grid-template-columns: 18px auto;
  grid-auto-flow: column;
  align-items: center;
}

.checkbox-label input {
  min-height: 18px;
  accent-color: var(--blue);
}

.dialog-summary {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  line-height: 1.45;
}

.issue-target-card {
  display: grid;
  gap: 10px;
}

.issue-target-card header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.issue-target-card header > div {
  min-width: 0;
}

.issue-target-card strong,
.issue-target-card small {
  display: block;
}

.issue-target-card strong {
  overflow: hidden;
  color: var(--heading);
  font-size: 15px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.issue-target-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
}

.issue-target-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.issue-target-grid span {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.issue-target-grid span.highlight {
  border-color: #a7d8c4;
  background: var(--green-soft);
}

.issue-target-grid b {
  color: var(--heading);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 950;
}

.issue-target-grid .price b {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.issue-target-grid .highlight b {
  color: var(--green);
}

.issue-target-progress {
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: #e8eef5;
}

.issue-target-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-accent, #c79a3a), var(--green));
}

.issue-fill-button {
  min-height: 38px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: #ffffff;
  color: var(--green);
  font-weight: 900;
}

.opening-stock-section .dialog-summary {
  display: grid;
  gap: 4px;
  margin: 10px 0 0;
  color: var(--heading);
  font-weight: 850;
}

.opening-stock-section .dialog-summary span:last-child {
  color: var(--green);
}

.dollar-calculator-result {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #b8d7c9;
  border-radius: 8px;
  background: var(--green-soft);
}

.dollar-calculator-result strong,
.dollar-calculator-result span,
.dollar-calculator-result small {
  display: block;
}

.dollar-calculator-result strong {
  color: var(--heading);
  font-size: 13px;
  font-weight: 900;
}

.dollar-calculator-result strong b {
  color: #064e3b;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 950;
}

.dollar-calculator-result span {
  color: #4f655d;
  font-size: 12px;
  font-weight: 800;
}

.dollar-calculator-result small {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.login-panel {
  display: grid;
  gap: 10px;
}

.login-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.login-panel input {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.login-meta {
  margin: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.45;
}

.account-section {
  margin-top: 16px;
}

.account-create,
.account-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(150px, 1fr) 120px auto auto;
  gap: 8px;
  align-items: center;
}

.account-create {
  margin-top: 12px;
}

.account-create input,
.account-create select,
.account-row input,
.account-row select {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
}

.account-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.account-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.account-row.inactive {
  opacity: 0.62;
}

.account-name {
  display: grid;
  gap: 3px;
}

.account-name strong {
  color: var(--heading);
  font-size: 13px;
}

.account-name span {
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 900px) {
  .anomaly-list,
  .kakao-review-grid,
  .profit-explain-panel {
    grid-template-columns: 1fr;
  }

  .kakao-review-stats {
    grid-template-columns: 1fr;
  }

  .profit-explain-lots div {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .profit-explain-lots b {
    grid-column: 1 / -1;
  }

  .account-create,
  .account-row {
    grid-template-columns: 1fr;
  }
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 36px));
  padding: 11px 13px;
  border: 1px solid #2f3b4b;
  border-radius: 8px;
  background: #101828;
  color: #ffffff;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.empty-state {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.warning {
  color: var(--red);
  font-weight: 850;
}

.ok {
  color: var(--green);
  font-weight: 850;
}

/* Readability pass: operating dashboard typography */
button,
input,
select,
textarea {
  font-family: var(--base-font);
}

h1 {
  font-size: 21px;
  font-weight: 900;
}

h2 {
  font-size: 22px;
  font-weight: 800;
}

h3 {
  font-size: 15.5px;
  font-weight: 800;
}

th,
td {
  font-size: 13.5px;
  line-height: 1.45;
}

th {
  font-size: 12.5px;
  font-weight: 800;
}

td strong,
.ops-qmain strong,
.ops-panel header h3,
.ops-current-metric span,
.ops-balance-line span,
.field label,
.section-eyebrow {
  font-weight: 800;
}

.row-muted,
.ops-qmain small,
.ops-balance-line span,
.ops-panel-total small {
  font-size: 12px;
}

.type-chip,
.status-chip,
.metal-chip,
.mini-button,
.ops-qactions button,
.ops-qgo,
.badge,
.user-pill,
.status-pill {
  font-size: 12.5px;
}

.primary-button,
.secondary-button,
.danger-button,
.ops-btn {
  font-size: 13.5px;
  font-weight: 800;
}

.toolbar input,
.toolbar select,
.krx-form-grid input,
.krx-form-grid select,
.form-grid input,
.form-grid select,
.field input,
.field select,
.field textarea {
  font-size: 14.5px;
}

.number,
td.number,
th.number,
.kpi-value,
.ops-hero-figure strong,
.ops-stock-formula b,
.ops-cost-row b,
.ops-current-metric b,
.ops-balance-card > strong,
.ops-balance-line b,
.ops-balance-diff b,
.ops-panel-total b,
.ops-qitem b,
.ops-xls-metric b,
.hero-field input,
.calc-result-amount {
  font-family: var(--num-font);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.ops-hero-heading,
.ops-balance-card p {
  font-size: 11.5px;
}

.ops-stock-formula small {
  font-size: 10px;
}

.ops-panel header span {
  font-size: 10px;
}

.ops-current-heading,
.ops-section-label {
  font-size: 13.5px;
}

.ops-current-group-title {
  font-size: 12px;
}

.ops-panel header h3,
.ops-supply-balance h3 {
  font-size: 16px;
  font-weight: 900;
}

.ops-current-metric b {
  font-size: 13px;
}

.ops-current-metric.is-highlight b {
  font-size: 15.5px;
}

.ops-balance-card > strong {
  font-size: 26px;
  line-height: 1.05;
}

.ops-qmain strong {
  font-size: 14px;
}

.ops-qmain small {
  font-size: 12px;
}

.ops-qitem b {
  font-size: 15px;
}

.ops-xls-metric b {
  font-size: 17.5px;
}

.ops-xls-metric.is-highlight b {
  font-size: 19px;
}

.ops-panel-total b {
  font-size: 22px;
}

.purchase-dollar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.purchase-dollar-actions kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  margin-left: 6px;
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.18);
  font-family: var(--num-font);
  font-size: 11px;
  font-weight: 900;
}

.purchase-dollar-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.purchase-dollar-summary .kpi-card {
  min-height: 108px;
  border-color: var(--line);
  box-shadow: var(--shadow-sm), var(--shadow-hairline);
}

.purchase-dollar-summary .kpi-card:first-child {
  border-color: var(--amber-line);
  border-top: 3px solid var(--gold-accent);
  background: linear-gradient(180deg, #fff, var(--amber-soft));
}

.purchase-dollar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.85fr);
  gap: 14px;
  align-items: start;
}

.purchase-dollar-main,
.purchase-dollar-side {
  display: grid;
  gap: 14px;
}

.pd-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), var(--shadow-hairline);
}

.purchase-dollar-table {
  min-width: 980px;
}

.purchase-dollar-table th {
  background: #f4f8fb;
}

.purchase-dollar-table td {
  vertical-align: middle;
}

.purchase-dollar-table tr.is-due-today td {
  background: #edf9f3;
}

.purchase-dollar-table tr.is-due-today td:first-child {
  border-left: 4px solid var(--green);
}

.purchase-dollar-table tr.is-overdue td {
  background: #fff4f2;
}

.purchase-dollar-table tr.is-overdue td:first-child {
  border-left: 4px solid var(--red);
}

.purchase-dollar-table tr.is-completed {
  opacity: 0.72;
}

.dollar-ledger-table {
  min-width: 1040px;
}

.dollar-ledger-table td:first-child strong {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  font-size: 12px;
  white-space: nowrap;
}

.pd-dollar-ledger-card {
  border-top: 2px solid var(--gold-accent);
}

.pd-dtag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  margin-right: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.pd-dtag.today {
  border: 1px solid var(--green-line);
  background: var(--green-soft);
  color: var(--green);
}

.pd-dtag.next {
  border: 1px solid #c8d9ea;
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.pd-dtag.overdue {
  border: 1px solid #f4b3ad;
  background: var(--red-soft);
  color: var(--red);
}

.pd-dtag.muted {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
}

.pd-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
}

.pd-status.pending {
  border: 1px solid var(--amber-line);
  background: var(--amber-soft);
  color: var(--amber-dark);
}

.pd-status.done {
  border: 1px solid var(--green-line);
  background: var(--green-soft);
  color: var(--green);
}

.pd-flow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.pd-flow-grid > div {
  display: grid;
  gap: 4px;
  min-height: 78px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.pd-flow-grid span,
.pd-flow-grid small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pd-flow-grid b {
  color: var(--heading);
  font-family: var(--num-font);
  font-size: 20px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pd-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.pd-calendar-day {
  min-height: 70px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  box-shadow: var(--shadow-hairline);
}

.pd-calendar-day b {
  display: block;
  margin-bottom: 5px;
  color: var(--muted-strong);
  font-size: 11.5px;
  font-weight: 900;
}

.pd-calendar-day.today {
  border-color: var(--green-line);
  background: var(--green-soft);
}

.pd-calendar-day.overdue {
  border-color: #f4b3ad;
  background: var(--red-soft);
}

.pd-calendar-amount,
.pd-calendar-empty {
  display: inline-flex;
  max-width: 100%;
  padding: 3px 5px;
  border-radius: 5px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-family: var(--num-font);
  font-size: 11px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pd-calendar-empty {
  background: transparent;
  color: var(--line-strong);
}

.pd-calendar-day small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.25;
}

.schedule-header {
  align-items: center;
}

.schedule-month-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-sm), var(--shadow-hairline);
}

.schedule-month-controls strong {
  min-width: 124px;
  color: var(--heading);
  font-size: 18px;
  font-weight: 950;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.schedule-nav-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  font-family: var(--num-font);
  font-size: 22px;
  line-height: 1;
}

.schedule-today-button {
  min-height: 34px;
  padding: 6px 11px;
  border-radius: 999px;
}

.schedule-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), var(--shadow-hairline);
}

.schedule-summary > b {
  margin-left: auto;
  color: var(--heading);
  font-family: var(--num-font);
  font-size: 15px;
  font-weight: 950;
}

.schedule-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.schedule-pill.sell {
  border-color: #f5b6ad;
  background: var(--red-soft);
  color: var(--red);
}

.schedule-pill.buy {
  border-color: var(--green-line);
  background: var(--green-soft);
  color: var(--green);
}

.schedule-pill.issue {
  border-color: var(--amber-line);
  background: var(--amber-soft);
  color: var(--gold-deep);
}

.schedule-pill.maturity,
.schedule-pill.dollar {
  border-color: #d9c18b;
  background: #fff8dd;
  color: var(--gold-deep);
}

.schedule-pill.manual {
  border-color: #c8d9ea;
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.schedule-pill.pricing {
  border-color: #c9b7f2;
  background: #f4f0ff;
  color: #5a3a9d;
}

.schedule-pill.factory {
  border-color: #c8d9ea;
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.schedule-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.32fr);
  gap: 14px;
  align-items: start;
}

.schedule-calendar-shell {
  margin-bottom: 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm), var(--shadow-hairline);
}

.schedule-weekdays,
.schedule-month-grid {
  min-width: 0;
}

.schedule-calendar-title {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.schedule-weekdays {
  display: grid;
  grid-template-columns: minmax(52px, 0.46fr) repeat(5, minmax(94px, 1fr)) minmax(52px, 0.46fr);
  border-bottom: 1px solid var(--line);
  background: #f4f8fb;
}

.schedule-weekdays span {
  padding: 9px 8px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 950;
  text-align: center;
}

.schedule-month-grid {
  display: grid;
  grid-template-columns: minmax(52px, 0.46fr) repeat(5, minmax(94px, 1fr)) minmax(52px, 0.46fr);
}

.schedule-day {
  display: block;
  width: 100%;
  min-height: 150px;
  padding: 8px;
  text-align: left;
  border-right: 1px solid var(--line);
  border-top: 0;
  border-left: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.schedule-day:nth-child(7n) {
  border-right: 0;
}

.schedule-day.is-out {
  background: #f8fafc;
  color: var(--muted);
}

.schedule-day.is-today {
  background: #fffaf0;
  box-shadow: inset 0 0 0 2px var(--gold-accent);
}

.schedule-day.is-selected {
  background: #eef7ff;
  box-shadow: inset 0 0 0 2px var(--blue);
}

.schedule-day:hover {
  background: #f8fbff;
}

.schedule-day header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 22px;
  margin-bottom: 7px;
}

.schedule-day header b {
  color: var(--heading);
  font-family: var(--num-font);
  font-size: 13px;
  font-weight: 950;
}

.schedule-day header span {
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--gold-deep);
  font-size: 10px;
  font-weight: 950;
}

.schedule-day-events {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  flex-wrap: wrap;
}

.schedule-day-chip,
.schedule-day-empty {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 5px;
  border-radius: 999px;
  background: #f3f6f9;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.schedule-day:nth-child(7n + 1),
.schedule-day:nth-child(7n) {
  min-height: 118px;
  padding: 7px 6px;
}

.schedule-day:nth-child(7n + 1) .schedule-day-chip,
.schedule-day:nth-child(7n) .schedule-day-chip,
.schedule-day:nth-child(7n + 1) .schedule-day-empty,
.schedule-day:nth-child(7n) .schedule-day-empty {
  font-size: 10px;
  padding-inline: 4px;
}

.schedule-day-chip.buy {
  background: var(--green-soft);
  color: var(--green);
}

.schedule-day-chip.maturity,
.schedule-day-chip.dollar {
  background: #fff8dd;
  color: var(--gold-deep);
}

.schedule-day-chip.manual {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.schedule-day-chip.pricing {
  background: #f4f0ff;
  color: #5a3a9d;
}

.schedule-day-pricing {
  width: 100%;
  justify-content: space-between;
  gap: 4px;
  border-radius: 7px;
}

.schedule-day-pricing-label {
  flex: 0 0 auto;
  color: #5a3a9d;
  font-size: 10px;
  font-weight: 950;
}

.schedule-day-pricing b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 950;
}

.schedule-day-pricing em {
  flex: 0 0 auto;
  color: #3f2875;
  font-family: var(--num-font);
  font-style: normal;
  font-weight: 950;
}

.schedule-day-empty {
  background: transparent;
  color: var(--muted);
}

.schedule-event.sell span,
.schedule-event.dollarSell span {
  background: var(--red-soft);
  color: var(--red);
}

.schedule-event.buy span,
.schedule-event.dollarBuy span {
  background: var(--green-soft);
  color: var(--green);
}

.schedule-event.issue span,
.schedule-event.maturity span {
  background: #fff8dd;
  color: var(--gold-deep);
}

.schedule-event.factory span {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.schedule-event.pricing span {
  background: #f4f0ff;
  color: #5a3a9d;
}

.schedule-more {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.schedule-side-panel {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 128px;
}

.schedule-selected-card,
.schedule-manual-card {
  padding: 14px;
}

.schedule-side-list {
  display: grid;
  gap: 8px;
}

.schedule-side-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.schedule-side-item span {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #f3f6f9;
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 950;
}

.schedule-side-item strong,
.schedule-side-item small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-side-item strong {
  color: var(--heading);
  font-size: 13px;
  font-weight: 900;
}

.schedule-side-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.schedule-side-item.buy span,
.schedule-side-item.dollarBuy span {
  background: var(--green-soft);
  color: var(--green);
}

.schedule-side-item.dollarSell span {
  background: var(--red-soft);
  color: var(--red);
}

.schedule-side-item.maturity span,
.schedule-side-item.payment span {
  background: #fff8dd;
  color: var(--gold-deep);
}

.schedule-side-item.pricing span {
  background: #f4f0ff;
  color: #5a3a9d;
}

.schedule-side-item.meeting span,
.schedule-side-item.check span,
.schedule-side-item.memo span,
.schedule-side-item.manual span {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.schedule-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 0.7fr);
  gap: 9px;
}

.schedule-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.schedule-form input,
.schedule-form select {
  min-width: 0;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--heading);
  font-size: 13px;
  font-weight: 800;
}

.schedule-form-wide,
.schedule-form .primary-button {
  grid-column: 1 / -1;
}

.schedule-pricing-only {
  display: none !important;
}

.schedule-form.is-pricing .schedule-pricing-only {
  display: grid !important;
}

.schedule-detail-panel {
  padding: 14px;
}

.schedule-detail-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.schedule-detail-row {
  display: grid;
  grid-template-columns: 104px 82px minmax(180px, 1fr) minmax(260px, 1.5fr);
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.schedule-detail-row:last-child {
  border-bottom: 0;
}

.schedule-detail-row span,
.schedule-detail-row b,
.schedule-detail-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-detail-row span {
  color: var(--muted-strong);
  font-family: var(--num-font);
  font-size: 12px;
  font-weight: 850;
}

.schedule-detail-row b {
  color: var(--gold-deep);
  font-size: 12px;
  font-weight: 950;
}

.schedule-detail-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--heading);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-detail-row small {
  color: var(--muted);
  font-size: 12px;
}

.dollar-dropzone.compact {
  min-height: 72px;
  padding: 12px;
  border-radius: 10px;
}

.pd-pdf-list {
  display: grid;
  gap: 8px;
}

.pd-pdf-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.pd-pdf-item > div:first-child {
  grid-column: 1 / -1;
  min-width: 0;
}

.pd-pdf-item.is-due-today {
  border-color: var(--green-line);
  background: var(--green-soft);
}

.pd-pdf-item.is-completed {
  opacity: 0.72;
  background: var(--surface-soft);
}

.pd-pdf-item strong,
.pd-pdf-item span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.pd-pdf-item strong {
  margin-top: 5px;
  color: var(--heading);
  font-size: 13px;
  font-weight: 900;
}

.pd-pdf-item span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.pd-pdf-item b {
  grid-column: 1;
  justify-self: start;
  color: var(--heading);
  font-family: var(--num-font);
  font-size: 14px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pd-pdf-item > .row-actions {
  grid-column: 2;
  justify-self: end;
}

.pd-confirmation-detail {
  margin-top: 10px;
}

.pd-confirmation-detail summary {
  cursor: pointer;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 900;
}

.settings-ia-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  gap: 14px;
  align-items: start;
}

.settings-ia-left {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.settings-ia-left .account-section {
  margin-top: 0;
  min-width: 0;
  overflow: hidden;
}

.settings-ia-left .account-create,
.settings-ia-left .account-row {
  min-width: 0;
}

.settings-ia-left .account-create {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(96px, 120px) auto;
}

.settings-ia-left .account-row {
  grid-template-columns: minmax(118px, 1fr) minmax(96px, 120px) minmax(116px, 1fr) auto auto;
}

.settings-ia-left .account-request-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.settings-ia-left .account-request-title,
.settings-ia-left .account-request-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}

.settings-ia-left .account-request-title {
  grid-template-columns: minmax(150px, 1fr) auto;
  color: var(--muted);
  font-size: 12px;
}

.settings-ia-left .account-request-title strong {
  color: var(--heading);
}

.settings-ia-left .account-request-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.settings-ia-left .account-create input,
.settings-ia-left .account-create select,
.settings-ia-left .account-row input,
.settings-ia-left .account-row select,
.settings-ia-left .account-name {
  min-width: 0;
}

.settings-ia-left .account-name strong,
.settings-ia-left .account-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-ia-left .account-create .primary-button,
.settings-ia-left .account-row .secondary-button,
.settings-ia-left .account-request-row .secondary-button {
  min-width: 0;
  padding-right: 10px;
  padding-left: 10px;
  white-space: nowrap;
}

.link-button.account-request-open {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 800;
  cursor: pointer;
}

.is-readonly-disabled {
  opacity: .48;
  cursor: not-allowed !important;
}

.settings-base-card {
  border-top: 3px solid var(--gold-accent);
  box-shadow: var(--shadow-sm), var(--shadow-hairline);
}

.settings-base-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.settings-base-metrics > div {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.settings-base-metrics span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.settings-base-metrics b {
  color: var(--heading);
  font-family: var(--num-font);
  font-size: 17px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.settings-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted-strong);
  font-size: 12px;
}

.settings-warning.is-active {
  border-color: var(--amber-line);
  border-left: 4px solid var(--gold-accent);
  background: var(--amber-soft);
  color: var(--amber-dark);
}

.settings-warning strong {
  color: var(--heading);
}

.settings-advanced {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), var(--shadow-hairline);
}

.settings-advanced summary {
  cursor: pointer;
  padding: 13px 14px;
  color: var(--heading);
  font-weight: 950;
}

.settings-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0 12px 12px;
}

.settings-grid-compact .settings-section {
  box-shadow: none;
}

.settings-audit-panel {
  position: sticky;
  top: 120px;
  min-width: 0;
  max-height: calc(100vh - 140px);
  overflow: auto;
}

.settings-audit-list {
  display: grid;
  gap: 7px;
}

.settings-audit-row {
  display: grid;
  grid-template-columns: 108px minmax(74px, 104px) minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 9px 8px;
  border-bottom: 1px dashed var(--line);
  color: var(--text);
  font-size: 12px;
}

.settings-audit-row:last-child {
  border-bottom: 0;
}

.settings-audit-row.delete {
  color: var(--red);
}

.settings-audit-row.update .settings-audit-action {
  color: var(--blue-dark);
}

.settings-audit-row.create .settings-audit-action {
  color: var(--green);
}

.settings-audit-time {
  color: var(--muted);
  font-family: var(--num-font);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.settings-audit-action {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 950;
  white-space: nowrap;
}

.settings-audit-summary {
  min-width: 0;
  color: var(--muted-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .schedule-layout {
    grid-template-columns: 1fr;
  }

  .schedule-side-panel {
    position: static;
  }

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

  .purchase-dollar-layout,
  .settings-ia-grid {
    grid-template-columns: 1fr;
  }

  .settings-audit-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 720px) {
  .schedule-weekdays,
  .schedule-month-grid {
    min-width: 580px;
  }

  .schedule-day {
    min-height: 118px;
  }

  .schedule-form {
    grid-template-columns: 1fr;
  }

  .purchase-dollar-actions {
    justify-content: flex-start;
  }

  .purchase-dollar-summary,
  .pd-flow-grid,
  .settings-base-metrics,
  .settings-grid-compact {
    grid-template-columns: 1fr;
  }

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

  .pd-pdf-item,
  .settings-audit-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .kpi-grid,
  .dashboard-topline,
  .priority-grid,
  .pipeline-grid,
  .workflow-strip,
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-hero,
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-hero-actions {
    width: 100%;
  }

  .grid-two,
  .krx-layout,
  .ops-dashboard-shell,
  .ops-hero,
  .ops-cols {
    grid-template-columns: 1fr;
  }

  .ops-sticky-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .ops-hero-main {
    border-bottom: 1px solid var(--line);
  }

  .ops-stock-primary {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .ops-hero-side {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

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

@media (max-width: 720px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 14px;
    position: static;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .app-main {
    padding: 14px;
  }

  .tabbar {
    top: 0;
    padding: 8px 14px;
  }

  .kpi-grid,
  .dashboard-topline,
  .priority-grid,
  .pipeline-grid,
  .workflow-strip,
  .settings-grid,
  .mode-toggle,
  .entry-grid,
  .amount-grid,
  .krx-form-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .issued-field {
    max-width: none;
  }

  .view-header {
    display: block;
  }

  .dashboard-hero {
    padding: 15px;
  }

  .dashboard-hero h2 {
    font-size: 23px;
  }

  .hero-stock-card {
    padding: 14px;
  }

  .hero-stock-card > strong {
    font-size: 31px;
  }

  .hero-stock-strip span {
    display: block;
  }

  .hero-stock-strip b {
    display: block;
    margin-top: 2px;
  }

  .priority-board-header {
    display: block;
  }

  .priority-board-header .badge {
    margin-top: 8px;
  }

  .dashboard-hero-actions {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .view-actions {
    justify-content: flex-start;
    margin-top: 12px;
  }

  .dollar-dropzone {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar input,
  .toolbar select {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
  }

  .ops-actionbar,
  .ops-current-status,
  .ops-excel-summary,
  .ops-balance-body,
  .ops-supply-balance,
  .ops-match-row,
  .ops-strip,
  .ops-detail-grid,
  .sales-chat-steps,
  .sales-review-summary {
    grid-template-columns: 1fr;
  }

  .ops-actionbar {
    display: grid;
    top: 56px;
  }

  .ops-btn.ledger {
    margin-left: 0;
  }

  .ops-btn.ledger::before {
    display: none;
  }

  .ops-hero-main {
    padding: 20px;
  }

  .ops-stock-primary {
    padding: 20px;
  }

  .ops-hero-rollup {
    grid-template-columns: 1fr;
  }

  .ops-stock-formula {
    gap: 7px;
  }

  .ops-stock-formula span {
    min-width: 58px;
    padding: 7px 8px;
  }

  .ops-hero-figure strong {
    font-size: 44px;
  }

  .ops-hero-side {
    padding: 16px 20px;
  }

  .ops-strip-cell {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .ops-strip-cell:last-child {
    border-bottom: 0;
  }

  .ops-xls-grid,
  .ops-xls-panel:first-child .ops-xls-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-supply-balance > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .ops-current-heading {
    min-height: 20px;
  }

  .ops-current-card {
    grid-template-columns: 1fr;
  }

  .ops-current-group.buy {
    border-right: 0;
    border-bottom: 1px solid #d2dbe5;
  }

  .ops-current-grid.buy {
    grid-template-columns: 1fr;
  }

  .ops-current-metric {
    border-bottom: 1px solid #c6d0dc;
  }

  .ops-current-grid.buy .ops-current-metric:nth-last-child(-n + 2) {
    border-bottom: 1px solid #c6d0dc;
  }

  .ops-current-grid.buy .ops-current-metric:last-child,
  .ops-current-grid.confirmed .ops-current-metric:last-child {
    border-bottom: 0;
  }

  .ops-balance-diff {
    min-height: 90px;
    border: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .ops-match-diff {
    border-left: 0;
    border-right: 0;
    border-top: 1px solid var(--line);
    border-bottom: 0;
  }

  .ops-xls-metric,
  .ops-xls-panel:first-child .ops-xls-metric:nth-child(4n),
  .ops-xls-panel:first-child .ops-xls-metric:nth-child(3n) {
    border-right: 1px solid var(--line);
  }

  .ops-xls-metric:nth-child(2n),
  .ops-xls-panel:first-child .ops-xls-metric:nth-child(2n) {
    border-right: 0;
  }

  .ops-qitem {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .ops-qactions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .ops-qgo {
    display: none;
  }

  .ops-check-row {
    grid-template-columns: 1fr auto;
  }

  .ops-check-row small {
    grid-column: 1 / -1;
  }
}

/* Mobile app pass: PWA/phone-first operating layout */
@media (display-mode: standalone) {
  body {
    min-height: 100dvh;
  }
}

@media (max-width: 720px) {
  html {
    scroll-padding-top: 96px;
  }

  body {
    min-height: 100dvh;
    font-size: 14px;
    -webkit-tap-highlight-color: transparent;
  }

  button,
  input,
  select,
  textarea {
    min-height: 44px;
    font-size: 16px;
  }

  .app-header {
    position: sticky;
    top: 0;
    z-index: 30;
    gap: 9px;
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
    background: rgba(255, 255, 255, 0.97);
  }

  .brand-home {
    width: 100%;
  }

  .eyebrow {
    margin-bottom: 2px;
    font-size: 9.5px;
  }

  .brand-home h1,
  h1 {
    font-size: 18px;
    line-height: 1.2;
  }

  .header-actions {
    width: 100%;
    gap: 6px;
  }

  .auth-actions {
    flex: 1 1 auto;
    min-width: 0;
  }

  .user-pill,
  .status-pill {
    min-height: 30px;
    padding: 4px 8px;
    font-size: 11.5px;
  }

  .edit-toggle {
    min-height: 34px;
    padding: 5px 8px;
    font-size: 12px;
  }

  .tabbar {
    position: sticky;
    top: 0;
    z-index: 24;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    background: rgba(244, 246, 248, 0.96);
    scrollbar-width: none;
  }

  .tabbar::-webkit-scrollbar {
    display: none;
  }

  .tab {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 8px;
    white-space: nowrap;
  }

  /* UX 2026-06-08 (mobile pass 2): 헤더 로그인/로그아웃 버튼이 .secondary-button width:100% 규칙에 걸려
     전체폭으로 늘어나 헤더가 한 줄을 통째로 차지 -> 컴팩트 인라인으로 복귀 */
  .app-header .secondary-button,
  .app-header .auth-actions button {
    width: auto;
    min-height: 36px;
    padding: 6px 12px;
    flex: 0 0 auto;
  }

  /* UX 2026-06-08 (mobile pass 2): 탭바는 가로 스크롤되지만 스크롤바를 숨겨 "더 있음"이 안 보임
     -> 오른쪽 끝 페이드 마스크로 스크롤 가능 암시 */
  .tabbar {
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 90%, transparent 100%);
    mask-image: linear-gradient(to right, #000 0, #000 90%, transparent 100%);
  }

  /* UX 2026-06-08 (mobile pass 2): 빠른실행(ops-actionbar)도 동일 처리 */
  .ops-actionbar {
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 92%, transparent 100%);
    mask-image: linear-gradient(to right, #000 0, #000 92%, transparent 100%);
  }

  .app-main {
    width: 100%;
    padding: 10px 10px calc(76px + env(safe-area-inset-bottom));
  }

  .view-header {
    padding: 2px 0 4px;
  }

  .view-header h2 {
    font-size: 18px;
  }

  .view-header p {
    font-size: 12.5px;
  }

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

  .view-actions button,
  .primary-button,
  .secondary-button,
  .danger-button {
    width: 100%;
    min-height: 42px;
  }

  .ops-dashboard {
    gap: 12px;
  }

  .ops-actionbar {
    top: 49px;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    margin: 0 -10px;
    padding: 8px 10px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    scrollbar-width: none;
  }

  .ops-actionbar::-webkit-scrollbar {
    display: none;
  }

  .ops-btn {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 8px 11px;
    font-size: 12.5px;
  }

  .ops-btn span {
    display: none;
  }

  .approval-panel {
    margin: 0 -10px 4px;
    border-right: 0;
    border-left-width: 4px;
    border-radius: 0;
  }

  .approval-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .approval-card-actions {
    justify-content: flex-end;
  }

  .ops-hero {
    gap: 0;
    border-radius: 10px;
  }

  .ops-stock-primary,
  .ops-hero-side,
  .ops-hero-rollup {
    padding: 16px;
  }

  .ops-hero-figure strong {
    font-size: clamp(38px, 14vw, 54px);
  }

  .ops-stock-delta {
    width: fit-content;
    max-width: 100%;
  }

  .ops-stock-formula {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .ops-stock-formula i {
    display: none;
  }

  .ops-stock-formula span {
    min-width: 0;
    width: 100%;
  }

  .ops-stock-formula .current {
    grid-column: 1 / -1;
  }

  .ops-match-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ops-match-card,
  .ops-match-diff,
  .ops-match-maturity {
    min-height: 88px;
  }

  .ops-cols,
  .grid-two,
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .ops-panel,
  .panel {
    padding: 12px;
    border-radius: 10px;
  }

  .ops-qitem {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 9px;
    padding: 12px 10px;
  }

  .ops-qitem b {
    grid-column: 2;
    justify-self: start;
  }

  .toolbar {
    gap: 8px;
    padding: 10px;
  }

  .transactions-shell,
  .compact-table,
  .table-shell {
    overflow: visible;
  }

  .transactions-table,
  .issue-table,
  .factory-table {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .transactions-table thead,
  .issue-table thead,
  .factory-table thead {
    display: none;
  }

  .transactions-table tbody,
  .issue-table tbody,
  .factory-table tbody {
    display: grid;
    gap: 10px;
  }

  .transactions-table tr,
  .issue-table tr,
  .factory-table tr {
    display: block;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }

  .transactions-table td,
  .issue-table td,
  .factory-table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100% !important;
    min-width: 0 !important;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    background: transparent !important;
    text-align: right;
    white-space: normal;
  }

  .transactions-table td::before,
  .issue-table td::before,
  .factory-table td::before {
    flex: 0 0 88px;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 850;
    text-align: left;
  }

  .transactions-table td:last-child,
  .issue-table td:last-child,
  .factory-table td:last-child {
    border-bottom: 0;
  }

  .transactions-table th:nth-child(11),
  .transactions-table td:nth-child(11) {
    position: static;
    box-shadow: none;
  }

  .transactions-table td:nth-child(1)::before { content: "날짜"; }
  .transactions-table td:nth-child(2)::before { content: "구분"; }
  .transactions-table td:nth-child(3)::before { content: "상태"; }
  .transactions-table td:nth-child(4)::before { content: "품목"; }
  .transactions-table td:nth-child(5)::before { content: "업체명"; }
  .transactions-table td:nth-child(6)::before { content: "수량"; }
  .transactions-table td:nth-child(7)::before { content: "단가"; }
  .transactions-table td:nth-child(8)::before { content: "금액"; }
  .transactions-table td:nth-child(9)::before { content: "발행/미발행"; }
  .transactions-table td:nth-child(10)::before { content: "수정자"; }
  .transactions-table td:nth-child(11)::before { content: "작업"; }

  .issue-table td:nth-child(1)::before { content: "일자"; }
  .issue-table td:nth-child(2)::before { content: "업체"; }
  .issue-table td:nth-child(3)::before { content: "분류"; }
  .issue-table td:nth-child(4)::before { content: "품목"; }
  .issue-table td:nth-child(5)::before { content: "상태"; }
  .issue-table td:nth-child(6)::before { content: "판매수량"; }
  .issue-table td:nth-child(7)::before { content: "발행완료"; }
  .issue-table td:nth-child(8)::before { content: "미발행"; }
  .issue-table td:nth-child(9)::before { content: "작업"; }

  .factory-table td:nth-child(1)::before { content: "일자"; }
  .factory-table td:nth-child(2)::before { content: "품목"; }
  .factory-table td:nth-child(3)::before { content: "공장/처"; }
  .factory-table td:nth-child(4)::before { content: "수량"; }
  .factory-table td:nth-child(5)::before { content: "입력방식"; }
  .factory-table td:nth-child(6)::before { content: "메모"; }
  .factory-table td:nth-child(7)::before { content: "입력자"; }
  .factory-table td:nth-child(8)::before { content: "작업"; }

  .transactions-table td > *,
  .issue-table td > *,
  .factory-table td > * {
    min-width: 0;
  }

  .row-actions {
    justify-content: flex-end;
    width: 100%;
  }

  .mini-button {
    min-height: 36px;
    padding: 7px 10px;
  }

  .modal {
    width: 100dvw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .modal form {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding: calc(14px + env(safe-area-inset-top)) 12px calc(14px + env(safe-area-inset-bottom));
    overflow: auto;
  }

  .modal-header {
    position: sticky;
    top: calc(-14px - env(safe-area-inset-top));
    z-index: 3;
    margin: calc(-14px - env(safe-area-inset-top)) -12px 12px;
    padding: calc(14px + env(safe-area-inset-top)) 12px 12px;
    background: rgba(255, 255, 255, 0.98);
  }

  .modal-actions {
    position: sticky;
    bottom: calc(-14px - env(safe-area-inset-bottom));
    z-index: 3;
    margin: auto -12px calc(-14px - env(safe-area-inset-bottom));
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.98);
  }

  .modal-actions button {
    flex: 1 1 0;
  }

  .entry-section,
  .mode-section {
    padding: 12px;
  }

  .entry-grid,
  .buy-pricing-grid,
  .dollar-calculator-grid {
    gap: 10px;
  }

  .quick-entry-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

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

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

  .issue-quick-entry .quick-entry-grid > .field:nth-child(1),
  .issue-quick-entry .quick-entry-grid > .field:nth-child(3),
  .issue-quick-entry .quick-entry-grid > .field:nth-child(4),
  .issue-quick-entry .quick-entry-grid > .quick-counterparty-field {
    grid-column: span 1;
  }

  .quick-entry-grid .quick-counterparty-field {
    grid-column: span 2;
  }

  .issue-quick-entry .quick-entry-grid > .quick-counterparty-field,
  .issue-quick-entry .quick-submit-button {
    grid-column: span 2;
  }

  .quick-submit-button {
    grid-column: span 2;
    width: 100%;
  }

  .toast {
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    max-width: none;
  }
}

@media (max-width: 420px) {
  .ops-current-grid,
  .ops-xls-grid,
  .ops-xls-panel:first-child .ops-xls-grid {
    grid-template-columns: 1fr;
  }

  .ops-hero-figure strong {
    font-size: 40px;
  }

  .ops-panel header {
    align-items: flex-start;
    flex-direction: column;
  }

  .quick-entry-grid,
  .quick-entry-grid .quick-counterparty-field,
  .quick-entry-grid .field:nth-child(4),
  .quick-submit-button {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .issue-quick-entry .quick-entry-grid {
    grid-template-columns: 1fr;
  }

  .issue-quick-entry .quick-entry-grid > .field:nth-child(1),
  .issue-quick-entry .quick-entry-grid > .field:nth-child(3),
  .issue-quick-entry .quick-entry-grid > .field:nth-child(4),
  .issue-quick-entry .quick-entry-grid > .quick-counterparty-field,
  .issue-quick-entry .quick-submit-button {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .ops-sale-card {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 13px 11px;
  }

  .ops-sale-card .ops-qhead {
    align-items: flex-start;
  }

  .ops-sale-card .ops-qamount {
    grid-template-columns: auto 1fr;
    align-items: end;
    justify-items: start;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid #e1e8f0;
    border-radius: 8px;
    background: #ffffff;
  }

  .ops-sale-card .ops-qamount > span {
    grid-column: 1 / -1;
  }

  .ops-sale-card .ops-qamount > small {
    justify-self: end;
    align-self: center;
  }

  .ops-sale-card .ops-qamount b {
    font-size: 22px;
  }

  .ops-sale-card .ops-qactions {
    grid-template-columns: 0.7fr 1.3fr;
    gap: 8px;
  }

  .ops-sale-card .ops-qactions button {
    min-height: 42px;
  }

  .issue-target-grid {
    grid-template-columns: 1fr;
  }

  .issue-target-card header {
    align-items: flex-start;
  }

  .issue-fill-button {
    min-height: 44px;
  }
}

.market-ticker {
  display: flex;
  overflow-x: auto;
  padding: 7px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  scrollbar-width: none;
}

.market-ticker::-webkit-scrollbar {
  display: none;
}

.app-header .market-ticker {
  flex: 1 1 auto;
  justify-content: flex-start;
  min-width: 260px;
  max-width: 620px;
  padding: 0;
  border-bottom: 0;
  background: transparent;
}

.app-header .ticker-track {
  gap: 16px;
}

.ticker-track {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.ticker-item {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
}

.ticker-label {
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 900;
}

.gold-label {
  background: var(--amber-soft);
  color: var(--amber-dark);
}

.silver-label {
  background: var(--surface-strong);
  color: var(--muted-strong);
}

.ticker-price {
  color: var(--heading);
  font-family: var(--num-font);
  font-size: 14px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.ticker-change {
  font-size: 11px;
  font-weight: 850;
}

.ticker-change.up {
  color: var(--red);
}

.ticker-change.down {
  color: var(--blue);
}

.ticker-change.neutral {
  color: var(--muted);
}

.entry-section-title-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tab svg {
  display: none;
}

.md-ticks {
  display: none;
}

@media (max-width: 720px) {
  :root {
    --md-primary: #2f6af0;
    --md-primary-deep: #1f52cf;
    --md-primary-soft: #eaf1fe;
    --md-buy: #e23b3b;
    --md-buy-deep: #c42b2b;
    --md-buy-soft: #fdebeb;
    --md-gold: #e0a82e;
    --md-silver: #8794a2;
    --md-ink: #0f1722;
    --md-text: #1c2733;
    --md-muted: #76838f;
    --md-muted2: #9caab6;
    --md-surface: #ffffff;
    --md-surface2: #f5f7fa;
    --md-line: #ecf0f4;
    --md-line2: #dde4ec;
    --md-page: #f3f5f8;
    --md-radius: 15px;
    --md-shadow: 0 1px 2px rgba(20, 30, 48, 0.04), 0 6px 18px -10px rgba(20, 30, 48, 0.14);
  }

  html {
    scroll-padding-top: 0;
  }

  body {
    background: var(--md-page);
  }

  .app-header {
    position: static;
    padding: 13px 16px 10px;
    border-bottom: 0;
    background: var(--md-page);
    box-shadow: none;
  }

  .brand-home .eyebrow {
    color: var(--md-primary);
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  .brand-home h1 {
    color: var(--md-ink);
    font-size: 18px;
    letter-spacing: -0.02em;
  }

  .header-actions {
    width: 100%;
    gap: 8px;
  }

  .status-pill,
  .user-pill,
  .edit-toggle {
    min-height: 32px;
    font-size: 11.5px;
  }

  .tabbar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    display: flex;
    gap: 0;
    overflow: visible;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--md-line);
    border-bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 -8px 28px rgba(20, 30, 48, 0.07);
    backdrop-filter: blur(12px);
  }

  .tab {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    min-height: auto;
    padding: 6px 1px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--md-muted2);
    font-size: 10px;
    font-weight: 750;
    line-height: 1.1;
    white-space: nowrap;
  }

  .tab svg {
    display: block;
    width: 21px;
    height: 21px;
    stroke-width: 1.9;
  }

  .tab.active {
    border-color: transparent;
    background: transparent;
    color: var(--md-primary);
    box-shadow: none;
  }

  .tab.active svg {
    stroke-width: 2.35;
  }

  .app-main {
    padding: 6px 14px calc(88px + env(safe-area-inset-bottom));
  }

  .market-ticker {
    display: none;
  }

  .ops-dashboard {
    gap: 13px;
  }

  .ops-actionbar {
    position: sticky;
    top: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    margin: 0 -14px;
    padding: 8px 14px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: none;
    scrollbar-width: none;
  }

  .ops-actionbar::-webkit-scrollbar {
    display: none;
  }

  .ops-btn {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 8px 12px;
    border-color: var(--md-line2);
    border-radius: 999px;
    background: var(--md-surface);
    box-shadow: var(--md-shadow);
    color: var(--md-text);
    font-size: 12px;
  }

  .ops-btn.primary {
    border-color: var(--md-primary);
    background: var(--md-primary);
    color: #ffffff;
  }

  .ops-btn span {
    display: none;
  }

  .md-ticks {
    display: grid;
    gap: 9px;
    margin: 2px 0 14px;
  }

  .md-ticks-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2px;
  }

  .md-ticks-head b {
    color: var(--md-ink);
    font-size: 15px;
    font-weight: 850;
    letter-spacing: -0.02em;
  }

  .md-ticks-head span {
    padding: 3px 9px;
    border: 1px solid var(--md-line);
    border-radius: 999px;
    background: var(--md-surface2);
    color: var(--md-muted);
    font-size: 9.5px;
    font-weight: 750;
  }

  .md-ticks-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 11px;
  }

  .md-tick {
    padding: 12px 13px 8px;
    border: 1px solid var(--md-line);
    border-radius: var(--md-radius);
    background: var(--md-surface);
    box-shadow: var(--md-shadow);
  }

  .md-tick .tr,
  .md-tick .pr {
    display: flex;
    align-items: center;
  }

  .md-tick .tr {
    gap: 7px;
  }

  .md-tick .coin {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    border-radius: 50%;
    color: #ffffff;
    font-size: 11px;
    font-weight: 850;
  }

  .md-tick .coin.g {
    background: linear-gradient(140deg, #f0c75b, var(--md-gold));
  }

  .md-tick .coin.s {
    background: linear-gradient(140deg, #aeb9c4, var(--md-silver));
  }

  .md-tick .tr b {
    color: var(--md-ink);
    font-size: 13px;
    font-weight: 760;
  }

  .md-tick .pair {
    margin-left: auto;
    color: var(--md-muted2);
    font-size: 9.5px;
    font-weight: 750;
    letter-spacing: 0.02em;
  }

  .md-tick .pr {
    justify-content: space-between;
    margin-top: 9px;
  }

  .md-tick .v {
    color: var(--md-ink);
    font-family: var(--num-font);
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -0.02em;
  }

  .md-tick .c {
    font-size: 11.5px;
    font-weight: 850;
  }

  .md-tick .c.up {
    color: var(--md-buy);
  }

  .md-tick .c.dn {
    color: var(--md-primary);
  }

  .md-tick .c.neutral {
    color: var(--md-muted);
  }

  .md-tick .tspark {
    display: block;
    width: 100%;
    margin-top: 6px;
  }

  .ops-dashboard-shell,
  .ops-dashboard-main {
    display: grid;
    gap: 13px;
  }

  .ops-hero {
    display: grid;
    gap: 12px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .ops-stock-primary,
  .ops-hero-side,
  .ops-hero-main {
    padding: 16px;
    border: 1px solid var(--md-line);
    border-radius: 20px;
    background: var(--md-surface);
    box-shadow: var(--md-shadow);
  }

  .ops-hero-main {
    border-bottom: 1px solid var(--md-line);
  }

  .ops-hero-rollup {
    margin-top: 10px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .ops-hero-heading {
    margin-bottom: 10px;
    color: var(--md-muted);
    font-size: 12px;
  }

  .ops-hero-heading span {
    color: var(--md-gold);
  }

  .ops-stock-primary .ops-hero-heading span {
    color: var(--md-buy);
  }

  .ops-hero-figure strong {
    color: var(--md-ink);
    font-size: clamp(40px, 13.5vw, 52px);
    letter-spacing: -0.04em;
  }

  .ops-hero-figure em {
    color: var(--md-muted);
  }

  .ops-stock-delta {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12.5px;
  }

  .ops-stock-formula {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
  }

  .ops-stock-formula i {
    display: none;
  }

  .ops-stock-formula span {
    min-width: 0;
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: var(--md-surface2);
  }

  .ops-stock-formula .current {
    grid-column: 1 / -1;
    border: 1px solid rgba(47, 106, 240, 0.24);
    background: var(--md-primary-soft);
  }

  .ops-cost-row,
  .ops-rollup-row {
    gap: 8px;
  }

  .ops-cost-row b,
  .ops-rollup-row b {
    font-size: 15px;
  }

  .ops-cost-row small {
    display: block;
    margin-top: 2px;
    color: var(--md-muted);
    font-size: 11px;
  }

  .ops-section-label {
    margin-top: 5px;
  }

  .ops-metal-section {
    padding: 13px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.64);
  }

  .ops-metal-tab {
    min-width: 76px;
    margin: 0 0 12px;
    border-radius: 999px;
  }

  .ops-cols {
    gap: 12px;
  }

  .ops-panel {
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--md-line);
    border-radius: var(--md-radius);
    background: var(--md-surface);
    box-shadow: var(--md-shadow);
  }

  .ops-panel header {
    padding: 14px 15px 12px;
  }

  .ops-panel header span {
    color: var(--md-muted);
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  .ops-panel h3 {
    font-size: 15px;
  }

  .ops-panel-total b {
    font-size: 20px;
  }

  .ops-queue {
    padding: 0 11px 11px;
  }

  .ops-qitem,
  .ops-sale-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--md-line);
    border-radius: var(--md-radius);
    background: var(--md-surface);
    box-shadow: var(--md-shadow);
  }

  .ops-sale-card {
    padding: 14px 13px 13px 17px;
  }

  .ops-sale-card::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: linear-gradient(#f0c75b, var(--md-gold));
  }

  .ops-metal-section.silver .ops-sale-card::before {
    background: linear-gradient(#aeb9c4, var(--md-silver));
  }

  .ops-sale-card .ops-qmain strong {
    color: var(--md-ink);
    font-size: 16px;
  }

  .ops-sale-card .ops-qmain small {
    color: var(--md-muted);
    white-space: normal;
  }

  .ops-sale-card .ops-qtag.unissued {
    background: var(--md-primary-soft);
    color: var(--md-primary-deep);
  }

  .ops-sale-card .ops-qtag.partial {
    background: var(--md-buy-soft);
    color: var(--md-buy-deep);
  }

  .ops-sale-card .ops-qamount {
    padding: 11px 13px;
    border: 0;
    border-radius: 12px;
    background: var(--md-surface2);
  }

  .ops-sale-card .ops-qamount > span {
    color: var(--md-primary);
  }

  .ops-sale-card .ops-qamount b {
    color: var(--md-ink);
    font-size: 24px;
  }

  .ops-sale-card .ops-qprogress i {
    background: var(--md-primary);
  }

  .ops-sale-card .ops-qactions button {
    min-height: 42px;
    border-color: var(--md-line2);
    border-radius: 11px;
    background: var(--md-surface);
    color: var(--md-muted);
  }

  .ops-sale-card .ops-qactions button.complete {
    border-color: var(--md-primary);
    background: var(--md-primary);
    color: #ffffff;
  }

  .ops-qitem .ops-qtag.buy {
    background: var(--md-buy-soft);
    color: var(--md-buy-deep);
  }

  .ops-match-row {
    grid-template-columns: 1fr;
    border-radius: var(--md-radius);
  }

  .ops-match-card,
  .ops-match-diff,
  .ops-match-maturity {
    min-height: auto;
    padding: 13px 15px;
  }

  .ops-match-card b,
  .ops-match-diff-main b {
    font-size: 20px;
  }

  #issueDialog.modal {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: none;
    height: auto;
    max-height: 88dvh;
    margin: 0;
    border: 0;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -18px 44px -10px rgba(15, 23, 34, 0.32);
  }

  #issueDialog.modal form {
    min-height: auto;
    max-height: 88dvh;
    padding: 10px 14px calc(16px + env(safe-area-inset-bottom));
    overflow: auto;
  }

  #issueDialog .modal-header {
    top: -10px;
    margin: -10px -14px 12px;
    padding: 14px 14px 12px;
    border-radius: 24px 24px 0 0;
  }

  #issueDialog .modal-actions {
    margin: auto -14px calc(-16px - env(safe-area-inset-bottom));
    padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  }

  #issueDialog .issue-fill-button,
  #issueDialog .primary-button {
    border-color: var(--md-primary);
    background: var(--md-primary);
    color: #ffffff;
  }

  #issueDialog .issue-target-card .highlight b {
    color: var(--md-primary-deep);
  }
}

/* === A/B pass 2026-06-08: 에러 배너 · 되돌리기 바 · 확인 모달 · 현황 박스 정리 === */

/* B7: 저장 실패 고정 배너 */
.error-banner {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #f0b4ab;
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}
.error-banner[hidden] { display: none; }
.error-banner-text { flex: 1 1 auto; min-width: 0; }
.error-banner-close {
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid rgba(180, 35, 24, 0.35);
  border-radius: 6px;
  background: #ffffff;
  color: var(--red);
  font-weight: 900;
  cursor: pointer;
}
.error-banner-close:hover { background: #fff0ed; }

/* B8: 삭제 되돌리기 바 */
.undo-bar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 22;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(460px, calc(100vw - 32px));
  padding: 10px 12px 10px 15px;
  border: 1px solid #2f3b4b;
  border-radius: 10px;
  background: #101828;
  color: #ffffff;
  box-shadow: var(--shadow-md);
  font-size: 13px;
}
.undo-bar[hidden] { display: none; }
.undo-bar-text { flex: 1 1 auto; min-width: 0; }
.undo-bar-button {
  flex: 0 0 auto;
  padding: 6px 13px;
  border: 1px solid #d7a43f;
  border-radius: 7px;
  background: transparent;
  color: #f3c970;
  font-weight: 900;
  cursor: pointer;
}
.undo-bar-button:hover { background: rgba(215, 164, 63, 0.16); }

/* A4: 확인 모달 메시지 (줄바꿈 유지) */
.confirm-message {
  margin: 4px 0 18px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.55;
  white-space: pre-line;
}

/* A2: 현황 패널 박스 느낌 완화 (색은 유지, 내부 구분선만 연하게) */
.ops-rollup-card h4 { border-right-color: rgba(178, 190, 204, 0.32); }
.ops-rollup-row { border-top-color: rgba(180, 194, 209, 0.45); }


/* 발행 다이얼로그: 선확정 판매 금/은 토글 */
.issue-metal-toggle {
  display: inline-flex;
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.issue-metal-toggle button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 18px;
  border: 0;
  background: var(--surface);
  color: var(--muted-strong);
  font-weight: 850;
  cursor: pointer;
}
.issue-metal-toggle button + button { border-left: 1px solid var(--line); }
.issue-metal-toggle button.active { background: var(--gold); color: var(--gold-deep); }
.issue-metal-toggle button[data-issue-metal="silver"].active { background: var(--silver); color: var(--muted-strong); }


/* 거래내역: 선확정 통합 선택 */
.transactions-table th.merge-col,
.transactions-table td.merge-col { width: 34px; text-align: center; padding-left: 6px; padding-right: 6px; }
.merge-check { width: 16px; height: 16px; cursor: pointer; accent-color: var(--blue); }


/* 선확정 탭: 품목 세그먼트 필터 */
.seg-group { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg-btn { padding: 7px 16px; border: 0; background: var(--surface); color: var(--muted-strong); font-weight: 850; cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.active { background: var(--blue); color: #ffffff; }

/* === 거래내역 통합 원장 UX (Claude 2026-06-09) === */
.ledger-issue-row { background: #f4f8fc; }
.transactions-table .ledger-issue-row td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
.ledger-factory-row { background: #f7fbff; }
.transactions-table .ledger-factory-row td:first-child { box-shadow: inset 3px 0 0 var(--blue-dark); }

@media (max-width: 720px) {
  .ledger-table thead { display: none; }
  .ledger-table,
  .ledger-table tbody { display: block; width: 100%; }
  .ledger-table tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin: 0 0 10px;
    padding: 8px 12px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }
  .ledger-table tr.ledger-issue-row { background: #f4f8fc; }
  .ledger-table tr.ledger-factory-row { background: #f7fbff; }
  .ledger-table td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    border: 0;
    padding: 5px 0;
    text-align: right;
  }
  .ledger-table td::before {
    content: attr(data-label);
    color: var(--muted-strong);
    font-weight: 800;
    font-size: 12px;
    text-align: left;
    white-space: nowrap;
  }
  .ledger-table td.merge-col { display: none; }
  .ledger-table td .row-muted { text-align: right; }
  .ledger-table td .row-actions { justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
  .transactions-table .ledger-issue-row td:first-child,
  .transactions-table .ledger-factory-row td:first-child { box-shadow: none; }
}

/* === 거래내역 UI/UX pass 2026-06-10 === */
.ledger-control-card {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), var(--shadow-hairline);
}

.ledger-search-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(150px, .36fr) minmax(150px, .36fr) auto auto;
  gap: 10px;
  align-items: end;
}

.ledger-search-row label,
.ledger-advanced-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 900;
}

.ledger-search-row input,
.ledger-advanced-grid select {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #ffffff;
  color: var(--heading);
  font-size: 13px;
  font-weight: 750;
}

.ledger-search-field input {
  font-size: 14px;
}

.ledger-advanced-filter {
  border-top: 1px solid #e7edf3;
  padding-top: 10px;
}

.ledger-advanced-filter summary {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.ledger-advanced-filter summary::-webkit-details-marker {
  display: none;
}

.ledger-advanced-filter[open] summary {
  border-color: rgba(43, 93, 132, .3);
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.ledger-advanced-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.ledger-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 28px;
}

.ledger-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid #d9e2ec;
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
}

.ledger-chip span {
  color: var(--muted);
  font-weight: 750;
}

.ledger-chip strong {
  color: var(--heading);
  font-weight: 900;
}

.ledger-chip em {
  color: var(--muted);
  font-style: normal;
  font-weight: 950;
}

.ledger-chip.muted {
  cursor: default;
  background: var(--surface-soft);
}

.ledger-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.ledger-summary-card {
  display: grid;
  gap: 5px;
  min-height: 88px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), var(--shadow-hairline);
}

.ledger-summary-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.ledger-summary-card strong {
  color: var(--heading);
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.ledger-summary-card small {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 750;
}

.ledger-summary-card.primary { border-left-color: var(--amber); }
.ledger-summary-card.sell { border-left-color: var(--green); }
.ledger-summary-card.buy { border-left-color: var(--blue); }
.ledger-summary-card.issue { border-left-color: #d07813; }

.ledger-aggregate-panel {
  margin-bottom: 12px;
  border: 1px solid var(--amber-line);
  border-radius: 8px;
  background: var(--amber-soft);
}

.ledger-aggregate-panel summary {
  padding: 10px 13px;
  color: var(--amber-dark);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.ledger-aggregate-list {
  display: grid;
  gap: 1px;
  padding: 0 10px 10px;
}

.ledger-aggregate-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .72);
}

.ledger-aggregate-item strong,
.ledger-aggregate-item b,
.ledger-aggregate-item small {
  font-variant-numeric: tabular-nums;
}

.ledger-aggregate-item strong {
  display: block;
  color: var(--heading);
  font-size: 13px;
}

.ledger-aggregate-item span {
  color: var(--muted);
  font-size: 12px;
}

.ledger-aggregate-item b {
  color: var(--heading);
  white-space: nowrap;
}

.ledger-aggregate-item small {
  color: var(--muted-strong);
  white-space: nowrap;
}

.ledger-actionbar {
  position: sticky;
  top: 112px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .95);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.ledger-actionbar-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.ledger-actionbar-tools .ledger-filter-chips {
  justify-content: flex-end;
  flex: 1 1 auto;
  min-width: 0;
}

.ledger-actionbar-tools .secondary-button {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12px;
  white-space: nowrap;
}

.ledger-actionbar strong {
  color: var(--heading);
  font-size: 13px;
  font-weight: 950;
}

.ledger-actionbar span:not(.badge) {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.chip-icon {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin-left: -2px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
}

.transactions-table .type-chip,
.transactions-table .status-chip {
  gap: 5px;
  border-radius: 999px;
}

.transactions-table .type-issue {
  border: 1px solid #efcda4;
  background: #fff5e8;
  color: #9a5108;
}

.transactions-table .status-deleted {
  background: #f4f4f5;
  color: #6b7280;
}

.transactions-table .status-buyCompleted {
  background: var(--green-soft);
  color: var(--green);
}

@media (min-width: 721px) {
  .transactions-shell {
    max-height: calc(100vh - 220px);
    overflow: auto;
    border-radius: 8px;
  }

  .ledger-table {
    min-width: 1180px;
    border-collapse: separate;
    border-spacing: 0;
  }

  .ledger-table th {
    top: 0;
    z-index: 3;
    height: 42px;
    border-bottom: 1px solid var(--line-strong);
    background: #eef3f7;
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 950;
  }

  .ledger-table .ledger-filter-row th {
    top: 42px;
    z-index: 3;
    height: 48px;
    padding: 6px 8px;
    border-bottom: 1px solid #d4dde7;
    background: #f8fafc;
  }

  .ledger-filter-row input,
  .ledger-filter-row select {
    width: 100%;
    min-height: 30px;
    padding: 4px 7px;
    border: 1px solid #c7d3df;
    border-radius: 6px;
    background: #ffffff;
    color: var(--heading);
    font-size: 12px;
    font-weight: 750;
  }

  .ledger-filter-row input[type="date"] {
    min-width: 0;
    font-size: 11px;
  }

  .ledger-date-range,
  .ledger-filter-stack {
    display: grid;
    gap: 4px;
    min-width: 0;
  }

  .ledger-date-range {
    grid-template-columns: 1fr;
  }

  .ledger-table td {
    min-height: 54px;
    padding: 12px 14px;
    border-bottom: 1px solid #e6edf4;
    background: #ffffff;
    font-size: 13px;
    vertical-align: middle;
  }

  .ledger-table tbody tr:nth-child(even) td {
    background: #fbfcfe;
  }

  .ledger-table tbody tr:hover td {
    background: #f4f8fb;
  }

  .ledger-table tbody tr.ledger-issue-row td {
    background: #f4f8fc;
  }

  .ledger-table tbody tr.ledger-issue-row:hover td {
    background: #edf5fb;
  }

  .ledger-table tbody tr.ledger-factory-row td {
    background: #f7fbff;
  }

  .ledger-table tbody tr.ledger-factory-row:hover td {
    background: #eef7ff;
  }

  .ledger-table th.merge-col,
  .ledger-table td.merge-col {
    position: sticky;
    left: 0;
    z-index: 5;
    width: 40px;
    min-width: 40px;
    box-shadow: 1px 0 0 #e1e8ef;
  }

  .ledger-table th:nth-child(2),
  .ledger-table td:nth-child(2) {
    position: sticky;
    left: 40px;
    z-index: 4;
    min-width: 112px;
    box-shadow: 1px 0 0 #e1e8ef;
  }

  .ledger-table th.merge-col,
  .ledger-table th:nth-child(2),
  .ledger-table .ledger-filter-row th:nth-child(2) {
    z-index: 7;
  }

  .ledger-table .number {
    font-family: var(--num-font);
    font-variant-numeric: tabular-nums;
  }

  .ledger-table .amount-cell strong {
    white-space: nowrap;
  }

  .ledger-table .row-actions {
    display: inline-flex;
    justify-content: flex-end;
    gap: 6px;
    min-width: 164px;
  }

  .ledger-table .row-actions .mini-button {
    min-width: 44px;
  }
}

@media (max-width: 1100px) {
  .ledger-search-row {
    grid-template-columns: minmax(240px, 1fr) repeat(2, minmax(130px, .4fr));
  }

  .ledger-search-row > button {
    grid-column: span 1;
  }

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

@media (max-width: 720px) {
  .ledger-control-card {
    padding: 12px;
    border-radius: 15px;
  }

  .ledger-search-row,
  .ledger-advanced-grid,
  .ledger-summary-grid {
    grid-template-columns: 1fr;
  }

  .ledger-actionbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .ledger-actionbar span:not(.badge) {
    display: block;
    margin: 3px 0 0;
  }

  .ledger-aggregate-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .ledger-table td {
    min-height: 34px;
  }

  .ledger-table td[data-label="업체명"],
  .ledger-table td[data-label="작업"] {
    align-items: flex-start;
  }
}

/* 매입·달러 탭: 넓은 매입 테이블이 우측 달력 패널을 침범하지 않도록 격리 */
.purchase-dollar-layout,
.purchase-dollar-main,
.purchase-dollar-side,
.purchase-dollar-main .pd-panel,
.purchase-dollar-side .pd-panel,
.purchase-dollar-main .table-shell,
.purchase-dollar-side .table-shell {
  min-width: 0;
  max-width: 100%;
}

.purchase-dollar-main .table-shell {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
}

.purchase-dollar-side .table-shell {
  overflow-x: auto;
}

.purchase-dollar-table {
  width: max-content;
  min-width: 940px;
}

.purchase-dollar-table th,
.purchase-dollar-table td {
  white-space: nowrap;
}

/* Compact confirmed sales lists */
.ops-sale-card {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px 10px;
  min-height: 48px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px dashed #d9d0bf;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.ops-sale-card:hover {
  background: #fffdf8;
}

.ops-sale-card.partial {
  border-color: #d9d0bf;
  background: transparent;
}

.ops-sale-card .ops-qtag {
  min-width: 42px;
  padding: 4px 7px;
  border: 1px solid #d7aa48;
  border-radius: 6px;
  background: #fff8dd;
  color: #8a6010;
  text-align: center;
}

.ops-sale-card .ops-qtag.group-b2b {
  border-color: #8fb7dd;
  background: #eef6ff;
  color: #1f5d8b;
}

.ops-sale-card .ops-qtag.group-special {
  border-color: #d7aa48;
  background: #fff4d7;
  color: #8a6010;
}

.ops-sale-card .ops-qtag.group-silver {
  border-color: #b9c7d4;
  background: #f3f6f8;
  color: #45586b;
}

.ops-sale-card .ops-qtag.partial {
  border-color: #aebfd1;
  background: #f4f7fa;
  color: var(--muted-strong);
}

.ops-sale-card .ops-qmain strong {
  font-size: 13.5px;
  font-weight: 900;
}

.ops-sale-card .ops-qmain small {
  margin-top: 2px;
  font-size: 11.5px;
}

.ops-sale-card > b {
  justify-self: end;
  color: var(--heading);
  font-size: 14.5px;
}

.ops-sale-card > b small {
  font-size: 10.5px;
}

.ops-sale-card .ops-qamount,
.ops-sale-card .ops-qprogress {
  display: none;
}

.ops-sale-card .ops-qactions {
  grid-column: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ops-sale-card .ops-qactions button {
  min-width: 42px;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
}

.ops-sale-card .ops-qactions button.complete {
  border-color: #d7aa48;
  background: #fff8dd;
  color: #8a6010;
}

.confirmed-sales-shell {
  overflow: hidden;
  border: 1px solid #d2dce7;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), var(--shadow-hairline);
}

.confirmed-sales-shell > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #d7e0ea;
  background: #fbfcfe;
}

.confirmed-sales-shell > header span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.confirmed-sales-shell > header h3 {
  margin: 2px 0 0;
  color: var(--heading);
  font-size: 16px;
  font-weight: 950;
}

.confirmed-sales-shell > header strong {
  color: var(--amber-dark);
  font-family: var(--num-font);
  font-size: 22px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.confirmed-sales-list {
  display: grid;
  gap: 0;
  padding: 6px 12px 10px;
}

.confirmed-sale-row {
  grid-template-columns: 20px auto minmax(0, 1fr) auto auto auto;
}

.confirmed-sale-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.confirmed-sale-row .metal-chip {
  justify-self: end;
}

.confirmed-sale-row .ops-qactions button {
  min-width: 42px;
}

@media (max-width: 720px) {
  .ops-sale-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 46px;
    padding: 8px 4px;
  }

  .ops-sale-card .ops-qactions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .confirmed-sale-row {
    grid-template-columns: 20px auto minmax(0, 1fr) auto;
  }

  .confirmed-sale-row .metal-chip {
    display: none;
  }

.confirmed-sale-row > b {
    grid-column: 4;
  }

  .confirmed-sales-shell > header {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Ledger table: Excel-like header filters and tighter operator columns */
.ledger-head-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.ledger-head-cell > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-head-filter {
  position: relative;
  flex: 0 0 auto;
}

.ledger-head-filter[open] {
  z-index: 90;
}

.ledger-head-filter summary {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #aeb9c4;
  border-radius: 2px;
  background: #f7fafc;
  color: #516173;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  list-style: none;
}

.ledger-head-filter summary::-webkit-details-marker {
  display: none;
}

.ledger-head-filter.is-active summary {
  border-color: #9b6d13;
  background: #fff8dd;
  color: #8a6010;
}

.ledger-filter-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 100;
  display: grid;
  gap: 8px;
  width: max-content;
  min-width: 176px;
  max-width: 260px;
  padding: 9px;
  border: 1px solid #b8c4d0;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(16, 24, 40, 0.16);
}

.ledger-filter-menu label {
  display: grid;
  gap: 5px;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 900;
}

.ledger-sort-menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e3eaf1;
}

.ledger-sort-menu button {
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid #c7d3df;
  border-radius: 5px;
  background: #f8fafc;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.1;
  cursor: pointer;
}

.ledger-sort-menu button.is-active {
  border-color: #9b6d13;
  background: #fff8dd;
  color: #8a6010;
}

.ledger-filter-menu input,
.ledger-filter-menu select {
  width: 100%;
  min-height: 31px;
  padding: 5px 8px;
  border: 1px solid #c7d3df;
  border-radius: 5px;
  background: #ffffff;
  color: var(--heading);
  font-size: 12px;
  font-weight: 750;
}

.ledger-filter-menu input[type="date"] {
  min-width: 146px;
}

.ledger-counterparty-cell strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-item-inline {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  gap: 3px;
  white-space: nowrap;
}

.ledger-item-separator {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.ledger-item-category {
  min-width: 0;
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 11.5px;
  font-weight: 800;
  text-overflow: ellipsis;
}

.ledger-actor-cell {
  color: var(--muted-strong);
  font-size: 11.5px;
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
}

.ledger-actor-name,
.ledger-actor-empty {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  min-height: 1em;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

@media (min-width: 721px) {
  .transactions-shell {
    overflow-x: auto;
    overflow-y: auto;
  }

  .ledger-table,
  .ledger-table thead,
  .ledger-table tr,
  .ledger-table th {
    overflow: visible;
  }

  .ledger-table th:has(.ledger-head-filter[open]) {
    z-index: 90 !important;
  }

  .ledger-table {
    min-width: 1140px;
  }

  .ledger-table .ledger-label-row th {
    height: 38px;
    padding: 7px 8px;
  }

  .ledger-table th:nth-child(2),
  .ledger-table td:nth-child(2) {
    width: 132px;
    min-width: 132px;
    white-space: nowrap;
  }

  .ledger-table th:nth-child(6),
  .ledger-table td:nth-child(6) {
    width: 114px;
    min-width: 114px;
    max-width: 114px;
  }

  .ledger-table th:nth-child(5),
  .ledger-table td:nth-child(5) {
    width: 88px;
    min-width: 88px;
    max-width: 88px;
  }

  .ledger-table th:nth-child(7),
  .ledger-table td:nth-child(7) {
    width: 74px;
    min-width: 74px;
    max-width: 74px;
  }

  .ledger-table th:nth-child(8),
  .ledger-table td:nth-child(8) {
    width: 112px;
    min-width: 112px;
    max-width: 112px;
  }

  .ledger-table th:nth-child(9),
  .ledger-table td:nth-child(9) {
    width: 96px;
    min-width: 96px;
    max-width: 96px;
  }

  .ledger-table th:nth-child(10),
  .ledger-table td:nth-child(10) {
    width: 110px;
    min-width: 110px;
    max-width: 110px;
  }

  .ledger-table th:nth-child(11),
  .ledger-table td:nth-child(11) {
    position: static;
    right: auto;
    z-index: auto;
    width: 76px;
    min-width: 76px;
    max-width: 76px;
    box-shadow: none;
    padding-right: 6px;
    padding-left: 6px;
    font-size: 11.5px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    background: #ffffff;
  }

  .ledger-table tbody tr:nth-child(even) td:nth-child(11) {
    background: #fbfcfe;
  }

  .ledger-table tbody tr:hover td:nth-child(11) {
    background: #f4f8fb;
  }

  .ledger-table tbody tr.ledger-issue-row td:nth-child(11) {
    background: #f4f8fc;
  }

  .ledger-table tbody tr.ledger-issue-row:hover td:nth-child(11) {
    background: #edf5fb;
  }

  .ledger-table tbody tr.ledger-factory-row td:nth-child(11) {
    background: #f7fbff;
  }

  .ledger-table tbody tr.ledger-factory-row:hover td:nth-child(11) {
    background: #eef7ff;
  }

  .ledger-table th:nth-child(12),
  .ledger-table td:nth-child(12) {
    position: static;
    right: auto;
    z-index: auto;
    width: 148px;
    min-width: 148px;
    max-width: 148px;
    padding-right: 8px;
    padding-left: 8px;
    background: var(--surface);
    box-shadow: none;
  }

  .ledger-table th:nth-child(12) {
    z-index: 3;
    background: #eef3f7;
  }

  .ledger-table tbody tr:nth-child(even) td:nth-child(12) {
    background: #fbfcfe;
  }

  .ledger-table tbody tr:hover td:nth-child(12) {
    background: #f4f8fb;
  }

  .ledger-table .row-actions {
    justify-content: center;
    flex-wrap: nowrap;
    gap: 4px;
    width: 100%;
    min-width: 0;
  }

  .ledger-table .row-actions .mini-button {
    min-width: 36px;
    min-height: 26px;
    padding: 3px 6px;
    border-radius: 7px;
    font-size: 11.5px;
    line-height: 1.1;
  }
}

@media (max-width: 720px) {
  .ledger-table td::before {
    content: attr(data-label) !important;
  }
}

/* ===================== 모바일 통합 셸 (≤720px) ===================== */
:root{
  --msh-navy:#0b3a86; --msh-navy-bright:#1763b6; --msh-navy-deep:#0a2a5e;
  --msh-navy-soft:#eaf1fb; --msh-navy-line:#d3e0f3;
  --msh-au:#b1851f; --msh-au-soft:#fbf4e3; --msh-au-line:#ecdcb4; --msh-silver:#6c7682;
  --msh-green:#127a51; --msh-green-soft:#e7f5ee; --msh-red:#d24a3d; --msh-red-soft:#fcecea; --msh-red-line:#f1c4be;
  --msh-warn:#946b00; --msh-warn-soft:#fbf2d8;
  --msh-ink:#16212e; --msh-sub:#5b6878; --msh-faint:#9aa6b4; --msh-line:#eaedf2; --msh-line2:#d8dee7;
}
.mobile-on .app-header,
.mobile-on .tabbar{ display:none !important; }
.mobile-on #app{ padding:0 !important; max-width:none !important; margin:0 !important; background:#eef1f6; min-height:100vh; padding-bottom:78px !important; }
.mobile-on .toast{ bottom:88px; }

#mobileNav{ display:none; }
.mobile-on #mobileNav{
  position:fixed; left:0; right:0; bottom:0; z-index:60; display:flex;
  background:var(--msh-navy-deep); padding:8px 6px calc(10px + env(safe-area-inset-bottom));
}
.msh-nav button{ flex:1; appearance:none; border:0; background:none; padding:6px 0 4px; display:flex; flex-direction:column; align-items:center; gap:5px;
  color:#9db4d6; font-size:11px; font-weight:700; cursor:pointer; position:relative; }
.msh-nav button svg{ width:23px; height:23px; }
.msh-nav button.on{ color:#fff; }
.msh-badge{ position:absolute; top:-3px; right:50%; margin-right:-20px; min-width:16px; height:16px; padding:0 4px; border-radius:9px;
  background:var(--msh-red); color:#fff; font-size:10px; font-weight:900; display:flex; align-items:center; justify-content:center;
  border:1.5px solid var(--msh-navy-deep); font-style:normal; }

.msh-top{ display:flex; align-items:center; gap:10px; padding:12px 16px; background:#fff; border-bottom:1px solid var(--msh-line);
  position:sticky; top:0; z-index:5; }
.msh-logo{ width:32px; height:32px; border-radius:9px; background:var(--msh-navy); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:900; font-size:14px; }
.msh-title small{ display:block; font-size:8.5px; letter-spacing:.16em; color:var(--msh-faint); font-weight:800; }
.msh-title b{ font-size:15px; }
.msh-role{ margin-left:auto; display:flex; align-items:center; gap:7px; font-size:11px; color:var(--msh-sub); font-weight:700;
  background:#f5f7fa; border:1px solid var(--msh-line2); border-radius:999px; padding:4px 6px 4px 11px; }
.msh-role b{ color:var(--msh-ink); }
.msh-ava{ width:24px; height:24px; border-radius:50%; background:var(--msh-navy); color:#fff; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:900; font-style:normal; }

.msh-screen{ padding:16px 15px 20px; }
.msh-ticks{ display:flex; gap:9px; margin-bottom:13px; }
.msh-tick{ flex:1; background:#fff; border:1px solid var(--msh-line); border-radius:13px; padding:11px 13px; }
.msh-tick .k{ font-size:10.5px; color:var(--msh-faint); font-weight:800; display:flex; align-items:center; gap:5px; }
.msh-tick .k i{ width:6px; height:6px; border-radius:50%; }
.msh-tick .v{ font-size:16px; font-weight:900; font-variant-numeric:tabular-nums; margin-top:3px; }
.msh-tick .v small{ font-size:10px; color:var(--msh-faint); font-weight:700; }
.msh-tick .v.au{ color:var(--msh-au); } .msh-tick .v.ag{ color:var(--msh-silver); }
.msh-hero{ background:#fff; border:1px solid var(--msh-navy-line); border-top:3px solid var(--msh-navy); border-radius:18px; padding:20px 18px 16px; text-align:center; margin-bottom:13px; }
.msh-hero .lab{ font-size:11.5px; color:var(--msh-navy); font-weight:800; display:inline-flex; align-items:center; gap:6px; }
.msh-hero .lab i{ width:6px; height:6px; border-radius:50%; background:var(--msh-navy); box-shadow:0 0 0 3px var(--msh-navy-soft); }
.msh-hero .big{ font-size:48px; font-weight:900; letter-spacing:-.035em; line-height:1.02; margin-top:6px; color:var(--msh-navy-deep); font-variant-numeric:tabular-nums; }
.msh-hero .big small{ font-size:18px; color:var(--msh-sub); font-weight:800; }
.msh-hero .delta{ display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:800; margin-top:7px; border-radius:999px; padding:4px 11px; }
.msh-hero .delta.up{ color:var(--msh-red); background:var(--msh-red-soft); border:1px solid var(--msh-red-line); }
.msh-hero .delta.down{ color:var(--msh-navy-bright); background:var(--msh-navy-soft); border:1px solid var(--msh-navy-line); }
.msh-twocol{ display:grid; grid-template-columns:1fr 1fr; gap:11px; margin-bottom:3px; }
.msh-stat{ background:#fff; border:1px solid var(--msh-line); border-radius:15px; padding:14px 15px; }
.msh-stat .k{ font-size:11.5px; color:var(--msh-faint); font-weight:800; }
.msh-stat .v{ font-size:24px; font-weight:900; font-variant-numeric:tabular-nums; margin-top:4px; letter-spacing:-.03em; }
.msh-stat .v small{ font-size:12px; color:var(--msh-sub); font-weight:800; }
.msh-stat.au .v{ color:var(--msh-au); } .msh-stat.silver .v{ color:var(--msh-silver); }
.msh-seclab{ font-size:11px; color:var(--msh-faint); font-weight:800; letter-spacing:.06em; margin:18px 3px 9px; display:flex; align-items:center; gap:8px; }
.msh-seclab b{ color:var(--msh-navy); }
.msh-seclab span{ flex:1; height:1px; background:var(--msh-line2); }
.msh-item{ display:flex; align-items:center; gap:12px; background:#fff; border:1px solid var(--msh-line); border-radius:14px; padding:13px 14px; margin-bottom:9px; }
.msh-item .av{ width:38px; height:38px; border-radius:10px; background:var(--msh-navy-soft); color:var(--msh-navy); display:flex; align-items:center; justify-content:center; font-weight:900; font-size:13px; flex:none; border:1px solid var(--msh-navy-line); }
.msh-item .nm{ flex:1; min-width:0; }
.msh-item .nm b{ font-size:14.5px; font-weight:800; display:block; }
.msh-item .nm small{ color:var(--msh-faint); font-weight:700; font-size:11.5px; }
.msh-item .kg{ font-weight:900; font-variant-numeric:tabular-nums; font-size:15px; text-align:right; }
.msh-item .kg small{ font-size:10.5px; color:var(--msh-faint); font-weight:700; }
.msh-item .arr{ color:var(--msh-line2); font-size:20px; font-weight:700; }
.msh-seg{ display:flex; gap:7px; margin-bottom:14px; }
.msh-seg button{ flex:1; appearance:none; border:1.5px solid var(--msh-line2); background:#fff; border-radius:11px; padding:13px 0; font-size:14px; font-weight:800; color:var(--msh-sub); cursor:pointer; }
.msh-seg button.on{ background:var(--msh-navy); border-color:var(--msh-navy); color:#fff; }
.msh-seg-sm button{ padding:10px 0; font-size:13px; }
.msh-fld{ margin-bottom:14px; }
.msh-fld label{ display:flex; align-items:center; gap:5px; font-size:12.5px; font-weight:800; color:var(--msh-sub); margin-bottom:7px; }
.msh-fld label em{ color:var(--msh-navy); font-style:normal; }
.msh-fld input{ width:100%; border:1.5px solid var(--msh-line2); border-radius:13px; padding:16px 15px; font-size:18px; font-weight:800; font-variant-numeric:tabular-nums; background:#fff; }
.msh-fld input:focus{ outline:0; border-color:var(--msh-navy); box-shadow:0 0 0 3px var(--msh-navy-soft); }
.msh-fld.amount input{ text-align:right; }
.msh-fld .unit{ position:relative; }
.msh-fld .unit span{ position:absolute; right:16px; top:50%; transform:translateY(-50%); color:var(--msh-faint); font-size:13px; font-weight:800; }
.msh-fld .unit input{ padding-right:48px; }
.msh-hint{ font-size:12px; color:var(--msh-faint); margin:-7px 3px 14px; font-weight:600; }
.msh-preview{ background:var(--msh-navy-soft); border:1px solid var(--msh-navy-line); border-radius:13px; padding:13px 15px; margin-bottom:16px; font-size:13px; color:var(--msh-navy-deep); }
.msh-preview b{ color:var(--msh-navy); }
.msh-btn{ width:100%; border:0; border-radius:14px; padding:18px; font-size:17px; font-weight:900; color:#fff; cursor:pointer; background:var(--msh-navy); }
.msh-btn:active{ background:var(--msh-navy-deep); }
.msh-btn.ghost{ background:#fff; color:var(--msh-sub); border:1.5px solid var(--msh-line2); }
.msh-card{ background:#fff; border:1px solid var(--msh-line); border-radius:15px; padding:14px 15px; margin-bottom:11px; }
.msh-card .top{ display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.msh-card .type{ font-size:10.5px; font-weight:900; border-radius:6px; padding:3px 9px; }
.msh-card .type.sell{ background:var(--msh-au-soft); color:var(--msh-au); }
.msh-card .type.issue{ background:var(--msh-green-soft); color:var(--msh-green); }
.msh-card .type.buy{ background:var(--msh-navy-soft); color:var(--msh-navy); }
.msh-card .who{ margin-left:auto; font-size:11px; color:var(--msh-faint); font-weight:700; }
.msh-card .nm{ font-size:16px; font-weight:900; }
.msh-card .meta{ font-size:12.5px; color:var(--msh-sub); font-weight:700; margin-top:3px; font-variant-numeric:tabular-nums; }
.msh-st{ font-size:11px; font-weight:900; border-radius:7px; padding:4px 10px; }
.msh-st.wait{ background:var(--msh-warn-soft); color:var(--msh-warn); }
.msh-st.ok{ background:var(--msh-green-soft); color:var(--msh-green); }
.msh-st.no{ background:var(--msh-red-soft); color:var(--msh-red); }
.msh-reason{ margin-top:9px; font-size:12px; font-weight:700; color:var(--msh-red); background:var(--msh-red-soft); border:1px solid var(--msh-red-line); border-radius:9px; padding:8px 11px; }
.msh-appr-actions{ display:flex; gap:10px; margin-top:13px; }
.msh-appr-actions button{ flex:1; appearance:none; border:0; border-radius:11px; padding:13px 0; font-size:15px; font-weight:900; cursor:pointer; }
.msh-appr-actions .ok{ background:var(--msh-navy); color:#fff; }
.msh-appr-actions .no{ background:#fff; border:1.5px solid var(--msh-red-line); color:var(--msh-red); }
.msh-viewonly{ font-size:11.5px; color:var(--msh-faint); font-weight:700; margin-top:10px; text-align:center; }
.msh-empty{ text-align:center; color:var(--msh-faint); font-weight:700; padding:40px 16px; }
.msh-empty.tight{ padding:22px 12px; }
.msh-empty .msh-btn{ max-width:200px; margin:14px auto 0; }
.msh-chips{ display:flex; flex-wrap:wrap; gap:7px; }
.msh-chip{ appearance:none; border:1.5px solid var(--msh-line2); background:#fff; border-radius:999px; padding:9px 13px; font-size:12.5px; font-weight:800; color:var(--msh-sub); cursor:pointer; }
.msh-chip.on{ background:var(--msh-navy-soft); border-color:var(--msh-navy); color:var(--msh-navy); }
.msh-fld input[readonly]{ background:#f5f7fa; color:var(--msh-sub); }
.settings-audit-changes{ display:flex; flex-wrap:wrap; gap:4px 8px; margin-top:4px; }
.audit-change{ font-size:11px; font-weight:700; color:var(--msh-sub, #5b6878); background:#f3f6fa; border:1px solid #e2e8f1; border-radius:6px; padding:2px 7px; font-variant-numeric:tabular-nums; }
.audit-change b{ color:#16212e; }
.update-banner{ position:fixed; left:50%; bottom:18px; transform:translateX(-50%); z-index:9999; display:flex; align-items:center; gap:14px;
  background:#0a2a5e; color:#fff; font-size:13px; font-weight:800; padding:12px 16px 12px 18px; border-radius:13px; box-shadow:0 14px 34px rgba(13,34,70,.3); }
.update-banner button{ appearance:none; border:0; border-radius:9px; padding:9px 16px; font-size:13px; font-weight:900; cursor:pointer; background:#fff; color:#0a2a5e; }
.data-refresh-banner{ background:#0f766e; box-shadow:0 14px 34px rgba(15,118,110,.24); }
.data-refresh-banner button{ color:#0f766e; }
.mobile-on .update-banner{ bottom:84px; }
#mobileBack{ display:none; }
.mobile-on #mobileBack{ position:fixed; left:12px; top:12px; z-index:55; display:inline-flex; align-items:center; gap:4px;
  appearance:none; border:1px solid var(--msh-line2); background:rgba(255,255,255,.95); color:var(--msh-navy);
  font-size:13px; font-weight:800; border-radius:999px; padding:8px 14px 8px 10px; box-shadow:0 4px 14px rgba(20,40,70,.14); cursor:pointer; backdrop-filter:blur(4px); }
.mobile-on #mobileBack svg{ width:18px; height:18px; }

@media (max-width: 980px) {
  .purchase-sim-summary,
  .purchase-sim-row {
    grid-template-columns: 1fr 1fr;
  }

  .purchase-sim-row-index {
    display: none;
  }
}

@media (max-width: 640px) {
  .purchase-sim-summary,
  .purchase-sim-row {
    grid-template-columns: 1fr;
  }
}
