.pe-shell {
  --pe-ink: #202124;
  --pe-muted: #5f6368;
  --pe-line: #dadce0;
  --pe-soft: #f8fafd;
  --pe-navy: #f1f3f4;
  --pe-teal: #1a73e8;
  --pe-teal-dark: #1967d2;
  --pe-green: #188038;
  --pe-yellow: #fef7e0;
  --pe-blue: #e8f0fe;
  --pe-red: #d93025;
  color: var(--pe-ink);
  font-family: "Google Sans", Roboto, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  min-width: 0;
  padding: 0 0 44px;
}

.pe-shell *,
.pe-shell *::before,
.pe-shell *::after {
  box-sizing: border-box;
}

.pe-hero {
  align-items: flex-end;
  background:
    radial-gradient(circle at 88% 18%, rgba(66, 133, 244, 0.11), transparent 26%),
    radial-gradient(circle at 76% 100%, rgba(52, 168, 83, 0.08), transparent 30%),
    linear-gradient(135deg, #ffffff 0%, #f8fbff 68%, #f2f7ff 100%);
  border: 1px solid var(--pe-line);
  border-radius: 16px 16px 0 0;
  color: var(--pe-ink);
  display: flex;
  gap: 28px;
  justify-content: space-between;
  min-height: 176px;
  overflow: hidden;
  padding: 34px 38px;
  position: relative;
}

.pe-hero::after {
  border: 1px solid rgba(66, 133, 244, 0.12);
  border-radius: 999px;
  content: "";
  height: 190px;
  position: absolute;
  right: -46px;
  top: -94px;
  width: 190px;
}

.pe-eyebrow,
.pe-card > header span,
.pe-section-head > div > span {
  color: #1a73e8;
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  line-height: 1.4;
  margin-bottom: 7px;
}

.pe-hero h1 {
  color: #202124;
  font-size: clamp(30px, 3.2vw, 46px);
  letter-spacing: -0.045em;
  line-height: 1.08;
  margin: 0;
}

.pe-hero p {
  color: #5f6368;
  font-size: 14px;
  line-height: 1.75;
  margin: 14px 0 0;
  max-width: 720px;
}

.pe-hero-meta {
  align-items: flex-end;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 7px;
  position: relative;
  z-index: 1;
}

.pe-hero-meta span {
  align-items: center;
  color: #5f6368;
  display: flex;
  font-size: 12px;
  gap: 7px;
}

.pe-hero-meta span i {
  background: #34a853;
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(52, 168, 83, 0.12);
  height: 7px;
  width: 7px;
}

.pe-hero-meta strong {
  background: #e8f0fe;
  border: 1px solid #d2e3fc;
  border-radius: 999px;
  color: #1967d2;
  font-size: 12px;
  padding: 7px 12px;
}

.pe-hero-meta small {
  color: #80868b;
  font-size: 11px;
}

.pe-toolbar {
  align-items: center;
  background: #fff;
  border: 1px solid var(--pe-line);
  border-top: 0;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  min-width: 0;
  padding: 10px 14px 10px 18px;
}

.pe-tabs {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.pe-tabs button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 9px;
  color: #5f6368;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
  padding: 9px 11px;
}

.pe-tabs button:hover {
  background: var(--pe-soft);
  color: var(--pe-teal-dark);
}

.pe-tabs button.is-active {
  background: #e8f0fe;
  color: #1967d2;
}

.pe-tabs em {
  align-items: center;
  background: var(--pe-red);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 10px;
  font-style: normal;
  height: 18px;
  justify-content: center;
  min-width: 18px;
  padding: 0 5px;
}

.pe-export,
.pe-primary,
.pe-secondary,
.pe-row-button {
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  transition: 0.18s ease;
}

.pe-export,
.pe-secondary,
.pe-row-button {
  background: #fff;
  border: 1px solid #dadce0;
  color: #1967d2;
}

.pe-export {
  flex: 0 0 auto;
  padding: 9px 13px;
}

.pe-primary {
  background: var(--pe-teal);
  border: 1px solid var(--pe-teal);
  color: #fff;
  padding: 10px 16px;
}

.pe-primary:hover {
  background: #185abc;
  border-color: #185abc;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.pe-secondary {
  padding: 10px 16px;
}

.pe-export:hover,
.pe-secondary:hover,
.pe-row-button:hover {
  background: #f6fafe;
  border-color: #c5d3e8;
}

.pe-page {
  background: #f8fafd;
  border: 1px solid var(--pe-line);
  border-radius: 0 0 16px 16px;
  border-top: 0;
  min-height: 620px;
  padding: 26px;
}

.pe-section-head {
  align-items: flex-end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.pe-section-head > div > span,
.pe-card > header span {
  color: var(--pe-teal);
}

.pe-section-head h2,
.pe-card h3 {
  color: var(--pe-ink);
  letter-spacing: -0.025em;
  margin: 0;
}

.pe-section-head h2 {
  font-size: 24px;
}

.pe-section-head p,
.pe-card > header p {
  color: var(--pe-muted);
  font-size: 13px;
  line-height: 1.65;
  margin: 7px 0 0;
}

.pe-head-actions,
.pe-row-actions {
  display: flex;
  gap: 7px;
}

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

.pe-kpi {
  background: #fff;
  border: 1px solid var(--pe-line);
  border-radius: 12px;
  min-width: 0;
  overflow: hidden;
  padding: 18px 18px 16px;
  position: relative;
}

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

.pe-kpi.is-success::before { background: var(--pe-green); }
.pe-kpi.is-warning::before { background: #d3a321; }
.pe-kpi.is-danger::before { background: var(--pe-red); }

.pe-kpi > span {
  color: var(--pe-muted);
  display: block;
  font-size: 12px;
  font-weight: 650;
}

.pe-kpi strong {
  color: var(--pe-ink);
  display: block;
  font-size: 24px;
  letter-spacing: -0.04em;
  line-height: 1.2;
  margin: 11px 0 7px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pe-kpi small,
.pe-tool-grid small {
  color: #7d8d89;
  font-size: 11px;
  line-height: 1.45;
}

.pe-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

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

.pe-card {
  background: #fff;
  border: 1px solid var(--pe-line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.04);
  margin-bottom: 16px;
  min-width: 0;
  overflow: hidden;
}

.pe-card > header {
  align-items: flex-end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 19px 20px 15px;
}

.pe-card h3 { font-size: 17px; }

.pe-quarter-bars,
.pe-budget-list {
  display: grid;
  gap: 15px;
  padding: 10px 20px 18px;
}

.pe-quarter-bars > div {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 32px minmax(120px, 1fr) auto;
}

.pe-quarter-bars span,
.pe-budget-list > div > span {
  color: #5f6368;
  font-size: 12px;
  font-weight: 800;
}

.pe-quarter-bars strong,
.pe-budget-list strong {
  color: #3c4043;
  font-size: 11px;
  white-space: nowrap;
}

.pe-bar-track,
.pe-budget-list > div > div {
  background: #e8eaed;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  position: relative;
}

.pe-bar-track i,
.pe-bar-track b,
.pe-budget-list i {
  border-radius: 999px;
  bottom: 0;
  display: block;
  left: 0;
  position: absolute;
  top: 0;
  width: var(--pe-width);
}

.pe-bar-track i { background: #d2e3fc; }
.pe-bar-track b { background: var(--pe-teal); height: 4px; top: 3px; }

.pe-legend {
  border-top: 1px solid #eceff1;
  display: flex;
  gap: 18px;
  padding: 12px 20px 16px;
}

.pe-legend span {
  align-items: center;
  color: var(--pe-muted);
  display: flex;
  font-size: 11px;
  gap: 6px;
}

.pe-legend i {
  background: #d2e3fc;
  border-radius: 2px;
  height: 7px;
  width: 16px;
}

.pe-legend span:last-child i,
.pe-budget-list i { background: var(--pe-teal); }

.pe-budget-list > div {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 30px minmax(100px, 1fr) 45px minmax(90px, auto);
}

.pe-budget-list small {
  color: #8a9895;
  font-size: 10px;
  text-align: right;
  white-space: nowrap;
}

.pe-caveat {
  align-items: center;
  background: #fef7e0;
  border: 1px solid #fdd663;
  border-radius: 11px;
  color: #5f4b00;
  display: flex;
  font-size: 12px;
  gap: 12px;
  line-height: 1.55;
  margin-bottom: 14px;
  padding: 11px 14px;
}

.pe-caveat b {
  background: #fbbc04;
  border-radius: 6px;
  color: #3c4043;
  flex: 0 0 auto;
  padding: 4px 7px;
}

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

.pe-table {
  border-collapse: separate;
  border-spacing: 0;
  color: #3c4043;
  font-size: 12px;
  min-width: 100%;
  width: 100%;
}

.pe-table.pe-wide { min-width: 1520px; }

.pe-table th {
  background: var(--pe-navy);
  border-bottom: 1px solid #dadce0;
  color: #3c4043;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.02em;
  padding: 11px 12px;
  text-align: left;
  white-space: nowrap;
}

.pe-table td {
  background: #fff;
  border-bottom: 1px solid #e8eaed;
  padding: 11px 12px;
  vertical-align: middle;
  white-space: nowrap;
}

.pe-table tbody tr:last-child td { border-bottom: 0; }
.pe-table tbody tr:hover td { background: #f8fafd; }
.pe-table tr.is-input-row td { background: var(--pe-yellow); }
.pe-table tr.is-derived-row td { background: var(--pe-blue); }

.pe-table td b,
.pe-table td small {
  display: block;
}

.pe-table td small {
  color: #869590;
  font-size: 10px;
  margin-top: 4px;
}

.pe-action-cell {
  line-height: 1.45;
  max-width: 270px;
  min-width: 180px;
  white-space: normal !important;
}

.pe-negative { color: var(--pe-red) !important; font-weight: 800; }

.pe-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 10px;
  font-weight: 800;
  padding: 5px 8px;
  white-space: nowrap;
}

.pe-pill.is-success { background: #e6f4ea; color: #137333; }
.pe-pill.is-warning { background: #fef7e0; color: #b06000; }
.pe-pill.is-danger { background: #fce8e6; color: #c5221f; }

.pe-priority {
  background: #fff0cf;
  border-radius: 6px;
  color: #915d00;
  display: inline-block;
  font-size: 10px;
  padding: 4px 7px;
}

.pe-priority.is-p0 { background: #fde6e7; color: #a52937; }

.pe-row-button {
  line-height: 1;
  padding: 7px 9px;
}

.pe-row-button.is-danger {
  border-color: #efc6c9;
  color: #ab3540;
}

.pe-derived-label {
  color: #1967d2;
  font-size: 10px;
  font-weight: 750;
}

.pe-product-thumb {
  align-items: center;
  background: #f1f3f4;
  border: 1px solid #dadce0;
  border-radius: 10px;
  color: #80868b;
  display: inline-flex;
  font-size: 12px;
  font-weight: 750;
  height: 54px;
  justify-content: center;
  overflow: hidden;
  width: 54px;
}

.pe-product-thumb img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.pe-profit-table {
  min-width: 2600px;
}

.pe-funnel-table {
  min-width: 4200px;
}

.pe-channel-row.is-first > td {
  border-top: 2px solid #d2e3fc;
}

.pe-channel-row:first-child > td {
  border-top: 0;
}

.pe-group-cell {
  background: #fff !important;
  vertical-align: top !important;
}

.pe-tool-chip {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 10px;
  font-weight: 750;
  justify-content: center;
  min-width: 84px;
  padding: 6px 9px;
  white-space: nowrap;
}

.pe-tool-chip.is-success { background: #e6f4ea; color: #137333; }
.pe-tool-chip.is-danger { background: #fce8e6; color: #c5221f; }
.pe-tool-chip.is-idle { background: #f1f3f4; color: #5f6368; }

.pe-image-field {
  background: #f8fafd;
  border: 1px solid #dadce0;
  border-radius: 12px;
  display: grid;
  gap: 13px;
  padding: 14px;
}

.pe-image-field > div:first-child {
  display: grid;
  gap: 4px;
}

.pe-image-field > div:first-child b { color: #3c4043; font-size: 12px; }
.pe-image-field > div:first-child span { color: #80868b; font-size: 11px; }

.pe-image-editor-row {
  align-items: center;
  display: flex;
  gap: 14px;
}

.pe-image-editor-preview {
  align-items: center;
  background: #fff;
  border: 1px dashed #bdc1c6;
  border-radius: 12px;
  color: #80868b;
  display: flex;
  font-size: 11px;
  height: 88px;
  justify-content: center;
  overflow: hidden;
  width: 88px;
}

.pe-image-editor-preview img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.pe-image-editor-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pe-image-editor-actions small {
  color: #5f6368;
  flex-basis: 100%;
  font-size: 11px;
}

.pe-image-upload {
  cursor: pointer;
  display: inline-flex;
}

.pe-image-upload input { display: none; }

.pe-primary:disabled,
.pe-secondary:disabled {
  cursor: wait;
  opacity: 0.55;
}

.pe-empty-cell {
  color: #879792;
  padding: 38px 20px !important;
  text-align: center;
}

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

.pe-tool-grid article {
  background: #fff;
  border: 1px solid var(--pe-line);
  border-radius: 13px;
  padding: 17px;
}

.pe-tool-grid span {
  color: var(--pe-teal);
  display: block;
  font-size: 11px;
  font-weight: 800;
}

.pe-tool-grid strong {
  color: var(--pe-ink);
  display: block;
  font-size: 20px;
  margin: 8px 0 5px;
}

.pe-step-grid {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 4px 18px 20px;
}

.pe-step-grid article {
  display: flex;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  position: relative;
}

.pe-step-grid article:not(:last-child)::after {
  background: #dadce0;
  content: "";
  height: 1px;
  position: absolute;
  right: -7px;
  top: 27px;
  width: 14px;
}

.pe-step-grid i {
  align-items: center;
  background: #e8f0fe;
  border-radius: 9px;
  color: var(--pe-teal-dark);
  display: flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.pe-step-grid b { color: var(--pe-ink); font-size: 13px; }
.pe-step-grid p { color: #5f6368; font-size: 11px; line-height: 1.55; margin: 6px 0; }
.pe-step-grid span { color: #80868b; font-size: 10px; line-height: 1.45; }

.pe-modal {
  align-items: center;
  background: rgba(32, 33, 36, 0.58);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 10050;
}

.pe-dialog {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(60, 64, 67, 0.28);
  max-height: min(880px, calc(100vh - 48px));
  max-width: 900px;
  overflow: auto;
  width: 100%;
}

.pe-dialog > header {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #dadce0;
  color: #202124;
  display: flex;
  justify-content: space-between;
  padding: 20px 24px;
}

.pe-dialog > header span {
  color: #1a73e8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.pe-dialog h2 { color: #202124; font-size: 20px; margin: 4px 0 0; }

.pe-dialog > header button {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 9px;
  color: #5f6368;
  cursor: pointer;
  font-size: 22px;
  height: 36px;
  line-height: 1;
  width: 36px;
}

.pe-form-grid {
  display: grid;
  gap: 15px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 22px 24px 26px;
}

.pe-form-grid > label {
  display: grid;
  gap: 7px;
}

.pe-form-grid > label > span {
  color: #3c4043;
  font-size: 11px;
  font-weight: 750;
}

.pe-form-grid input,
.pe-form-grid select,
.pe-form-grid textarea {
  background: #fffdf5;
  border: 1px solid #dadce0;
  border-radius: 9px;
  color: #202124;
  font: inherit;
  font-size: 13px;
  outline: none;
  padding: 10px 11px;
  width: 100%;
}

.pe-form-grid textarea { min-height: 82px; resize: vertical; }

.pe-form-grid input:focus,
.pe-form-grid select:focus,
.pe-form-grid textarea:focus {
  border-color: var(--pe-teal);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.pe-span-2 { grid-column: 1 / -1; }

.pe-form-section {
  align-items: center;
  background: #e8f0fe;
  border-radius: 9px;
  display: flex;
  gap: 10px;
  padding: 10px 12px;
}

.pe-form-section b { color: var(--pe-teal-dark); font-size: 12px; }
.pe-form-section span { color: #5f6368; font-size: 11px; }

.pe-dialog form > footer {
  align-items: center;
  background: #f8fafd;
  border-top: 1px solid var(--pe-line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 15px 24px;
}

.pe-dialog form > footer > span { color: #80868b; font-size: 11px; }
.pe-dialog form > footer > div { display: flex; gap: 8px; }

.pe-settings-form {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
}

.pe-settings-body { padding: 18px 20px 22px; }

.pe-settings-platform-row input[type="text"],
.pe-settings-tool-row input[type="text"] {
  background: #fffdf5;
  border: 1px solid #dadce0;
  border-radius: 9px;
  color: #202124;
  font: inherit;
  font-size: 13px;
  outline: none;
  padding: 10px 11px;
  width: 100%;
}

.pe-settings-platform-row input:disabled,
.pe-settings-tool-row input:disabled { background: #f8fafd; color: #5f6368; }
.pe-settings-platform-row input:focus,
.pe-settings-tool-row input:focus { border-color: var(--pe-teal); box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12); }

.pe-settings-platform-list,
.pe-settings-tool-list { display: grid; gap: 10px; }
.pe-settings-platform-row,
.pe-settings-tool-row { align-items: center; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) auto; }
.pe-settings-platform-row { grid-template-columns: 28px minmax(0, 1fr) auto; }
.pe-settings-platform-row > span {
  color: #80868b;
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}
.pe-settings-add { margin-top: 14px; }
.pe-settings-footer { display: flex; gap: 10px; grid-column: 1 / -1; justify-content: flex-end; }

@media (max-width: 1280px) {
  .pe-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pe-step-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pe-step-grid article::after { display: none; }
}

@media (max-width: 900px) {
  .pe-hero { align-items: flex-start; border-radius: 14px 14px 0 0; flex-direction: column; min-height: 0; padding: 27px 24px; }
  .pe-hero-meta { align-items: flex-start; }
  .pe-toolbar { align-items: stretch; flex-direction: column; }
  .pe-export { align-self: flex-start; }
  .pe-page { padding: 18px; }
  .pe-grid-2, .pe-tool-grid { grid-template-columns: 1fr; }
  .pe-section-head { align-items: flex-start; flex-direction: column; }
  .pe-settings-form { grid-template-columns: 1fr; }
  .pe-settings-footer { grid-column: auto; }
}

@media (max-width: 620px) {
  .pe-page { padding: 14px 10px; }
  .pe-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pe-kpi { padding: 15px 13px; }
  .pe-kpi strong { font-size: 19px; }
  .pe-step-grid, .pe-form-grid { grid-template-columns: 1fr; }
  .pe-span-2 { grid-column: auto; }
  .pe-modal { padding: 0; }
  .pe-dialog { border-radius: 0; max-height: 100vh; }
  .pe-dialog form > footer { align-items: stretch; flex-direction: column; }
  .pe-dialog form > footer > div { justify-content: flex-end; }
  .pe-image-editor-row { align-items: flex-start; flex-direction: column; }
}
