/* Creator Studio: progressive presentation layer for the existing dashboard.
   Loaded after dashboard/index.html's inline styles. Login and API stay intact. */

#dash.studio-shell {
  --ink: #f6f8f7;
  --paper: #192a32;
  --surface: #fff;
  --surface-2: #f6f8f7;
  --brass: #2756e7;
  --brass-dim: #647fe4;
  --muted: #6e797e;
  --muted-2: #7c898e;
  --line: #e1e6e6;
  --line-strong: #d4dddd;
  --ok: #28664f;
  --warn: #8d651b;
  --serif: var(--sans);
  --studio-blue-pale: #eef2ff;
  --studio-green-pale: #eaf4ef;
  --studio-amber-pale: #fbf2df;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  background: #f6f8f7;
  background-image: none;
  color: #192a32;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: -.025em;
}

/* Never undo authentication, view, role, or native hidden state. */
#dash.hidden,
#dash .hidden,
#dash [hidden] {
  display: none !important;
}

#dash *,
#dash *::before,
#dash *::after {
  box-sizing: border-box;
}

#dash .studio-main,
#dash .studio-content,
#dash .menu-view,
#dash .studio-header-left,
#dash .brand,
#dash .who,
#dash .studio-nav-copy {
  min-width: 0;
}

#dash button,
#dash input,
#dash select,
#dash textarea {
  font-family: inherit;
  letter-spacing: inherit;
  max-width: 100%;
  -webkit-tap-highlight-color: transparent;
}

#dash input,
#dash select,
#dash textarea {
  min-width: 0;
  color: var(--paper);
  accent-color: var(--brass);
}

#dash img,
#dash video,
#dash canvas {
  max-width: 100%;
}

#dash svg {
  display: block;
  flex-shrink: 0;
}

#dash :is(button, a, input, select, textarea, summary, [tabindex], [contenteditable="true"]):focus-visible {
  outline: 3px solid #829cff;
  outline-offset: 3px;
}

#dash :is(input, select, textarea):focus {
  border-color: var(--brass);
}

#dash .studio-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Persistent desktop navigation. */
#dash .studio-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  z-index: 80;
  display: flex;
  flex-direction: column;
  width: 232px;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding: 29px 18px 20px;
  background: #fff;
  border-right: 1px solid var(--line);
  box-shadow: none;
}

#dash .studio-logo {
  display: block;
  flex-shrink: 0;
  padding: 0 12px 24px;
  color: var(--paper);
  text-decoration: none;
}

#dash .studio-wordmark {
  font-size: 19px;
  font-weight: 850;
  line-height: 1.35;
  letter-spacing: -.07em;
  white-space: nowrap;
}

#dash .studio-wordmark :is(i, em, span) {
  font-style: normal;
  color: var(--brass);
}

#dash .studio-logo-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .1em;
}

#dash .studio-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
  min-width: 0;
  margin: 0 5px 23px;
  padding: 14px 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

#dash .studio-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e6eada;
  color: #566647;
  font-size: 13px;
  font-weight: 700;
}

#dash .studio-identity > :last-child {
  min-width: 0;
}

#dash #studio-name,
#dash #studio-role {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#dash #studio-name {
  color: var(--paper);
  font-size: 13px;
  font-weight: 650;
}

#dash #studio-role {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

#dash .studio-nav {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  border: 0;
  background: transparent;
  scrollbar-width: thin;
  scrollbar-color: #d8dfdf transparent;
}

#dash .studio-nav::after {
  content: none;
  display: none;
  background: none;
}

#dash .studio-nav > .wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: visible;
}

#dash .studio-nav-label {
  padding: 0 13px 8px;
  color: #8a969b;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .08em;
}

#dash .studio-nav .menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 10px 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #657178;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  text-align: left;
  text-decoration: none;
  white-space: normal;
  transition: background-color .15s ease, color .15s ease;
}

#dash .studio-nav .menu-item:hover {
  background: #f6f8f8;
  color: var(--paper);
}

#dash .studio-nav .menu-item.active {
  background: var(--studio-blue-pale);
  color: var(--brass);
  font-weight: 700;
}

#dash .studio-nav-icon {
  display: grid;
  place-items: center;
  flex: 0 0 18px;
  width: 18px;
  height: 20px;
}

#dash .studio-nav-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.6;
}

#dash .studio-sidebar-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 22px 12px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

