body.app-shell .share-page {
  padding: 1rem 1.1rem 2rem;
}

.share-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.share-heading h2 {
  margin: 0 0 0.2rem;
  color: #1f2933;
  font-size: 1.3rem;
  font-weight: 700;
}

.share-heading p,
.share-links__heading p {
  margin: 0;
  color: #6b7280;
  font-size: 0.88rem;
}

.share-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.share-settings { min-width: 0; margin: 0; }

.share-card {
  margin: 0;
  padding: 1rem;
}

.share-card h3,
.share-empty h3 {
  margin: 0 0 0.85rem;
  color: #1f2933;
  font-size: 1rem;
  font-weight: 650;
}

.share-card__heading { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.85rem; }
.share-card__heading h3 { margin: 0; }
.share-card__heading .share-preview-trigger { flex: 0 0 auto; }

.share-card .form-label {
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.share-fieldset {
  min-width: 0;
  margin: 0.9rem 0;
  padding: 0;
  border: 0;
}

.share-fieldset legend {
  float: none;
  width: auto;
  margin-bottom: 0.35rem;
  color: #1f2933;
  font-size: 0.78rem;
  font-weight: 650;
}

.share-check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.15rem 0.55rem;
}

.share-check-grid .form-check {
  min-height: 1.45rem;
  margin: 0;
  padding-left: 1.35rem;
  font-size: 0.74rem;
}

.share-check-grid .form-check-input {
  margin-top: 0.18rem;
}

.share-fieldset small {
  display: block;
  margin-top: 0.35rem;
  color: #6b7280;
  font-size: 0.7rem;
}

.share-default-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin: 0.9rem 0;
}

.share-default-range > label {
  flex: 0 0 100%;
  margin: 0;
  color: #1f2933;
  font-size: 0.78rem;
  font-weight: 650;
}

.share-default-range > small {
  flex: 0 0 100%;
  color: #6b7280;
  font-size: 0.7rem;
}

.share-default-range__menu {
  right: auto;
  left: 0;
  width: max-content;
  min-width: 170px;
}

.share-privacy {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0.8rem 0;
  padding: 0.6rem 0.65rem;
  border-radius: 6px;
  background: #f3f7f8;
  color: #5b6671;
  font-size: 0.7rem;
}

.share-privacy i {
  color: #138e9c;
  flex: 0 0 auto;
}

.share-card > .btn { width: 100%; }

.share-preview {
  min-width: 0;
  padding: 1rem 1.15rem;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  background: #fff;
}

