:root {
  color-scheme: light;
  --ink: #1f1d1b;
  --muted: #746c67;
  --line: #e9e2dd;
  --paper: #f7f4f1;
  --card: #fffefe;
  --blush-soft: #f4e8e4;
  --rose: #9f756c;
  --sage: #687d76;
  --sage-soft: #edf2ef;
  --taupe: #77665f;
  --coffee: #473d38;
  --graphite: #202221;
  --gold: #a98f61;
  --shadow: 0 20px 48px rgba(48, 42, 38, 0.09);
  --shadow-soft: 0 10px 28px rgba(48, 42, 38, 0.055);
  --focus: rgba(104, 125, 118, 0.14);
  --radius: 7px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 0%, rgba(244, 232, 228, 0.62), transparent 32%),
    linear-gradient(180deg, #fbfaf8 0%, #f4f1ee 52%, #f8f6f3 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: var(--radius);
  background: var(--graphite);
  color: #fff;
  min-height: 42px;
  padding: 10px 18px;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(32, 34, 33, 0.13);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(32, 34, 33, 0.16);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  padding: 11px 13px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
  background: #fff;
  border-color: rgba(104, 125, 118, 0.74);
  box-shadow: 0 0 0 4px var(--focus);
}

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

.shell {
  width: min(1240px, calc(100% - 36px));
  margin: 26px auto 58px;
}

.site-footer {
  padding: 0 18px 28px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--ink);
  text-decoration: underline;
}

.hero {
  min-height: 238px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  align-items: end;
  gap: 34px;
  padding: 38px 42px;
  border: 1px solid rgba(236, 229, 224, 0.86);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, #202221 0%, #34302d 68%, #5f544e 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  left: 42px;
  right: 42px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(169, 143, 97, 0.86), transparent);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  letter-spacing: 0;
  font-weight: 760;
  text-transform: none;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 4.6vw, 58px);
  letter-spacing: 0;
  line-height: 1.04;
}

.hero h1 {
  color: #fff;
}

h2 {
  margin: 0;
}

.sub {
  max-width: 640px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 17px;
  line-height: 1.72;
}

.hero-card {
  min-height: 168px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.075);
  backdrop-filter: blur(14px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  box-shadow: none;
}

.hero-card strong {
  font-size: 54px;
  color: #fff;
}

.hero-card span,
.hero-card small {
  color: rgba(255, 255, 255, 0.78);
}