#dash .studio-sidebar-footer :is(p, small) {
  display: block;
  margin-top: 6px;
  font-size: 11px;
}

#dash .studio-sidebar-footer a {
  color: #536269;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

#dash .studio-nav-backdrop,
#dash .studio-nav-toggle {
  display: none;
}

/* Header stays in the content column, not across the sidebar. */
#dash .dashboard-header {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  background: #fff;
}

#dash .topbar {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

#dash .topbar > .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 76px;
  margin: 0;
  padding: 12px 42px;
}

#dash .studio-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
}

#dash .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

#dash .studio-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #8a959a;
  font-size: 12px;
}

#dash #studio-current-view {
  overflow: hidden;
  color: #536269;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#dash .who {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 1 auto;
  gap: 9px;
  width: auto;
  color: var(--muted);
  font-size: 12px;
}

#dash .who > span:first-child {
  min-width: 0;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#dash .who b {
  color: #536269;
  font-weight: 600;
}

#dash #who-ig {
  font-size: 11px;
}

#dash #act-as-sel {
  flex: 0 1 190px;
  width: auto;
  max-width: 190px !important;
  min-height: 34px;
  padding: 7px 9px !important;
  font-size: 12px !important;
  text-overflow: ellipsis;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

#dash .who :is(#pw-btn, #logout-btn) {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 10px !important;
  border-color: var(--line);
  font-size: 11px !important;
  white-space: nowrap;
}

/* Common, scoped surfaces. The login card's 420px maximum is untouched. */
#dash .studio-content {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 34px 42px 52px;
}

#dash .card {
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: none;
}

#dash :is(.card, .settle-card) h1 {
  margin: 0 0 9px;
  font-family: var(--sans);
  font-size: 29px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -.05em;
}

#dash :is(.card, .settle-card) h2 {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -.04em;
}

#dash :is(.card, .settle-card) h3 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.03em;
}

#dash .head,
#dash .studio-page-head {
  padding: 0;
  margin-bottom: 25px;
}

#dash .studio-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

#dash .studio-page-head h1,
#dash .head h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: 30px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -.055em;
  word-break: keep-all;
}

#dash .studio-eyebrow {
  margin-bottom: 8px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
}

#dash .desc,
#dash .head .desc,
#dash .studio-page-head p:not(.studio-eyebrow) {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

#dash .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid var(--brass);
  border-radius: 7px;
  background: var(--brass);
  color: #fff;
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: normal;
  transition: background-color .15s ease, border-color .15s ease;
}

#dash .btn:hover {
  filter: none;
  background: #204bd0;
  border-color: #204bd0;
}

#dash .btn.ghost {
  border-color: var(--line);
  background: #fff;
  color: #536269;
}

#dash .btn.ghost:hover {
  border-color: #c9d3d3;
  background: #f6f8f7;
}

#dash .btn:disabled {
  opacity: .48;
  cursor: not-allowed;
}

#dash .btn.sm {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 11px;
}

#dash .btn svg {
  width: 15px;
  height: 15px;
}

#dash :is(.card input[type=email], .card input[type=text], .card input[type=password], .mp-f input, .mp-f select, .mp-f textarea, input[type=month], input[type=number], .search input) {
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--paper);
  font-size: 13px;
}

#dash :is(input, select, textarea):disabled {
  color: #819096;
  background: #f5f7f6;
}

#dash label,
#dash .mp-f {
  color: #5a6b73;
  font-size: 12px;
  font-weight: 500;
}

#dash .mp-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 16px;
}

#dash .mp-f {
  min-width: 0;
  gap: 7px;
  margin-bottom: 0;
}

#dash .mp-f :is(input, select, textarea) {
  width: 100%;
}

#dash .msg {
  overflow-wrap: anywhere;
}

#dash .msg.info {
  border: 1px solid #dfe6f4;
  background: #f1f4fa;
  color: #536a8c;
}

#dash .msg.err {
  border: 1px solid #efd8db;
  background: #fcf0f1;
  color: #ae4551;
}

#dash .msg.ok {
  border: 1px solid #d4e6dc;
  background: var(--studio-green-pale);
  color: var(--ok);
}

/* Monthly overview and real finance states. */
#dash .studio-report-tools.card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 23px;
  padding: 16px 20px;
}

#dash .studio-report-tools label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

#dash .studio-report-tools input[type=month] {
  width: 158px;
  max-width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 7px 10px;
  font-size: 12px;
}