.share-preview__heading,
.share-preview__chart-head,
.share-preview__breakdown > div,
.share-preview__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.share-preview__heading { margin-bottom: 0.8rem; }
.share-preview__heading > div > span { color: #77838f; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.05em; }
.share-preview__heading h3 { margin: 0.15rem 0 0.05rem; color: #1f2933; font-size: 1rem; font-weight: 700; }
.share-preview__heading p { margin: 0; color: #6b7280; font-size: 0.75rem; }
.share-preview__badge { padding: 0.25rem 0.5rem; border-radius: 999px; background: #eef3f5; color: #596774; font-size: 0.65rem; }

.share-preview__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

.share-preview__stats > div {
  min-width: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid #e1e5e9;
  border-radius: 6px;
  background: #fff;
}

.share-preview__stats span { display: block; color: #697580; font-size: 0.66rem; font-weight: 600; }
.share-preview__stats strong { display: block; margin-top: 0.1rem; color: #1f2933; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.share-preview__chart-head { margin-bottom: 0.25rem; }
.share-preview__chart-head strong { color: #1f2933; font-size: 0.78rem; }
.share-preview__chart-head span { color: #6b7280; font-size: 0.68rem; }
.share-preview__chart svg { display: block; width: 100%; height: auto; }
.share-preview__grid line { stroke: #e8ecef; stroke-width: 1; }
.share-preview__axis { fill: #6b7280; font: 10px system-ui, sans-serif; }
.share-preview__line { fill: none; stroke: #1593a3; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

.share-preview__breakdown { margin-top: 0.4rem; }
.share-preview__breakdown > div { padding-bottom: 0.25rem; color: #697580; font-size: 0.7rem; }
.share-preview__breakdown p { display: grid; grid-template-columns: minmax(0, 1fr) 3.5rem minmax(4rem, 0.55fr); align-items: center; gap: 0.6rem; margin: 0; padding: 0.4rem 0; border-top: 1px solid #edf0f2; color: #34414d; font-size: 0.72rem; }
.share-preview__breakdown p b { text-align: right; font-weight: 550; font-variant-numeric: tabular-nums; }
.share-preview__breakdown p i { height: 5px; overflow: hidden; border-radius: 5px; background: #eef2f4; }
.share-preview__breakdown p em { display: block; height: 100%; border-radius: inherit; background: #1593a3; }
.share-preview__foot { margin-top: 0.5rem; color: #77838f; font-size: 0.65rem; }
.share-preview__foot b { color: #138e9c; }
.share-preview [data-preview-metric][hidden],
.share-preview [data-preview-total][hidden],
.share-preview [data-preview-cards][hidden] { display: none !important; }
.share-preview .path-tree-stats { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }

.share-links { min-width: 0; margin: 0; }
.share-links__heading { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 0.6rem; }
.share-links__heading h3 { margin: 0 0 0.15rem; color: #1f2933; font-size: 0.98rem; font-weight: 650; }
.share-links__heading p { font-size: 0.78rem; }
.share-preview-trigger { flex: 0 0 auto; }
.share-links__empty { margin: 0; padding: 1rem; border: 1px solid #e1e5e9; border-radius: 8px; background: #fff; color: #697580; font-size: 0.82rem; }

.share-link-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(220px, 1.3fr) auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #e1e5e9;
  border-bottom: 0;
  background: #fff;
}
.share-link-row:first-of-type { border-radius: 8px 8px 0 0; }
.share-link-row:last-of-type { border-bottom: 1px solid #e1e5e9; border-radius: 0 0 8px 8px; }
.share-link-row:only-of-type { border-radius: 8px; }
.share-link-row.is-new { box-shadow: inset 3px 0 #1593a3; }
.share-link-row__details { display: flex; min-width: 0; flex-direction: column; gap: 0.1rem; }
.share-link-row__details strong { color: #1f2933; font-size: 0.83rem; }
.share-link-row__identity { display: flex; min-width: 0; align-items: center; gap: 0.55rem; }
.share-link-row__identity strong { overflow: hidden; text-overflow: ellipsis; }
.share-link-row__details small { color: #7b8792; font-size: 0.67rem; }
.share-link-row__url { display: flex; min-width: 0; gap: 0.4rem; }
.share-link-row__link { display: flex; width: 100%; min-width: 0; align-items: center; gap: 0.35rem; overflow: hidden; padding: 0.25rem 0.1rem; color: #526271; font-size: 0.7rem; text-decoration: none; }
.share-link-row__link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-link-row__link:hover { color: #087f8c; text-decoration: underline; }
.share-link-row__link:focus-visible { outline: 2px solid #0d6efd; outline-offset: 1px; }
.share-link-row__url .share-copy { width: 30px; flex: 0 0 30px; justify-content: center; padding: 0; }
.share-link-row__actions { display: flex; align-items: center; gap: 0.5rem; }
.share-link-row__actions form { margin: 0; }
.share-link-row__actions .btn { padding: 0.2rem 0.35rem; font-size: 0.75rem; }
.share-state { color: #198754; font-size: 0.7rem; font-weight: 650; }
.share-state.is-off { color: #75808b; }
.share-empty { padding: 1.25rem; }
.share-empty p { color: #6b7280; }

.share-preview-dialog { width: min(1100px, calc(100vw - 2rem)); max-width: none; height: min(850px, calc(100vh - 2rem)); margin: 1rem auto; }
.share-preview-dialog .modal-content { height: 100%; overflow: hidden; border: 1px solid #e1e5e9; border-radius: 12px; box-shadow: 0 1rem 3rem rgba(16, 24, 40, 0.22); }
.share-preview-modal .modal-header { flex: 0 0 auto; align-items: center; padding: 0.7rem 1.25rem; }
.share-preview__eyebrow { display: block; margin-bottom: 0.12rem; color: #77838f; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em; }
.share-preview-modal .modal-title { color: #1f2933; font-size: 1rem; font-weight: 650; }
.share-preview-modal .modal-body.share-preview { min-width: 0; padding: 1.25rem; border: 0; border-radius: 0; overflow-y: auto; }
.share-preview-modal .classic-view { width: min(100%, 1440px); margin: 0 auto; }
.share-preview-modal .share-preview__foot { width: min(100%, 1440px); margin: 0.8rem auto 0; }

body.public-share { min-height: 100vh; margin: 0; background: #f4f5f7; color: #1f2933; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.public-report-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem max(1rem, calc((100% - 1440px) / 2)); border-bottom: 1px solid #e1e5e9; background: #fff; }
.public-report-header__identity { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.public-report-brand { display: flex; align-items: center; gap: 0.55rem; color: #1f2933; font-size: 1rem; font-weight: 700; text-decoration: none; }
.public-report-brand img { width: 28px; height: 28px; object-fit: contain; }
.public-report-site { display: flex; align-items: center; gap: 0.55rem; min-width: 0; padding-left: 1rem; border-left: 1px solid #e5e7eb; }
.public-report-site__link { display: block; overflow: hidden; color: #1f2933; font-size: 0.9rem; font-weight: 650; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.public-report-site__link:hover { color: #1a8a96; text-decoration: underline; }
.public-report-header__actions { display: flex; flex: 0 0 auto; align-items: center; gap: 1rem; }
.public-report-header__status { color: #6b7280; font-size: 0.78rem; white-space: nowrap; }
.public-report-main { width: min(100% - 2rem, 1440px); margin: 1rem auto; }
.public-report-range { flex: 0 0 auto; }
.public-report-content { padding: 1rem; border: 1px solid #e1e5e9; border-radius: 9px; background: #fff; }
.public-report-content .path-tree-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0 0 0.85rem; }
.public-report-content .path-tree-stat { min-height: 66px; }
.public-report-content .classic-view { display: block; padding: 0; }
.public-report-content .classic-chart { margin-top: 0; }
.public-report-content .classic-cards { margin-top: 0.75rem; }
.public-report-footer { display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.8rem; color: #7b8792; font-size: 0.7rem; }
.public-report-footer strong { color: #138e9c; }
.public-report-empty { padding: 2rem; color: #6b7280; text-align: center; }
.public-report-revoked { max-width: 620px; margin: 5rem auto; padding: 2rem; text-align: center; }
.public-report-revoked h1 { margin: 0 0 0.5rem; color: #1f2933; font-size: 1.35rem; font-weight: 700; }
.public-report-revoked p { margin: 0 0 1.25rem; color: #6b7280; font-size: 0.9rem; }
.public-report-revoked .btn-primary { padding: 0.85rem 2rem; border: 2px solid #fff; border-radius: 12px; background: #56b6c6; color: #fff; font-weight: 700; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); }
.public-report-revoked .btn-primary:hover { border-color: #fff; background: #469ead; color: #fff; }

@media (max-width: 900px) {
  .share-workspace { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.7rem; }
}

@media (max-width: 700px) {
  body.app-shell .share-page { padding: 0.85rem 0.7rem 1.5rem; }
  .share-workspace { grid-template-columns: 1fr; }
  .share-link-row { grid-template-columns: 1fr; gap: 0.5rem; }
  .share-link-row__actions { justify-content: space-between; }
  .share-preview-dialog { width: calc(100vw - 1rem); height: calc(100vh - 1rem); margin: 0.5rem auto; }
  .share-preview-modal .modal-body.share-preview { padding: 0.85rem; }
  .public-report-header { padding: 0.7rem 1rem; }
  .public-report-header { flex-wrap: wrap; }
  .public-report-header__identity { flex: 1 1 100%; gap: 0.65rem; }
  .public-report-site { padding-left: 0.65rem; }
  .public-report-header__actions { flex: 1 1 100%; justify-content: space-between; }
  .public-report-main { width: calc(100% - 1rem); margin: 1rem auto; }
  .public-report-content { padding: 0.65rem; }
  .public-report-content .path-tree-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