.login-panel,
.app-panel {
  margin-top: 24px;
  border: 1px solid rgba(233, 226, 221, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-panel {
  width: min(460px, 100%);
  display: grid;
  gap: 16px;
}

label {
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.hidden {
  display: none;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 24px rgba(48, 42, 38, 0.045);
}

.admin-topbar > div {
  display: grid;
  gap: 3px;
}

.admin-topbar .eyebrow {
  margin: 0;
  color: var(--taupe);
  font-size: 12px;
}

.admin-topbar strong {
  font-size: 18px;
}

.admin-topbar small {
  color: var(--muted);
}

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

.account-settings {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.account-settings.hidden {
  display: none;
}

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

.ghost {
  background: rgba(255, 255, 255, 0.92);
  color: var(--coffee);
  border: 1px solid var(--line);
  box-shadow: none;
}

.ghost.danger {
  color: #8f3f35;
  border-color: rgba(143, 63, 53, 0.28);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.tabs button {
  background: transparent;
  color: var(--coffee);
  border: 1px solid var(--line);
  box-shadow: none;
  min-height: 40px;
  padding: 8px 16px;
}

.tabs button.active {
  background: var(--graphite);
  color: #fff;
  border-color: transparent;
}

.tab-page {
  display: none;
  padding-top: 22px;
}

.tab-page.active {
  display: block;
}

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

.stats article,
.item-card,
.overview-result article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  padding: 18px;
  box-shadow: 0 8px 22px rgba(48, 42, 38, 0.045);
}

.stats span,
.item-card span {
  color: var(--muted);
}

.stats strong {
  display: block;
  margin-top: 10px;
  font-size: 36px;
  line-height: 1.05;
}

.overview-content {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 22px rgba(48, 42, 38, 0.04);
}

.compact-head {
  align-items: flex-start;
  margin-bottom: 14px;
}

.segmented {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f5f2;
}

.segmented button {
  background: transparent;
  border: 0;
  color: var(--coffee);
  box-shadow: none;
  padding: 9px 12px;
}

.segmented button.active {
  background: var(--graphite);
  color: #fff;
}

.overview-filters {
  display: grid;
  grid-template-columns: 180px 220px;
  gap: 12px;
  margin-bottom: 14px;
}

.overview-result {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.overview-result strong {
  display: block;
  margin: 8px 0 3px;
  font-size: 44px;
}

.overview-result small {
  color: var(--muted);
}

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

.overview-mini-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.overview-mini-row span {
  color: var(--muted);
}

.analysis-filters {
  display: grid;
  grid-template-columns: 110px 120px 150px auto;
  gap: 10px;
  align-items: end;
}

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

.analysis-summary article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 22px rgba(48, 42, 38, 0.045);
}

.analysis-summary span {
  color: var(--muted);
}

.analysis-summary strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
  line-height: 1.05;
}

.analysis-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.analysis-chart-panel,
.analysis-ranking {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 22px rgba(48, 42, 38, 0.045);
}

.chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.chart-head span {
  color: var(--muted);
  font-size: 13px;
}

.bar-chart {
  min-height: 210px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(18px, 1fr);
  gap: 8px;
  align-items: end;
  overflow-x: auto;
  padding: 18px 6px 4px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fbfaf8, #f4f1ee);
}

.bar-item {
  min-width: 22px;
  display: grid;
  gap: 8px;
  justify-items: center;
  align-items: end;
}

.bar-stack {
  height: 142px;
  display: flex;
  gap: 3px;
  align-items: end;
}

.bar {
  width: 8px;
  border-radius: 999px 999px 2px 2px;
  display: block;
}

.bar.customers {
  background: #9f756c;
}

.bar.visits {
  background: #687d76;
}

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

.rank-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
}

.rank-index {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f4eee9;
  color: var(--coffee);
  font-weight: 800;
}

.rank-card strong,
.rank-card span {
  display: block;
}

.rank-card span {
  color: var(--muted);
  margin-top: 4px;
}

.rank-metrics {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rank-metrics span {
  margin: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f7f3ef;
  color: var(--coffee);
  font-size: 12px;
}

.panel-head {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
  gap: 10px;
}

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

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

.publish-form textarea {
  min-height: 180px;
}

.wide-field,
.publish-form .check-row,
.form-actions,
.doctor-fields {
  grid-column: 1 / -1;
}

.doctor-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(244, 232, 228, 0.62), rgba(237, 242, 239, 0.82));
}

.doctor-fields.hidden,
.preview-doctor.hidden,
.hidden {
  display: none;
}

.form-actions {
  display: flex;
  gap: 10px;
}

.field-note {
  color: var(--muted);
  font-size: 13px;
}

.media-manager {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 245, 242, 0.86);
}

.media-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.media-tile {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 8px 18px rgba(48, 42, 38, 0.05);
}

.media-tile img,
.media-tile video {
  width: 100%;
  height: 118px;
  object-fit: cover;
  display: block;
  background: #eee5df;
}

.media-tile button {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 6px 8px;
  min-height: 0;
  border-radius: 999px;
  background: rgba(42, 36, 32, 0.86);
  color: #fff;
  box-shadow: none;
  font-size: 12px;
}

.media-kind {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.9);
  color: var(--coffee);
  font-size: 12px;
  font-weight: 800;
}

.card-actions {
  display: grid;
  grid-template-columns: max-content minmax(220px, 1fr) max-content;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

.card-actions button {
  min-height: 44px;
  white-space: nowrap;
}

.card-actions .transfer-select {
  min-height: 44px;
}

.customer-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) 160px 160px;
  gap: 10px;
  width: min(720px, 100%);
}

.customer-line {
  display: grid;
  gap: 4px;
}

.customer-line strong {
  color: var(--ink);
}

.customer-advisor {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--sage);
  font-weight: 800;
}

