:root {
  --red: #e2232f;
  --red-dark: #bd1520;
  --red-soft: #fff0f1;
  --ink: #17191d;
  --ink-2: #3c4047;
  --muted: #717680;
  --line: #e5e7eb;
  --line-strong: #d5d8dd;
  --surface: #ffffff;
  --canvas: #f5f6f8;
  --green: #138a5b;
  --green-soft: #eaf8f2;
  --amber: #b76a00;
  --amber-soft: #fff5df;
  --blue: #1769aa;
  --blue-soft: #edf6ff;
  --cyan: #087f8c;
  --shadow: 0 8px 24px rgba(22, 26, 32, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

img {
  display: block;
  max-width: 100%;
}

.icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.9;
}

.icon-sm {
  width: 15px;
  height: 15px;
}

.icon-lg {
  width: 22px;
  height: 22px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
}

.icon-btn:hover {
  color: var(--red);
  background: var(--red-soft);
}

.btn {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink-2);
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.btn:hover {
  border-color: #aeb3ba;
  color: var(--ink);
}

.btn-primary {
  border-color: var(--red);
  color: #fff;
  background: var(--red);
}

.btn-primary:hover {
  border-color: var(--red-dark);
  color: #fff;
  background: var(--red-dark);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
}

.btn-danger-ghost {
  color: var(--red);
  border-color: transparent;
  background: transparent;
}

.btn-compact {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
  color: var(--muted);
  background: #f0f1f3;
}

.tag-red {
  color: var(--red-dark);
  background: var(--red-soft);
}

.tag-green {
  color: var(--green);
  background: var(--green-soft);
}

.tag-amber {
  color: var(--amber);
  background: var(--amber-soft);
}

.tag-blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

/* Mobile app */
.mobile-page {
  min-height: 100vh;
  background:
    linear-gradient(90deg, #eceff2 0, #f7f8f9 35%, #f7f8f9 65%, #eceff2 100%);
}

.mobile-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  color: var(--ink);
  background: var(--canvas);
  box-shadow: 0 0 30px rgba(21, 25, 31, 0.12);
}

.mobile-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 56px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
}

.mobile-header h1 {
  margin: 0;
  overflow: hidden;
  font-size: 18px;
  font-weight: 650;
  line-height: 24px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-main {
  min-height: calc(100vh - 56px);
  padding: 14px 14px 92px;
}

.mobile-main.form-main {
  padding-bottom: 96px;
}

.todo-fixed-header {
  position: sticky;
  z-index: 20;
  top: 0;
  padding: 12px 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.todo-fixed-header h1 {
  margin: 0 0 22px;
  font-size: 18px;
  font-weight: 650;
  line-height: 24px;
  text-align: center;
}

.todo-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.todo-summary-card {
  position: relative;
  min-width: 0;
  min-height: 82px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: 1fr auto;
  align-items: center;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  text-align: left;
  background: #fff;
}

.todo-summary-card.active {
  border-color: var(--red);
}

.todo-summary-card .todo-summary-icon {
  align-self: start;
  color: var(--ink);
}

.todo-summary-card.active .todo-summary-icon,
.todo-summary-card.active > span:last-child {
  color: var(--red);
}

.todo-summary-card strong {
  align-self: start;
  font-size: 22px;
  line-height: 24px;
}

.todo-summary-card > span:last-child {
  grid-column: 1 / -1;
  color: #8b8f96;
  font-size: 14px;
}

.todo-muted-icon {
  position: absolute;
  right: 14px;
  bottom: 13px;
  color: #9da1a8;
}

.todo-home-main {
  min-height: calc(100vh - 180px);
  padding: 6px 12px 92px;
  background: #fff;
}

.todo-search {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  color: #9a9fa7;
  background: #fff;
}

.todo-search input {
  min-width: 0;
  flex: 1;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}

.todo-search input::placeholder {
  color: #a4a8af;
}

.todo-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 18px 0 0;
  border-bottom: 1px solid var(--line);
}

.todo-tabs button {
  position: relative;
  min-width: 0;
  height: 50px;
  padding: 0 2px;
  border: 0;
  color: #91959c;
  background: transparent;
  font-size: 14px;
  white-space: nowrap;
}

.todo-tabs button.active {
  color: var(--ink);
  font-weight: 650;
}

.todo-tabs button.active::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 2px;
  background: var(--ink);
}

.todo-task-content {
  padding-top: 16px;
}

.todo-content-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 10px;
}

.todo-content-head h2 {
  margin: 0;
  font-size: 15px;
  line-height: 22px;
}