#dash .studio-report-tools .btn {
  min-height: 36px;
  padding: 7px 12px;
}

#dash #report-check {
  flex: 1 1 230px;
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 11px !important;
  text-align: right;
  overflow-wrap: anywhere;
}

#dash .studio-report {
  min-width: 0;
  margin-bottom: 24px;
}

#dash .studio-finance-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 11px;
}

#dash .studio-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--studio-green-pale);
  color: var(--ok);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

#dash .studio-state.is-warning {
  background: var(--studio-amber-pale);
  color: var(--warn);
}

#dash .studio-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

#dash .studio-kpi {
  position: relative;
  min-width: 0;
  padding: 23px 24px;
}

#dash .studio-kpi + .studio-kpi::before {
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 0;
  width: 1px;
  background: var(--line);
  content: '';
}

#dash .studio-kpi .k {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
}

#dash .studio-kpi .v {
  color: var(--paper);
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}

#dash .studio-unit {
  margin-left: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

#dash .studio-kpi-note {
  margin-top: 9px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

#dash .studio-finance-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

#dash .studio-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: start;
  gap: 23px;
}

#dash .studio-home-grid > .card > :is(h2, h3) {
  margin-bottom: 8px;
}

#dash .studio-shortcut {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-width: 0;
  padding: 17px 0;
  border: 0;
  border-bottom: 1px solid #edf0ef;
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  text-align: left;
  text-decoration: none;
}

#dash .studio-shortcut:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

#dash .studio-shortcut:hover {
  color: var(--brass);
}

#dash .studio-shortcut > svg {
  width: 18px;
  height: 18px;
  color: #7a8a90;
}

#dash .studio-shortcut-copy {
  flex: 1 1 auto;
  min-width: 0;
}

#dash .studio-shortcut-copy :is(b, strong) {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

#dash .studio-shortcut-copy span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

#dash .studio-step-list {
  list-style: none;
  margin: 13px 0 0;
  padding: 0;
  counter-reset: studio-step;
}

#dash .studio-step-list > li {
  position: relative;
  padding: 15px 0 15px 34px;
  border-bottom: 1px solid #edf0ef;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
  counter-increment: studio-step;
}

#dash .studio-step-list > li::before {
  position: absolute;
  top: 17px;
  left: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #f0f3f3;
  color: #6e8087;
  font-size: 10px;
  font-weight: 600;
  content: counter(studio-step, decimal-leading-zero);
}

#dash .studio-step-list > li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

#dash .studio-step-list :is(b, strong) {
  display: block;
  margin-bottom: 3px;
  color: var(--paper);
  font-size: 12px;
  font-weight: 600;
}

/* Existing customer, settlement, and membership views retain their structure. */
#dash .stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 12px;
  margin: 22px 0;
}

#dash .stat {
  min-width: 0;
  padding: 19px 20px;
  border-color: var(--line);
  border-radius: 12px;
  box-shadow: none;
}

#dash .stat .k {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0;
}

#dash .stat .v {
  font-size: 27px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}

#dash .toolbar {
  gap: 10px;
  margin-bottom: 16px;
}

#dash .search {
  flex: 1 1 220px;
  min-width: 0;
}

#dash .table-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: auto;
  border-color: var(--line);
  border-radius: 14px;
  box-shadow: none;
  -webkit-overflow-scrolling: touch;
}

#dash :is(#table-mount, #db-table) {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

#dash table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}

#dash thead th {
  position: static;
  padding: 12px 19px;
  border-color: var(--line);
  background: #f8faf9;
  color: #75858b;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

#dash tbody td {
  padding: 16px 19px;
  border-color: #edf0ef;
}

#dash tbody tr:hover {
  background: #fafcfb;
}

#dash .cust-name {
  font-weight: 600;
}

#dash .pill {
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--studio-blue-pale);
  color: var(--brass);
  font-size: 10px;
  font-weight: 500;
}

#dash .group-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: 13px;
  padding: 20px;
}

#dash .group-card {
  min-width: 0;
  padding: 20px;
  border-color: var(--line);
  border-radius: 11px;
  box-shadow: none;
  transition: border-color .15s ease, background-color .15s ease;
}

#dash .group-card:hover {
  border-color: #a9bbf5;
  background: #fbfcff;
  box-shadow: none;
  transform: none;
}

#dash .group-card .gname {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