.customer-advisor.muted-line {
  margin-top: 0;
  color: var(--taupe);
  font-weight: 700;
}

.check-row {
  display: flex;
  grid-auto-flow: column;
  align-items: center;
  justify-content: start;
  gap: 8px;
  color: var(--muted);
}

.check-row input {
  width: auto;
}

.list,
.grid-list {
  display: grid;
  gap: 12px;
}

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

.publish-preview {
  position: sticky;
  top: 18px;
}

.preview-phone {
  overflow: hidden;
  border: 7px solid #1f1d1b;
  border-radius: 30px;
  background: #f8f6f3;
  box-shadow: 0 24px 56px rgba(37, 31, 28, 0.15);
}

.preview-cover {
  height: 210px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f4e8e4, #edf2ef);
  background-position: center;
  background-size: cover;
  color: var(--taupe);
  font-size: 28px;
  font-weight: 800;
}

.preview-cover video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-body {
  display: grid;
  gap: 12px;
  padding: 20px;
}

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

.preview-media-list .media-tile {
  min-height: 88px;
}

.preview-media-list .media-tile img,
.preview-media-list .media-tile video {
  height: 88px;
}

.preview-body h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

.preview-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.preview-doctor {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(244, 232, 228, 0.72), rgba(237, 242, 239, 0.9));
}

.preview-doctor strong {
  color: var(--coffee);
}

.hairline {
  height: 1px;
  background: var(--line);
}

.item-card {
  display: grid;
  gap: 8px;
}

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

.badge {
  display: inline-flex;
  width: max-content;
  align-items: center;
  border-radius: 999px;
  background: #f4eee9;
  color: #72594f;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 800;
}

.danger {
  background: #8d4c4b;
}

.ghost {
  background: rgba(255, 255, 255, 0.92);
  color: var(--coffee);
  border: 1px solid var(--line);
  box-shadow: none;
}

.item-card:hover,
.stats article:hover,
.overview-result article:hover {
  border-color: rgba(159, 117, 108, 0.32);
}

@media (max-width: 860px) {
  .hero,
  .stats,
  .analysis-summary,
  .analysis-layout,
  .analysis-filters,
  .overview-filters,
  .overview-result,
  .publish-layout,
  .publish-form,
  .doctor-fields,
  .customer-filters,
  .inline-form,
  .grid-list,
  .media-list {
    grid-template-columns: 1fr;
  }

  .publish-preview {
    position: static;
  }

  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

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

@media (max-width: 620px) {
  body {
    background: #f8f6f3;
  }

  .shell {
    width: 100%;
    margin: 0;
    padding: 10px;
  }

  .hero {
    min-height: auto;
    padding: 22px;
    grid-template-columns: 1fr;
    gap: 18px;
  }

  h1 {
    font-size: 30px;
  }

  .sub {
    font-size: 14px;
  }

  .app-panel,
  .login-panel {
    padding: 14px;
    margin-top: 12px;
    box-shadow: none;
  }

  .admin-topbar,
  .panel-head,
  .topbar-actions {
    align-items: stretch;
  }

  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 10px;
  }

  .tabs button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 12px;
    font-size: 13px;
  }

  input,
  select,
  textarea,
  button {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 14px;
  }

  .stats strong,
  .analysis-summary strong {
    font-size: 28px;
  }

  .item-card,
  .stats article,
  .analysis-summary article,
  .analysis-chart-panel,
  .analysis-ranking {
    padding: 14px;
  }
}

body.phone-fit .shell {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 10px;
}

body.phone-fit .hero,
body.phone-fit .stats,
body.phone-fit .analysis-summary,
body.phone-fit .analysis-layout,
body.phone-fit .analysis-filters,
body.phone-fit .overview-filters,
body.phone-fit .overview-result,
body.phone-fit .publish-layout,
body.phone-fit .publish-form,
body.phone-fit .doctor-fields,
body.phone-fit .customer-filters,
body.phone-fit .inline-form,
body.phone-fit .grid-list,
body.phone-fit .media-list {
  grid-template-columns: 1fr;
}

body.phone-fit .hero {
  min-height: auto;
  padding: 22px;
}

