:root {
  color-scheme: light dark;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #111;
  color: #f5f5f5;
}

:root {
  color-scheme: light dark;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #111;
  color: #f5f5f5;
}

body {
  margin: 0;
  padding: 0;
  background: linear-gradient(145deg, #161b22, #0d1117);
  min-height: 100vh;
}

.page-blocker {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 14, 0.22);
  backdrop-filter: blur(1px);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 16px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.page-blocker.is-active {
  opacity: 1;
  pointer-events: all;
}

.page-blocker-card {
  background: rgba(13, 18, 30, 0.96);
  border: 1px solid rgba(91, 141, 239, 0.35);
  border-radius: 12px;
  padding: 24px 28px;
  text-align: center;
  min-width: 260px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.page-blocker-title {
  font-weight: 700;
  margin-top: 12px;
  color: #f8fafc;
}

.page-blocker-subtitle {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #9aa4b2;
}

.page-blocker-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(148, 163, 184, 0.35);
  border-top-color: #38bdf8;
  margin: 0 auto;
  animation: blockerSpin 0.9s linear infinite;
}

@keyframes blockerSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Live-Log modal ────────────────────────────────────── */
#live-log-panel {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 14, 0.65);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

#live-log-panel[hidden] {
  display: none;
}

#live-log-panel.is-visible {
  opacity: 1;
  pointer-events: all;
}

#live-log-panel .live-log-card {
  position: relative;
  background: rgba(13, 18, 30, 0.97);
  border: 1px solid rgba(91, 141, 239, 0.35);
  border-radius: 14px;
  padding: 20px 24px 24px;
  width: min(92vw, 760px);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

#live-log-panel .live-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-shrink: 0;
}

#live-log-panel .live-log-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #f8fafc;
}

#live-log-panel .live-log-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: rgba(247, 247, 247, 0.55);
  font-size: 0.85rem;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}

#live-log-panel .live-log-close[hidden] {
  display: none;
}

#live-log-panel .live-log-close:hover {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.12);
}

#live-log-panel #log-wrapper {
  flex: 1 1 auto;
  min-height: 200px;
  max-height: calc(80vh - 80px);
  height: 420px;
}

/* ── Log history picker ────────────────────────────────── */
.log-history-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0;
}

.log-history-picker-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  padding: 2px 4px 8px;
  border-bottom: 1px solid rgba(99, 110, 141, 0.2);
  margin-bottom: 2px;
}

.log-history-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(99, 110, 141, 0.2);
  background: rgba(9, 12, 19, 0.6);
  color: #cdd3df;
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}

.log-history-entry:hover {
  background: rgba(91, 141, 239, 0.08);
  border-color: rgba(91, 141, 239, 0.35);
}

.log-history-entry.is-error {
  border-color: rgba(255, 133, 124, 0.2);
}

.log-history-entry.is-error:hover {
  background: rgba(255, 133, 124, 0.06);
  border-color: rgba(255, 133, 124, 0.35);
}

.log-history-icon {
  flex-shrink: 0;
  font-size: 0.9rem;
}

.log-history-when {
  flex: 0 0 auto;
  color: #e2e8f0;
  white-space: nowrap;
}

.log-history-kind {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(91, 141, 239, 0.15);
  color: #8bb4f7;
  white-space: nowrap;
}

.log-history-meta {
  flex: 1 1 auto;
  color: #7d8799;
  text-align: right;
  white-space: nowrap;
}

.log-history-btn {
  font-size: 0.78rem;
  padding: 6px 10px;
}

.log-history-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  margin-bottom: 8px;
  border-radius: 6px;
  border: 1px solid rgba(99, 110, 141, 0.25);
  background: rgba(99, 110, 141, 0.08);
  color: #94a3b8;
  font-size: 0.78rem;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.log-history-back:hover {
  color: #e2e8f0;
  background: rgba(91, 141, 239, 0.10);
  border-color: rgba(91, 141, 239, 0.35);
}

body.is-busy {
  overflow: hidden;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

h1 {
  margin-top: 0;
  margin-bottom: 0;
  font-size: 1.8rem;
  letter-spacing: 0.02em;
}

.login-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(91, 141, 239, 0.15);
  color: #5b8def;
  border: 1px solid rgba(91, 141, 239, 0.3);
  transition: all 120ms ease;
  font-size: 0.9rem;
}