#dash .group-card .gcnt {
  font-size: 27px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

#dash .group-head {
  flex-wrap: wrap;
  font-size: 15px;
  font-weight: 600;
}

#dash .settle-card {
  min-width: 0;
  padding: 23px 24px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: none;
}

#dash .settle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr));
  gap: 22px;
}

#dash .settle-grid .it {
  min-width: 0;
}

#dash .settle-grid .k,
#dash .settle-summary .k {
  color: var(--muted);
  font-size: 12px !important;
}

#dash .settle-grid .v,
#dash .settle-summary .v {
  margin-top: 5px;
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}

#dash .settle-summary {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 18px;
}

#dash .settle-controls {
  gap: 12px;
}

#dash .settle-controls :is(label, input) {
  max-width: 100%;
}

#dash .settle-prod {
  margin-top: 18px;
  padding-top: 14px;
}

#dash .settle-prod .r {
  gap: 12px;
  padding: 7px 0;
}

#dash .settle-prod .r > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

#dash .alert-card {
  border: 1px solid #efd8db;
  border-left: 3px solid #ae4551;
  border-radius: 12px;
  background: #fff;
}

#dash .dep-row {
  background: #fafbfa;
  border-color: var(--line);
}

#dash :is(.empty, .skeleton) {
  font-size: 13px;
  line-height: 1.8;
}

#dash footer {
  padding: 32px 0 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.9;
}

/* Real product management controls, with no invented covers or imagery. */
#dash #prodchat > .settle-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#dash #prodchat > .settle-card > h3 {
  margin-bottom: 10px;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -.05em;
}

#dash #prodchat > .settle-card > p {
  margin-bottom: 24px !important;
  line-height: 1.9;
}

#dash .pc-row {
  min-width: 0;
  margin-bottom: 20px !important;
  padding: 24px !important;
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  background: #fff;
  box-shadow: none;
}

#dash .pc-row > div:first-child {
  margin-bottom: 18px !important;
  color: var(--paper);
  font-size: 16px !important;
  font-weight: 650 !important;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

#dash .pc-row > div:nth-child(2),
#dash .pc-row > div:nth-child(3) {
  margin-bottom: 18px !important;
  padding-bottom: 18px !important;
  border-bottom: 1px solid #edf0ef !important;
}

#dash .pc-row :is(.pc-status, .pc-price) {
  min-height: 36px;
  padding: 8px 10px !important;
  border-color: var(--line) !important;
  background: #fff;
}

#dash .pc-row .pc-price {
  flex: 0 1 120px;
  width: 120px;
  font-variant-numeric: tabular-nums;
}

#dash .pc-row .btn {
  min-height: 34px;
}

#dash .pc-row .pc-save,
#dash .pc-row .pc-edit-save {
  min-width: 78px;
}

#dash .pc-edit {
  padding-top: 12px;
}

#dash .pc-current-images img {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

#dash :is(.pc-summary-editor, .pc-detail-editor, .rte) {
  border-color: var(--line) !important;
  border-radius: 8px;
  overflow-wrap: anywhere;
}

#dash :is(.pc-summary-editor, .pc-detail-editor) img {
  height: auto;
}

#dash .rte-bar {
  background: #f8faf9;
}

#dash :is(#db-formlink, #db-sheet, #db-paste) > div {
  background: #fff !important;
  color: var(--paper);
}

@media (max-width: 1200px) {
  #dash .topbar > .wrap {
    padding-right: 26px;
    padding-left: 26px;
  }

  #dash .studio-content {
    padding: 28px 26px 45px;
  }

  #dash .who {
    flex-wrap: wrap;
    gap: 7px;
  }

  #dash .who > span:first-child {
    max-width: 130px;
  }

  #dash #who-ig {
    display: none;
  }

  #dash .studio-kpi {
    padding: 21px 18px;
  }

  #dash .studio-home-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 761px) and (max-width: 1050px) {
  #dash .topbar > .wrap {
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  #dash .studio-header-left {
    flex-basis: 100%;
  }

  #dash .who {
    justify-content: flex-start;
    width: 100%;
  }

  #dash #act-as-sel {
    flex: 1 1 150px;
    max-width: 220px !important;
  }

  #dash .studio-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #dash .studio-kpi:nth-child(n+3) {
    border-top: 1px solid var(--line);
  }

  #dash .studio-kpi:nth-child(odd)::before {
    content: none;
  }

  #dash .studio-kpi .v {
    font-size: 27px;
  }

  #dash #report-check {
    flex-basis: 100%;
    text-align: left;
  }
}