body.phone-fit .app-panel,
body.phone-fit .login-panel {
  padding: 14px;
  box-shadow: none;
}

body.phone-fit .tabs {
  overflow-x: auto;
  flex-wrap: nowrap;
}

body.phone-fit .tabs button {
  flex: 0 0 auto;
}

body.phone-fit .publish-preview {
  position: static;
}

/* Final commercial UI pass: quieter, denser, and mobile-first. */
:root {
  --ink: #242321;
  --muted: #706a65;
  --line: #e5dfd8;
  --paper: #f6f4f1;
  --card: #fffdfb;
  --rose: #8e6f66;
  --sage: #65786f;
  --taupe: #6c5f58;
  --coffee: #3d3834;
  --graphite: #222321;
  --gold: #9c8258;
  --shadow: 0 1px 2px rgba(38, 35, 32, 0.04), 0 10px 26px rgba(38, 35, 32, 0.05);
  --shadow-soft: 0 1px 2px rgba(38, 35, 32, 0.035);
  --focus: rgba(101, 120, 111, 0.14);
  --radius: 6px;
}

body {
  background: var(--paper);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  box-shadow: none;
  font-weight: 650;
}

button:hover {
  transform: none;
  box-shadow: none;
  background: #2b2b29;
}

input,
select,
textarea {
  background: #fff;
  border-color: var(--line);
  box-shadow: none;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin-top: 22px;
}

.hero {
  min-height: 184px;
  grid-template-columns: minmax(0, 1fr) 188px;
  gap: 28px;
  padding: 30px 34px;
  background: #242321;
  border-color: #242321;
  box-shadow: none;
}

.hero::after {
  left: 34px;
  right: 34px;
  background: rgba(156, 130, 88, 0.72);
}

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

.hero .eyebrow {
  color: #bca174;
}

h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
}

.sub {
  max-width: 580px;
  font-size: 15px;
  line-height: 1.7;
}

.hero-card {
  min-height: 134px;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: none;
  border-radius: var(--radius);
}

.hero-card strong {
  font-size: 42px;
}

.login-panel,
.app-panel,
.admin-topbar,
.account-settings,
.overview-content,
.stats article,
.item-card,
.overview-result article,
.analysis-summary article,
.analysis-chart-panel,
.analysis-ranking,
.media-manager,
.rank-card {
  background: var(--card);
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
  backdrop-filter: none;
}

.app-panel {
  padding: 22px;
}

.admin-topbar {
  padding: 14px 16px;
}

.tabs {
  gap: 6px;
  padding-bottom: 12px;
}

.tabs button {
  min-height: 38px;
  padding: 8px 14px;
  color: var(--coffee);
  background: #fff;
}

.tabs button.active {
  background: var(--graphite);
}

.stats {
  gap: 10px;
}

.stats article,
.item-card,
.overview-result article,
.analysis-summary article {
  padding: 15px;
}

.stats strong,
.analysis-summary strong {
  font-size: 30px;
}

.doctor-fields,
.preview-doctor,
.preview-cover {
  background: #f5f1ed;
}

.preview-phone {
  border-width: 5px;
  border-radius: 22px;
  box-shadow: none;
}

.badge,
.rank-metrics span,
.meta-pill {
  background: #f2ede8;
  color: var(--taupe);
}

.danger {
  background: #87504d;
}

.ghost:hover {
  background: #f7f4f1;
  color: var(--coffee);
}

