.phe-explorer-root {
  --phe-bg: #f5f7fb;
  --phe-panel: #ffffff;
  --phe-panel-alt: #f8fafc;
  --phe-border: #d8e0ec;
  --phe-text: #17212f;
  --phe-muted: #5e6c80;
  --phe-accent: #2c6bed;
  --phe-accent-soft: #e9f0ff;
  --phe-high: #b42318;
  --phe-high-soft: #fee4e2;
  --phe-medium: #b54708;
  --phe-medium-soft: #ffead5;
  --phe-low: #027a48;
  --phe-low-soft: #dcfae6;
  --phe-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  color: var(--phe-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.phe-explorer-root * {
  box-sizing: border-box;
}

.phe-shell {
  background: var(--phe-bg);
  border: 1px solid var(--phe-border);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--phe-shadow);
}

.phe-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.phe-eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--phe-muted);
}

.phe-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.phe-toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.phe-toolbar-button,
.phe-email-item,
.phe-tab,
.phe-inline-marker,
.phe-cta-button,
.phe-attachment-chip {
  font: inherit;
}

.phe-toolbar-button {
  border: 1px solid var(--phe-border);
  background: var(--phe-panel);
  color: var(--phe-text);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.phe-toolbar-button:hover,
.phe-email-item:hover,
.phe-tab:hover,
.phe-inline-marker:hover,
.phe-cta-button:hover,
.phe-attachment-chip:hover {
  transform: translateY(-1px);
}

.phe-banner {
  background: linear-gradient(135deg, #eff5ff, #f8fbff);
  border: 1px solid #d7e4ff;
  color: #24457a;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 14px;
  margin-bottom: 18px;
}

.phe-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.95fr) minmax(380px, 1.55fr) minmax(290px, 1fr);
  gap: 18px;
  align-items: start;
}

.phe-sidebar,
.phe-message-card,
.phe-analysis-panel {
  background: var(--phe-panel);
  border: 1px solid var(--phe-border);
  border-radius: 20px;
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.05);
}

.phe-sidebar,
.phe-analysis-panel {
  padding: 16px;
}

.phe-panel-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--phe-muted);
  margin-bottom: 12px;
}

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

.phe-email-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--phe-border);
  background: var(--phe-panel-alt);
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.phe-email-item.is-active {
  border-color: rgba(44, 107, 237, 0.45);
  background: #f2f7ff;
  box-shadow: 0 10px 22px rgba(44, 107, 237, 0.12);
}

.phe-email-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.phe-email-sender {
  font-weight: 700;
  font-size: 13px;
  color: var(--phe-text);
}

.phe-email-score,
.phe-status-pill,
.phe-risk-pill,
.phe-link-signal,
.phe-signal-severity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.phe-email-score.is-high,
.phe-status-pill.is-high,
.phe-signal-severity.is-high {
  background: var(--phe-high-soft);
  color: var(--phe-high);
}

.phe-email-score.is-medium,
.phe-status-pill.is-medium,
.phe-signal-severity.is-medium {
  background: var(--phe-medium-soft);
  color: var(--phe-medium);
}

.phe-email-score.is-low,
.phe-status-pill.is-low,
.phe-signal-severity.is-low,
.phe-signal-severity.is-safe {
  background: var(--phe-low-soft);
  color: var(--phe-low);
}

.phe-email-subject {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.35;
  margin-bottom: 6px;
}

.phe-email-preview {
  font-size: 13px;
  color: var(--phe-muted);
  line-height: 1.45;
}

.phe-message-card {
  padding: 24px;
}

.phe-message-topline {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.phe-risk-pill {
  background: #edf2f7;
  color: #30455e;
}

.phe-message-subject {
  margin: 0 0 16px;
  font-size: 28px;
  line-height: 1.2;
}

.phe-message-meta {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--phe-muted);
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--phe-border);
}

.phe-meter {
  position: relative;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #e8eef6;
  margin-bottom: 22px;
}

.phe-meter > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3a7afe 0%, #7f56d9 55%, #d92d20 100%);
  border-radius: inherit;
}

.phe-message-body {
  background: #fcfdff;
  border: 1px solid var(--phe-border);
  border-radius: 18px;
  padding: 18px;
}

.phe-paragraph {
  margin: 0 0 14px;
  line-height: 1.65;
  font-size: 15px;
}

.phe-paragraph:last-child {
  margin-bottom: 0;
}

.phe-inline-marker {
  display: inline;
  padding: 0 2px;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: inset 0 -2px 0 rgba(44, 107, 237, 0.28);
}

.phe-shell.hints-on .phe-inline-marker.is-revealed {
  background: rgba(44, 107, 237, 0.08);
  box-shadow: inset 0 -2px 0 rgba(44, 107, 237, 0.55);
}

.phe-shell.hints-off .phe-inline-marker {
  box-shadow: inset 0 -1px 0 rgba(94, 108, 128, 0.32);
}