@media (max-width: 760px) {
  #dash.studio-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  #dash .studio-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 232px;
    max-width: calc(100vw - 48px);
    height: 100vh;
    height: 100dvh;
    padding-top: max(26px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform .2s ease, visibility .2s;
  }

  #dash.studio-nav-open .studio-sidebar {
    visibility: visible;
    transform: translateX(0);
  }

  #dash .studio-nav-backdrop:not([hidden]):not(.hidden) {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(25, 42, 50, .28);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    cursor: pointer;
  }

  #dash .studio-nav-toggle {
    display: inline-grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: #536269;
  }

  #dash .studio-nav-toggle svg {
    width: 18px;
    height: 18px;
  }

  #dash .topbar > .wrap {
    min-height: 64px;
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 12px 18px;
  }

  #dash .studio-header-left {
    flex: 1 1 100%;
    gap: 10px;
  }

  #dash .studio-breadcrumb {
    gap: 8px;
    font-size: 11px;
  }

  #dash .who {
    justify-content: flex-start;
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: 7px;
    width: 100%;
    font-size: 11px;
  }

  #dash .who > span:first-child {
    display: block;
    flex: 1 1 60px;
    max-width: none;
    margin: 0 auto 0 0;
  }

  #dash .who b {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
  }

  #dash #act-as-sel {
    order: 1;
    flex: 1 1 100%;
    width: 100%;
    max-width: 100% !important;
    min-height: 36px;
    font-size: 12px !important;
  }

  #dash .who :is(#pw-btn, #logout-btn) {
    min-height: 32px;
    padding: 6px 9px !important;
    font-size: 11px !important;
  }

  #dash .studio-content {
    padding: 24px 18px 35px;
  }

  #dash .studio-page-head {
    display: block;
    margin-bottom: 23px;
  }

  #dash .studio-page-head h1,
  #dash .head h2 {
    font-size: 26px;
  }

  #dash .studio-eyebrow {
    font-size: 10px;
  }

  #dash .desc,
  #dash .head .desc,
  #dash .studio-page-head p:not(.studio-eyebrow) {
    font-size: 12px;
  }

  #dash .studio-page-head > :last-child:not(:first-child) {
    margin-top: 15px;
  }

  #dash .studio-report-tools.card {
    gap: 12px;
    padding: 15px 16px;
    margin-bottom: 20px;
  }

  #dash .studio-report-tools label {
    flex: 1 1 180px;
    gap: 8px;
    font-size: 11px;
  }

  #dash .studio-report-tools input[type=month] {
    flex: 1 1 125px;
    width: 145px;
  }

  #dash .studio-report-tools .btn {
    flex: 0 0 auto;
    padding: 7px 10px;
    font-size: 11px;
  }

  #dash #report-check {
    flex-basis: 100%;
    text-align: left;
    font-size: 10px !important;
  }

  #dash .studio-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #dash .studio-kpi {
    padding: 19px 17px;
  }

  #dash .studio-kpi + .studio-kpi::before {
    top: 19px;
    bottom: 19px;
  }

  #dash .studio-kpi:nth-child(n+3) {
    border-top: 1px solid var(--line);
  }

  #dash .studio-kpi:nth-child(odd)::before {
    content: none;
  }

  #dash .studio-kpi .k {
    margin-bottom: 8px;
    font-size: 10px;
  }

  #dash .studio-kpi .v {
    font-size: clamp(20px, 5.7vw, 28px);
  }

  #dash .studio-unit {
    font-size: 11px;
  }

  #dash .studio-kpi-note {
    margin-top: 7px;
    font-size: 10px;
  }

  #dash .studio-home-grid {
    gap: 18px;
  }

  #dash .card,
  #dash .settle-card {
    padding: 20px 18px;
  }

  #dash .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  #dash .stat {
    padding: 16px;
  }

  #dash .stat .v {
    font-size: 25px;
  }

  #dash .toolbar {
    gap: 9px;
  }

  #dash .toolbar .search {
    flex-basis: 100%;
  }

  #dash .toolbar > .btn {
    flex: 1 1 auto;
  }

  #dash :is(thead th, tbody td) {
    padding-left: 16px;
    padding-right: 16px;
  }

  #dash .group-grid {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }

  #dash .settle-grid,
  #dash .settle-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 14px;
  }

  #dash .settle-grid .v,
  #dash .settle-summary .v {
    font-size: 23px;
  }

  #dash .settle-prod .r {
    flex-wrap: wrap;
  }

  #dash .mp-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #dash .pc-row {
    padding: 20px 18px !important;
  }

  #dash #prodchat > .settle-card > h3 {
    font-size: 26px;
  }

  #dash .pc-row > div:first-child {
    font-size: 15px !important;
  }

  #dash .pc-row .pc-price {
    flex-basis: 110px;
    width: 110px;
  }

  #dash .dep-row {
    align-items: flex-start;
    padding: 12px;
  }

  #dash .dep-row > .btn {
    padding: 7px 9px;
    font-size: 11px;
  }

  #dash :is(#db-q, #db-event, #db-form-url) {
    min-width: 0 !important;
  }

  #dash footer {
    padding-top: 26px;
    font-size: 10px;
  }
}

