:root {
  color-scheme: light;
  --canvas: #f3f6fb;
  --surface: #fff;
  --ink: #132640;
  --muted: #52647d;
  --line: #dfe7f2;
  --blue: #014daf;
  --blue-dark: #073984;
  --blue-light: #eaf3ff;
  --orange: #ce520a;
  --sidebar-width: 236px;
  --page-padding: clamp(22px, 3.2vw, 46px);
  --card-radius: 14px;
  --shadow: 0 2px 5px #16375608, 0 6px 20px #16375606;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.65 "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

a {
  color: var(--blue);
  text-underline-offset: .2em;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.disclosure-body {
  min-width: 0;
  margin-block-start: 8px;
  margin-inline-start: 4px;
  padding-inline-start: clamp(10px, 1.2vw, 16px);
  border-inline-start: 1px solid var(--line);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: var(--sidebar-width);
  padding: 22px 16px;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.brand {
  display: block;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
  margin-block: -13px -8px;
}

.nav-primary {
  --sidebar-label-inset: 44px;
  display: grid;
  gap: 5px;
}

.sidebar nav a, .sidebar-summary {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 45px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.nav-icon {
  flex: 0 0 22px;
  text-align: center;
  color: var(--blue);
  font: 18px/1 "Segoe UI Symbol", sans-serif;
}

.sidebar nav a:hover,
.sidebar nav a[aria-current="page"],
.sidebar-summary:hover,
.sidebar-group[data-current]:not([open]) > .sidebar-summary {
  background: var(--blue-light);
  color: var(--blue-dark);
}
.sidebar-group[data-current] > .sidebar-summary { color: var(--blue-dark); }

.sidebar nav a[aria-current="page"]::before {
  position: absolute;
  inset: 9px auto 9px 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--orange);
  content: "";
}

.sidebar-summary { cursor: pointer; list-style: none; }
.sidebar-summary::-webkit-details-marker { display: none; }
.sidebar-summary::after {
  content: "";
  flex: 0 0 6px;
  height: 6px;
  margin-left: auto;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
}
.sidebar-group[open] > .sidebar-summary::after { transform: translateY(2px) rotate(225deg); }
.sidebar-submenu {
  display: grid;
  gap: 2px;
  margin: 5px 0 3px var(--sidebar-label-inset);
  padding: 0 0 0 9px;
  border-left: 2px solid var(--line);
  list-style: none;
}
.sidebar nav .sidebar-submenu a { min-height: 34px; padding: 5px 9px; font-size: 13px; font-weight: 550; }
.sidebar nav .sidebar-submenu a[aria-current="page"] { font-weight: 650; }

.sidebar-bottom { display: grid; gap: 10px; margin-top: auto; }
.sidebar-shortcuts { display: flex; gap: 8px; }
.sidebar-shortcut {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--blue);
}
.sidebar-shortcut:hover, .sidebar-shortcut[aria-current="page"] {
  background: var(--blue-light);
  border-color: #b9cfee;
  color: var(--blue-dark);
}
.kb-book { position: relative; width: 20px; height: 16px; }
.kb-book::before, .kb-book::after {
  position: absolute;
  inset-block: 0;
  width: 10px;
  border: 1.5px solid currentColor;
  content: "";
}
.kb-book::before { left: 0; border-radius: 3px 2px 1px 3px; }
.kb-book::after { right: 0; border-radius: 2px 3px 3px 1px; }
.usage-bars {
  width: 18px;
  height: 16px;
  background:
    linear-gradient(currentColor, currentColor) 0 100% / 4px 7px no-repeat,
    linear-gradient(currentColor, currentColor) 50% 100% / 4px 12px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 100% / 4px 16px no-repeat;
}

.sidebar-account { position: relative; min-width: 0; }
.sidebar-account > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 50px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
  list-style: none;
}
.sidebar-account > summary::-webkit-details-marker { display: none; }
.sidebar-account > summary::after {
  flex: 0 0 6px;
  height: 6px;
  margin-left: auto;
  border: solid var(--muted);
  border-width: 1.5px 0 0 1.5px;
  transform: translateY(2px) rotate(45deg);
  content: "";
}
.sidebar-account[open] > summary, .sidebar-account > summary:hover { background: var(--blue-light); }
.sidebar-account[open] > summary::after { transform: translateY(-2px) rotate(225deg); }
.account-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-weight: 650;
  object-fit: cover;
}
.sidebar-account-name { min-width: 0; font-size: 14px; font-weight: 650; line-height: 1.3; }
.sidebar-account-name bdi {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-account-name small { display: block; font-size: 11px; font-weight: 500; }
.sidebar-account-menu {
  position: absolute;
  inset: auto 0 calc(100% + 8px) 0;
  z-index: 2;
  min-width: min(190px, calc(100vw - 28px));
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 6px 24px #153b7024;
}
.sidebar-account-menu > small {
  display: block;
  padding: 7px 9px;
  overflow-wrap: anywhere;
}
.sidebar nav.sidebar-account-menu a, .sidebar-account-menu button {
  min-height: 36px;
  padding: 6px 9px;
  font-size: 13px;
}
.sidebar-account-menu button {
  width: 100%;
  border: 0;
  background: var(--surface);
  color: #9e2430;
}
.sidebar-account-menu button:hover { background: #fbecee; }

.kb-library { max-width: 960px; }
.kb-library + .kb-library { margin-top: 16px; }
.kb-list { margin: 0; padding: 0; list-style: none; }
.kb-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px 16px;
  align-items: center;
  min-height: 66px;
  padding: 12px 0;
}
.kb-list li + li { border-top: 1px solid var(--line); }
.kb-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.kb-report-label { min-width: 0; overflow-wrap: anywhere; }
.kb-report-label a, .kb-download { text-decoration: none; }
.kb-report-label a:hover, .kb-download:hover { text-decoration: underline; }
.kb-report-label small { display: block; margin-top: 2px; }
.kb-download { font-size: 13px; white-space: nowrap; }
.kb-reader { max-width: 1060px; font-size: 15px; line-height: 1.8; }
.kb-reader p, .kb-reader li { color: var(--ink); overflow-wrap: anywhere; }
.kb-reader p { margin: 0 0 12px; white-space: pre-wrap; }
.kb-reader h2 { margin: 27px 0 10px; scroll-margin-top: 18px; }
.kb-reader h3 { margin: 18px 0 6px; }
.kb-reader ul { padding-inline-start: 1.5em; }
.kb-reader .kb-doc-title { margin: 15px 0 12px; font-size: 20px; font-weight: 650; line-height: 1.5; }
.kb-toc {
  margin-bottom: 22px;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f8fd;
}
.kb-toc summary { cursor: pointer; font-weight: 650; }
.kb-toc ul { margin: 9px 0 2px; }
.kb-table { margin: 13px 0 18px; }
.kb-table td, .kb-table th { white-space: normal; vertical-align: top; }
.kb-table td { border-bottom: 1px solid var(--line); }
.kb-table td p, .kb-table th p { margin: 0; font-size: 13px; }
.kb-table tr:nth-child(even) { background: #f8faff; }
.kb-figure { max-width: 100%; height: auto; display: block; margin: 10px 0; }

@media (max-width: 760px) {
  body { padding-bottom: 68px; }
  .sidebar-shortcut { box-shadow: 0 4px 15px #153b7021; }
  .kb-list li { grid-template-columns: auto minmax(0, 1fr); }
  .kb-list li > :last-child { grid-column: 2; justify-self: start; }
}

main { margin-left: var(--sidebar-width); }

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 64px;
  padding: 12px var(--page-padding);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.app-name {
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.signin-body { padding-bottom: 0; }
.signin-main {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  margin: 0;
  padding: 24px 16px;
}
.signin-card {
  width: min(100%, 420px);
  padding: clamp(22px, 5vw, 36px);
  border-top: 3px solid var(--blue);
}
.signin-logo { display: block; width: 154px; height: auto; margin-bottom: 14px; }
.signin-card h1 { margin-bottom: 18px; font-size: 27px; }
.signin-card button { justify-content: center; width: 100%; }
.signin-footer { display: inline-block; margin-top: 16px; font-size: 14px; }
.account-card { min-width: 0; max-width: 780px; }
.account-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 16px;
  align-items: start;
  max-width: 1060px;
}
.account-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  overflow-wrap: anywhere;
}
.account-profile .account-avatar { width: 54px; height: 54px; font-size: 22px; }
.account-profile small { display: block; }
.avatar-feedback:empty { display: none; }
.avatar-feedback[data-error] { color: #9e2430; }
.avatar-crop {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8faff;
}
.avatar-crop h3 { margin: 0 0 10px; font-size: 15px; }
.avatar-crop-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px 18px;
}
.avatar-crop canvas {
  display: block;
  width: min(100%, 176px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  background: repeating-conic-gradient(#e4ebf5 0% 25%, #fff 0% 50%) 50% / 16px 16px;
  box-shadow: 0 0 0 1px #b9cde9;
  cursor: grab;
  touch-action: none;
}
.avatar-crop canvas:active { cursor: grabbing; }
.avatar-crop-controls {
  display: grid;
  flex: 1 1 162px;
  gap: 5px;
}
.avatar-crop-controls label { font-size: 13px; }
.avatar-crop-controls input[type="range"] {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--blue);
}
.avatar-crop-controls .actions { gap: 6px; }
.avatar-crop-controls button.secondary {
  min-height: 36px;
  padding: 5px 8px;
  border-color: #bfd1e8;
  color: var(--blue-dark);
  font-size: 13px;
}
.avatar-crop-controls button.secondary:hover { background: var(--blue-light); }
.account-grants { min-width: 0; margin: 0; padding: 0; border: 0; }
.account-grants legend { margin-bottom: 4px; padding: 0; font-weight: 650; }
.account-grant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 8px;
  margin-top: 8px;
}
label.account-grant, label.account-check {
  display: flex;
  align-items: start;
  gap: 8px;
  cursor: pointer;
}
label.account-grant {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.account-grant:has(:checked) { border-color: #afc8ee; background: var(--blue-light); }
.account-grant small { display: block; font-weight: 400; }
.account-grant input, .account-check input {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 4px 0 0;
  padding: 0;
  accent-color: var(--blue);
}
.account-member-select { display: flex; align-items: end; gap: 8px; }
.account-member-select label { flex: 1; min-width: 0; }
.account-grant-edit { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.account-users { margin-top: 16px; }
.account-users td { overflow-wrap: anywhere; }
.account-users details form { margin-top: 9px; min-width: 210px; }
.account-users details summary { color: var(--blue-dark); cursor: pointer; }
.account-code { margin-bottom: 14px; padding: 12px; border-radius: 8px; background: var(--blue-light); }
.account-code input { font-family: ui-monospace, monospace; }
.account-code .hint { margin-top: 6px; }

.video-section-nav { margin-bottom: 18px; }
.video-section-path { margin: 0 0 6px; font-size: 13px; }
.video-section-path span { margin: 0 3px; color: var(--blue); }
.material-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  width: fit-content;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--canvas);
}
.material-nav a {
  padding: 5px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}
.material-nav a:hover { color: var(--blue-dark); }
.material-nav a[aria-current="page"] {
  background: var(--surface);
  color: var(--blue-dark);
  box-shadow: 0 1px 4px #1637561a;
}

.content {
  max-width: 1420px;
  margin-inline: auto;
  padding: 30px var(--page-padding) 48px;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(27px, 3.4vw, 37px);
  line-height: 1.22;
}

h2 {
  margin-bottom: 16px;
  font-size: 18px;
  line-height: 1.4;
}

h3 { margin-bottom: 4px; font-size: 16px; }
p, small, time { color: var(--muted); }

.heading { margin-bottom: 24px; }
.heading p { margin-bottom: 0; }

.home-areas {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.card {
  min-width: 0;
  padding: clamp(16px, 2vw, 24px);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.home-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  text-decoration: none;
}

a.home-area:hover {
  border-color: #a9c8f1;
  box-shadow: 0 5px 18px #014daf12;
}

.home-area-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 11px;
  background: var(--blue-light);
  color: var(--blue);
  font: 21px/1 "Segoe UI Symbol", sans-serif;
}

.home-area-copy {
  display: grid;
  grid-column: 1 / -1;
  gap: 4px;
}
.home-area-copy strong { font-size: 18px; line-height: 1.4; }
.home-area-group .home-area-copy h2 { margin: 0; }
.home-area-children {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 4px;
}
.home-area-children a {
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--blue-light);
  font-size: 13px;
  text-decoration: none;
}
.home-area-children a:hover { background: #dceafa; }
.home-area-copy small, .home-review-list small { font-size: 13px; }
.home-arrow { color: var(--blue); font-size: 18px; }
.home-area > .home-arrow { grid-area: 1 / 2; }
.home-reviews .section-head { margin-bottom: 8px; }

.home-review-list {
  max-height: 20rem;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}
.home-review-list li + li { border-top: 1px solid var(--line); }
.home-review-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
}
.home-review-list a:hover { background: var(--blue-light); }
.home-review-list a:focus-visible { outline-offset: -2px; }
.home-review-list strong { overflow-wrap: anywhere; }

.shop-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 20px;
}
.shop-heading .heading, .shop-heading h1 { margin: 0; }
.shop-adviser-heading { margin-top: 12px; }
.shop-adviser-heading .heading p { margin-top: 7px; }
.shop-dashboard { margin-top: 16px; }
.shop-dashboard .section-head { align-items: flex-start; }
.shop-dashboard h2 { margin: 0 0 3px; }
.shop-dashboard-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 14px; }
.shop-report { display: grid; gap: 14px; }
.shop-report .shop-heading { margin-bottom: 0; }
.shop-report-dates { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.shop-report-dates label { font-size: 13px; }
.shop-report-section td { overflow-wrap: anywhere; }
.shop-report-section th { white-space: nowrap; }
.shop-report-settings > summary { cursor: pointer; font-weight: 650; }
.shop-kpis, .shop-orders dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}
.shop-kpis > div {
  padding: 10px 13px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-alt, #f5f8fc);
}
.shop-kpis dt, .shop-orders dt { color: var(--muted); font-size: 13px; }
.shop-kpis dd, .shop-orders dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: clamp(20px, 2.3vw, 29px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.23;
  overflow-wrap: anywhere;
}
.shop-kpis dd small, .shop-orders dd small { font-size: 12px; font-weight: 500; }
.shop-delta { display: block; margin-top: 3px; font-size: 12px; }
.shop-delta.up { color: #087050; }
.shop-delta.down { color: #a93537; }
.shop-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.shop-chart {
  min-width: 0;
  margin: 0;
  padding: 12px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.shop-chart figcaption {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2px 8px;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 700;
}
.shop-chart figcaption small { font-size: 12px; font-weight: 400; }
.shop-chart ol {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}
.shop-chart li {
  display: grid;
  grid-template-rows: minmax(16px, auto) 75px auto;
  justify-items: center;
  min-width: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.shop-bar-value {
  align-self: end;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.shop-bar-track {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to top, #edf2f8 0 1px, transparent 1px 25px);
}
.shop-bar {
  width: min(48%, 34px);
  height: max(2px, var(--bar-height));
  border-radius: 4px 4px 0 0;
  background: #2265bc;
}
.shop-chart-paid .shop-bar { background: #168573; }
.shop-bar.shop-bar-zero { height: 2px; opacity: .6; }
.shop-chart time { padding-top: 4px; white-space: nowrap; }
.shop-orders {
  margin-top: 13px;
  padding: 12px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.shop-orders-head, .shop-brief-summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-bottom: 8px;
}
.shop-orders h3 { margin: 0; font-size: 14px; }
.shop-orders dd { font-size: 19px; }
.shop-orders .hint { margin: 8px 0 0; }
.shop-data-note { margin: 8px 0 0; }
.shop-message {
  margin-bottom: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.shop-message.shop-error { color: #972f34; border-color: #f0ccd0; }
.shop-brief-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.shop-brief-grid h2 { margin-bottom: 9px; }
.shop-brief-grid ul { margin: 0; padding-left: 18px; overflow-wrap: anywhere; }
.shop-brief-grid li + li { margin-top: 8px; }
.shop-brief-grid li small { display: block; margin-top: 1px; }
.shop-brief-details { margin-top: 12px; padding: 11px 15px; }
.shop-brief-details summary { cursor: pointer; font-weight: 650; }
.shop-brief-details p { margin: 7px 0 0; }
.shop-import { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-top: 10px; }
.shop-import label { flex: 0 1 350px; }
.shop-adviser-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.shop-adviser-tabs a {
  padding: 9px 12px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.shop-adviser-tabs a[aria-current="page"] { border-color: var(--blue); color: var(--blue); }
.shop-adviser-tabs a:hover { background: var(--blue-light); }
.coach-page-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.coach-page-head > a { white-space: nowrap; }
.coach-workspace { display: grid; grid-template-columns: minmax(200px, 245px) minmax(0, 1fr); gap: 14px; align-items: start; }
.coach-customers form { display: flex; gap: 6px; }
.coach-customers form button { flex: 0 0 auto; }
.coach-customers ul { list-style: none; margin: 12px 0 0; padding: 0; max-height: 55vh; overflow-y: auto; }
.coach-customers li + li { margin-top: 4px; }
.coach-customers li a { display: block; padding: 8px 10px; border-radius: 7px; text-decoration: none; overflow-wrap: anywhere; }
.coach-customers li a:hover, .coach-customers li a[aria-current="page"] { background: var(--blue-light); color: var(--blue-dark); }
.coach-customers li a[aria-current="page"] { font-weight: 650; }
.coach-dialog { display: grid; gap: 12px; }
.coach-dialog-head { display: grid; gap: 8px; }
.coach-dialog-title, .coach-scope { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.coach-dialog-title { justify-content: space-between; }
.coach-dialog-title h2 { margin: 0; overflow-wrap: anywhere; }
.coach-dialog-meta { display: flex; gap: 8px 15px; flex-wrap: wrap; align-items: start; font-size: 13px; color: var(--muted); }
.coach-dialog-meta summary { color: var(--blue); cursor: pointer; }
.coach-profile { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.coach-profile ul { margin: 7px 0; padding-left: 22px; }
.coach-profile p { margin: 4px 0; }
.coach-scope-panel .coach-scope { margin-top: 7px; }
.coach-scope { font-size: 13px; }
.coach-scope label { display: flex; flex: 0 1 auto; min-width: 0; align-items: center; }
.coach-scope select { min-height: 34px; max-width: min(35vw, 360px); width: auto; font-size: 13px; padding-block: 4px; }
.coach-log { height: clamp(250px, 39vh, 430px); overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; padding: 12px; }
.coach-empty { margin: 0; padding: 34px 12px; text-align: center; color: var(--muted); }
.coach-turn { display: grid; justify-items: start; gap: 7px; margin-bottom: 12px; }
.coach-turn:last-child { margin-bottom: 0; }
.coach-bubble { max-width: min(78%, 750px); padding: 8px 12px; border-radius: 9px; overflow-wrap: anywhere; }
.coach-user { justify-self: end; color: var(--blue-dark); background: var(--blue-light); }
.coach-response { background: var(--canvas); }
.coach-bubble strong, .coach-evidence { font-size: 13px; }
.coach-bubble p { margin: 3px 0 0; white-space: pre-wrap; }
.coach-product {
  display: grid;
  gap: 4px;
  margin: 7px 0 10px;
  padding: 7px 9px;
  border-left: 2px solid var(--blue);
  background: var(--surface);
  border-radius: 4px;
  font-size: 13px;
}
.coach-product small, .coach-learning small, .coach-knowledge-item small { color: var(--muted); }
.coach-product-source { display: grid; gap: 3px; margin-top: 6px; }
.coach-product-source small { color: var(--muted); }
.coach-copy, .coach-composer button.ops-outline { background: var(--surface); border-color: #c1d4ee; color: var(--blue); }
.coach-copy:hover, .coach-composer button.ops-outline:hover { background: var(--blue-light); }
.coach-copy { min-height: 30px; margin-top: 6px; padding: 3px 8px; font-size: 13px; }
.coach-copy + small { margin-left: 6px; }
.coach-evidence { margin-top: 6px; }
.coach-evidence summary { cursor: pointer; color: var(--blue); }
.coach-composer { gap: 8px; }
.coach-composer textarea { resize: vertical; }
.coach-learning, .coach-opportunity {
  width: min(100%, 640px);
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.coach-learning strong, .coach-learning small { display: block; }
.coach-opportunity small { display: block; color: var(--muted); margin-top: 3px; }
.coach-learning p, .coach-opportunity p, .coach-knowledge-item p { white-space: pre-wrap; margin: 6px 0; }
.coach-learning .ops-outline, .coach-knowledge-actions .ops-outline { min-height: 30px; padding: 3px 8px; font-size: 13px; }
.coach-learning button.ops-outline, .coach-knowledge-actions button.ops-outline { background: var(--surface); border-color: #c1d4ee; color: var(--blue); }
.coach-learning button.ops-outline:hover, .coach-knowledge-actions button.ops-outline:hover { background: var(--blue-light); }
.coach-knowledge { width: min(100%, 920px); }
.coach-knowledge summary { color: var(--blue); cursor: pointer; }
.coach-knowledge-form { margin: 12px 0; }
.coach-knowledge-item { border-top: 1px solid var(--line); padding: 14px 0 0; margin-top: 14px; overflow-wrap: anywhere; }
.coach-knowledge-item h3 { margin: 0 0 4px; }
.coach-knowledge-actions { float: right; }
@media (max-width: 1050px) {
  .coach-workspace { grid-template-columns: minmax(0, 1fr); }
  .coach-customers ul { display: flex; flex-wrap: wrap; gap: 4px; max-height: 145px; }
  .coach-customers li + li { margin-top: 0; }
  .coach-bubble { max-width: 90%; }
}

.sales-create { margin-bottom: 16px; }
.sales-inbox-top, .sales-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.sales-inbox-top { justify-content: space-between; margin-bottom: 12px; }
.sales-tabs { margin: 0; }
.sales-search { flex-wrap: nowrap; gap: 6px; }
.sales-search input { width: min(220px, 48vw); }
.sales-search button { white-space: nowrap; }
.sales-list { min-width: 620px; }
.sales-list td { overflow-wrap: anywhere; }
.sales-list small { display: block; color: var(--muted); }
.sales-customer-list { min-width: 740px; }
.sales-owner, .sales-deadline { width: 7.5rem; min-width: 7.5rem; }
.sales-deadline { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sales-deal-link { font-weight: 650; }
.sales-list .sales-overdue, .sales-overdue { color: #9e381c; }
.sales-remove-link { color: #a2272e; white-space: nowrap; }
.sales-remove-button { background: #ab2632; border-color: #ab2632; }
.sales-remove-button:hover { background: #8c1d29; border-color: #8c1d29; }
.sales-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 12px;
}
.sales-pagination .catalog-pagination { margin: 0; }
.sales-inbox { scroll-margin-top: 16px; }
.sales-register {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(200px, 2fr) auto;
  align-items: end;
  gap: 12px 14px;
}
.sales-register label { min-width: 0; }
.sales-register button { min-height: 44px; }
.sales-register select > button { min-height: 0; }

.deal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 18px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.deal-workspace { display: grid; gap: 14px; }
.deal-workspace > p { margin: 0; }
.deal-stages {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  list-style: none;
}
.deal-stages li {
  padding: 8px 4px;
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.deal-stages li[aria-current=step] {
  color: var(--blue-dark);
  background: var(--blue-light);
  font-weight: 700;
}
.deal-focus {
  scroll-margin-top: 16px;
  padding: clamp(20px, 3vw, 32px);
  border-top: 3px solid var(--blue);
}
.deal-focus h2 { margin: 5px 0 8px; font-size: clamp(21px, 2vw, 28px); overflow-wrap: anywhere; }
.deal-focus .deal-focus-label {
  margin: 0;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 700;
}
.deal-focus > p { margin: 0 0 10px; }
.deal-step-reason { color: var(--muted); overflow-wrap: anywhere; }
.deal-deadline {
  display: inline-block;
  margin: 2px 0;
  padding: 3px 9px;
  border-radius: 5px;
  background: var(--blue-light);
  color: var(--blue-dark);
}
.deal-step-form { max-width: 820px; margin-top: 14px; }
.deal-step-form textarea { resize: vertical; }
.deal-step-form[data-sales-reply] textarea { background: var(--canvas); }
.deal-wait-actions { display: flex; flex-wrap: wrap; gap: 0 10px; align-items: end; }
.deal-wait-actions .deal-step-note[open] { width: min(70vw, 640px); max-width: 100%; }
.deal-focus button.ops-outline, .deal-closed button.ops-outline, .sales-search button.ops-outline {
  color: var(--blue);
  background: var(--surface);
  border-color: #bfd2ee;
}
.deal-focus button.ops-outline:hover, .deal-closed button.ops-outline:hover, .sales-search button.ops-outline:hover {
  background: var(--blue-light);
}
.deal-focus > .sales-details { margin-top: 13px; }
.deal-step-fields, .deal-other-actions { display: grid; gap: 8px; }
.deal-other-actions .deal-step-form { margin-top: 0; }
.deal-history { scroll-margin-top: 16px; }
.deal-history > .disclosure-body > details + details { margin-top: 9px; }
.sales-evidence-navigation { position: sticky; top: 0; z-index: 1; padding: 6px 0; background: var(--surface); }
.deal-closed { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.deal-close { margin: 0 4px 10px; }
.deal-close > form { max-width: 500px; }
.sales-details > summary { cursor: pointer; font-weight: 650; color: var(--blue); }
.sales-details > form { margin-top: 10px; }
.deal-history > summary { color: var(--ink); }
.deal-close > summary { color: var(--muted); }
.sales-files { line-height: 1.5; font-size: 13px; }
.sales-files input { display: block; max-width: min(100%, 400px); }
.sales-files .hint { display: block; }
.sales-details .sales-findings { margin-top: 8px; }
@media (max-width: 900px) {
  .sales-register { grid-template-columns: minmax(0, 1fr); }
  .sales-register > button { justify-self: start; }
}
@media (max-width: 550px) {
  .deal-stages li { font-size: 11px; line-height: 1.4; }
  .deal-wait-actions .deal-step-note[open] { width: 100%; }
}
.sales-findings { display: grid; gap: 10px; margin: 0 0 10px; }
.sales-findings > div { padding: 9px 11px; border-radius: 7px; background: var(--canvas); overflow-wrap: anywhere; }
.sales-findings dt { font-weight: 650; font-size: 13px; color: var(--blue-dark); }
.sales-findings dd { margin: 2px 0 0; white-space: pre-wrap; }
.sales-note { border-bottom: 1px solid var(--line); padding: 8px 0; scroll-margin-top: 14px; }
.sales-note summary { cursor: pointer; }
.sales-note summary span { font-weight: 600; }
.sales-note small { margin-left: 7px; color: var(--muted); }
.sales-note-preview, .sales-note-body { margin: 4px 0 0; overflow-wrap: anywhere; }
.sales-note summary .sales-note-preview { display: block; font-weight: 400; color: var(--muted); }
.sales-note[open] .sales-note-preview, .sales-note:not([open]) .sales-note-body { display: none; }
.sales-note-body { max-height: 310px; overflow: auto; white-space: pre-wrap; }
.sales-note + .sales-details { margin-top: 10px; }
.sales-chat-history { padding: 8px 0; }
.sales-chat-log {
  max-height: min(680px, 65vh);
  overflow-y: auto;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.sales-chat-entry { scroll-margin-top: 8px; }
.sales-chat-entry + .sales-chat-entry { margin-top: 1em; }
.sales-chat-entry > small { display: block; margin-bottom: 4px; }
.sales-chat-entry > p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sales-chat-entry img { display: block; max-width: 100%; height: auto; }
[data-sales-evidence-selected] { background: var(--blue-light); }
.shop-answer li:target, .ops-action-items li:target { background: var(--blue-light); scroll-margin-top: 16px; }
.product-diagnosis :target { background: var(--blue-light); scroll-margin-top: 16px; }
.shop-adviser-body [id^="shop-report-"]:target { background: var(--blue-light); scroll-margin-top: 16px; }

.shop-adviser-body { display: grid; gap: 12px; }
.shop-adviser-body .shop-brief-details { margin-top: 0; }
.shop-report-date { margin: 0 0 9px; }
.shop-overview .section-head { margin-bottom: 9px; }
.shop-answer ul { margin: 0; padding-left: 18px; }
.shop-answer li { overflow-wrap: anywhere; padding-left: 2px; }
.shop-answer li + li { margin-top: 12px; }
.shop-answer li small { display: block; }
.shop-answer li a { font-size: 13px; }
.shop-answer li p { margin: 3px 0; }
.shop-signal { color: var(--blue); }
.shop-products { min-width: 620px; }
.shop-products td small { display: block; margin-top: 2px; }
.shop-sync { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; margin-top: 9px; }
.shop-adviser-body button.ops-outline {
  background: white;
  border-color: #b5cdea;
  color: var(--blue);
}
.shop-adviser-body button.ops-outline:hover { background: var(--blue-light); }
.shop-adviser-body .shop-message { margin-bottom: 0; }
.shop-tracking .ops-advice-fold { margin: 0; padding: 0; border: 0; }
.peer-groups { display: grid; gap: 20px; margin-top: 16px; }
.peer-group {
  min-width: 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.peer-group-heading, .peer-card-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.peer-group-heading { flex-wrap: wrap; margin-bottom: 10px; }
.peer-group-heading > div { flex: 1 1 215px; min-width: 0; }
.peer-group-heading h3 { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.peer-group-heading small, .peer-card small { font-size: 12px; color: var(--muted); }
.peer-group-heading small + small { display: block; }
.peer-thumb {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--canvas);
}
.peer-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; background: white; }
.peer-thumb:empty::before { content: "暂无图"; color: var(--muted); font-size: 10px; }
.peer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 295px), 1fr)); gap: 9px; }
.peer-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  overflow-wrap: anywhere;
}
.peer-card-heading .peer-thumb { width: 58px; height: 58px; }
.peer-card-heading a {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-weight: 650;
}
.peer-card p, .peer-card .shop-evidence { margin: 0; }
.peer-card p { font-size: 13px; }
.peer-match span { border-radius: 4px; padding: 1px 5px; font-size: 12px; white-space: nowrap; }
.peer-match-similar { background: #e0f2e8; color: #165c46; }
.peer-match-review { background: #fff2dd; color: #75470a; }
.peer-match-different { background: #fae6e8; color: #8f2531; }
.peer-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.peer-card-actions a { font-size: 13px; }
.peer-card-actions button { min-height: 30px; padding: 3px 8px; font-size: 13px; }
.peer-add { margin-bottom: 10px; }
.shop-evidence { margin-top: 6px; }
.shop-evidence summary { color: var(--blue); cursor: pointer; font-size: 13px; }
.peer-add > summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  list-style: none;
}
.peer-add > summary::-webkit-details-marker { display: none; }
.peer-add > summary:hover, .peer-add[open] > summary { background: var(--blue-light); }
.peer-search-icon {
  position: relative;
  width: 11px;
  height: 11px;
  margin: 0 2px 2px 0;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.peer-search-icon::after {
  position: absolute;
  bottom: -3px;
  right: -4px;
  width: 5px;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  transform: rotate(45deg);
  content: "";
}
.peer-analysis {
  display: grid;
  gap: 6px;
  margin: 5px 0 0;
  padding: 8px 9px;
  background: var(--canvas);
  border-radius: 7px;
  font-size: 12px;
}
.peer-analysis dt { font-weight: 650; }
.peer-analysis dd { margin: 2px 0 0; }
.peer-review > p, .peer-review > form, .peer-review > small { margin-top: 5px; }
.peer-review > form { justify-items: start; }
.peer-review button { min-height: 30px; padding: 3px 8px; font-size: 13px; }
.peer-grid:has(.peer-review[open]) { align-items: start; }
.shop-assign, .shop-peer-add { display: grid; gap: 8px; max-width: 740px; margin-top: 6px; }
.shop-assign button, .shop-peer-add button { justify-self: start; }
@media (max-width: 920px) {
  .shop-charts, .shop-brief-grid { grid-template-columns: 1fr; }
}
@media (max-width: 550px) {
  .shop-kpis, .shop-orders dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-kpis > div { padding-inline: 9px; }
  .shop-chart { padding-inline: 6px; }
  .shop-chart li { font-size: 11px; }
  .shop-adviser-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 6px; }
}

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

.section-head {
  justify-content: space-between;
  margin-bottom: 15px;
}

.section-head h2 { margin: 0; }
.section-head a { font-size: 14px; font-weight: 600; text-decoration: none; }
.section-head a:hover { text-decoration: underline; }

.columns {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) minmax(0, 3fr);
  align-items: start;
  gap: 18px;
}

.detail { grid-template-columns: minmax(0, 3fr) minmax(240px, 2fr); }
.stack, form { display: grid; gap: 14px; }

.domestic-leads { display: grid; gap: 16px; }
.lead-search { grid-template-columns: minmax(0, 560px) minmax(0, 190px) auto; justify-content: start; align-items: end; }
.lead-search > div { display: grid; gap: 6px; min-width: 0; }
.lead-search select { width: 100%; min-width: 0; }
.lead-search + .hint { margin-top: 10px; }
.domestic-leads table td { vertical-align: top; }
.domestic-leads table td p { margin: 0; }
.domestic-leads table td > small { display: block; margin-top: 4px; }
.domestic-leads table form { justify-items: start; }
.lead-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 285px), 1fr)); gap: 12px; }
.lead-card { min-width: 0; display: grid; align-content: start; gap: 9px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.lead-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.lead-card h3, .lead-card p { margin: 0; }
.lead-contact {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--canvas);
  font-size: 13px;
  overflow-wrap: anywhere;
  scroll-margin-top: 16px;
}
.lead-contact-values {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin: 0;
}
.deal-workspace > .lead-contact { padding: 12px 16px; }
.lead-card .actions { gap: 7px; }
.lead-card .actions button, .lead-card .actions .button { min-height: 35px; padding: 5px 9px; font-size: 13px; }
.lead-draft { display: grid; gap: 6px; }
.lead-draft textarea { width: 100%; min-height: 72px; }
.lead-error { color: #9c2b24; }
.lead-card.lead-selected { border-color: #8fb4e5; }
tr.lead-selected > td { background: var(--blue-light); }
@media (max-width: 650px) {
  .lead-search { grid-template-columns: minmax(0, 1fr) auto; }
  .lead-search > div:first-child { grid-column: 1 / -1; }
}

.creative-prompt-fields {
  display: grid;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  gap: 14px;
}
.creative-prompt > section, .creative-prompt-fields > div { min-width: 0; }
.creative-prompt-fields > div { display: grid; gap: 6px; }
.creative-prompt-fields select { min-width: 0; max-width: 100%; }
.creative-prompt-fields .hint { margin: 0; }
#creative-prompt-body { min-height: 290px; line-height: 1.65; }

.inline-prompt { display: grid; gap: 6px; min-width: 0; }
.inline-prompt-heading { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.inline-prompt-heading button { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.inline-prompt textarea { line-height: 1.65; }
.inline-prompt [data-prompt-status] { margin: 0; }
.inline-prompt [data-prompt-status][data-error] { color: #9c2b24; }
label { display: grid; gap: 6px; font-weight: 650; }

input, textarea, select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #cbd7e6;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}

input::placeholder, textarea::placeholder { color: #607089; }

.model-sync { margin-top: 5px; }
.model-sync:empty { display: none; }

@supports (appearance: base-select) {
  select[data-model-medium],
  select[data-model-medium]::picker(select) { appearance: base-select; }

  select[data-model-medium]::picker(select) {
    max-width: min(510px, calc(100vw - 32px));
    max-height: min(55vh, 365px);
    margin-block-start: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    color: var(--ink);
  }

  select[data-model-medium] optgroup { padding: 5px; }
  select[data-model-medium] option { padding: 8px 9px; overflow-wrap: anywhere; }
  select[data-model-medium] option:hover,
  select[data-model-medium] option:focus-visible { background: var(--blue-light); }

  .peer-product-select, .peer-product-select::picker(select) { appearance: base-select; }
  .peer-product-select { align-items: center; }
  .peer-product-select::picker(select) {
    width: anchor-size(width);
    max-width: calc(100vw - 24px);
    max-height: min(48vh, 390px);
    margin-block: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 6px 20px #1637561a;
  }
  .peer-product-select > button {
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
  }
  .peer-product-select selectedcontent, .peer-product-select option {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
  }
  .peer-product-select option { padding: 5px 8px; border-radius: 5px; }
  .peer-product-select option:hover, .peer-product-select option:focus-visible { background: var(--blue-light); }
  .peer-product-select .peer-thumb { width: 36px; height: 36px; }
  .peer-product-select .peer-product-title { min-width: 0; overflow-wrap: anywhere; }
  .peer-product-select selectedcontent .peer-product-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .peer-product-id { display: block; font-size: 12px; color: var(--muted); }
}

input[type="file"] {
  padding: 6px;
  background: #f9fbfe;
}

input::file-selector-button {
  margin-right: 10px;
  padding: 5px 10px;
  border: 0;
  border-radius: 5px;
  background: var(--blue-light);
  color: var(--blue-dark);
  font: inherit;
  cursor: pointer;
}

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

button, .button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

button:hover, .button:hover { background: var(--blue-dark); }

button.secondary {
  border-color: #edcacc;
  background: white;
  color: #912d36;
}

button.secondary:hover { background: #fff2f2; }

.hint { margin: 0; font-size: 13px; }

.ops-home { display: grid; gap: 16px; }
.ops-home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 18px;
}
.ops-home-header .heading { margin: 0; }
.ops-advice { min-width: 0; }
.ops-advice .ops-section-header { margin-bottom: 6px; }
.ops-advice-period { display: flex; align-items: center; gap: 8px; }
.ops-advice-stamp { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.ops-advice-stamp .status { margin-left: 4px; }
.ops-advice-list, .ops-action-items, .ops-advice-products { padding: 0; margin: 0; list-style: none; }
.ops-advice-list { display: grid; gap: 8px; margin-bottom: 14px; }
.ops-advice-list > li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faff;
}
.ops-advice-list h3 { margin: 0 0 3px; font-size: 15px; }
.ops-advice-list p, .ops-advice-empty { margin: 0; color: var(--muted); font-size: 13px; }
.ops-advice-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.ops-advice-actions form { margin: 0; }
.ops-advice-empty { margin-top: 8px; }
.ops-advice .button.secondary, .ops-action-detail .button.secondary {
  flex-shrink: 0;
  border-color: #c3d4ed;
  background: white;
  color: var(--blue-dark);
}
.ops-advice .button.secondary { min-height: 34px; padding: 5px 11px; font-size: 13px; }
.ops-advice .button.secondary:hover, .ops-action-detail .button.secondary:hover { background: var(--blue-light); }
.ops-advice-list .visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.ops-advice-fold { border-top: 1px solid var(--line); margin-top: 7px; padding-top: 7px; }
.ops-advice-fold > summary, #ops-action-history > summary { padding-block: 3px; cursor: pointer; font-weight: 650; }
.ops-advice-fold small { margin-left: 5px; color: var(--muted); font-weight: 400; }
.ops-advice-fold > div { padding-block: 6px 3px; }
p.ops-pilot-status { margin: 7px 0 0; padding-top: 7px; border-top: 1px solid var(--line); }
.ops-pilot-status small { color: var(--muted); }
.ops-pilot-dates small { display: block; margin-left: 0; overflow-wrap: anywhere; }
.ops-advice-metrics { min-width: 390px; margin-bottom: 7px; }
.ops-advice-metrics th[scope="row"] { border-top: 1px solid var(--line); }
.ops-advice-metrics td { font-variant-numeric: tabular-nums; }
.ops-advice-metrics td small { display: block; margin: 1px 0 0; color: var(--muted); font-size: 11px; }
.ops-advice-products { margin: 6px 0 8px; }
.ops-action-items li, .ops-advice-products li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 6px 14px;
  border-top: 1px solid var(--line); padding: 7px 0;
}
.ops-action-items small { margin-left: 8px; }
.ops-action-overdue { color: #912d36; }
.ops-advice-products span { color: var(--muted); font-size: 12px; flex-shrink: 0; }
.ops-advice-products a, .ops-action-note { overflow-wrap: anywhere; }
.ops-action-note { white-space: pre-wrap; }
.ops-action-detail { display: grid; min-width: 0; gap: 13px; }
.ops-action-detail .heading { margin: 0; }
.ops-action-detail h3 small { color: var(--muted); font-weight: 400; }
.ops-action-form { display: grid; gap: 10px; max-width: 780px; }
.ops-action-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 10px; }
.ops-action-controls { display: grid; justify-items: start; gap: 10px; }
[data-advice-update] { margin-top: 6px; }
.ops-overview-form { display: block; }
.ops-date-range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ops-date-range input { min-width: 0; }
.ops-products { border: 0; margin: 0; padding: 0; min-width: 0; }
.ops-products legend { padding: 0; font-weight: 650; }
.ops-selection, .ops-submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.ops-selection { min-height: 35px; margin-bottom: 4px; }
.ops-selection label { display: inline-flex; gap: 7px; align-items: center; cursor: pointer; }
.ops-selection label[hidden] { display: none; }
.ops-product-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 285px;
  padding: 3px;
  overflow-y: auto;
}
.ops-product {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.ops-product:has(input:checked) { background: var(--blue-light); }
.ops-product input, .ops-selection input { width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: var(--blue); }
.ops-product input { margin-top: 4px; }
.ops-product strong,
.ops-result-product a {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.ops-product small { display: block; margin-top: 2px; font-weight: 400; }

.ops-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 14px;
}
.ops-section-header h2 { margin: 0 0 3px; }
.ops-section-header select { width: auto; min-height: 34px; padding: 5px 9px; font-size: 13px; }
.ops-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.ops-trend [data-metric="itemCnt"] { --metric-color: #0757ba; }
.ops-trend [data-metric="hasVisitorItemCnt"] { --metric-color: #bd570b; }
.ops-trend [data-metric="itemPv"] { --metric-color: #08786a; }
.ops-trend [data-metric="uv"] { --metric-color: #7245ad; }
.ops-trend [data-metric="pullSalesItemCnt"] { --metric-color: #b43163; }
.ops-metric {
  display: grid;
  gap: 2px;
  align-content: start;
  width: 100%;
  padding: 8px 12px;
  text-align: left;
  line-height: 1.4;
  border-color: var(--line);
  background: #f7f9fc;
  color: var(--muted);
}
.ops-metric span { font-size: 13px; }
.ops-metric strong { color: var(--ink); font-size: clamp(17px, 2.2vw, 25px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ops-metric:hover { border-color: var(--metric-color); background: #f7f9fc; }
.ops-metric[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--metric-color) 42%, white);
  background: color-mix(in srgb, var(--metric-color) 9%, white);
  box-shadow: inset 0 -2px var(--metric-color);
  color: var(--metric-color);
}
.ops-trend-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 13px; }
.ops-trend-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ops-trend-legend span::before { width: 9px; height: 9px; border-radius: 2px; background: var(--metric-color); content: ""; }
.ops-trend-chart { display: block; width: 100%; height: 236px; }
.ops-trend-point { display: block; min-height: 1.65em; color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.ops-overview-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; color: var(--muted); }
.ops-overview-meta small:empty { display: none; }
.ops-trend[data-state="pending"] [data-overview-status] { color: #914108; }
.ops-trend[data-state="failed"] [data-overview-status] { color: #912d36; }
.ops-trend { min-width: 0; }

.ops-report-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 20px;
  margin-bottom: 18px;
}
.ops-report-heading .heading { margin: 0; }
.ops-report-heading form { display: block; }
.ops-report { display: grid; gap: 14px; min-width: 0; }
.ops-task-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; color: var(--muted); font-size: 13px; }
.ops-kpis {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}
.ops-kpis .card { min-width: 0; padding: 16px 20px; }
.ops-kpis dt { font-size: 13px; color: var(--muted); }
.ops-kpis dd { margin: 3px 0 0; font-size: clamp(20px, 2.4vw, 30px); font-weight: 700; line-height: 1.3; }
.ops-kpis dd small { font-size: 13px; font-weight: 500; }
.ops-kpi-foot { display: block; margin-top: 5px; }
.ops-notice {
  padding: 11px 16px;
  border: 1px solid #f1d8bc;
  border-radius: 9px;
  background: #fff7ed;
}
.ops-notice p { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 0; color: #784014; }
.ops-notice p + p { margin-top: 6px; }
.ops-data-card { min-width: 0; }
.ops-data-card > .hint { margin-top: 9px; }
.ops-data-card > .empty { margin: 0; }
.diagnosis-header .heading, .diagnosis-finding { min-width: 0; }
.diagnosis-header .heading p, .diagnosis-finding dd, .diagnosis-summary .diagnosis-facts { overflow-wrap: anywhere; }
.diagnosis-period, .diagnosis-dates, .diagnosis-facts, .diagnosis-review, .diagnosis-references {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}
.diagnosis-period {
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3f7fd;
}
.diagnosis-period a { padding: 4px 10px; border-radius: 5px; text-decoration: none; }
.diagnosis-period a[aria-current="page"] { color: var(--blue-dark); font-weight: 650; background: white; }
.diagnosis-table { min-width: 365px; font-variant-numeric: tabular-nums; }
.diagnosis-table th, .diagnosis-table td { padding: 9px 12px; }
.diagnosis-table th[scope="row"] { color: var(--ink); }
.diagnosis-table small { display: block; margin-top: 3px; }
.diagnosis-table strong { font-size: 17px; }
.diagnosis-findings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  gap: 14px;
}
.diagnosis-finding .ops-section-header { margin-bottom: 8px; }
.diagnosis-finding h3 { margin-bottom: 9px; font-size: 17px; }
.diagnosis-finding dl { display: grid; gap: 8px; margin: 0; }
.diagnosis-finding dt { color: var(--muted); font-size: 13px; }
.diagnosis-finding dd { margin: 2px 0 0; }
.diagnosis-finding ul { margin: 0; padding-left: 1.1em; }
.diagnosis-finding li + li { margin-top: 4px; }
.diagnosis-summary { border-left: 4px solid var(--blue); }
.diagnosis-summary .section-head { margin-bottom: 6px; }
.diagnosis-summary .section-head h2 { margin: 0; }
.diagnosis-summary p { margin: 0 0 10px; }
.diagnosis-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--blue-light);
  color: var(--blue-dark);
}
.diagnosis-progress span { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--blue); }
.diagnosis-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 137px), 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.diagnosis-kpis > div { padding: 10px 13px; border-radius: 8px; background: #f3f7fd; min-width: 0; }
.diagnosis-kpis dt, .diagnosis-strengths small { color: var(--muted); }
.diagnosis-kpis dd { margin: 3px 0; font-size: clamp(20px, 2.4vw, 27px); font-weight: 720; overflow-wrap: anywhere; }
.diagnosis-kpis small { display: block; }
.diagnosis-chart-scroll { overflow-x: auto; }
.diagnosis-bars {
  display: grid;
  grid-template-columns: repeat(var(--days), minmax(0, 1fr));
  gap: 3px;
  margin: 8px 0 14px;
  padding: 0;
  min-width: min(100%, 490px);
  list-style: none;
}
.diagnosis-bars li { position: relative; height: 155px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.diagnosis-bar {
  position: absolute;
  bottom: 0;
  inset-inline: 10%;
  height: max(2px, var(--height));
  border-radius: 3px 3px 0 0;
  background: #1765c5;
}
.diagnosis-bars .spike .diagnosis-bar { background: #bd560c; }
.diagnosis-bars .missing .diagnosis-bar { background: transparent; border-top: 1px dashed #9aaec5; }
.diagnosis-bars small { position: absolute; bottom: -21px; left: 0; white-space: nowrap; font-size: 10px; }
.diagnosis-bars li:last-child small { left: auto; right: 0; }
.diagnosis-checks li, .diagnosis-strengths li { margin-bottom: 6px; }
.diagnosis-strengths small { display: block; }
.diagnosis-sku { margin-top: 8px; }
.diagnosis-sku summary { cursor: pointer; font-weight: 630; margin-bottom: 5px; }
.diagnosis-review { margin: 14px 0 0; padding-top: 9px; border-top: 1px solid var(--line); }
.diagnosis-references { margin: 0; }
.ops-table-scroll { max-height: min(55vh, 540px); overflow: auto; }
.ops-results { min-width: 790px; }
.ops-results thead th { position: sticky; top: 0; z-index: 1; }
.ops-day, .ops-numeric { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ops-results .ops-numeric, .ops-dates .ops-numeric { text-align: right; }
.ops-results td, .ops-results th[scope="row"] { border-top: 1px solid var(--line); font-size: inherit; }
.ops-results .ops-result-product {
  min-width: 225px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  line-height: 1.45;
}
.ops-result-product a { text-decoration: none; }
.ops-result-product a:hover { text-decoration: underline; }
.ops-result-product small { display: block; margin-top: 3px; font-weight: 400; }
.ops-results .ops-result-price { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ops-result-price small { display: block; margin-top: 3px; }
.ops-fold.card { min-width: 0; padding: 0; }
.ops-fold summary { padding: 13px 19px; font-weight: 650; cursor: pointer; }
.ops-fold summary small { margin-left: 6px; font-weight: 400; }
.ops-fold-body { padding: 0 19px 15px; }
.ops-dates { min-width: 530px; }
.ops-dates th[scope="row"] { border-top: 1px solid var(--line); white-space: nowrap; background: transparent; }
.ops-dates td:last-child { white-space: normal; }
.ops-missing { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ops-missing li { display: flex; align-items: baseline; gap: 10px; }
.ops-missing span { flex-shrink: 0; color: var(--muted); font-size: 12px; }
.ops-missing a { overflow-wrap: anywhere; }

.ops-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.ops-tabs a {
  padding: 9px 16px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}
.ops-tabs a[aria-current="page"], .ops-tabs a:hover {
  border-color: var(--blue);
  color: var(--blue-dark);
}
.button.ops-outline { color: var(--blue); border-color: #b5cdea; background: white; }
.button.ops-outline:hover { background: var(--blue-light); }
.ops-advice-summary p { margin-bottom: 8px; }
.ops-product-link {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.ops-finding .ops-product-link { font-size: 17px; }
.ops-finding .section-head { margin-bottom: 8px; }
.ops-evidence {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 9px 0 15px;
  padding: 11px 13px;
  border-radius: 8px;
  background: #f3f7fd;
}
.ops-evidence dt { color: var(--muted); font-size: 12px; }
.ops-evidence dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; font-weight: 650; }
.ops-gap-list { display: grid; gap: 9px; margin: 12px 0 0; padding: 0; list-style: none; }
.ops-gap-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.ops-gap-list li > :last-child { flex-shrink: 0; font-size: 13px; }
.ops-gap-list a { overflow-wrap: anywhere; }
.ops-compare { min-width: 500px; }
.ops-compare th[scope="row"] { min-width: 98px; border-top: 1px solid var(--line); }
.ops-compare td { min-width: 145px; white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.ops-compare-hint { margin-top: 10px; }
.ops-peer-note { margin: 0; }
.ops-peer-analysis dl {
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr;
  gap: 10px;
  margin: 0;
}
.ops-peer-analysis dl > div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faff;
}
.ops-peer-analysis dt { font-weight: 650; }
.ops-peer-analysis dd { margin: 4px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.ops-peer-history { min-width: 520px; }
.ops-peer-history td { font-variant-numeric: tabular-nums; }
.ops-peer-history td:first-child { white-space: nowrap; }
.ops-peer-history-note { color: var(--muted); overflow-wrap: anywhere; }

@media (max-width: 600px) {
  .ops-peer-analysis dl { grid-template-columns: 1fr; }
  .ops-product-list { grid-template-columns: minmax(0, 1fr); }
  .ops-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-trend-chart { height: 196px; }
  .ops-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ops-kpis .card { padding: 12px 15px; }
  .ops-kpis .card:first-child { grid-column: 1 / -1; }
  .ops-date-range { grid-template-columns: repeat(auto-fit, minmax(min(124px, 100%), 1fr)); }
  .ops-results { display: block; min-width: 0; }
  .ops-results thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ops-results tbody { display: block; }
  .ops-results tbody tr {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px 3px;
    padding: 12px;
  }
  .ops-results tbody tr + tr { border-top: 1px solid var(--line); }
  .ops-results td, .ops-results th[scope="row"] { padding: 0; border: 0; }
  .ops-results .ops-day, .ops-results .ops-result-product { grid-column: 1 / -1; min-width: 0; }
  .ops-results .ops-day { color: var(--muted); font-size: 12px; }
  .ops-results .ops-result-price { grid-column: 1 / -1; white-space: normal; }
  .ops-result-price small { display: inline; margin-left: 7px; }
  .ops-results .ops-numeric { padding-top: 3px; text-align: left; white-space: normal; overflow-wrap: anywhere; }
  .ops-results .ops-numeric::before, .ops-results .ops-result-price::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; }
  .ops-evidence { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-tabs a { padding-inline: 10px; }
}

.empty {
  margin-bottom: 0;
  padding: 26px 16px;
  border: 1px dashed #cbd8e8;
  border-radius: 9px;
  background: #f8faff;
  text-align: center;
}

.catalog-titlebar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: 20px;
}
.catalog-titlebar .heading { flex: 1 1 320px; min-width: 0; margin: 0; }
.catalog-titlebar .heading h1 { overflow-wrap: anywhere; }
.catalog-titlebar .actions { flex: 0 1 auto; }
.catalog-secondary {
  color: var(--blue);
  background: var(--blue-light);
  border-color: var(--line);
}
.catalog-secondary:hover { color: var(--blue-dark); background: #dcecff; }
.catalog-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 16px;
}
.catalog-filter input[type="search"] { width: min(340px, 100%); }
.catalog-filter select { width: auto; }
.catalog-list-count { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 10px; }
.catalog-list-count span { color: var(--muted); font-size: 13px; }
.catalog-list-note { margin-top: 12px; }
.catalog-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
}
.catalog-thumb {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  overflow: hidden;
  border-radius: 9px;
  background: var(--canvas);
  border: 1px solid var(--line);
}
.catalog-thumb img { width: 100%; height: 100%; object-fit: contain; }
.catalog-name { color: var(--ink); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.catalog-name:hover { color: var(--blue); text-decoration: underline; }
.catalog-table tbody tr:has(.catalog-featured) { background-color: #fff5e9; }
.catalog-table tbody tr:has(.catalog-featured):is(:hover, :focus-within) { background-color: #ffecd3; }
.catalog-table tbody tr:has(.catalog-featured) > td:first-child { box-shadow: inset 4px 0 #df7728; }
.catalog-featured {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 7px; padding: 1px 7px;
  border: 1px solid #eec49d; border-radius: 999px; background: #ffead2; color: #874308;
  font-size: 12px; font-weight: 650; vertical-align: middle;
}
.catalog-featured::before {
  content: ""; width: 11px; height: 11px; flex: none; background: currentColor;
  clip-path: polygon(50% 0, 61% 35%, 100% 38%, 70% 61%, 79% 100%, 50% 76%, 21% 100%, 30% 61%, 0 38%, 39% 35%);
}
@media (prefers-reduced-motion: no-preference) {
  .catalog-table tbody tr:has(.catalog-featured) {
    transition: background-color 160ms ease;
    animation: catalog-feature-in 550ms ease-out;
  }
  @keyframes catalog-feature-in { from { background-color: #ffe4bc; } }
}
.catalog-identity small { display: block; color: var(--muted); line-height: 1.5; }
.catalog-placeholder { color: var(--muted); font-size: 12px; }
.catalog-table td:nth-child(n+2):nth-child(-n+6) { min-width: 0; white-space: nowrap; }
.catalog-table th { white-space: nowrap; }
.catalog-links, .catalog-pagination { display: flex; align-items: center; gap: 12px; }
.catalog-links { gap: 5px; white-space: nowrap; }
.catalog-feature-toggle {
  min-height: 29px; padding: 3px 7px; background: transparent; color: var(--blue);
  border-color: var(--line); font-size: 12px; font-weight: 550;
}
.catalog-feature-toggle:hover { color: var(--blue-dark); background: var(--blue-light); }
.catalog-sync-form { display: block; }
.catalog-sync {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faff;
  color: var(--muted);
  font-size: 13px;
}
.catalog-sync small:empty { display: none; }
.catalog-sync-status, .catalog-sync-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}
.catalog-sync-status { color: var(--ink); }
.catalog-sync-badge { padding: 2px 8px; border-radius: 999px; background: #e9eef6; color: var(--muted); }
.catalog-sync:is([data-sync-state="queued"], [data-sync-state="running"]) .catalog-sync-badge {
  background: var(--blue-light);
  color: var(--blue-dark);
}
.catalog-sync[data-sync-state="completed"] .catalog-sync-badge { background: #e2f3ea; color: #176042; }
.catalog-sync[data-sync-state="failed"] .catalog-sync-badge { background: #fbe7e9; color: #912b36; }
.catalog-sync[data-sync-state="cancelling"] .catalog-sync-badge { background: #fff0df; color: #894508; }
.catalog-sync-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.catalog-sync-controls[hidden], [data-sync-cancel][hidden] { display: none; }
.catalog-sync-cancel-button {
  min-height: 32px;
  padding: 4px 11px;
  background: white;
  color: #912d36;
  border-color: #ecc9ce;
}
.catalog-sync-cancel-button:hover { background: #fff2f3; }
.catalog-sync-progress { width: min(100%, 320px); height: 7px; accent-color: var(--blue); }
.catalog-sync-progress[hidden] { display: none; }
.catalog-sync-failures { min-width: 0; padding-top: 6px; border-top: 1px solid var(--line); }
.catalog-sync-failures summary { width: fit-content; color: #912b36; font-weight: 650; cursor: pointer; }
.catalog-sync-failure-list {
  display: grid;
  gap: 6px;
  max-height: 240px;
  margin: 6px 0 0;
  padding: 0 2px 0 0;
  overflow-y: auto;
  list-style: none;
}
.catalog-sync-failure-list li {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow-wrap: anywhere;
}
.catalog-failure-ident { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; }
.catalog-failure-ident a { font-weight: 600; }
.catalog-sync-failure-list p { margin: 3px 0 0; color: var(--muted); }
.catalog-pagination { margin-top: 12px; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.catalog-pagination a, .catalog-page-current {
  display: inline-flex; min-width: 34px; min-height: 34px; align-items: center; justify-content: center;
  padding: 3px 8px; border: 1px solid var(--line); border-radius: 7px; text-decoration: none;
}
.catalog-pagination a:hover { background: var(--blue-light); }
.catalog-page-current { color: white; background: var(--blue); border-color: var(--blue); }
.catalog-page-gap { padding: 0 4px; color: var(--muted); }
.catalog-missing { color: var(--muted); }
.catalog-form { max-width: 760px; }
.catalog-current-photo img { width: 112px; height: 112px; object-fit: contain; border-radius: 8px; background: var(--canvas); }
.catalog-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.catalog-tabs a {
  padding: 8px 12px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.catalog-tabs a:hover { color: var(--blue); }
.catalog-tabs [aria-current="page"] { color: var(--blue); border-color: var(--blue); }
.catalog-overview { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 1.6fr); gap: 16px; }
.catalog-cover {
  display: grid;
  place-items: center;
  min-height: 250px;
  background: var(--canvas);
  border-radius: 10px;
}
.catalog-cover img { display: block; width: 100%; max-height: 310px; object-fit: contain; }
.catalog-section { margin-top: 16px; }
.catalog-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 10px; margin: 10px 0 0; }
.catalog-facts div { padding: 10px 12px; border-radius: 8px; background: var(--canvas); min-width: 0; }
.catalog-facts dt { color: var(--muted); font-size: 13px; }
.catalog-facts dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.catalog-sku td:nth-child(2), .catalog-import-table td:first-child { min-width: 170px; }
.catalog-sku th, .catalog-sku td:nth-child(n+3) { white-space: nowrap; }
.catalog-sku .catalog-thumb { width: 52px; height: 52px; border-radius: 6px; }
.catalog-sku-note { margin-bottom: 10px; }
.catalog-attributes td:first-child { width: min(25%, 210px); }
.catalog-attributes td:last-child { white-space: normal; }
.catalog-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 16px; }
.catalog-image { margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.catalog-image img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 7px; background: var(--canvas); }
.catalog-image figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; font-size: 13px; margin-top: 5px; }
.catalog-image form { display: block; }
.catalog-image button { margin-top: 4px; }
.catalog-source summary { color: var(--blue); font-weight: 650; cursor: pointer; }
.catalog-import-result .hint { margin-top: 12px; }
.catalog-import-result form { margin-top: 12px; }
.catalog-import-result form button { justify-self: start; }
.catalog-import-links { display: flex; flex-wrap: wrap; gap: 8px 20px; padding-left: 18px; }
.catalog-saved { margin: 0 0 12px; color: #156049; background: #e3f4eb; padding: 8px 12px; border-radius: 8px; }

.task-product-field { display: grid; gap: 6px; min-width: 0; }
.task-product-picker { position: relative; min-width: 0; }
.task-product-picker summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #cbd7e6;
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  list-style: none;
}
.task-product-picker summary::-webkit-details-marker { display: none; }
.task-product-picker summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-product-picker summary::after {
  flex: 0 0 7px;
  height: 7px;
  margin-right: 2px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  content: "";
}
.task-product-picker[open] summary::after { transform: rotate(225deg); }
.task-product-popover {
  position: absolute;
  z-index: 3;
  inset: calc(100% + 5px) 0 auto;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 6px 20px #1637561a;
}
.task-product-matches {
  max-height: min(17rem, 35vh);
  overflow-y: auto;
}
.task-product-matches:empty { display: none; }
.task-product-matches button {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  overflow-wrap: anywhere;
}
.task-product-matches button:hover, .task-product-matches button[aria-current="true"] {
  background: var(--blue-light);
  color: var(--blue-dark);
}
.task-product-matches button:focus-visible { outline-offset: -2px; }
#task-product-empty { padding: 5px; }

.task-references {
  min-inline-size: 0;
  margin: 0;
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7faff;
}
.task-references legend { padding: 0 5px; font-weight: 700; }
.task-references [hidden] { display: none; }
.task-reference-summary:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin-bottom: 8px;
}
.task-reference-summary div { min-width: 0; overflow-wrap: anywhere; }
.task-reference-summary strong { display: block; line-height: 1.35; }
.task-reference-summary .hint { color: var(--muted); margin-top: 4px; }
#task-reference-preview {
  flex: 0 0 88px;
  height: 88px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
}
#task-reference-preview img { display: block; width: 100%; height: 100%; border-radius: 7px; object-fit: contain; }
.task-reference-selected { margin: 4px 0 0; font-size: 13px; font-weight: 650; color: var(--blue-dark); }
.task-reference-selected:empty { display: none; }
.task-reference-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
}
.task-reference-options:not(:empty) { margin-top: 8px; }
.task-reference-option {
  position: relative;
  gap: 3px;
  padding: 4px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}
.task-reference-option:hover { border-color: #8ab9f0; }
.task-reference-option:has(input:checked) { background: var(--blue-light); border-color: var(--blue); color: var(--blue-dark); }
.task-reference-option:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.task-reference-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  clip-path: inset(50%);
}
.task-reference-option img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--surface); border-radius: 4px; }
.task-reference-option span { font-size: 12px; line-height: 1.45; }
.task-reference-option:has(input:disabled) { cursor: default; border-color: var(--line); }
.task-reference-unavailable {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 4px;
  border-radius: 4px;
  background: var(--canvas);
}

@media (max-width: 700px) {
  .catalog-overview { grid-template-columns: 1fr; }
  .catalog-table th:nth-child(n+4):nth-child(-n+6),
  .catalog-table td:nth-child(n+4):nth-child(-n+6) { display: none; }
}

.preserve { white-space: pre-wrap; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
}

table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 11px 12px; }
th { background: #f1f6fc; color: var(--muted); font-weight: 600; }
td { border-top: 1px solid var(--line); }
td:nth-child(2) { min-width: 6.5em; overflow-wrap: anywhere; }
td:last-child, th:last-child { white-space: nowrap; font-size: 13px; }
tbody tr:hover { background: #f9fbff; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-size: 12px;
  white-space: nowrap;
}

.status::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status.review { background: #fff0df; color: #85400e; }
.status.ready, .status.image_approved { background: #e3f4eb; color: #156049; }
.status.failed, .status.rejected, .error { background: #fbe8eb; color: #8e2934; }

.error { padding: 10px; border-radius: 8px; }
.back { display: inline-block; margin-bottom: 12px; }
progress { width: 100%; accent-color: var(--blue); }

.preview {
  display: grid;
  gap: 6px;
  margin: 15px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.preview img, .preview video {
  width: 100%;
  max-height: 450px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f0f4fa;
  object-fit: contain;
}

.revision-actions { margin: 12px 0; }
.revision-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.35fr) minmax(280px, 1fr);
  align-items: start;
  gap: 18px;
}

.revision-guide { gap: 2px 10px; margin-bottom: 5px; }
.revision-pictures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.revision-pictures figure { margin: 0; min-width: 0; }
.revision-pictures figcaption {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.revision-surface {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  outline: 1px solid var(--line);
  background: #f0f4fa;
}

.revision-surface img { display: block; width: 100%; height: auto; }
.revision-editable { cursor: crosshair; touch-action: none; user-select: none; }
.revision-selection {
  position: absolute;
  border: 2px solid #ff6900;
  background: #ff690021;
  outline: 1px solid white;
  pointer-events: none;
}

.revision-versions { margin: 0; padding: 0; list-style: none; }
.revision-versions li {
  display: grid;
  grid-template-columns: auto minmax(30px, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}

.revision-versions a[aria-current="page"] { font-weight: 700; }
.revision-note { margin-top: 12px; color: var(--muted); font-size: 13px; }

.events { margin-bottom: 0; padding: 0; list-style: none; }
.events li { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.events time { font-size: 13px; }
.events p { margin: 4px 0 0; }
.events p:empty { display: none; }

.agent-chat {
  display: grid;
  grid-template-rows: auto minmax(150px, 1fr) auto auto;
  min-height: 490px;
  height: min(760px, calc(100vh - 120px));
  max-width: 960px;
  margin-inline: auto;
  padding: 0;
}
.agent-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px clamp(13px, 3vw, 24px);
  border-bottom: 1px solid var(--line);
}
.agent-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px 12px;
}
.agent-header-actions a {
  padding: 4px 6px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}
.agent-header-actions a:hover { background: var(--blue-light); }

.replacement-workspace { max-width: 960px; margin-inline: auto; }
.replacement-workspace > .ops-fold { margin-top: 16px; }
.replacement-assets {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 12px;
  align-items: start;
}
.replacement-upload {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px dashed #b8cce7;
  border-radius: 9px;
  background: #f7faff;
}
.replacement-upload[data-drag] { border-color: var(--blue); background: var(--blue-light); }
.replacement-upload [hidden] { display: none; }
.replacement-upload label small { font-weight: 400; }
.replacement-assets video, .replacement-assets img {
  display: block;
  width: 100%;
  max-height: min(44vh, 330px);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  object-fit: contain;
}
.replacement-parameters, .replacement-saved-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.replacement-workspace textarea { min-height: 108px; }
.replacement-error { color: #912d36; }
.replacement-saved figure { min-width: 0; margin: 0; }
.replacement-saved figcaption {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.replacement-saved-settings {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 18px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faff;
}
.replacement-saved-settings dt { color: var(--muted); font-size: 13px; }
.replacement-saved-settings dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.replacement-saved > p:last-child { margin-bottom: 0; }
.replacement-history { margin: 0; padding: 0; list-style: none; }
.replacement-history li {
  display: flex;
  justify-content: space-between;
  gap: 6px 12px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.replacement-history a { overflow-wrap: anywhere; }
.replacement-history time { white-space: nowrap; font-size: 13px; }

.prompt-filters {
  grid-template-columns: minmax(0, 1fr) minmax(120px, 170px) auto;
  align-items: center;
  margin-bottom: 16px;
}
.prompt-body { line-height: 1.6; font-weight: 400; }
.prompt-body[readonly] { background: #f7faff; }
.agent-production-meta { margin-top: 8px; overflow-wrap: anywhere; }
.agent-production-card, .production-performance {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.agent-production-card summary, .production-performance summary {
  padding: 10px 12px;
  font-weight: 650;
  cursor: pointer;
}
.agent-production-card summary small, .production-performance summary small {
  margin-left: 5px;
  color: var(--muted);
  font-weight: 400;
}
.production-steps, .production-topics { margin: 0; padding: 0 12px 12px 32px; }
.production-steps > li { padding: 8px 0; border-top: 1px solid var(--line); }
.production-steps p { margin: 2px 0 5px; }
.production-topics { padding-bottom: 0; }
.production-topics > li { margin: 6px 0; overflow-wrap: anywhere; }
.production-topics > li + li { border-top: 1px solid var(--line); padding-top: 7px; }
.production-topics form { display: block; }
.production-topics button { padding: 4px 9px; min-height: 32px; }
.production-script { display: grid; grid-template-columns: max-content minmax(0,1fr); gap: 3px 10px; }
.production-script dd { margin: 0; overflow-wrap: anywhere; }
.production-performance > form, .production-performance > ul { margin: 0 12px 12px; }
.production-review { padding: 0 12px 8px; }
.production-metrics { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); gap: 8px; }

@media (max-width: 600px) {
  .replacement-assets, .replacement-parameters { grid-template-columns: 1fr; }
  .replacement-saved-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prompt-filters { grid-template-columns: minmax(0, 1fr) auto; }
  .prompt-filters input { grid-column: 1 / -1; }
}

.agent-history {
  display: grid;
  align-content: start;
  gap: 16px;
  overflow-y: auto;
  padding: 16px clamp(13px, 3vw, 24px);
}
.agent-start {
  margin: clamp(14px, 7vh, 66px) auto 0;
  text-align: center;
}
.agent-start h1 { font-size: clamp(24px, 3vw, 32px); }
.agent-composer {
  gap: 6px;
  margin: 0 clamp(12px, 3vw, 24px);
  padding: 10px 12px;
  border: 1px solid #cbd7e6;
  border-radius: 15px;
  background: #f8faff;
}
.agent-composer textarea {
  min-height: 58px;
  max-height: 160px;
  resize: vertical;
  border: 0;
  background: transparent;
}
.agent-composer textarea:focus-visible { outline-offset: -2px; }
.agent-drop { background: var(--blue-light); outline: 2px dashed var(--blue); }
.agent-tools, .agent-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}
.agent-chips:empty { display: none; }
.agent-chips { max-height: 94px; overflow-y: auto; }
.agent-chip, .agent-attach {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.agent-chip { min-width: 0; max-width: 100%; }
.agent-chip-label { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
button.agent-chip-preview {
  display: block;
  flex: 0 0 56px;
  width: 56px;
  height: 46px;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: zoom-in;
}
.agent-chip-preview:hover { border-color: var(--blue); }
.agent-chip-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.agent-chip-remove { flex: 0 0 auto; }
.agent-attach { position: relative; cursor: pointer; }
.agent-attach:focus-within { outline: 2px solid var(--blue); }
.agent-attach input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.agent-tools #agent-send { margin-left: auto; }
.agent-status { flex: 1; min-width: 0; }
.agent-disclosure { padding: 7px 12px 10px; text-align: center; }
.agent-skills-dialog, .agent-image-dialog {
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  box-shadow: var(--shadow);
}
.agent-skills-dialog {
  width: min(560px, calc(100% - 26px));
  max-height: min(82vh, 720px);
  max-height: min(82dvh, 720px);
  overflow: hidden;
  padding: 0;
}
.agent-skills-dialog[open] { display: flex; flex-direction: column; }
.agent-skills-header {
  flex: none;
  flex-wrap: nowrap;
  margin: 0;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}
.agent-skills-header button.agent-plain {
  min-height: 36px;
  padding: 0 10px;
  background: var(--blue-light);
  font-size: 14px;
  white-space: nowrap;
}
.agent-skill-feedback { flex: none; padding: 6px 18px; color: var(--blue-dark); }
.agent-skill-feedback:empty { display: none; }
.agent-skills-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 18px 18px;
}
.agent-skills-scroll > details, #agent-skill-list { margin-top: 12px; }
.skill-item { padding: 9px 0; border-top: 1px solid var(--line); }
.agent-skills-scroll summary { cursor: pointer; }
.skill-item summary small { margin-left: 6px; color: var(--muted); }
.skill-item p, .skill-item form, #agent-add-skill form { margin: 7px 0; }
.agent-skills-dialog button.skill-delete { color: #912d36; }
.skill-fields, .independent-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.independent-fields { display: grid; gap: 9px; }
.agent-image-dialog { width: min(900px, calc(100% - 26px)); max-height: calc(100vh - 28px); }
.agent-skills-dialog::backdrop, .agent-image-dialog::backdrop { background: #15283b66; }
.agent-image-dialog h2 { min-width: 0; overflow-wrap: anywhere; font-size: 16px; }
.agent-image-dialog img { display: block; max-width: 100%; max-height: 72vh; margin-inline: auto; object-fit: contain; }
.agent-action {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.agent-turn {
  display: grid;
  gap: 9px;
}
.agent-bubble {
  padding: 12px 15px;
  border-radius: 10px;
  background: #f3f6fb;
}
.agent-user {
  margin-left: 9%;
  background: var(--blue-light);
}
.agent-bubble p { margin: 4px 0; }
.agent-bubble p, .skill-item p { overflow-wrap: anywhere; }
.agent-attachments {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.agent-attachments img, .agent-attachments video {
  width: 100%;
  max-height: 230px;
  border-radius: 7px;
  background: #fff;
  object-fit: contain;
}
.agent-attachments figure { min-width: 0; margin: 0; }
.agent-attachments figcaption { overflow-wrap: anywhere; }
.agent-chat details { margin-top: 8px; }
.agent-chat summary {
  color: var(--blue);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}
.agent-chat details form { margin-top: 9px; }
button.agent-plain {
  min-height: 26px;
  padding: 0 4px;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
}
button.agent-plain:hover { text-decoration: underline; }
.task-context {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--blue-light);
}
.task-context h3 { margin: 0; font-size: 14px; }
.task-context ul { margin: 5px 0 0; padding-left: 20px; overflow-wrap: anywhere; }
button:disabled { opacity: .55; cursor: wait; }

@media (max-width: 550px) {
  .agent-attachments { grid-template-columns: 1fr; }
  .agent-chat { min-height: 480px; height: 74vh; }
}

.usage-card { margin-bottom: 18px; }
.usage-live {
  margin: 0;
  color: var(--blue);
  font-size: 13px;
}
.usage-live-error { color: #8e2934; }
.usage-filters {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(120px, 150px);
  gap: 12px;
}
.usage-filters label { font-size: 13px; }
.usage-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.usage-kpis div {
  min-width: 0;
  padding: 10px 13px;
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  background: #f1f6fd;
}
.usage-kpis .usage-cost { border-left-color: var(--orange); background: #fff7ef; }
.usage-kpis dt { color: var(--muted); font-size: 12px; }
.usage-kpis dd {
  margin: 2px 0 0;
  font-size: clamp(17px, 2.35vw, 29px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.usage-kpis .usage-cost-basis {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.usage-plot {
  display: flex;
  align-items: flex-start;
  min-height: 70px;
  padding: 10px 2px 4px;
  overflow-x: auto;
}
.usage-axis {
  flex: 0 0 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 192px;
  padding-right: 7px;
  color: var(--muted);
  text-align: right;
  font-size: 11px;
  line-height: 1;
}
.usage-columns {
  display: grid;
  flex: 1 0 auto;
  grid-template-columns: repeat(var(--days), minmax(30px, 1fr));
  background:
    repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--grid-step, 48px))
    no-repeat left top / 100% 193px;
}
.usage-point {
  display: grid;
  grid-template-rows: 192px auto;
  width: 100%;
  min-height: 0;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  text-align: center;
}
.usage-point:hover,
.usage-point[aria-current="date"] {
  background: #eaf3ff85;
  color: var(--blue-dark);
}
.usage-point:focus-visible { outline-offset: -2px; }
.usage-track {
  position: relative;
  height: 100%;
}
.usage-bar {
  position: absolute;
  bottom: 0;
  left: 22%;
  right: 22%;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(#2179dc, var(--blue));
}
.usage-bar-missing {
  height: 7px;
  background: repeating-linear-gradient(135deg, #c56731 0 2px, #ffe6d4 2px 5px);
}
.usage-date {
  display: block;
  padding: 5px 0;
  border-top: 1px solid #a8bbd3;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.usage-detail {
  min-height: 36px;
  padding: 8px 11px;
  border-radius: 6px;
  background: #f6f9fd;
}
.usage-summary p { margin: 11px 0 0; font-size: 13px; }

@media (max-width: 1050px) {
  .columns, .revision-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --page-padding: 16px; }

  .sidebar {
    position: static;
    gap: 10px;
    width: auto;
    padding: 12px var(--page-padding);
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    align-self: flex-start;
    width: 186px;
    padding: 0;
    border: 0;
  }

  .nav-primary { --sidebar-label-inset: 28px; grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .sidebar nav a, .sidebar-summary {
    gap: 4px;
    min-height: 38px;
    padding: 6px;
    font-size: 12px;
  }
  .sidebar nav .sidebar-submenu a { font-size: 12px; }
  .sidebar-bottom {
    position: fixed;
    inset: auto auto 12px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(312px, calc(100vw - 28px));
    z-index: 3;
  }
  .sidebar-bottom .sidebar-account { order: -1; max-width: 208px; }
  .sidebar-account > summary { box-shadow: 0 4px 15px #153b7021; }

  .nav-icon { flex-basis: 18px; font-size: 15px; }
  main { margin-left: 0; }
  .top { min-height: 48px; padding-block: 8px; }
  .content { padding-top: 18px; }
}

@media (max-width: 550px) {
  .usage-filters { grid-template-columns: 1fr; }
  .usage-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .usage-kpis div { padding-inline: 8px; }
  .usage-axis { flex-basis: 34px; }
  .nav-primary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-areas { grid-template-columns: 1fr; gap: 10px; }
  .home-area { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; }
  .home-area-copy { grid-area: 1 / 2; }
  .home-area > .home-arrow { grid-column: 3; }
  .home-review-list a { gap: 8px; }
}