.login-btn:hover {
  background: rgba(91, 141, 239, 0.25);
  border-color: rgba(91, 141, 239, 0.5);
  transform: translateY(-1px);
}

p.description {
  margin-top: 0;
  margin-bottom: 24px;
  color: #9ba1b0;
}

.panel {
  background: rgba(19, 24, 33, 0.85);
  border: 1px solid rgba(99, 110, 141, 0.4);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 18px 45px rgba(10, 12, 18, 0.45);
}

form .field {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.input-with-button {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.input-with-button input {
  flex: 1;
  min-width: 0;
}

.input-with-button button {
  flex-shrink: 0;
  white-space: nowrap;
}

label {
  font-weight: 600;
  margin-bottom: 6px;
}

input,
select,
button,
textarea {
  font: inherit;
}

input[type="url"],
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(99, 110, 141, 0.5);
  background: rgba(12, 18, 27, 0.9);
  color: inherit;
}

.readonly-value {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(99, 110, 141, 0.5);
  background: rgba(12, 18, 27, 0.6);
  color: #9ba1b0;
  word-break: break-word;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

#job-status,
.form-status {
  white-space: pre-line;
}

button {
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 80ms ease, box-shadow 120ms ease;
}

button.primary {
  background: #5b8def;
  color: #0d1117;
  box-shadow: 0 12px 24px rgba(40, 90, 196, 0.35);
}

button.secondary {
  background: transparent;
  color: #9ba1b0;
  border: 1px solid rgba(99, 110, 141, 0.4);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

button:not(:disabled):hover {
  transform: translateY(-1px);
}

.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.domain-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Plan badge ─────────────────────────────────────────────────────── */
.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(91, 141, 239, 0.15);
  color: #8bb4f7;
  border: 1px solid rgba(91, 141, 239, 0.25);
  white-space: nowrap;
}

.plan-badge.is-at-limit {
  background: rgba(239, 140, 91, 0.15);
  color: #f7c08b;
  border-color: rgba(239, 140, 91, 0.3);
}

.domain-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(99, 110, 141, 0.35);
  background: rgba(9, 12, 19, 0.55);
}

.domain-item:has(.domain-settings-accordion:not([hidden])) {
  border-color: rgba(91, 141, 239, 0.75);
  background: rgba(12, 16, 26, 0.75);
  box-shadow: 0 0 0 1px rgba(91, 141, 239, 0.2), 0 12px 24px rgba(9, 12, 19, 0.45);
}

.domain-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.domain-thumb {
  width: 72px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(99, 110, 141, 0.35);
  background: rgba(12, 18, 27, 0.9);
}

.domain-thumb-link {
  display: inline-flex;
  text-decoration: none;
}

.domain-thumb-link:hover .domain-thumb {
  border-color: rgba(91, 141, 239, 0.55);
}

.domain-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.domain-title {
  font-weight: 700;
  color: #f5f5f5;
}

.domain-subtitle {
  font-size: 0.85rem;
  color: #9ba1b0;
  word-break: break-word;
}

.domain-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.domain-settings-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.domain-settings-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.domain-settings-accordion {
  width: 100%;
  overflow: hidden;
  transition: all 200ms ease;
}

.domain-settings-accordion[hidden] {
  display: none;
}

.domain-settings-content {
  width: 100%;
}

.domain-settings-inner {
  padding: 16px;
  background: rgba(9, 12, 19, 0.9);
  border-radius: 8px;
  margin-top: 8px;
  border: 1px solid rgba(99, 110, 141, 0.25);
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 0.85rem;
}

.domain-item:has(.domain-settings-accordion:not([hidden])) .domain-settings-inner {
  border-color: rgba(91, 141, 239, 0.5);
  background: rgba(12, 18, 30, 0.95);
}

.settings-field {
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: #9ba1b0;
  line-height: 1.6;
}

.settings-field:last-child {
  margin-bottom: 0;
}

.settings-field label {
  display: block;
  margin: 0;
  font-weight: 400;
  color: #7d8799;
}

.settings-contact-field input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(99, 110, 141, 0.4);
  border-left: none;
  border-right: none;
  background: rgba(10, 14, 22, 0.9);
  color: #e5e9f2;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 0.85rem;
}