@media (max-width: 390px) {
  #dash .topbar > .wrap {
    padding-right: 16px;
    padding-left: 16px;
  }

  #dash .studio-content {
    padding-right: 16px;
    padding-left: 16px;
  }

  #dash .who :is(#pw-btn, #logout-btn) {
    padding-right: 8px !important;
    padding-left: 8px !important;
    font-size: 10px !important;
  }

  #dash .studio-kpi {
    padding: 17px 13px;
  }

  #dash .studio-kpi .v {
    font-size: 21px;
  }

  #dash .studio-report-tools label {
    flex-basis: 165px;
  }

  #dash .studio-report-tools input[type=month] {
    flex-basis: 110px;
    width: 128px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #dash *,
  #dash *::before,
  #dash *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Additional integrated shell and product-renderer hooks. */
#dash .studio-sidebar-head {
  position: relative;
  flex-shrink: 0;
}

#dash .studio-wordmark,
#dash .studio-logo-sub {
  display: block;
}

#dash .studio-sidebar-close {
  display: none;
}

#dash .studio-nav-label:not(:first-child) {
  margin-top: 17px;
}

#dash .studio-step-list + .btn {
  margin-top: 22px;
}

#dash .studio-product-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

#dash #studio-product-search {
  flex: 1 1 240px;
  width: 100%;
  min-width: 0;
  max-width: 460px;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--paper);
  font-size: 13px;
}

#dash #studio-product-count {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

#dash #studio-product-empty {
  padding: 30px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 13px;
  text-align: center;
}

#dash .studio-product-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

#dash .studio-product-head h2 {
  flex: 1 1 220px;
  min-width: 0;
  font-size: 17px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

#dash .studio-product-head > .muted {
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
}

#dash .studio-product-state {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 5px;
  background: #f0f3f3;
  color: #627277;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

#dash .studio-product-settings {
  min-width: 0;
}

#dash .studio-product-settings > summary {
  padding: 4px 0;
  color: #536269;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.8;
}

#dash .studio-product-settings > summary::marker {
  color: #7c898e;
}

#dash .studio-product-settings[open] > summary {
  margin-bottom: 18px;
}

#dash .studio-product-settings .pc-save {
  margin-top: 8px;
}

@media (max-width: 760px) {
  #dash .studio-sidebar-close {
    position: absolute;
    top: -17px;
    right: -6px;
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: #657178;
    font-size: 19px;
    font-weight: 400;
    line-height: 1;
  }

  #dash .studio-product-toolbar {
    gap: 9px;
    margin-bottom: 19px;
  }

  #dash #studio-product-search {
    flex-basis: 100%;
    max-width: none;
  }

  #dash .studio-product-head h2 {
    flex-basis: 100%;
    font-size: 16px;
  }
}

/* Final invariant: no component or breakpoint may reveal hidden UI. */
#dash.studio-shell.hidden,
#dash.studio-shell .hidden,
#dash.studio-shell [hidden] {
  display: none !important;
}

/* Keep Korean words and each price control together on narrow screens. */
#dash :is(.desc, .msg, .studio-finance-note, #report-check, .studio-shortcut-copy span, .studio-step-list li) {
  word-break: keep-all;
  overflow-wrap: anywhere;
}
#dash .studio-price-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  margin-left: 8px;
}
#dash .studio-price-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
@media (max-width: 760px) {
  #dash .studio-price-group { flex-basis: 100%; margin: 0; }
}