.todo-content-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.todo-entry-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 0;
  border: 0;
  color: var(--red);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.app-hero {
  position: relative;
  min-height: 112px;
  padding: 18px;
  overflow: hidden;
  border-radius: 8px;
  color: #fff;
  background: #20242a;
}

.app-hero::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -42px;
  width: 150px;
  height: 110px;
  border: 18px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  transform: rotate(-20deg);
}

.app-hero-label {
  position: relative;
  z-index: 1;
  margin-bottom: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.app-hero-title {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 23px;
  font-weight: 650;
  line-height: 31px;
}

.app-hero-meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.quick-entry {
  width: 100%;
  display: grid;
  grid-template-columns: 40px 1fr 24px;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 13px 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.quick-entry-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #fff;
  background: var(--red);
}

.quick-entry strong {
  display: block;
  margin-bottom: 3px;
  font-size: 15px;
}

.quick-entry span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.mobile-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 18px 0 10px;
  border-bottom: 1px solid var(--line);
}

.mobile-tab {
  position: relative;
  height: 42px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 15px;
}

.mobile-tab.active {
  color: var(--ink);
  font-weight: 650;
}

.mobile-tab.active::after {
  content: "";
  position: absolute;
  right: 27%;
  bottom: -1px;
  left: 27%;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--red);
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-card {
  width: 100%;
  padding: 15px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.task-card:active {
  background: #fafafa;
}

.task-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.task-card h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  line-height: 23px;
}

.task-card p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
}

.task-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.task-progress {
  flex: 1;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: #eceef1;
}

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

.task-progress-row b {
  min-width: 32px;
  font-size: 12px;
  text-align: right;
}

.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid #f0f1f2;
  font-size: 12px;
  color: var(--muted);
}

.task-card-footer .warning {
  color: var(--red);
  font-weight: 600;
}

.bottom-nav {
  position: fixed;
  z-index: 24;
  right: max(0px, calc((100vw - 430px) / 2));
  bottom: 0;
  left: max(0px, calc((100vw - 430px) / 2));
  height: 70px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  color: #7c8189;
  background: transparent;
  font-size: 11px;
}

.bottom-nav button.active {
  color: var(--red);
  font-weight: 600;
}

.detail-summary {
  padding: 16px;
  border-radius: 8px;
  color: #fff;
  background: #24282e;
}

.detail-summary .tag {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.detail-summary-tags {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-summary h2 {
  margin: 10px 0 8px;
  font-size: 21px;
  line-height: 29px;
}

.detail-summary p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  line-height: 20px;
}

.summary-progress {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 18px;
}

.summary-progress strong {
  font-size: 28px;
  line-height: 32px;
}

.summary-progress span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.68);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 20px 2px 10px;
}

.section-title h2 {
  margin: 0;
  font-size: 16px;
  line-height: 22px;
}

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

.city-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.city-item {
  width: 100%;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #eff0f2;
  background: #fff;
}

.city-item:last-child {
  border-bottom: 0;
}

.city-status-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--muted);
  background: #f0f1f3;
}

.city-status-icon.done {
  color: var(--green);
  background: var(--green-soft);
}

.city-status-icon.draft {
  color: var(--amber);
  background: var(--amber-soft);
}

.city-item strong {
  display: block;
  font-size: 14px;
}

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

.sticky-actions {
  position: fixed;
  z-index: 23;
  right: max(0px, calc((100vw - 430px) / 2));
  bottom: 0;
  left: max(0px, calc((100vw - 430px) / 2));
  display: grid;
  grid-template-columns: minmax(112px, 0.7fr) 1.3fr;
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.sticky-actions .btn {
  min-height: 44px;
}

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

.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 0 2px 16px;
}

.step {
  position: relative;
  padding-top: 22px;
  color: #a0a4aa;
  font-size: 11px;
  text-align: center;
}

.step::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 2px;
  left: calc(50% - 7px);
  width: 14px;
  height: 14px;
  border: 3px solid var(--canvas);
  border-radius: 50%;
  background: #c9cdd2;
}

.step::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #d8dbe0;
}

.step:last-child::after {
  display: none;
}

.step.active,
.step.done {
  color: var(--ink);
  font-weight: 600;
}

.step.active::before,
.step.done::before {
  background: var(--red);
}

.step.done::after {
  background: var(--red);
}

.form-section {
  margin-bottom: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.form-section.compact-section {
  padding: 14px;
}

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

.form-section-header h2 {
  margin: 0;
  font-size: 16px;
  line-height: 23px;
}

.form-section-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 10px;
}

