/* Scoped border-box reset — inputs/cards use width:100% with their own padding
   and border, so without this they overflow their grid cells and overlap. */
.intv-account-shell,
.intv-account-shell * { box-sizing: border-box; }

.intv-account-shell {
  display: grid;
  gap: 20px;
  max-width: 880px;
}

.intv-account-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.intv-account-header h1 {
  margin: 0;
  color: var(--text-color);
  font-size: 26px;
  line-height: 1.2;
}

.intv-account-section h2 {
  margin: 0;
  color: var(--text-color);
  font-size: 18px;
  line-height: 1.25;
}

.intv-account-header p,
.intv-account-section > p {
  margin: 6px 0 0;
  color: var(--text-secondary);
  line-height: 1.45;
}

#intv-account-content {
  display: grid;
  gap: 20px;
}

.intv-account-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-secondary);
}

.intv-account-tab {
  border: 0;
  border-radius: 10px;
  padding: 9px 14px;
  white-space: nowrap;
  color: var(--text-secondary);
  background: transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.intv-account-tab:hover { background: var(--bg-hover); color: var(--text-color); }
.intv-account-tab.active { background: var(--accent-color); color: var(--text-color-inv); }

.intv-account-section,
.intv-account-subcard {
  border: 1px solid var(--border-color);
  border-radius: 18px;
  background: var(--containerbackground);
  box-shadow: var(--shadow-sm, 0 1px 3px color-mix(in srgb, var(--text-color) 8%, transparent));
}

.intv-account-section { padding: 24px; }
.intv-account-subcard { padding: 18px; }

.intv-account-form-grid,
.intv-account-stat-grid,
.intv-dev-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.intv-account-field { display: grid; gap: 7px; }
.intv-account-field > span { color: var(--text-secondary); font-size: 13px; font-weight: 600; }
.intv-account-field-full { grid-column: 1 / -1; }

.intv-account-input,
.intv-account-select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-color);
  background: var(--bg-color);
  font: inherit;
}

.intv-account-input:focus,
.intv-account-select:focus {
  outline: 2px solid color-mix(in srgb, var(--accent-color) 32%, transparent);
  border-color: var(--accent-color);
}

.intv-account-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.intv-account-stat {
  padding: 17px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-secondary);
}

.intv-account-stat span { display: block; color: var(--text-secondary); font-size: 13px; }
.intv-account-stat strong { display: block; margin-top: 8px; color: var(--text-color); font-size: 25px; }
.intv-account-stat small { color: var(--text-tertiary); }

.intv-credit-progress {
  height: 9px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-tertiary);
}

.intv-credit-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-color);
}

.intv-dev-heading-row,
.intv-dev-key-row,
.intv-dev-guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.intv-dev-keys { display: grid; gap: 10px; margin-top: 18px; }
.intv-dev-key-row { padding: 14px; border: 1px solid var(--border-color); border-radius: 12px; background: var(--bg-secondary); }
.intv-dev-key-main { min-width: 0; }
.intv-dev-key-main strong { color: var(--text-color); }
.intv-dev-key-main code { color: var(--text-secondary); }
.intv-dev-scopes { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.intv-dev-scope { padding: 3px 7px; border-radius: 999px; color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 10%, transparent); font-size: 11px; }

.intv-dev-create-form { display: grid; gap: 14px; margin-top: 18px; }
.intv-dev-scope-options { display: grid; gap: 9px; }
.intv-dev-scope-option { display: flex; align-items: flex-start; gap: 9px; color: var(--text-secondary); }
.intv-dev-scope-option strong { display: block; color: var(--text-color); }
.intv-dev-scope-option small { display: block; margin-top: 2px; }

.intv-dev-secret {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent-color) 45%, var(--border-color));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent-color) 8%, var(--containerbackground));
}
.intv-dev-secret code { display: block; margin: 10px 0; overflow-wrap: anywhere; color: var(--text-color); }

.intv-dev-guide { display: grid; gap: 14px; margin-top: 20px; }
.intv-dev-tools-title { margin-top: 24px !important; }
.intv-dev-endpoint { padding: 11px; overflow-wrap: anywhere; border-radius: 10px; background: var(--bg-tertiary); color: var(--text-color); }
.intv-dev-steps { margin: 10px 0 0; padding-left: 20px; color: var(--text-secondary); }
.intv-dev-steps li + li { margin-top: 7px; }
.intv-dev-tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.intv-dev-tool { padding: 12px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-secondary); }
.intv-dev-tool code { display: block; color: var(--accent-color); }
.intv-dev-tool span { display: block; margin-top: 5px; color: var(--text-secondary); font-size: 12px; }

.intv-account-loading,
.intv-account-empty { padding: 18px 0; color: var(--text-secondary); text-align: center; }

@media (max-width: 760px) {
  .intv-account-header,
  .intv-dev-heading-row,
  .intv-dev-key-row { align-items: stretch; flex-direction: column; }
  .intv-account-form-grid,
  .intv-account-stat-grid,
  .intv-dev-tool-grid { grid-template-columns: 1fr; }
  .intv-account-section { padding: 18px; }
}