@media (max-width: 760px) {
  body {
    background: #f7f5f2;
    font-size: 14px;
  }

  .shell,
  body.phone-fit .shell {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .hero,
  body.phone-fit .hero {
    min-height: 128px;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 20px 16px 18px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .hero::after {
    left: 16px;
    right: 16px;
  }

  .hero-card {
    display: none;
  }

  h1 {
    font-size: 26px;
  }

  h2 {
    font-size: 19px;
  }

  .sub {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.58;
  }

  .login-panel,
  .app-panel,
  body.phone-fit .app-panel,
  body.phone-fit .login-panel {
    margin: 0;
    padding: 12px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  .admin-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    margin: -12px -12px 12px;
    padding: 12px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: stretch;
  }

  .topbar-actions button {
    width: 100%;
  }

  .account-settings {
    margin: 0 0 12px;
    padding: 12px;
    border-radius: var(--radius);
  }

  .tabs,
  body.phone-fit .tabs {
    position: sticky;
    top: 92px;
    z-index: 18;
    overflow-x: auto;
    flex-wrap: nowrap;
    margin: 0 -12px;
    padding: 8px 12px 10px;
    background: #fffdfb;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tabs button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 12px;
    font-size: 13px;
  }

  .tab-page {
    padding-top: 14px;
  }

  .panel-head,
  .media-toolbar,
  .row {
    align-items: stretch;
    flex-direction: column;
  }

  .stats,
  .analysis-summary,
  .analysis-layout,
  .analysis-filters,
  .overview-filters,
  .overview-result,
  .publish-layout,
  .publish-form,
  .doctor-fields,
  .customer-filters,
  .inline-form,
  .account-form,
  .grid-list,
  .media-list,
  .preview-media-list,
  body.phone-fit .stats,
  body.phone-fit .analysis-summary,
  body.phone-fit .analysis-layout,
  body.phone-fit .analysis-filters,
  body.phone-fit .overview-filters,
  body.phone-fit .overview-result,
  body.phone-fit .publish-layout,
  body.phone-fit .publish-form,
  body.phone-fit .doctor-fields,
  body.phone-fit .customer-filters,
  body.phone-fit .inline-form,
  body.phone-fit .account-form,
  body.phone-fit .grid-list,
  body.phone-fit .media-list {
    grid-template-columns: 1fr;
  }

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

  .stats article,
  .item-card,
  .overview-result article,
  .analysis-summary article,
  .analysis-chart-panel,
  .analysis-ranking {
    padding: 12px;
  }

  .stats strong,
  .analysis-summary strong {
    font-size: 24px;
  }

  .publish-preview,
  body.phone-fit .publish-preview {
    position: static;
  }

  .preview-phone {
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  .preview-cover {
    height: 150px;
  }

  .preview-body h3 {
    font-size: 20px;
  }

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

  input,
  select,
  textarea,
  button {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 14px;
  }
}

/* Premium commercial system pass: calmer medical-aesthetic admin shell. */
:root {
  --ink: #202321;
  --muted: #6f746f;
  --line: #e1ded8;
  --paper: #f5f3ef;
  --card: #fffdf9;
  --rose: #8b6d64;
  --sage: #65786f;
  --sage-soft: #eef3ef;
  --taupe: #746962;
  --coffee: #373431;
  --graphite: #202320;
  --gold: #9b8363;
  --shadow: 0 18px 44px rgba(31, 35, 32, 0.075);
  --shadow-soft: 0 8px 24px rgba(31, 35, 32, 0.05);
  --radius: 8px;
}

body {
  background:
    linear-gradient(180deg, #fbfaf7 0%, #f3f1ed 42%, #f8f7f4 100%);
  color: var(--ink);
  font-feature-settings: "kern";
}

.shell {
  width: min(1280px, calc(100% - 44px));
}

.hero {
  min-height: 198px;
  padding: 32px 38px;
  background:
    linear-gradient(135deg, #1d201e 0%, #2b2b28 58%, #514941 100%);
  border-color: rgba(231, 226, 219, 0.82);
}

h1 {
  font-size: clamp(32px, 3.9vw, 52px);
  font-weight: 780;
}

h2 {
  font-size: 22px;
  font-weight: 720;
}

.sub {
  font-size: 15px;
}

.login-panel,
.app-panel,
.admin-topbar,
.account-settings,
.overview-content,
.stats article,
.item-card,
.overview-result article,
.analysis-summary article,
.analysis-chart-panel,
.analysis-ranking {
  background: rgba(255, 253, 249, 0.94);
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
}

.admin-topbar {
  padding: 18px 20px;
}

.tabs {
  gap: 8px;
}

.tabs button,
.segmented button {
  box-shadow: none;
  font-weight: 650;
}

.tabs button {
  background: #fbfaf7;
  color: #494844;
  border: 1px solid var(--line);
}

.tabs button.active,
.segmented button.active {
  background: #202320;
  color: #fff;
  border-color: #202320;
}

.stats {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.stats article {
  min-height: 96px;
  padding: 17px 18px;
}

.stats span,
.item-card span,
.overview-result small,
.overview-mini-row small {
  color: var(--muted);
}

.stats strong {
  margin-top: 8px;
  font-size: 30px;
  font-weight: 760;
}

.overview-content {
  padding: 18px;
}

.compact-head h2 {
  font-size: 20px;
}

.overview-result {
  grid-template-columns: 190px minmax(0, 1fr);
}

.overview-result article {
  position: sticky;
  top: 14px;
  padding: 18px;
}

.overview-result strong {
  font-size: 38px;
  font-weight: 780;
}

.overview-result-list {
  gap: 10px;
}

.overview-mini-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-height: 94px;
  padding: 11px;
  border-color: var(--line);
  background: #fffdf9;
  box-shadow: 0 1px 0 rgba(31, 35, 32, 0.03);
}

.overview-mini-row.is-disabled {
  opacity: 0.58;
}

.overview-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 7px;
  background: #ece7df;
  border: 1px solid #e4ded6;
}

.overview-thumb-empty {
  display: grid;
  place-items: center;
  color: #806f64;
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
}

.overview-mini-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.overview-mini-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.overview-mini-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.overview-mini-copy > span,
.overview-mini-copy > small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.muted-badge {
  background: #f1ece7;
  color: #917f73;
}

.item-card {
  gap: 8px;
}

.item-card strong {
  font-size: 18px;
  line-height: 1.35;
}

button {
  background: #202320;
  box-shadow: 0 10px 22px rgba(31, 35, 32, 0.11);
}

.ghost {
  background: #fffdf9;
}

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

  * {
    min-width: 0;
  }

  .shell,
  body.phone-fit .shell {
    width: 100%;
    max-width: 100%;
    padding: 0;
    overflow-x: hidden;
  }

  .hero,
  body.phone-fit .hero {
    min-height: 104px;
    padding: 16px 14px;
  }

  h1 {
    font-size: 22px;
    line-height: 1.18;
  }

  h2,
  .compact-head h2 {
    font-size: 16px;
  }

  .sub {
    max-width: 24em;
    font-size: 12px;
    line-height: 1.45;
  }

  .app-panel,
  body.phone-fit .app-panel {
    padding: 10px;
    overflow-x: hidden;
  }

  .admin-topbar {
    padding: 11px 12px;
  }

  .admin-topbar strong {
    font-size: 16px;
  }

  .admin-topbar small,
  .hint,
  label {
    font-size: 12px;
  }

  .tabs,
  body.phone-fit .tabs {
    top: 82px;
    gap: 7px;
    padding: 7px 10px 9px;
  }

  .tabs button {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
  }

  .stats,
  body.phone-fit .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .stats article {
    min-height: 76px;
    padding: 10px 11px;
  }

  .stats span {
    font-size: 12px;
  }

  .stats strong,
  .analysis-summary strong {
    margin-top: 6px;
    font-size: 20px;
  }

  .overview-content {
    margin-top: 12px;
    padding: 12px;
  }

  .compact-head {
    gap: 10px;
  }

  .segmented {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .segmented button {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
  }

  .overview-filters,
  body.phone-fit .overview-filters {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .overview-result,
  body.phone-fit .overview-result {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .overview-result article {
    position: static;
    padding: 12px;
  }

  .overview-result strong {
    font-size: 24px;
  }

  .overview-mini-row {
    grid-template-columns: 60px minmax(0, 1fr);
    max-width: 100%;
    min-height: 78px;
    gap: 10px;
    padding: 9px;
  }

  .overview-thumb {
    width: 60px;
    height: 60px;
  }

  .overview-mini-title strong {
    font-size: 14px;
  }

  .overview-mini-copy > span,
  .overview-mini-copy > small {
    font-size: 12px;
  }

  .badge {
    min-height: 20px;
    padding: 2px 6px;
    font-size: 11px;
  }

  .item-card strong {
    font-size: 15px;
  }

  .grid-list,
  body.phone-fit .grid-list {
    gap: 10px;
  }
}