.field {
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-2);
  font-size: 13px;
}

.required::before {
  content: "*";
  margin-right: 3px;
  color: var(--red);
}

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

.field textarea {
  min-height: 76px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.field input[readonly] {
  color: var(--muted);
  background: #f6f7f8;
}

.input-unit {
  position: relative;
}

.input-unit input {
  padding-right: 38px;
}

.input-unit span {
  position: absolute;
  top: 50%;
  right: 11px;
  color: var(--muted);
  font-size: 12px;
  transform: translateY(-50%);
}

.ratio-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  grid-column: 1 / -1;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 12px;
}

.ratio-hint.invalid {
  color: var(--red-dark);
  background: var(--red-soft);
}

.edit-notice {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 12px;
  padding: 9px 11px;
  border: 1px solid #f3d7a4;
  border-radius: 6px;
  color: #805814;
  background: #fff8e8;
  font-size: 12px;
  line-height: 18px;
}

.brand-card {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.brand-card-head {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 13px;
}

.brand-card-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.icon-btn.danger {
  color: var(--muted);
}

.icon-btn.danger:hover {
  color: var(--red);
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.brand-card h3 {
  margin: 0;
  font-size: 15px;
}

.brand-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.brand-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid #eff0f2;
}

.brand-stat {
  padding: 10px 6px;
  text-align: center;
}

.brand-stat + .brand-stat {
  border-left: 1px solid #eff0f2;
}

.brand-stat b {
  display: block;
  font-size: 14px;
}

.brand-stat span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.add-block {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px dashed #b8bdc5;
  border-radius: 8px;
  color: var(--ink-2);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
}

.brand-selector {
  display: flex;
  gap: 7px;
  margin: -2px -2px 12px;
  padding: 2px;
  overflow-x: auto;
}

.brand-selector button {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #fff;
}

.brand-selector button.active {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-soft);
  font-weight: 600;
}

.model-card {
  margin-top: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}

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

.model-card-head h3 {
  margin: 0;
  font-size: 14px;
}

.model-card .field input,
.model-card .field select {
  background: #fff;
}

.brand-inline-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-inline-title .brand-mark {
  flex: 0 0 auto;
}

.brand-inline-title h2,
.brand-inline-title p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-summary-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.brand-summary-metrics div {
  padding: 10px 6px;
  text-align: center;
  background: #fafafa;
}

.brand-summary-metrics div + div {
  border-left: 1px solid var(--line);
}

.brand-summary-metrics b,
.brand-summary-metrics span {
  display: block;
}

.brand-summary-metrics b {
  font-size: 14px;
}

.brand-summary-metrics span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.model-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.model-list-row {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  background: #fff;
}

.model-list-row:last-child {
  border-bottom: 0;
}

.model-list-row:active {
  background: #fafafa;
}

.model-rank {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--muted);
  background: #f0f1f3;
  font-size: 12px;
  font-weight: 700;
}

.model-list-row:first-child .model-rank {
  color: #fff;
  background: var(--red);
}

.model-list-main {
  min-width: 0;
}

.model-list-main strong,
.model-list-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-list-main strong {
  font-size: 14px;
}

.model-list-main small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.model-list-price {
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.inline-empty,
.empty-compact {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  color: var(--muted);
  text-align: center;
}

.inline-empty {
  gap: 6px;
  font-size: 12px;
}

.empty-compact h2 {
  margin: 10px 0 4px;
  color: var(--ink);
  font-size: 16px;
}

.empty-compact p {
  max-width: 260px;
  margin: 0;
  font-size: 12px;
  line-height: 18px;
}

.price-stack {
  height: 10px;
  display: flex;
  overflow: hidden;
  border-radius: 5px;
  background: #eceef1;
}

.price-stack span {
  min-width: 2px;
  height: 100%;
}

.price-stack .tone-0 {
  background: var(--cyan);
}

.price-stack .tone-1 {
  background: var(--red);
}

.price-stack .tone-2 {
  background: var(--blue);
}

.price-stack .tone-3 {
  background: var(--amber);
}

.price-summary-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 13px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.price-summary-labels b {
  color: var(--ink);
}

.share-total {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
}

.share-total span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.share-total.valid {
  color: var(--green);
  background: var(--green-soft);
}

.share-total.invalid {
  color: var(--red-dark);
  background: var(--red-soft);
}

.review-list {
  display: grid;
  gap: 9px;
}

.review-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  font-size: 13px;
  line-height: 20px;
}