.phe-inline-marker:focus-visible,
.phe-cta-button:focus-visible,
.phe-tab:focus-visible,
.phe-email-item:focus-visible,
.phe-toolbar-button:focus-visible,
.phe-attachment-chip:focus-visible {
  outline: 3px solid rgba(44, 107, 237, 0.3);
  outline-offset: 2px;
}

.phe-cta-row {
  margin: 18px 0 10px;
}

.phe-cta-button {
  border: 0;
  border-radius: 14px;
  padding: 13px 18px;
  background: linear-gradient(135deg, #2c6bed, #1f52bc);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 25px rgba(44, 107, 237, 0.28);
}

.phe-signature {
  margin-top: 16px;
  color: var(--phe-muted);
  font-size: 14px;
}

.phe-signature-line + .phe-signature-line {
  margin-top: 3px;
}

.phe-attachments {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--phe-border);
}

.phe-attachments-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--phe-muted);
  margin-bottom: 10px;
}

.phe-attachment-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.phe-attachment-chip {
  border: 1px solid var(--phe-border);
  background: #f8fafc;
  color: var(--phe-text);
  padding: 9px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.phe-no-attachments {
  color: var(--phe-muted);
  font-size: 14px;
}

.phe-tab-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.phe-tab {
  border: 1px solid var(--phe-border);
  background: #f8fafc;
  color: var(--phe-text);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.phe-tab.is-active {
  background: var(--phe-accent-soft);
  color: #1b4db8;
  border-color: #c7dbff;
}

.phe-tab-panel {
  display: grid;
  gap: 12px;
  max-height: 850px;
  overflow: auto;
  padding-right: 4px;
}

.phe-analysis-summary {
  padding: 14px 16px;
  background: #f8fbff;
  border: 1px solid #dfeafb;
  border-radius: 16px;
}

.phe-analysis-summary p {
  margin: 0;
  line-height: 1.55;
  color: #30455e;
}

.phe-signal-card,
.phe-link-card,
.phe-response-card {
  border: 1px solid var(--phe-border);
  background: #fcfdff;
  border-radius: 18px;
  padding: 16px;
}

.phe-signal-card.warning {
  border-left: 4px solid #f79009;
}

.phe-signal-card.safe {
  border-left: 4px solid #12b76a;
}

.phe-signal-card.is-focused,
.phe-link-card.is-focused {
  box-shadow: 0 0 0 3px rgba(44, 107, 237, 0.16);
  border-color: rgba(44, 107, 237, 0.45);
}

.phe-signal-topline {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.phe-signal-topline h4,
.phe-link-card h4,
.phe-response-card h4 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.phe-signal-card p,
.phe-link-card p,
.phe-response-card li,
.phe-link-details,
.phe-header-table,
.phe-link-card code {
  font-size: 14px;
  line-height: 1.6;
}

.phe-signal-card p,
.phe-link-card p {
  margin: 0 0 12px;
}

.phe-signal-meta {
  background: #f8fafc;
  border: 1px solid #e7edf5;
  border-radius: 14px;
  padding: 12px;
}

.phe-signal-meta + .phe-signal-meta {
  margin-top: 10px;
}

.phe-signal-meta strong {
  display: block;
  margin-bottom: 6px;
  color: var(--phe-text);
}

.phe-signal-meta p {
  margin: 0;
  color: var(--phe-muted);
}

.phe-table-wrap {
  overflow: auto;
}

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

.phe-header-table th,
.phe-header-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 0;
  border-bottom: 1px solid var(--phe-border);
}

.phe-header-table th {
  width: 130px;
  color: var(--phe-muted);
  padding-right: 16px;
}

.phe-link-signal {
  background: #eff5ff;
  color: #1b4db8;
  margin: 8px 0 12px;
}

.phe-link-details {
  margin: 0 0 12px;
  display: grid;
  gap: 10px;
}

.phe-link-details div {
  background: #f8fafc;
  border: 1px solid #e7edf5;
  border-radius: 14px;
  padding: 12px;
}

.phe-link-details dt {
  font-weight: 700;
  margin-bottom: 4px;
}

.phe-link-details dd {
  margin: 0;
  color: var(--phe-muted);
  overflow-wrap: anywhere;
}

.phe-link-card code {
  white-space: normal;
  color: #1d2939;
}

.phe-response-card ul {
  margin: 12px 0 0 20px;
  padding: 0;
}

.phe-empty {
  margin: 0;
}

@media (max-width: 1180px) {
  .phe-grid {
    grid-template-columns: 1fr;
  }

  .phe-tab-panel {
    max-height: none;
  }
}

@media (max-width: 700px) {
  .phe-shell {
    padding: 14px;
    border-radius: 18px;
  }

  .phe-toolbar {
    flex-direction: column;
  }

  .phe-toolbar-actions {
    justify-content: flex-start;
  }

  .phe-title {
    font-size: 24px;
  }

  .phe-message-card,
  .phe-sidebar,
  .phe-analysis-panel {
    border-radius: 18px;
  }

  .phe-message-card {
    padding: 18px;
  }

  .phe-message-subject {
    font-size: 24px;
  }
}
