/* Account and admin pages — extends landing.css */

.account-main {
  max-width: var(--max-w, 1200px);
  margin: 0 auto;
  padding: 32px 24px;
}

.admin-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 24px;
}

/* Profile + Subscription / Plan pair side-by-side */
.account-profile-subscription-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 24px;
  margin-bottom: 12px;
  align-items: start;
}

@media (max-width: 1080px) {
  .account-profile-subscription-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .account-subscription-plan-pair {
    padding-left: 0;
  }
}

@media (max-width: 640px) {
  .account-main {
    padding: 24px 16px;
  }
}

.account-profile-section {
  margin-bottom: 0;
}

.account-profile-section p {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin: 0 0 6px;
  padding: 6px 0;
  max-width: 100%;
  gap: 8px;
}

.account-profile-section p:last-child {
  margin-bottom: 0;
}

.account-subscription-plan-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 24px;
  row-gap: 0;
  align-items: center;
  margin-bottom: 0;
  padding: 0 8px;
  min-width: 0;
}

.subscription-plan-heading {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text, #1f2937);
  align-self: start;
}

.subscription-plan-heading--right {
  text-align: right;
}

.subscription-plan-sync-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 24px;
  align-items: center;
}

.subscription-plan-sync-row .plan-card-row {
  margin: 0;
}

.plan-desc-spacer {
  min-height: 0;
}