.review-row span:first-child {
  color: var(--muted);
}

.review-row strong {
  max-width: 65%;
  text-align: right;
}

.price-bars {
  display: grid;
  gap: 10px;
}

.price-bar {
  display: grid;
  grid-template-columns: 88px 1fr 40px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.price-bar-track {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #eceef1;
}

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

.success-view {
  min-height: calc(100vh - 86px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  text-align: center;
}

.success-icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border-radius: 50%;
  color: var(--green);
  background: var(--green-soft);
}

.success-view h2 {
  margin: 0;
  font-size: 22px;
}

.success-view p {
  max-width: 290px;
  margin: 10px 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 22px;
}

.success-actions {
  width: 100%;
  max-width: 310px;
  display: grid;
  gap: 10px;
}

.success-actions .btn {
  min-height: 44px;
}

.sheet-backdrop {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(12, 14, 18, 0.42);
}

.bottom-sheet {
  width: min(100%, 430px);
  max-height: calc(100vh - 56px);
  max-height: calc(100dvh - 56px);
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  overflow: auto;
  border-radius: 8px 8px 0 0;
  background: #fff;
}

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

.sheet-head h2 {
  margin: 0;
  font-size: 18px;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.option-grid button {
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-2);
  background: #fff;
}

.option-grid button:hover,
.option-grid button.selected {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-soft);
}

.sheet-form {
  padding: 2px 0 6px;
}

.sheet-footer {
  position: sticky;
  z-index: 3;
  bottom: calc(-18px - env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 9px;
  margin: 14px -16px calc(-18px - env(safe-area-inset-bottom));
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fff;
}

.sheet-footer.split {
  grid-template-columns: 1fr 1fr;
  justify-content: space-between;
}

.sheet-footer .btn {
  min-height: 44px;
}

.confirm-sheet {
  padding: 8px 8px 4px;
  text-align: center;
}

.confirm-sheet-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  border-radius: 50%;
  color: var(--red);
  background: var(--red-soft);
}

.confirm-sheet h3 {
  margin: 0;
  font-size: 17px;
}

.confirm-sheet p {
  margin: 8px auto 0;
  max-width: 310px;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.range-intro {
  margin-bottom: 12px;
}

.range-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 19px;
}

.range-list {
  display: grid;
  gap: 9px;
}

.range-field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 7px 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fafafa;
}

.range-field > span {
  font-size: 13px;
}

.range-field output {
  min-width: 42px;
  padding: 3px 7px;
  border-radius: 12px;
  color: var(--red);
  text-align: center;
  background: var(--red-soft);
  font-size: 12px;
  font-weight: 700;
}

.range-field input[type="range"] {
  --range-value: 0%;
  grid-column: 1 / -1;
  width: 100%;
  height: 20px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.range-field input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--red) 0 var(--range-value), #dfe2e6 var(--range-value) 100%);
}

.range-field input[type="range"]::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  margin-top: -7px;
  appearance: none;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 1px 5px rgba(18, 22, 28, 0.25);
}

.range-field input[type="range"]:focus-visible {
  outline: 2px solid rgba(226, 35, 47, 0.28);
  outline-offset: 2px;
}

.price-average-field {
  margin-top: 13px;
}

.done-detail-tabs {
  display: flex;
  gap: 20px;
  margin: 16px 0 12px;
  border-bottom: 1px solid var(--line);
}

.done-detail-tabs button {
  position: relative;
  height: 38px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
}

.done-detail-tabs button.active {
  color: var(--ink);
  font-weight: 650;
}

.done-detail-tabs button.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--red);
}

/* PC admin */
.admin-page {
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-rows: 58px minmax(0, 1fr);
}

.admin-sidebar {
  position: fixed;
  z-index: 30;
  top: 0;
  bottom: 0;
  left: 0;
  width: 220px;
  padding: 0 12px;
  color: #fff;
  background: #1b1e23;
}

.admin-logo {
  height: 58px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.admin-logo img {
  width: 124px;
  filter: brightness(0) invert(1);
}

.sidebar-label {
  padding: 20px 10px 7px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
}

.sidebar-nav {
  display: grid;
  gap: 3px;
}

.sidebar-nav button {
  width: 100%;
  height: 42px;
  display: grid;
  grid-template-columns: 22px 1fr 18px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.68);
  text-align: left;
  background: transparent;
  font-size: 14px;
}

.sidebar-nav button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.sidebar-nav button.active {
  color: #fff;
  background: var(--red);
  font-weight: 600;
}

