/* apps/web/src/instagram-performance.css */
.instagram-performance-page {
  min-width: 0;
  --ig-surface:var(--surface);
  --ig-muted:var(--muted);
  --ig-text:#f5f3ff;
  --ig-line:var(--line);
  --ig-accent:var(--purple);
  --ig-green:var(--green);
  --ig-violet:var(--purple);
  color: var(--ig-text);
}
.ig-hud {
  padding: 20px 22px 22px;
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  background:
    radial-gradient(
      ellipse at 92% 50%,
      #7c20e909,
      transparent 62%),
    linear-gradient(
      110deg,
      var(--surface),
      var(--bg));
  overflow: hidden;
}
.ig-hud-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  margin-bottom: 23px;
}
.ig-hud-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: none;
}
.ig-hud-brand h2 {
  font-size: 13px;
  letter-spacing: .07em;
  margin: 0;
  font-weight: 800;
}
.ig-hud-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--ig-accent);
  border: 1px solid #a855f73f;
  background: #7c20e910;
  border-radius: 10px;
}
.ig-hud-heading > p {
  margin: 0;
  color: var(--ig-muted);
  font-size: 12px;
}
.ig-hud-heading-line {
  height: 1px;
  flex: 1;
  background:
    linear-gradient(
      90deg,
      var(--line),
      transparent);
  min-width: 16px;
}
.ig-hud-heading > button {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  border: 0;
  background: transparent;
  color: var(--ig-muted);
  font-size: 11px;
  padding: 4px 0;
  cursor: pointer;
}
.ig-hud-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
  flex-wrap: wrap;
}
.ig-hud-scope {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ig-hud-scope > b {
  font-size: 11px;
  letter-spacing: .07em;
  color: var(--ig-muted);
}
.ig-hud-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ig-accent);
  box-shadow: 0 0 10px #a855f770;
}
.ig-hud-period-tag {
  padding: 3px 9px;
  border-radius: 10px;
  border: 1px solid #a855f73b;
  background: #7c20e912;
  color: var(--ig-accent);
  font-size: 10px;
}
.ig-hud-updated {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ig-muted);
  font-size: 10px;
}
.ig-hud-updated > i {
  width: 6px;
  height: 6px;
  background: var(--muted-2);
  border-radius: 50%;
}
.ig-hud-updated.is-syncing > i {
  background: var(--ig-green);
  box-shadow: 0 0 8px #56ce8844;
}
.ig-hud-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}
.ig-hud-actions select {
  max-width: 170px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ig-text);
  padding: 5px 9px;
  font-size: 11px;
  outline-color: var(--ig-accent);
  cursor: pointer;
}
.ig-hud-actions select option {
  background: var(--surface);
  color: var(--ig-text);
}
.ig-hud-refresh {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ig-muted);
  cursor: pointer;
}
.ig-hud button:disabled,
.ig-performance-first-sync button:disabled {
  opacity: .45;
  cursor: default;
}
.ig-hud-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.ig-hud-card {
  min-width: 0;
  min-height: 164px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(
      145deg,
      var(--card),
      var(--surface));
  box-shadow: inset 0 1px 1px #a855f707;
}
.ig-hud-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}
.ig-hud-card h3 {
  font-size: 10px;
  letter-spacing: .09em;
  font-weight: 800;
  color: var(--ig-muted);
  margin: 0;
  overflow-wrap: anywhere;
}
.ig-hud-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  color: var(--ig-accent);
  background: #7c20e90a;
  border: 1px solid #a855f740;
  box-shadow: 0 0 18px #7c20e920;
}
.ig-hud-value {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(24px, 2.3vw, 32px);
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  display: block;
  margin: 0 0 4px;
}
.ig-hud-views .ig-hud-value {
  color: var(--ig-accent);
}
.ig-hud-reach .ig-hud-icon {
  color: var(--ig-accent);
  border-color: #a855f73f;
  background: #7c20e910;
  box-shadow: 0 0 18px #7c20e924;
}
.ig-hud-followers .ig-hud-value {
  color: var(--ig-green);
}
.ig-hud-followers .ig-hud-icon {
  color: var(--ig-green);
  border-color: #42ac6c40;
  background: #2c8c4910;
  box-shadow: 0 0 18px #42ac6c24;
}
.ig-hud-best .ig-hud-icon {
  color: var(--ig-accent);
  border-color: #a855f744;
  background: #7c20e910;
  box-shadow: 0 0 18px #7c20e925;
}
.ig-hud-stories .ig-hud-value {
  color: var(--ig-violet);
}
.ig-hud-stories .ig-hud-icon {
  color: var(--ig-violet);
  border-color: #9872b850;
  background: #71439015;
  box-shadow: 0 0 18px #9872b82e;
}
.ig-hud-card > footer {
  margin-top: auto;
  padding-top: 8px;
}
.ig-hud-card footer p {
  font-size: 11px;
  line-height: 1.4;
  color: var(--ig-muted);
  margin: 0;
}
.ig-hud-card footer b {
  font-weight: 700;
  color: var(--ig-text);
}
.ig-hud-coverage {
  display: block;
  margin-top: 4px;
  color: var(--ig-muted);
  font-size: 9px;
  line-height: 1.35;
}
.ig-hud-stories > header > div {
  display: flex;
  align-items: center;
  gap: 7px;
}
.ig-hud-story-refresh {
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: var(--ig-muted);
  padding: 3px;
  cursor: pointer;
}
.ig-hud-best-post {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 7px;
  min-width: 0;
}
.ig-hud-best-post > img,
.ig-hud-best-placeholder {
  width: 36px;
  height: 47px;
  flex: none;
  border-radius: 9px;
  object-fit: cover;
  background: var(--card-2);
  color: var(--muted);
}
.ig-hud-best-placeholder {
  display: grid;
  place-items: center;
}
.ig-hud-best-post > div {
  min-width: 0;
  flex: 1;
}
.ig-hud-best-user {
  display: block;
  font-size: 10px;
  color: var(--ig-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.ig-hud-best-post p {
  margin: 2px 0 0;
  line-height: 1.15;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px;
}
.ig-hud-best-post p strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 19px;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}
.ig-hud-best-post small {
  font-size: 10px;
  color: var(--ig-muted);
}
.ig-hud-best-empty .ig-hud-value {
  margin-top: 4px;
}
.ig-hud-best-empty p {
  font-size: 10px;
  color: var(--ig-muted);
  margin: 0;
}
.ig-hud-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--ig-accent);
  cursor: pointer;
}
.ig-performance-feedback {
  display: grid;
  gap: 10px;
  margin-top: 15px;
}
.ig-performance-feedback > p {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}
.ig-performance-error {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #bd405344;
  border-radius: 10px;
  background: #a32a3810;
  color: var(--red);
  padding: 13px;
  font-size: 12px;
}
.ig-performance-error > span {
  flex: 1;
}
.ig-performance-error > button,
.ig-performance-first-sync > button {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.ig-performance-first-sync {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
}
.ig-performance-first-sync > button {
  color: var(--purple);
}
.ig-performance-empty {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  background: var(--card);
}
.ig-performance-empty > svg {
  color: var(--purple);
}
.ig-performance-empty > div {
  flex: 1;
}
.ig-performance-empty h3 {
  margin: 0;
  font-size: 15px;
}
.ig-performance-empty p {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.ig-performance-empty > button {
  padding: 10px 14px;
  font-size: 12px;
}
.ig-performance-accounts {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  margin-top: 24px;
  scroll-margin-top: 100px;
  overflow: hidden;
}
.ig-performance-accounts > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}
.ig-performance-accounts > header span {
  font-size: 9px;
  color: var(--purple);
  letter-spacing: .12em;
  font-weight: 700;
}
.ig-performance-accounts h3 {
  margin: 5px 0;
  font-size: 17px;
}
.ig-performance-accounts p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}
.ig-performance-accounts > header > button,
.ig-performance-note > button {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.ig-performance-table-wrap {
  overflow-x: auto;
}
.ig-performance-accounts table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}
.ig-performance-accounts th,
.ig-performance-accounts td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-variant-numeric: tabular-nums;
}
.ig-performance-accounts thead th {
  color: var(--muted);
  font-weight: 500;
  font-size: 10px;
}
.ig-performance-accounts th:first-child {
  text-align: left;
}
.ig-performance-account {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}
.ig-performance-account > svg {
  color: var(--purple);
}
.ig-performance-account small,
.ig-performance-accounts td > small {
  display: block;
  font-size: 9px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 3px;
}
.ig-performance-no-accounts {
  padding: 20px;
}
.ig-performance-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 17px;
  color: var(--muted);
  font-size: 10px;
}
.ig-performance-note > span {
  max-width: 75%;
}
.ig-hud-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.ig-hud-spinning {
  animation: ig-hud-spin 1.2s linear infinite;
}
@keyframes ig-hud-spin {
  to {
    transform: rotate(360deg);
  }
}
html[data-theme=light] .instagram-performance-page {
  --ig-surface:#fff;
  --ig-muted:#73677f;
  --ig-text:#21182e;
  --ig-line:#eee7f6;
  --ig-accent:#8b3dff;
  --ig-green:#16875b;
  --ig-violet:#8b3dff;
}
html[data-theme=light] .ig-hud {
  background:
    radial-gradient(
      ellipse at 90% 30%,
      #efe4ff50,
      transparent 62%),
    linear-gradient(
      110deg,
      #fff,
      #faf7fe);
  border-color: #eee7f6;
}
html[data-theme=light] .ig-hud-card {
  background: #fff;
  border-color: #eee7f6;
  box-shadow: 0 5px 18px #49265f06;
}
html[data-theme=light] .ig-hud-heading-line {
  background:
    linear-gradient(
      90deg,
      #e5d8f5,
      transparent);
}
html[data-theme=light] .ig-hud-actions select,
html[data-theme=light] .ig-hud-actions select option,
html[data-theme=light] .ig-hud-refresh {
  background: #fff;
  color: var(--ig-text);
  border-color: #eee7f6;
}
html[data-theme=light] .ig-hud-coverage {
  color: #73677f;
}
@media (max-width: 1200px) {
  .ig-hud-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .ig-hud-card {
    min-height: 158px;
  }
  .ig-hud-value {
    font-size: 30px;
  }
  .ig-hud-best-post p strong {
    font-size: 21px;
  }
}
@media (max-width: 700px) {
  .ig-hud {
    padding: 17px 14px;
  }
  .ig-hud-heading {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
  }
  .ig-hud-heading > p {
    order: 3;
    flex-basis: 100%;
    font-size: 11px;
  }
  .ig-hud-heading-line {
    display: none;
  }
  .ig-hud-heading > button {
    margin-left: auto;
  }
  .ig-hud-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .ig-hud-card {
    padding: 12px;
    min-height: 164px;
    border-radius: 13px;
  }
  .ig-hud-card h3 {
    font-size: 9px;
    letter-spacing: .055em;
  }
  .ig-hud-icon {
    width: 28px;
    height: 28px;
  }
  .ig-hud-value {
    font-size: 27px;
  }
  .ig-hud-card footer p {
    font-size: 10px;
  }
  .ig-hud-toolbar {
    align-items: flex-start;
  }
  .ig-hud-scope {
    max-width: 100%;
  }
  .ig-hud-updated {
    flex-basis: 100%;
    margin-top: 3px;
  }
  .ig-hud-actions {
    margin-left: auto;
  }
  .ig-hud-best-post {
    gap: 6px;
  }
  .ig-hud-best-post p strong {
    font-size: 17px;
  }
  .ig-hud-best-post > img,
  .ig-hud-best-placeholder {
    width: 30px;
    height: 43px;
  }
  .ig-hud-best-user {
    font-size: 9px;
  }
  .ig-performance-empty {
    flex-wrap: wrap;
    padding: 17px;
  }
  .ig-performance-empty > button {
    width: 100%;
  }
  .ig-performance-note > span {
    max-width: 100%;
  }
}
@media (max-width: 370px) {
  .ig-hud-grid {
    grid-template-columns: 1fr;
  }
  .ig-hud-card {
    min-height: 150px;
  }
  .ig-hud-value {
    font-size: 32px;
  }
  .ig-hud-best-post p strong {
    font-size: 23px;
  }
  .ig-hud-card h3 {
    font-size: 10px;
  }
  .ig-hud-heading > button {
    font-size: 10px;
  }
  .ig-hud-brand h2 {
    font-size: 12px;
  }
}
@media (pointer: coarse) {
  .ig-hud-actions select,
  .ig-hud-refresh,
  .ig-hud-story-refresh {
    min-width: 44px;
    min-height: 44px;
  }
  .ig-hud-heading > button,
  .ig-hud-link,
  .ig-performance-note > button,
  .ig-performance-accounts > header > button,
  .ig-performance-first-sync > button {
    min-height: 44px;
  }
  .ig-hud-story-refresh {
    margin: -5px;
  }
  .ig-hud-stories > header > div {
    gap: 2px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ig-hud-spinning {
    animation: none;
  }
}
.ig-performance-availability {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
}
.ig-performance-availability > svg {
  color: var(--purple);
}
.ig-performance-availability > span {
  flex: 1;
}
.ig-performance-availability > button {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  color: var(--purple);
  font: inherit;
  cursor: pointer;
}
