.account-parser-page {
  background:
    radial-gradient(circle at 8% 0%, rgba(79, 70, 229, 0.1), transparent 30rem),
    radial-gradient(circle at 92% 18%, rgba(20, 148, 95, 0.07), transparent 25rem),
    var(--bg);
}

.account-parser-shell {
  min-height: 100vh;
}

.account-parser-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.local-only-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(20, 148, 95, 0.22);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(20, 148, 95, 0.08);
  color: #0e764b;
  font-size: 13px;
  font-weight: 800;
}

.local-only-badge > span {
  font-size: 9px;
}

.account-parser-main {
  display: grid;
  gap: 22px;
  padding-block: 42px 64px;
}

.account-parser-intro {
  max-width: 900px;
  padding-block: 12px 4px;
}

.account-parser-intro h1 {
  max-width: 820px;
  margin: 8px 0 14px;
  font-size: clamp(32px, 4.4vw, 58px);
  line-height: 1.03;
  letter-spacing: -0.045em;
}

.account-parser-intro > p:not(.eyebrow) {
  max-width: 830px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.account-parser-intro code,
.input-help-grid code {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 2px 6px;
  background: var(--surface-soft);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.privacy-strip {
  display: flex;
  max-width: 860px;
  align-items: flex-start;
  gap: 11px;
  margin-top: 20px;
  border: 1px solid rgba(20, 148, 95, 0.18);
  border-radius: 14px;
  padding: 13px 15px;
  background: rgba(20, 148, 95, 0.07);
  color: #176647;
  line-height: 1.5;
}

.account-parser-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.account-parser-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.account-parser-card-heading h2 {
  margin: 4px 0 0;
  font-size: clamp(21px, 2.3vw, 28px);
  letter-spacing: -0.025em;
}

.parser-state-badge {
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 850;
}

.raw-account-input {
  display: block;
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 17px 18px;
  background: #fbfbfe;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.65;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.raw-account-input:focus {
  border-color: rgba(79, 70, 229, 0.62);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.raw-account-input::placeholder {
  color: var(--subtle);
}

.input-help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 13px;
}

.input-help-grid p {
  margin: 0;
  border-radius: 12px;
  padding: 11px 13px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.parser-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 17px;
}

.parser-status {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.parser-status[data-state="success"] {
  color: var(--success);
}

.parser-status[data-state="warning"] {
  color: var(--warning);
}

.parser-status[data-state="error"] {
  color: var(--danger);
}

.batch-otp-intro {
  margin: -3px 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.batch-otp-intro code {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 2px 6px;
  background: var(--surface-soft);
  color: var(--text);
  font-family: var(--font-mono);
}

.batch-otp-input {
  min-height: 170px;
}

.batch-otp-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 13px;
}

.batch-otp-status-row .parser-status {
  margin: 0;
}

.batch-otp-status-row > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.batch-otp-empty {
  display: grid;
  min-height: 92px;
  place-items: center;
  margin-top: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  padding: 18px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.batch-otp-results {
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.batch-otp-list {
  max-height: 520px;
  overflow: auto;
  scrollbar-width: thin;
}

.batch-otp-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 154px;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  background: #fff;
}

.batch-otp-row:last-child {
  border-bottom: 0;
}

.batch-otp-row[data-state="error"] {
  background: rgba(185, 28, 28, 0.035);
}

.batch-otp-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 900;
}

.batch-otp-identity {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.batch-otp-identity strong {
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-otp-identity small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.batch-otp-row[data-state="error"] .batch-otp-identity small {
  color: var(--danger);
}

.batch-otp-code {
  min-height: 44px;
  border: 1px solid rgba(20, 148, 95, 0.28);
  border-radius: 11px;
  padding: 8px 12px;
  background: rgba(20, 148, 95, 0.09);
  cursor: pointer;
  color: #0b7548;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 950;
  letter-spacing: 0.09em;
  white-space: nowrap;
}

.batch-otp-code:hover:not(:disabled) {
  border-color: #14945f;
  background: rgba(20, 148, 95, 0.14);
}

.batch-otp-code:focus-visible {
  outline: 3px solid rgba(20, 148, 95, 0.18);
  outline-offset: 2px;
}

.batch-otp-code:disabled,
.batch-otp-code[data-state="error"] {
  border-color: var(--border);
  background: var(--surface-soft);
  cursor: not-allowed;
  color: var(--subtle);
  font-size: 12px;
  letter-spacing: 0;
}

.batch-otp-copy-row {
  margin: 0;
  border-top: 1px solid var(--border);
  padding: 16px;
  background: var(--surface-soft);
}

.format-builder-row {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 14px;
  background: var(--surface-soft);
  scrollbar-width: thin;
}

.format-builder-label {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
}

.format-field-list {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
}

.format-field-item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.format-field-separator {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 900;
}

.format-select,
.format-input {
  min-height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 9px 34px 9px 11px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  outline: none;
}

.format-input {
  width: 180px;
  padding-right: 11px;
  font-family: var(--font-mono);
}

.format-select:focus,
.format-input:focus {
  border-color: rgba(79, 70, 229, 0.62);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.format-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  margin-top: 15px;
}

.format-controls label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.fixed-copy-separator {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 11px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.fixed-copy-separator code {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 20px;
  line-height: 1;
}

.fixed-copy-separator small {
  font-weight: 700;
}

.format-slot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.format-note {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.format-preview-panel {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.format-preview-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 13px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
}

.format-preview-heading strong {
  color: var(--text);
}

.format-preview {
  max-height: 160px;
  min-height: 70px;
  margin: 0;
  overflow: auto;
  padding: 14px;
  background: #171825;
  color: #f4f5ff;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.copy-all-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
}

.copy-all-row > div {
  display: grid;
  gap: 4px;
}

.copy-all-row small {
  color: var(--muted);
}

.result-heading {
  align-items: center;
}

.show-secrets-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.result-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.result-summary > span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
}

.result-summary strong {
  color: var(--text);
}

.empty-results {
  display: grid;
  min-height: 210px;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
}

.empty-results > span {
  color: var(--primary);
  font-size: 32px;
}

.empty-results p {
  margin: 0;
  font-size: 13px;
}

.results-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  scrollbar-width: thin;
}

.results-table {
  width: 100%;
  min-width: 1640px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.results-table th,
.results-table td {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 9px;
  text-align: left;
  vertical-align: top;
}

.results-table th:last-child,
.results-table td:last-child {
  border-right: 0;
}

.results-table tbody tr:last-child td {
  border-bottom: 0;
}

.results-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f4f5fa;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.results-table tr[data-review="true"] td {
  background: rgba(194, 107, 18, 0.045);
}

.row-number {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 900;
}

.account-field-input {
  width: 100%;
  min-width: 150px;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 9px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
}

.account-field-input[data-field="twoFactorSecret"] {
  min-width: 250px;
}

.account-field-input:focus {
  border-color: rgba(79, 70, 229, 0.5);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.account-field-input::placeholder {
  color: #b1b3bf;
}

.otp-cell {
  min-width: 112px;
  color: var(--primary-strong);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.otp-cell[data-state="missing"] {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
}

.account-status {
  display: grid;
  max-width: 230px;
  gap: 5px;
}

.account-status strong {
  color: var(--success);
  white-space: nowrap;
}

.account-status[data-state="review"] strong {
  color: var(--warning);
}

.account-status small {
  color: var(--muted);
  line-height: 1.45;
}

.row-actions {
  display: flex;
  gap: 7px;
  white-space: nowrap;
}

.row-action-button {
  min-height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 7px 10px;
  background: #fff;
  cursor: pointer;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.row-action-button:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
}

.row-action-button.is-danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.clipboard-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid rgba(194, 107, 18, 0.22);
  border-radius: 15px;
  padding: 14px 16px;
  background: rgba(194, 107, 18, 0.07);
  color: #835018;
}

.clipboard-warning > span {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: rgba(194, 107, 18, 0.14);
  font-weight: 900;
}

.clipboard-warning p {
  margin: 1px 0 0;
  line-height: 1.5;
}

@media (max-width: 820px) {
  .account-parser-main {
    padding-block: 28px 48px;
  }

  .local-only-badge {
    display: none;
  }

  .input-help-grid {
    grid-template-columns: 1fr;
  }

  .copy-all-row {
    align-items: stretch;
    flex-direction: column;
  }

  .copy-all-row .button {
    width: 100%;
  }

  .batch-otp-status-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

@media (max-width: 620px) {
  .container-wide {
    width: min(100% - 24px, var(--container-wide));
  }

  .account-parser-header .manager-header-inner {
    min-height: 64px;
  }

  .account-parser-header .brand-text {
    display: none;
  }

  .account-parser-main {
    gap: 15px;
  }

  .account-parser-intro h1 {
    font-size: 34px;
  }

  .account-parser-intro > p:not(.eyebrow) {
    font-size: 15px;
  }

  .account-parser-card {
    border-radius: 18px;
    padding: 17px;
  }

  .account-parser-card-heading,
  .result-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .parser-actions .button,
  .format-slot-actions .button {
    flex: 1 1 auto;
  }

  .format-builder-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .format-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .format-select,
  .format-input {
    width: 100%;
  }

  .format-preview-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .batch-otp-row {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 8px 10px;
    padding: 11px;
  }

  .batch-otp-code {
    grid-column: 2;
    width: 100%;
  }
}