.settings-iframe-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: none;
  background: rgba(8, 12, 20, 0.95);
  color: #e5e9f2;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 0.82rem;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-iframe-input:focus {
  box-shadow: inset 0 0 0 1px rgba(91, 141, 239, 0.6);
}

.settings-contact-group .settings-iframe-input + .secondary {
  border-left: 1px solid rgba(99, 110, 141, 0.35);
}

.settings-iframe-copy {
  transition: none !important;
  box-shadow: none !important;
}

.settings-iframe-copy:hover,
.settings-iframe-copy:active,
.settings-iframe-copy:focus {
  transform: none !important;
  box-shadow: none !important;
}

.settings-contact-input:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(91, 141, 239, 0.6);
}

.settings-contact-field input::placeholder {
  color: rgba(125, 135, 153, 0.8);
}

.settings-contact-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.settings-contact-group {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-top: 8px;
  border: 1px solid rgba(99, 110, 141, 0.4);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(10, 14, 22, 0.9);
}

.settings-contact-prefix {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  color: #7d8799;
  font-size: 0.8rem;
  border-right: 1px solid rgba(99, 110, 141, 0.35);
  background: rgba(9, 12, 19, 0.9);
  white-space: nowrap;
}

.settings-contact-group .secondary {
  border-radius: 0;
  border-left: 1px solid rgba(99, 110, 141, 0.35);
  padding: 0 12px;
  height: auto;
}

.settings-help {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #c8d2e5;
  line-height: 1.5;
  background: rgba(16, 22, 36, 0.7);
  border-left: 3px solid rgba(108, 138, 255, 0.7);
  padding: 6px 10px;
  border-radius: 6px;
}

.settings-contact-status {
  font-size: 0.75rem;
  color: #7d8799;
}

.settings-links-field {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(99, 110, 141, 0.2);
}

.settings-links-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-links-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-links-list {
  margin-top: 8px;
  border: 1px solid rgba(99, 110, 141, 0.35);
  border-radius: 8px;
  padding: 8px;
  background: rgba(8, 12, 20, 0.85);
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}

.settings-links-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  color: #cdd3df;
  line-height: 1.4;
}

.settings-links-item span {
  word-break: break-all;
}

.settings-links-empty {
  font-size: 0.8rem;
  color: #7d8799;
  padding: 4px 2px;
}

.settings-links-footer {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-links-count,
.settings-links-status {
  font-size: 0.75rem;
  color: #7d8799;
}

.settings-field strong {
  color: #5b8def;
  font-weight: 600;
}

.settings-theme-field {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(99, 110, 141, 0.2);
}

.knowledge-pack {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(99, 110, 141, 0.2);
  font-size: 0.85rem;
  color: #c9cfdb;
}

.knowledge-pack-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.knowledge-pack-title {
  font-weight: 700;
  color: #f5f5f5;
}

.knowledge-pack-subtitle {
  font-size: 0.75rem;
  color: #7d8799;
}

.knowledge-pack-section {
  margin-bottom: 12px;
}

.knowledge-pack-section-title {
  font-weight: 600;
  color: #5b8def;
  margin-bottom: 6px;
}

.knowledge-pack-text {
  color: #9ba1b0;
}

.knowledge-pack-list {
  margin: 0;
  padding-left: 18px;
  color: #9ba1b0;
}

.theme-radio-group {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 12px;
}

.theme-radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(99, 110, 141, 0.05);
  border: 1px solid rgba(99, 110, 141, 0.2);
  border-radius: 6px;
  cursor: pointer;
  transition: all 150ms ease;
  font-size: 0.8rem;
  color: #9ba1b0;
  white-space: nowrap;
}

.theme-radio-label:hover {
  background: rgba(99, 110, 141, 0.1);
  border-color: rgba(99, 110, 141, 0.4);
}

.theme-radio-label input[type="radio"] {
  margin: 0;
  cursor: pointer;
}

.theme-radio-label input[type="radio"]:checked + span {
  color: #5b8def;
  font-weight: 600;
}