.sidebar-subnav {
  display: grid;
  gap: 2px;
  margin: 3px 0 8px 30px;
}

.sidebar-subnav button {
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.55);
  text-align: left;
  background: transparent;
  font-size: 13px;
}

.sidebar-subnav button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.admin-header {
  position: sticky;
  z-index: 25;
  top: 0;
  grid-column: 2;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

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

.admin-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: #2b3037;
  font-size: 12px;
  font-weight: 700;
}

.admin-main {
  grid-column: 2;
  min-width: 0;
  padding: 20px 22px 32px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.page-heading h1 {
  margin: 0;
  font-size: 22px;
  line-height: 30px;
}

.page-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-tabs {
  display: flex;
  gap: 26px;
  margin-bottom: 16px;
  padding: 0 2px;
  border-bottom: 1px solid var(--line);
}

.admin-tab {
  position: relative;
  height: 42px;
  padding: 0 2px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
}

.admin-tab.active {
  color: var(--ink);
  font-weight: 650;
}

.admin-tab.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: var(--red);
}

.filter-panel {
  margin-bottom: 12px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
}

.filter-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.filter-field input,
.filter-field select {
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: 0;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
}

.filter-field input:focus,
.filter-field select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.advanced-filters {
  display: none;
  grid-column: 1 / -1;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
}

.advanced-filters.open {
  display: grid;
}

.filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #eff0f2;
}

.filter-action-group {
  display: flex;
  gap: 8px;
}

.filter-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-size: 13px;
}

.table-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.table-toolbar {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
}

.table-toolbar-left,
.table-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-toolbar strong {
  font-size: 14px;
}

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

.table-scroll {
  width: 100%;
  overflow: auto;
}

.data-table {
  width: 100%;
  min-width: 1160px;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table:not(.rules-table) {
  min-width: 1320px;
}

.data-table:not(.rules-table) th:nth-child(2) {
  width: 145px;
}

.data-table:not(.rules-table) th:nth-child(3) {
  width: 90px;
}

.data-table:not(.rules-table) th:nth-child(4),
.data-table:not(.rules-table) th:nth-child(5) {
  width: 100px;
}

.data-table:not(.rules-table) th:nth-child(6) {
  width: 115px;
}

.data-table:not(.rules-table) th:nth-child(7) {
  width: 105px;
}

.data-table:not(.rules-table) th:nth-child(8),
.data-table:not(.rules-table) th:nth-child(9),
.data-table:not(.rules-table) th:nth-child(10) {
  width: 92px;
}

.data-table:not(.rules-table) th:nth-child(11) {
  width: 82px;
}

.data-table:not(.rules-table) th:nth-child(12) {
  width: 128px;
}

.data-table:not(.rules-table) th:nth-child(13) {
  width: 64px;
}

.data-table:not(.rules-table) td:nth-child(2),
.data-table:not(.rules-table) td:nth-child(3),
.data-table:not(.rules-table) td:nth-child(12) {
  white-space: nowrap;
}

.data-table th,
.data-table td {
  padding: 11px 10px;
  border-bottom: 1px solid #eff0f2;
  font-size: 12px;
  line-height: 18px;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  position: sticky;
  z-index: 3;
  top: 0;
  color: #5f646d;
  background: #f6f7f8;
  font-weight: 600;
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: #fafafa;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table .cell-main {
  display: block;
  color: var(--ink);
  font-weight: 600;
}

.data-table .cell-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.table-link {
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-size: 12px;
}

.table-link:hover {
  text-decoration: underline;
}

.pagination {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.pagination button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink-2);
  background: #fff;
}

.pagination button.active {
  border-color: var(--red);
  color: #fff;
  background: var(--red);
}

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

.kpi-card {
  position: relative;
  min-height: 112px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--red);
}

.kpi-card:nth-child(2)::before {
  background: var(--green);
}

.kpi-card:nth-child(3)::before {
  background: var(--blue);
}

.kpi-card:nth-child(4)::before {
  background: var(--amber);
}

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

.kpi-card strong {
  display: block;
  margin-top: 11px;
  font-size: 28px;
  line-height: 32px;
}

.kpi-card small {
  display: block;
  margin-top: 7px;
  color: var(--green);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 12px;
}