.plan-period-end-line {
  margin: 10px 0 0;
  color: var(--color-text-muted, #6b7280);
  font-size: 13px;
}

.plan-period-end-line--pair {
  margin: 7px 0 0;
  text-align: right;
  justify-self: end;
}

.plan-inline-link {
  display: block;
  margin-left: auto;
  margin-bottom: 6px;
  border: none;
  background: transparent;
  color: var(--color-green, #22c55e);
  text-decoration: underline;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  font-family: inherit;
}

.plan-inline-link--pair {
  margin: 0 0 0 auto;
  text-align: right;
}

.plan-inline-link[disabled] {
  cursor: not-allowed;
  color: var(--color-text-muted, #6b7280);
  text-decoration: none;
}

@media (max-width: 768px) {
  .subscription-plan-heading--right {
    text-align: left;
  }

  .plan-inline-link--pair {
    margin-left: 0;
    text-align: left;
  }

  .plan-period-end-line--pair {
    text-align: left;
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .account-subscription-plan-pair {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .subscription-plan-sync-row {
    grid-template-columns: 1fr;
  }

  .subscription-plan-sync-row .plan-desc-spacer {
    display: none;
  }
}

.plan-label {
  font-size: 14px;
  color: var(--color-text, #1f2937);
}

.account-usage-section {
  margin-bottom: 32px;
  margin-top: -8px;
}

.account-section,
.admin-section {
  margin-bottom: 32px;
}

.admin-section {
  margin-bottom: 20px;
}

.account-section h2,
.admin-section h2 {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text, #1f2937);
}

/* ── Sign-in methods inline row (inside Profile card) ── */
.signin-methods-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.signin-methods-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text, #1f2937);
  white-space: nowrap;
}

.signin-methods-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.signin-methods-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted, #6b7280);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}

.signin-methods-more-btn:hover,
.signin-methods-more-btn:focus-visible {
  background: var(--color-border, #e5e7eb);
  border-color: #9ca3af;
  color: var(--color-text, #1f2937);
  outline: none;
}

/* Badge pills */
.signin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.signin-badge--google {
  background: #e8f0fe;
  color: #1a56db;
}

.signin-badge--password {
  background: #e6f4ea;
  color: #188038;
}

/* ── Add Password modal ── */
.apw-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
  padding: 16px;
  display: none;
}

.apw-backdrop[aria-hidden="false"] {
  display: flex;
}

.apw-card {
  position: relative;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  padding: 32px 28px 28px;
  width: 100%;
  max-width: 420px;
}

.apw-close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--color-text-muted, #6b7280);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.apw-close-btn:hover,
.apw-close-btn:focus-visible {
  background: #f3f4f6;
  color: var(--color-text, #1f2937);
  outline: none;
}

.apw-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text, #1f2937);
  margin: 0 0 8px;
}

.apw-desc {
  font-size: 14px;
  color: var(--color-text-muted, #6b7280);
  margin: 0 0 24px;
  line-height: 1.5;
}

.apw-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.apw-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.apw-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text, #1f2937);
}

.apw-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1.5px solid var(--color-border, #e5e7eb);
  border-radius: 10px;
  box-sizing: border-box;
  background: #fff;
  color: var(--color-text, #1f2937);
  transition: border-color 0.15s;
}

.apw-input::placeholder {
  color: #adb5bd;
}

.apw-input:focus {
  outline: none;
  border-color: var(--color-green, #22c55e);
}

.apw-submit-btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  margin-top: 4px;
}

/* ── Confirm step (change existing password) ── */
.apw-confirm-panel {
  margin-top: 4px;
}

.apw-confirm-question {
  font-size: 15px;
  color: var(--color-text, #1f2937);
  margin: 0 0 20px;
  line-height: 1.5;
}

.apw-confirm-actions {
  display: flex;
  gap: 12px;
}

.apw-confirm-btn {
  flex: 1;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
}

.admin-section h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

/* Auth form (login/signup) */
.auth-form {
  max-width: 400px;
  margin: 0 auto;
  padding: 32px 24px;
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text, #1f2937);
}

.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius, 8px);
  box-sizing: border-box;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--color-green, #22c55e);
}

.auth-form .hint {
  font-size: 13px;
  color: var(--color-text-muted, #6b7280);
  margin-top: 4px;
}

.auth-form .btn-block {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
}

.auth-form .form-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--color-text-muted, #6b7280);
}

.auth-form .form-footer a {
  color: var(--color-green, #22c55e);
  font-weight: 500;
}

.auth-form .error-msg {
  color: #dc2626;
  font-size: 14px;
  margin-bottom: 12px;
}

.auth-form .success-msg {
  color: #166534;
  font-size: 14px;
  margin-bottom: 12px;
}

.oauth-success-banner {
  color: #166534;
  font-size: 14px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius, 8px);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: 13px;
  color: var(--color-text-muted, #6b7280);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border, #e5e7eb);
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 0;
  padding: 11px 14px;
  font-size: 15px;
  font-weight: 500;
  color: #3c4043;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: var(--radius, 8px);
  cursor: pointer;
  box-sizing: border-box;
  text-decoration: none;
  font-family: inherit;
}

.btn-google:hover {
  background: #f8f9fa;
  border-color: #d2d4d8;
}

.btn-google:focus {
  outline: 2px solid var(--color-green, #22c55e);
  outline-offset: 2px;
}

.btn-google .btn-google-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23EA4335' d='M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z'/%3E%3Cpath fill='%234285F4' d='M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z'/%3E%3Cpath fill='%23FBBC05' d='M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z'/%3E%3Cpath fill='%2334A853' d='M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z'/%3E%3Cpath fill='none' d='M0 0h48v48H0z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.oauth-retry-hint {
  font-size: 13px;
  color: var(--color-text-muted, #6b7280);
  margin-top: 8px;
  text-align: center;
}

.auth-temp-mode-wrap {
  max-width: var(--max-w, 1200px);
  margin: 16px auto 0;
  padding: 0 24px;
}

.auth-temp-mode-banner {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #f59e0b;
  border-radius: var(--radius, 8px);
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
  line-height: 1.4;
}

/* Subscription / plan card — no bordered box */
.plan-card {
  padding: 0;
  margin-bottom: 20px;
  border: none;
  background: transparent;
}

.account-subscription-plan-pair .plan-card-row {
  margin: 0;
}

.plan-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}


.plan-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text, #1f2937);
}

.plan-badge {
  text-transform: capitalize;
  padding: 2px 10px;
  border-radius: 4px;
  background: var(--color-green-light, #dcfce7);
  color: var(--color-green-dark, #16a34a);
}

.plan-badge.plan-free {
  background: #f3f4f6;
  color: #6b7280;
}

.plan-badge.plan-past-due {
  background: #fee2e2;
  color: #dc2626;
}

.subsection-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text, #1f2937);
  margin: 0 0 12px;
}

.subsection-desc {
  font-size: 14px;
  color: var(--color-text-muted, #6b7280);
  margin: 0 0 12px;
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 0;
}

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

.usage-item {
  padding: 16px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius, 8px);
  background: var(--color-bg-light, #f8faf8);
  text-align: center;
}

.usage-value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text, #1f2937);
}

.usage-label {
  display: block;
  font-size: 13px;
  color: var(--color-text-muted, #6b7280);
  margin-top: 4px;
}

.plan-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.plan-actions--pair {
  justify-content: flex-end;
  margin: 7px 0 0;
  width: 100%;
}

.plan-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1200;
}

.plan-modal-backdrop.is-open {
  display: flex;
}

.plan-modal {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--color-border, #e5e7eb);
}

.plan-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.plan-modal-header h3 {
  margin: 0;
  font-size: 17px;
}

.plan-modal-close-btn {
  border: 1px solid var(--color-border, #d1d5db);
  background: #fff;
  color: var(--color-text, #111827);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
}

.plan-modal-body {
  padding: 14px 16px 16px;
}

.plan-modal-plan-name {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--color-text, #1f2937);
  font-weight: 600;
}

.plan-features-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-features-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border, #f0f2f5);
  font-size: 13px;
}

.plan-features-list li:last-child {
  border-bottom: none;
}

.plan-feature-label {
  color: var(--color-text-muted, #6b7280);
}

.plan-feature-value {
  color: var(--color-text, #111827);
  font-weight: 600;
}

.folder-action-modal {
  width: min(520px, 100%);
}

.folder-action-modal .form-group {
  margin-bottom: 10px;
}

.folder-action-modal label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--color-text-muted, #6b7280);
}

/* Jobs list (legacy, kept for compatibility) */
.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.jobs-empty {
  margin: 0;
  padding: 24px;
  text-align: center;
  color: var(--color-text-muted, #6b7280);
  background: var(--color-bg-light, #f8faf8);
  border-radius: var(--radius, 8px);
}

.job-card {
  padding: 16px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius, 8px);
  background: var(--color-white, #fff);
}

.job-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.job-filename {
  font-weight: 500;
  color: var(--color-text, #1f2937);
}

.job-meta {
  font-size: 13px;
  color: var(--color-text-muted, #6b7280);
  margin-top: 6px;
}

.job-status {
  font-size: 13px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
}

.job-status-completed {
  background: var(--color-green-light, #dcfce7);
  color: var(--color-green-dark, #16a34a);
}

.job-status-pending {
  background: #fef3c7;
  color: #b45309;
}

.job-status-failed {
  background: #fee2e2;
  color: #dc2626;
}

/* My Models section */
.models-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.models-section-header h2 {
  margin: 0;
}

.models-upload-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.models-with-folders {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.models-with-folders.models-without-folders {
  grid-template-columns: minmax(0, 1fr);
}

.models-folders-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.models-folder-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.models-folder-row {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.models-folder-row .models-folder-item {
  flex: 1;
  min-width: 0;
}

.models-folder-delete {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted, #6b7280);
  cursor: pointer;
}

.models-folder-delete:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fecaca;
}

.models-folder-delete:focus-visible {
  outline: 2px solid #86efac;
  outline-offset: 1px;
}

.models-folder-delete:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.models-folders-panel {
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius, 8px);
  background: #fff;
  padding: 12px;
}

.models-folders-title {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--color-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.models-folder-tree {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.models-folder-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text, #1f2937);
  padding: 6px 8px;
  cursor: pointer;
  font-size: 13px;
}

.models-folder-item.is-folder {
  font-weight: 700;
}

.models-folder-item.is-nav {
  font-weight: 400;
}

.models-folder-item:hover {
  background: #f3f4f6;
}

.models-folder-item.is-active {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.models-upload-input {
  display: none;
}

.models-table-wrap {
  background: var(--color-bg-light, #f3f4f6);
  border-radius: var(--radius, 8px);
  padding: 0;
  overflow-x: hidden;
}

/* Export history: no scroll bar (overflow: hidden for both axes) */
.exports-table-wrap {
  overflow: hidden;
}

/* Align Export history columns with My Models — same column widths */
.models-th.models-th-status,
.models-th-spacer {
  width: 80px;
}

.models-th.models-th-size { width: 80px; }
.models-th.models-th-parts { width: 80px; }
.models-th.models-th-info { width: 50px; text-align: center; }
.models-th.models-th-date { width: 110px; }

.models-table {
  width: 100%;
  min-width: 0;
  /* collapse merges adjacent cell borders into one continuous row rule (fixes gaps under narrow columns and when optional columns are display:none) */
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 14px;
  background: #fff;
}

/* Fixed layout on both tables for consistent column alignment */
.models-table,
.models-table-exports {
  table-layout: fixed;
}

.models-table th,
.models-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  vertical-align: middle;
}

.models-table tbody tr:last-child td {
  border-bottom: none;
}

/* Match vertical rhythm with other rows (collapse was pulling first row up vs header) */
.models-table tbody tr:first-child td {
  padding-top: 14px;
}

.models-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.03);
}

.models-th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--color-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.models-th.models-th-filename {
  text-align: left;
  width: 350px;
  min-width: 0;
}
.models-th.models-th-status,
.models-th.models-th-size,
.models-th.models-th-parts,
.models-th.models-th-info { text-align: center; }

.models-th.models-th-date {
  text-align: left;
  padding-left: calc(16px + 1ch);
}

.models-sortable {
  cursor: pointer;
  user-select: none;
}

.models-sortable:hover {
  color: var(--color-text, #1f2937);
}

.models-sortable .models-sort-icon {
  margin-left: 4px;
  opacity: 0.5;
  font-size: 11px;
}

.models-sortable.models-sort-asc .models-sort-icon,
.models-sortable.models-sort-desc .models-sort-icon {
  opacity: 1;
}

/* File name column: keep <td> as table-cell; flex only on inner wrapper (flex on td breaks row border alignment). */
.models-td-filename {
  min-width: 0;
}

/* File name cell inner: [3D] tag + icon + filename */
.models-cell-filename {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.models-cell-filename > span {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.model-open-link {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.model-open-link:hover .model-3d-tag,
.model-open-link:hover .model-filename {
  color: var(--color-green, #22c55e);
  text-decoration: underline;
}

.model-3d-tag {
  font-size: 11px;
  font-weight: 600;
  color: #2563eb;
  flex-shrink: 0;
}

.model-filename {
  font-weight: 500;
  color: var(--color-text, #1f2937);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.models-cell-status,
.models-cell-size,
.models-cell-parts,
.models-cell-info {
  text-align: center;
  color: var(--color-text, #1f2937);
}

.model-info-btn {
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  border: 1px solid var(--color-border, #d1d5db);
  background: #fff;
  color: var(--color-text-muted, #6b7280);
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  padding: 0;
}

.model-info-btn:hover,
.model-info-btn:focus-visible {
  border-color: var(--color-green, #22c55e);
  color: var(--color-green-dark, #16a34a);
  outline: none;
}

.models-cell-date {
  text-align: left;
  color: var(--color-text, #1f2937);
  padding-left: calc(16px + 1ch);
}

/* Model status pills */
.model-status {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 9999px;
}

.model-status-ready {
  background: var(--color-green-light, #dcfce7);
  color: var(--color-green-dark, #16a34a);
}

.model-status-processing {
  background: #dbeafe;
  color: #1d4ed8;
}

.model-status-failed {
  background: #fee2e2;
  color: #dc2626;
}

.model-status-deleted {
  background: #fee2e2;
  color: #b91c1c;
}

.model-actions-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.model-row-deleted .model-filename {
  color: #9ca3af;
}

.model-row-deleted {
  opacity: 0.92;
}

/* My Models: move (..) + delete (Phase B) */
.models-th.models-th-move,
.models-th.models-th-actions {
  width: 45px;
  min-width: 45px;
  max-width: 45px;
  padding-left: 0;
  padding-right: 0;
  text-align: center;
  box-sizing: border-box;
}

.models-th.models-th-move,
.models-cell-move {
  border-right: 1px solid var(--color-border, #e5e7eb);
}

.models-cell-move,
.models-cell-actions {
  text-align: center;
  vertical-align: middle;
  width: 45px;
  min-width: 45px;
  max-width: 45px;
  padding-left: 0;
  padding-right: 0;
  box-sizing: border-box;
}

#models-list:not(.models-list-pro-folders) .models-th-move,
#models-list:not(.models-list-pro-folders) .models-cell-move {
  display: none;
}

#models-list:not(.models-list-can-delete) .models-th-actions,
#models-list:not(.models-list-can-delete) .models-cell-actions {
  display: none;
}

.model-move-btn {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  max-width: 41px;
  min-height: 2.25rem;
  padding: 0 2px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid var(--color-border, #d1d5db);
  border-radius: var(--radius, 6px);
  background: #fff;
  color: var(--color-text-muted, #6b7280);
  cursor: pointer;
  font-family: inherit;
}

.model-move-btn:hover:not(:disabled),
.model-move-btn:focus-visible {
  border-color: var(--color-green, #22c55e);
  color: var(--color-green-dark, #16a34a);
  outline: none;
}

.model-delete-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  max-width: 41px;
  min-height: 2.25rem;
  padding: 4px 2px;
  border: 1px solid var(--color-border, #d1d5db);
  border-radius: var(--radius, 6px);
  background: #fff;
  color: #64748b;
  cursor: pointer;
}

.model-delete-btn:hover:not(:disabled),
.model-delete-btn:focus-visible {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fef2f2;
  outline: none;
}

.model-delete-btn[aria-busy="true"] {
  cursor: wait;
}

.model-move-placeholder,
.model-action-placeholder {
  display: inline-block;
  min-width: 1ch;
  color: var(--color-text-muted, #9ca3af);
  font-size: 0.85rem;
}

.model-info-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.models-empty {
  padding: 32px 24px;
  text-align: center;
  color: var(--color-text-muted, #6b7280);
  font-size: 14px;
}

.model-action-muted {
  color: var(--color-text-muted, #6b7280);
}

.model-config-row td {
  background: #f9fafb;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  padding-top: 0;
}

.model-config-panel {
  padding: 14px 16px;
}

.model-config-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.model-config-slot {
  color: var(--color-text-muted, #6b7280);
  font-size: 12px;
}

.model-config-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.model-config-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
}

.model-config-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-config-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.model-config-empty {
  margin: 0;
  color: var(--color-text-muted, #6b7280);
  font-size: 13px;
}

@media (max-width: 768px) {
  .models-with-folders {
    grid-template-columns: 1fr;
  }

  .models-folders-panel {
    margin-bottom: 4px;
  }

  .models-folder-actions {
    margin-top: 8px;
  }

  .models-table-wrap {
    overflow-x: hidden;
  }

  .models-table {
    min-width: 0;
  }

  .models-table th,
  .models-table td {
    padding: 10px 12px;
    font-size: 13px;
  }

  .models-table tbody tr:first-child td {
    padding-top: 12px;
  }
}

/* Sprint 3 responsive table tiers - My Models (move + actions columns stay visible — §4.3) */
#models-list.hide-status .models-th-status,
#models-list.hide-status .models-cell-status {
  display: none;
}

#models-list.hide-size .models-th-size,
#models-list.hide-size .models-cell-size {
  display: none;
}

#models-list.hide-info .models-th-info,
#models-list.hide-info .models-cell-info {
  display: none;
}

/* Sprint 3 responsive table tiers - Export History */
#exports-list.exports-hide-size .models-th-size,
#exports-list.exports-hide-size .models-cell-size {
  display: none;
}

#exports-list.exports-hide-parts .models-th-parts,
#exports-list.exports-hide-parts .models-cell-parts {
  display: none;
}

/* Extreme narrow fallback (<420px) */
#models-list.hide-date-narrow .models-th-date,
#models-list.hide-date-narrow .models-cell-date,
#exports-list.hide-date-narrow .models-th-date,
#exports-list.hide-date-narrow .models-cell-date {
  display: none;
}

/* Admin page — compact layout (~10 rows visible) */
.admin-main {
  max-width: 1200px;
  padding: 16px 24px;
}

.admin-breadcrumb {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--color-text-muted, #6b7280);
}

/* Admin header storage (center) */
.header-center {
  flex: 1;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted, #6b7280);
}

/* Admin stats — compact 5 cards */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .admin-stats {
    grid-template-columns: 1fr;
  }
}

.admin-stat-card {
  padding: 10px 12px;
  background: var(--color-white, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius, 8px);
  text-align: center;
}

.admin-stat-icon {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
  opacity: 0.8;
}

.admin-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text, #1f2937);
  line-height: 1.2;
}

.admin-stat-label {
  font-size: 11px;
  color: var(--color-text-muted, #6b7280);
  margin-top: 2px;
  line-height: 1.3;
}

/* Admin toolbar */
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-search-input {
  flex: 1;
  min-width: 180px;
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius, 8px);
}

.admin-search-input:focus {
  outline: none;
  border-color: var(--color-green, #22c55e);
}

.admin-filter-select {
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius, 8px);
  background: var(--color-white, #fff);
}

.admin-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.admin-pagination-footer {
  margin-top: 12px;
  margin-left: 0;
}

.admin-pagination-info {
  font-size: 13px;
  color: var(--color-text-muted, #6b7280);
}

/* Admin users table — compact; one row per account; full width = 100% */
.admin-table-wrap {
  container-type: inline-size;
  container-name: admin-accounts;
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
}

.admin-table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.35;
}

.admin-table th,
.admin-table td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  vertical-align: middle;
}

.admin-table th {
  font-weight: 600;
  font-size: 12px;
  color: var(--color-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: center;
}

.admin-table td {
  text-align: left;
  color: var(--color-text, #1f2937);
}

/*
 * Accounts Overview — column widths (sum 100%):
 * Account 30, Plan 5, Billing 5, Usage 35, Models 6, Actions 7, Disable 6, Delete 6
 */
.admin-table th:nth-child(1),
.admin-table td:nth-child(1) {
  width: 30%;
  min-width: 0;
  vertical-align: middle;
}

.admin-table th:nth-child(2),
.admin-table td:nth-child(2) {
  width: 5%;
  white-space: nowrap;
  vertical-align: middle;
}

.admin-table th:nth-child(3),
.admin-table td:nth-child(3) {
  width: 5%;
  white-space: nowrap;
  vertical-align: middle;
}

.admin-table th:nth-child(4),
.admin-table td.admin-col-usage {
  width: 35%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.admin-table th:nth-child(5),
.admin-table td.admin-col-models {
  width: 6%;
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
}

.admin-table th:nth-child(6),
.admin-table td.admin-col-activity {
  width: 7%;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}

.admin-table th:nth-child(7),
.admin-table td.admin-col-disable {
  width: 6%;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}

.admin-table th:nth-child(8),
.admin-table td.admin-col-delete {
  width: 6%;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}

.admin-col-activity .admin-actions-meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

/*
 * Accounts Overview — narrow viewports: hide columns in this order
 * (each step stacks on narrower @container; Account + Disable + Delete always stay):
 * 1) Models  2) Plan  3) Billing  4) Actions (date)  5) Usage
 */
@container admin-accounts (max-width: 1024px) {
  .admin-table th:nth-child(5),
  .admin-table td:nth-child(5) {
    display: none !important;
  }
}

@container admin-accounts (max-width: 880px) {
  .admin-table th:nth-child(2),
  .admin-table td:nth-child(2) {
    display: none !important;
  }
}

@container admin-accounts (max-width: 720px) {
  .admin-table th:nth-child(3),
  .admin-table td:nth-child(3) {
    display: none !important;
  }
}

@container admin-accounts (max-width: 600px) {
  .admin-table th:nth-child(6),
  .admin-table td:nth-child(6) {
    display: none !important;
  }
}

@container admin-accounts (max-width: 480px) {
  .admin-table th:nth-child(4),
  .admin-table td.admin-col-usage {
    display: none !important;
  }
}

.admin-table tbody tr {
  min-height: 0;
}

.admin-account-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.admin-account-cell .admin-expand-btn {
  flex-shrink: 0;
}

.admin-account-info {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  flex: 1;
}

.admin-account-email {
  font-weight: 500;
  color: var(--color-text, #1f2937);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-account-name {
  font-size: 12px;
  color: var(--color-text-muted, #6b7280);
}

/* Expandable detail row */
.admin-detail-row td {
  padding: 0 !important;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  background: var(--color-bg-light, #f3f4f6);
  vertical-align: top;
}

.admin-detail-panel {
  padding: 12px 16px 16px;
}

.admin-detail-panel h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.admin-models-empty {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted, #6b7280);
  padding: 8px 0;
}

.admin-models-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-model-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--color-white, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 4px;
  font-size: 13px;
}

.admin-model-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background: var(--color-green-light, #dcfce7);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.admin-model-filename {
  flex: 1;
  font-weight: 500;
  color: var(--color-text, #1f2937);
}

.admin-model-meta {
  font-size: 12px;
  color: var(--color-text-muted, #6b7280);
  white-space: nowrap;
}

.admin-expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  font-size: 12px;
  color: var(--color-text-muted, #6b7280);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.admin-expand-btn:hover {
  color: var(--color-text, #1f2937);
}

.admin-expand-btn[aria-expanded="true"] .admin-expand-icon {
  transform: rotate(180deg);
}

.admin-models-link {
  color: var(--color-green, #22c55e);
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 13px;
  padding: 0;
}

.admin-models-link:hover {
  text-decoration: underline;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.admin-actions-meta {
  color: var(--color-text-muted, #6b7280);
  font-size: 12px;
}

.admin-action-btn {
  padding: 3px 8px;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  width: auto;
  min-width: 0;
}

/* Danger (destructive) action button — used for admin Delete */
.btn-danger {
  background: var(--color-red, #dc2626);
  color: #fff;
  border: 1px solid var(--color-red, #dc2626);
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn-danger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Admin delete-account modal helpers */
.admin-delete-warning {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #7f1d1d;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
}

.admin-delete-error {
  margin: 6px 0 0;
  min-height: 1em;
  font-size: 12px;
  color: var(--color-red, #dc2626);
}

#admin-delete-email-echo {
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

/* ── Upload progress overlay ── */
@keyframes upload-spin {
  to { transform: rotate(360deg); }
}

.upload-progress-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 2000;
}

.upload-progress-overlay.is-visible {
  display: flex;
}

.upload-progress-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.22);
  border: 1px solid var(--color-border, #e5e7eb);
  padding: 36px 40px 32px;
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.upload-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--color-border, #e5e7eb);
  border-top-color: var(--color-green, #22c55e);
  border-radius: 50%;
  animation: upload-spin 0.8s linear infinite;
  flex-shrink: 0;
}

.upload-progress-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text, #1f2937);
}

.upload-progress-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted, #6b7280);
  line-height: 1.5;
  max-width: 320px;
}