.theme-radio-label:has(input[type="radio"]:checked) {
  background: rgba(91, 141, 239, 0.1);
  border-color: #5b8def;
  box-shadow: 0 0 0 1px rgba(91, 141, 239, 0.2), inset 0 0 0 1px rgba(91, 141, 239, 0.2);
}

.status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 8px;
  color: #9ba1b0;
}

.status-line strong {
  color: #f5f5f5;
}

#log-wrapper {
  height: 320px;
  overflow-y: auto;
  border-radius: 8px;
  background: rgba(9, 12, 19, 0.9);
  border: 1px solid rgba(99, 110, 141, 0.25);
  padding: 16px;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.log-line {
  margin: 0;
}

.log-line.stderr {
  color: #ff857c;
}

.log-line.stdout {
  color: #8be9a5;
}

.log-line.system {
  color: #69c7ff;
}

.connection-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
}

.connection-indicator[data-status="connected"] {
  background: rgba(102, 255, 153, 0.12);
  color: #72ffb9;
}

.connection-indicator[data-status="disconnected"] {
  background: rgba(255, 133, 124, 0.15);
  color: #ffa59d;
}

footer {
  margin-top: 40px;
  text-align: center;
  color: #606a7a;
  font-size: 0.85rem;
}

/* Client Text editor */
.custom-editor {
  display: grid;
  gap: 12px;
}

.custom-editor-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.custom-status {
  color: #9ba1b0;
  font-size: 0.9rem;
}

.custom-textarea {
  min-height: 140px;
  padding: 12px 12px;
  border-radius: 10px;
  border: 1px solid rgba(99, 110, 141, 0.5);
  background: rgba(12, 18, 27, 0.9);
  color: inherit;
  outline: none;
  line-height: 1.5;
  white-space: pre-wrap;
}

.custom-textarea:focus {
  border-color: rgba(105, 199, 255, 0.7);
  box-shadow: 0 0 0 0.15rem rgba(105, 199, 255, 0.18);
}

.custom-textarea:empty:before {
  content: attr(data-placeholder);
  color: #606a7a;
}

.custom-editor-footer {
  display: flex;
  justify-content: flex-end;
}

.custom-count {
  color: #606a7a;
  font-size: 0.85rem;
}


/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.is-visible {
  display: flex;
}

.modal.is-open {
  display: flex;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: rgba(19, 24, 33, 0.98);
  border: 1px solid rgba(99, 110, 141, 0.4);
  border-radius: 12px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  animation: modalSlideIn 200ms ease-out;
}

.modal-content .warning-message {
  margin-top: 16px;
  padding: 12px;
  background: rgba(255, 193, 7, 0.1);
  border-left: 3px solid #ffc107;
  border-radius: 4px;
  font-size: 0.9em;
}

.modal-content .warning-message strong {
  color: #ffc107;
  display: block;
  margin-bottom: 8px;
}

.modal-content .data-impact-list {
  margin: 8px 0 0 0;
  padding-left: 20px;
  list-style: disc;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85em;
  line-height: 1.6;
}

.modal-content .data-impact-list li {
  margin: 4px 0;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(99, 110, 141, 0.25);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.modal-close {
  appearance: none;
  background: transparent;
  border: none;
  color: #9ba1b0;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 120ms ease, color 120ms ease;
}

.modal-close:hover {
  background: rgba(99, 110, 141, 0.2);
  color: #f5f5f5;
}

.modal-body {
  padding: 24px;
}

.form-status {
  min-height: 18px;
  margin-bottom: 12px;
  color: #9ba1b0;
  font-size: 0.9rem;
}

/* Inline status for the main job form */
#job-status.form-status {
  margin-top: 12px;
  margin-bottom: 0;
}

.form-status.is-error {
  color: #ff857c;
}

.form-status.is-pending {
  color: #69c7ff;
}

.form-status.is-success {
  color: #8be9a5;
}

.modal-body .field {
  margin-bottom: 16px;
}

.modal-body input[type="email"],
.modal-body input[type="password"] {
  width: 100%;
  box-sizing: border-box;
}

.modal-footer {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  justify-content: flex-end;
}

/* ── Account Settings Modal ──────────────────────────────────────────── */

.modal-content--wide {
  max-width: 640px;
}