.chart-panel {
  min-height: 320px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.panel-head h2 {
  margin: 0;
  font-size: 16px;
}

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

.bar-chart {
  height: 230px;
  display: flex;
  align-items: flex-end;
  gap: 18px;
  padding: 18px 8px 0;
  border-bottom: 1px solid var(--line);
}

.chart-column {
  flex: 1;
  min-width: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.chart-column b {
  font-size: 12px;
}

.chart-bar {
  width: min(38px, 70%);
  min-height: 8px;
  border-radius: 4px 4px 0 0;
  background: var(--red);
}

.chart-column:nth-child(2n) .chart-bar {
  background: var(--cyan);
}

.chart-column span {
  height: 28px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.ranking-list {
  display: grid;
  gap: 15px;
}

.ranking-row {
  display: grid;
  grid-template-columns: 24px 60px 1fr 46px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.rank-num {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  color: var(--muted);
  background: #f0f1f3;
}

.ranking-row:nth-child(-n + 3) .rank-num {
  color: #fff;
  background: var(--ink);
}

.rank-track {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #eceef1;
}

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

.analysis-view-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.analysis-view-tabs button {
  min-width: 96px;
  height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
}

.analysis-view-tabs button:hover {
  color: var(--ink);
  background: #f5f6f8;
}

.analysis-view-tabs button.active {
  color: #fff;
  background: var(--ink);
}

.analysis-filterbar {
  min-height: 58px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.analysis-filter {
  min-width: 140px;
}

.analysis-filter label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.analysis-filter select,
.compact-select,
.province-report-actions select {
  height: 32px;
  padding: 0 28px 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  outline: 0;
  color: var(--ink-2);
  background: #fff;
  font-size: 12px;
}

.analysis-filter select {
  min-width: 140px;
}

.analysis-filter select:focus,
.compact-select:focus,
.province-report-actions select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.analysis-updated {
  margin: 0 0 7px auto;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.analysis-view {
  animation: analysis-in 0.18s ease-out;
}

@keyframes analysis-in {
  from {
    opacity: 0.45;
    transform: translateY(3px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.analysis-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.analysis-kpis > div {
  min-height: 92px;
  padding: 14px 16px;
  background: #fff;
}

.analysis-kpis span,
.analysis-kpis small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.analysis-kpis strong {
  display: inline-block;
  margin: 8px 5px 5px 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 28px;
}

.brand-kpis > div {
  border-top: 3px solid var(--brand-color);
}

.analysis-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.analysis-grid-2 {
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
}

.analysis-panel {
  min-width: 0;
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.analysis-grid > .analysis-panel {
  margin-bottom: 0;
}

.panel-tools {
  display: flex;
  align-items: center;
  gap: 7px;
}

.analysis-download {
  width: 32px;
  height: 32px;
  border-color: var(--line);
  background: #fff;
}

.chart-empty {
  width: 100%;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}

.province-map-shell {
  min-width: 0;
}

.province-map {
  width: 100%;
  height: 318px;
  overflow: hidden;
  border-radius: 6px;
  background: linear-gradient(180deg, #fbfcfd, #f7f8f9);
}

.province-map-meta {
  min-height: 25px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.province-map-source {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #555b63;
}

.province-map-source i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2a9d5b;
}

.province-map-selection {
  margin-left: auto;
  height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 7px;
  border: 1px solid #d9dce0;
  border-radius: 4px;
  color: var(--ink-2);
  background: #fff;
  font-size: 10px;
}

.province-map-selection:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.analysis-table-scroll {
  width: 100%;
  overflow: auto;
  border: 1px solid #eff0f2;
  border-radius: 6px;
}

.compact-height {
  height: 346px;
}

.matrix-height {
  max-height: 430px;
}

.city-height {
  height: 396px;
}

.store-height {
  height: 354px;
}

.province-table-height {
  max-height: 560px;
  border-radius: 0;
}

.analysis-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.analysis-table th,
.analysis-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #eff0f2;
  color: var(--ink-2);
  font-size: 11px;
  line-height: 17px;
  text-align: right;
  white-space: nowrap;
}

.analysis-table th {
  position: sticky;
  z-index: 4;
  top: 0;
  color: #5f646d;
  background: #f7f8f9;
  font-weight: 600;
}

.analysis-table th:first-child,
.analysis-table th:nth-child(2),
.analysis-table td:first-child,
.analysis-table td:nth-child(2) {
  text-align: left;
}

.analysis-table tbody tr:last-child td {
  border-bottom: 0;
}

.analysis-table tbody tr[data-action] {
  cursor: pointer;
}

.analysis-table tbody tr:hover {
  background: #fafbfc;
}

.analysis-table td b {
  color: var(--ink);
}

.analysis-table td small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 400;
}

.share-matrix {
  min-width: 1040px;
}

.heat-cell {
  min-width: 42px;
  display: inline-flex;
  justify-content: flex-end;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(23, 105, 170, calc(0.06 + var(--cell) * 0.4));
}

.share-chart {
  display: grid;
  gap: 10px;
}

.share-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 10px;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--ink-2);
  background: transparent;
  text-align: left;
}

.share-row:hover,
.share-row.active {
  border-color: var(--line);
  background: #f8f9fa;
}

.share-label {
  font-size: 12px;
  font-weight: 600;
}

.share-stack {
  height: 22px;
  display: flex;
  overflow: hidden;
  border-radius: 4px;
  background: #eceef1;
}

.share-stack i {
  min-width: 0;
  height: 100%;
  display: block;
  transition: width 0.22s ease;
}

.share-stack .share-other,
.legend-other {
  background: #9298a1;
}

.share-row > b {
  font-size: 11px;
  text-align: right;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.chart-legend span,
.chart-legend button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chart-legend i {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 2px;
}

.price-stack-chart {
  display: grid;
  gap: 10px;
}

.price-stack-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.price-stack-row > b {
  font-size: 11px;
  text-align: right;
}

.price-stack-row > div {
  height: 28px;
  display: flex;
  overflow: hidden;
  border-radius: 4px;
  background: #eef0f2;
}

.price-segment {
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  color: #26303a;
  transition: filter 0.16s ease, transform 0.16s ease;
}

.price-segment:hover {
  z-index: 2;
  filter: brightness(0.94);
  transform: scaleY(1.12);
}

.price-segment span {
  font-size: 9px;
}

.price-0 {
  background: #5d7fba;
}

.price-1 {
  background: #eb9250;
}

.price-2 {
  background: #f0c84b;
}

.price-3 {
  background: #72a85b;
}

.price-4 {
  background: #36a5a3;
}

.price-5 {
  background: #7b61a8;
}

.price-legend button {
  padding: 3px 5px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
}

.price-legend button:hover,
.price-legend button.active {
  border-color: var(--line);
  color: var(--ink);
  background: #f7f8f9;
}

.price-ranking {
  padding-top: 3px;
}

.brand-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
}

.brand-switcher button {
  min-width: 82px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-2);
  background: #fff;
  font-size: 12px;
  font-weight: 600;
}

.brand-switcher button i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-color);
}

.brand-switcher button:hover,
.brand-switcher button.active {
  border-color: var(--brand-color);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--brand-color);
}

.model-analysis-list {
  display: grid;
}

.model-analysis-row {
  min-height: 66px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) 78px;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid #eff0f2;
}

.model-analysis-row:last-child {
  border-bottom: 0;
}

.model-analysis-row > span {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: #fff;
  background: var(--ink);
  font-size: 10px;
}

.model-analysis-row > div {
  min-width: 0;
}

.model-analysis-row b,
.model-analysis-row small {
  display: block;
}

.model-analysis-row b {
  font-size: 12px;
}

.model-analysis-row small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-analysis-row i {
  height: 4px;
  display: block;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 2px;
  background: #eceef1;
}

.model-analysis-row em {
  height: 100%;
  display: block;
  border-radius: inherit;
  transition: width 0.22s ease;
}

.model-analysis-row > strong {
  font-size: 12px;
  text-align: right;
}

.model-analysis-row > strong small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.store-analysis-layout {
  display: grid;
  grid-template-columns: minmax(440px, 1.2fr) minmax(330px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.inline-empty {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.province-report-panel {
  padding: 0;
  overflow: hidden;
}

.province-report-toolbar,
.province-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.province-report-toolbar {
  border-bottom: 1px solid var(--line);
}

.province-table-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.segmented-control {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f8f9;
}

.segmented-control button {
  height: 29px;
  padding: 0 13px;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 600;
}

.segmented-control button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 4px rgba(22, 26, 32, 0.1);
}

.province-report-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.province-report-actions label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.province-report-table {
  min-width: 1120px;
}

.province-report-table th:first-child,
.province-report-table td:first-child {
  position: sticky;
  z-index: 3;
  left: 0;
  width: 105px;
  background: #fff;
}

.province-report-table th:nth-child(2),
.province-report-table td:nth-child(2) {
  position: sticky;
  z-index: 3;
  left: 105px;
  width: 110px;
  background: #fff;
  box-shadow: 5px 0 8px rgba(22, 26, 32, 0.05);
}

.province-report-table th:first-child,
.province-report-table th:nth-child(2) {
  z-index: 6;
  background: #f7f8f9;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: inherit;
  font-weight: inherit;
}

.sort-button .icon-sm {
  opacity: 0.28;
}

.sort-button.active {
  color: var(--red);
}

.sort-button.active .icon-sm {
  opacity: 1;
}

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

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  color: var(--ink-2);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
}

.detail-primary,
.detail-side {
  min-width: 0;
}

.detail-block {
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.detail-block h2 {
  margin: 0 0 14px;
  font-size: 16px;
}

.description-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 18px;
}

.description-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.description-item strong {
  display: block;
  font-size: 13px;
  line-height: 19px;
}

.brand-detail {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.brand-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #f7f8f9;
}

.brand-detail-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-detail-title b {
  font-size: 14px;
}

.brand-detail-body {
  padding: 13px 14px;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.mini-metric {
  padding: 9px 10px;
  border-radius: 6px;
  background: #f7f8f9;
}

.mini-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.mini-metric b {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.compact-table {
  width: 100%;
  border-collapse: collapse;
}

.compact-table th,
.compact-table td {
  padding: 9px 8px;
  border-bottom: 1px solid #eff0f2;
  font-size: 12px;
  text-align: left;
}

.compact-table th {
  color: var(--muted);
  background: #fafafa;
  font-weight: 600;
}

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

.timeline {
  display: grid;
  gap: 0;
}

.timeline-item {
  position: relative;
  padding: 0 0 18px 19px;
  font-size: 12px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 3px;
  left: 1px;
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 1px var(--red);
}

.timeline-item::after {
  content: "";
  position: absolute;
  top: 13px;
  bottom: -2px;
  left: 5px;
  width: 1px;
  background: var(--line-strong);
}

.timeline-item:last-child::after {
  display: none;
}

.timeline-item b {
  display: block;
  margin-bottom: 4px;
}

.timeline-item span {
  color: var(--muted);
  line-height: 18px;
}

.rules-table {
  min-width: 980px;
}

.switch {
  position: relative;
  width: 36px;
  height: 20px;
  display: inline-block;
}

.switch input {
  width: 0;
  height: 0;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: #c9cdd2;
  transition: 0.2s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: 0.2s ease;
}

.switch input:checked + span {
  background: var(--red);
}

.switch input:checked + span::after {
  transform: translateX(16px);
}

.modal-backdrop {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(12, 14, 18, 0.45);
}

.admin-modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-head {
  position: sticky;
  z-index: 2;
  top: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.modal-body {
  padding: 18px;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.modal-field.full {
  grid-column: 1 / -1;
}

.modal-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-2);
  font-size: 13px;
}

.modal-field input,
.modal-field select,
.modal-field textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: 0;
}

.modal-field textarea {
  min-height: 72px;
  resize: vertical;
}

.modal-field input:focus,
.modal-field select:focus,
.modal-field textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.scope-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scope-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
}

.modal-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  top: 72px;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border: 1px solid #bce6d4;
  border-radius: 7px;
  color: var(--green);
  background: #f2fbf7;
  box-shadow: var(--shadow);
  font-size: 13px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: var(--muted);
  text-align: center;
}

.empty-state .icon {
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
  color: #b7bbc2;
}

@media (max-width: 1180px) {
  .filter-grid,
  .advanced-filters {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .analysis-filterbar {
    flex-wrap: wrap;
    align-items: flex-end;
  }

  .analysis-updated {
    flex-basis: 100%;
    margin: 2px 0 0;
  }

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

  .analysis-grid-2,
  .store-analysis-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .province-report-toolbar {
    flex-wrap: wrap;
  }
}

@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .admin-sidebar {
    width: 72px;
    padding: 0 8px;
  }

  .admin-logo {
    justify-content: center;
    padding: 0;
  }

  .admin-logo img {
    width: 46px;
    object-fit: cover;
    object-position: left;
  }

  .sidebar-label,
  .sidebar-subnav,
  .sidebar-nav button span,
  .sidebar-nav button .nav-chevron {
    display: none;
  }

  .sidebar-nav button {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }

  .detail-layout,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

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

  .province-map {
    height: 350px;
  }
}

@media (max-width: 620px) {
  .mobile-page {
    background: var(--canvas);
  }

  .mobile-shell {
    box-shadow: none;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .field.full,
  .ratio-hint {
    grid-column: auto;
  }

  .analysis-kpis {
    grid-template-columns: 1fr;
  }

  .province-report-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .province-map {
    height: 270px;
  }

  .province-map-meta {
    flex-wrap: wrap;
  }

  .province-map-selection {
    margin-left: 0;
  }
}