/* Tabs */
.account-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid rgba(99, 110, 141, 0.25);
  margin-bottom: 20px;
}

.account-tab {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #9ba1b0;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
}

.account-tab:hover {
  color: #c8cdd8;
}

.account-tab.is-active {
  color: #5b8def;
  border-bottom-color: #5b8def;
}

/* Tab panels */
.account-tab-panel {
  display: none;
}

.account-tab-panel.is-active {
  display: block;
}

.account-loading {
  text-align: center;
  color: #9ba1b0;
  padding: 24px 0;
}

/* ── My Plan tab ─────────────────────────────────────────────────────── */

.account-plan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.account-plan-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 700;
}

.account-plan-price {
  font-size: 1.1rem;
  color: #9ba1b0;
}

.account-plan-price span:first-child {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e8edf5;
}

.account-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.account-pill--free {
  background: rgba(99, 110, 141, 0.2);
  color: #9ba1b0;
}

.account-pill--active {
  background: rgba(91, 141, 239, 0.18);
  color: #8bb4f7;
}

.account-pill--trial {
  background: rgba(139, 92, 246, 0.18);
  color: #b294f7;
}

.account-pill--past_due {
  background: rgba(255, 193, 7, 0.18);
  color: #ffc107;
}

.account-pill--canceled {
  background: rgba(255, 92, 117, 0.18);
  color: #ff5c75;
}

/* Usage bars */
.account-usage-section {
  margin-bottom: 20px;
}

.account-usage-section h3 {
  margin: 0 0 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #9ba1b0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.account-usage-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.account-usage-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-usage-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #c8cdd8;
}

.account-usage-track {
  height: 8px;
  background: rgba(99, 110, 141, 0.2);
  border-radius: 999px;
  overflow: hidden;
}

.account-usage-fill {
  height: 100%;
  background: #5b8def;
  border-radius: 999px;
  transition: width 400ms ease;
  min-width: 0;
}

.account-usage-fill.is-full {
  background: #ff5c75;
}

/* Features list */
.account-features-section h3 {
  margin: 0 0 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #9ba1b0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.account-features-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.account-features-list li {
  font-size: 0.85rem;
  margin: 0;
}

.account-features-list .feature-yes {
  color: #8be9a5;
}

.account-features-list .feature-no {
  color: rgba(155, 161, 176, 0.5);
}

/* ── Upgrade tab ─────────────────────────────────────────────────────── */

.account-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.plan-card {
  background: rgba(12, 18, 27, 0.7);
  border: 1px solid rgba(99, 110, 141, 0.3);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  transition: border-color 150ms ease;
}

.plan-card:hover {
  border-color: rgba(99, 110, 141, 0.5);
}

.plan-card--current {
  border-color: #5b8def;
  background: rgba(91, 141, 239, 0.06);
}

.plan-card-header {
  margin-bottom: 14px;
}

.plan-card-name {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
}

.plan-card-price {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.plan-card-amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e8edf5;
}

.plan-card-period {
  font-size: 0.8rem;
  color: #9ba1b0;
}

.plan-card-limits {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.plan-card-limits li {
  font-size: 0.85rem;
  color: #c8cdd8;
  margin: 4px 0;
}

.plan-card-features {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.plan-card-features li {
  font-size: 0.8rem;
  color: #8be9a5;
  margin: 3px 0;
}

.plan-card-no-features {
  color: #9ba1b0 !important;
  font-style: italic;
}

.plan-card-action {
  margin-top: 14px;
}

.plan-card-action button {
  width: 100%;
}

/* ── Profile tab ─────────────────────────────────────────────────────── */

.account-divider {
  border: none;
  border-top: 1px solid rgba(99, 110, 141, 0.25);
  margin: 24px 0;
}

#account-profile-content .field {
  margin-bottom: 14px;
}

#account-profile-content input[type="text"],
#account-profile-content input[type="email"],
#account-profile-content input[type="password"] {
  width: 100%;
  box-sizing: border-box;
}

#account-profile-content h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 500px) {
  .modal-content--wide {
    max-width: 100%;
  }

  .account-plans-grid {
    grid-template-columns: 1fr;
  }

  .account-features-list {
    grid-template-columns: 1fr;
  }

  .account-plan-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
