/* ─── MAIN ───────────────────────────────────────────────────────────────── */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ─── SECTIONS ───────────────────────────────────────────────────────────── */
.section { display: none; }
.section.active { display: block; }

/* ─── SELECTORS ──────────────────────────────────────────────────────────── */
.selectors {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

select:focus { border-color: var(--accent); }

/* ─── CARDS ──────────────────────────────────────────────────────────────── */
.cards {
  display: grid;
  gap: 16px;
  margin-bottom: 32px;
}

.cards-4 { grid-template-columns: repeat(4, 1fr); }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px 22px;
  transition: border-color 0.2s;
}

.card:hover { border-color: var(--border-strong); }

.card-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.card-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}

.card-value.green { color: var(--green); }
.card-value.yellow { color: var(--yellow); }
.card-value.orange { color: var(--orange); }
.card-value.red { color: var(--red); }
.card-value.blue { color: var(--blue); }

.card-sub {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  margin-top: 8px;
}

.badge-green  { background: rgba(74,222,128,0.12);  color: var(--green); }
.badge-yellow { background: rgba(251,191,36,0.12);  color: var(--yellow); }
.badge-orange { background: color-mix(in srgb, var(--orange) 14%, transparent); color: var(--orange); }
.badge-red    { background: rgba(248,113,113,0.12); color: var(--red); }
.badge-blue   { background: rgba(140,168,216,0.12); color: var(--blue); }
.badge-accent { background: var(--accent-soft);     color: var(--accent-strong); }
.badge-muted  { background: rgba(159,148,136,0.08); color: var(--muted); }

.pill-event {
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ─── BLOCK TITLE ────────────────────────────────────────────────────────── */
.block-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ─── CHARTS ─────────────────────────────────────────────────────────────── */
.charts-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 32px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.charts-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.charts-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px 22px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.chart-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.chart-subtitle {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 18px;
}

.chart-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 200px;
  overflow: hidden;
}
.chart-wrap.tall { height: 260px; }
.chart-wrap canvas {
  display: block;
  width: 100% !important;
  max-width: 100%;
  min-width: 0;
  height: 100% !important;
}

.chart-empty-state {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

.chart-footnote {
  color: var(--muted);
  font-size: 10px;
  text-align: right;
  margin-top: 6px;
  opacity: 0.7;
}

/* ─── TOOLTIPS ────────────────────────────────────────────────────────────── */
.tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 5px;
}

.tooltip-trigger {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  padding: 0;
  transition: border-color 0.15s, color 0.15s;
}

.tooltip-trigger:hover,
.tooltip-trigger:focus {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.tooltip-bubble {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  min-width: 180px;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 11px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 12px 32px rgba(0,0,0,0.28);
  z-index: 9999;
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0;
  font-family: var(--font-main);
}

.tooltip-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: var(--surface2) transparent transparent transparent;
}

.tooltip-wrap:hover .tooltip-bubble,
.tooltip-wrap:focus-within .tooltip-bubble {
  display: block;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Edge variants — added by JS when near viewport edge */
.tooltip-bubble.tooltip-edge-right {
  left: auto;
  right: -8px;
  transform: translateY(4px);
}
.tooltip-bubble.tooltip-edge-right::after {
  left: auto;
  right: 12px;
  transform: none;
}
.tooltip-wrap:hover .tooltip-bubble.tooltip-edge-right,
.tooltip-wrap:focus-within .tooltip-bubble.tooltip-edge-right {
  transform: translateY(0);
}

.tooltip-bubble.tooltip-edge-left {
  left: -8px;
  transform: none;
}
.tooltip-bubble.tooltip-edge-left::after {
  left: 12px;
  transform: none;
}
.tooltip-wrap:hover .tooltip-bubble.tooltip-edge-left,
.tooltip-wrap:focus-within .tooltip-bubble.tooltip-edge-left {
  opacity: 1;
}

@media print {
  .tooltip-wrap { display: none !important; }
}

.app-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 400;
}

.app-modal.open {
  display: flex;
}

.app-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 16, 0.72);
  backdrop-filter: blur(4px);
}

.app-modal-dialog {
  position: relative;
  width: min(640px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
}

.app-modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.28);
}

/* Mi cuenta / Account settings */
.account-view {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  background: transparent;
}

.account-page-band {
  display: block;
  margin-bottom: 24px;
  background: transparent;
}

.account-page {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.account-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 4px;
}

.account-page-header h1 {
  margin: 0 0 4px;
  color: var(--text);
  font-family: var(--font-serif, var(--font-main));
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
}

.account-page-header p,
.account-card-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.account-page-summary {
  display: grid;
  gap: 2px;
  min-width: min(100%, 250px);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: right;
}

.account-page-summary strong,
.account-profile-head strong {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.account-page-summary span,
.account-profile-head span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.account-page-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.account-page-grid-single {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.account-card-compact {
  align-self: start;
}

.account-card-wide {
  grid-column: span 1;
}

.account-card-header,
.account-card-body {
  min-width: 0;
}

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

.account-card-header h2,
.asset-reserve-head h2,
.target-card-head h2 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.account-card-header-with-badge {
  align-items: flex-start;
}

.account-profile-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-bottom: 10px;
}

.account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface2);
  color: var(--accent-strong, var(--accent));
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.account-profile-list {
  display: grid;
  gap: 0;
  margin: 0 0 10px;
}

.account-profile-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
}

.account-profile-row dt {
  color: var(--muted);
  font-size: 12px;
}

.account-profile-row dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  overflow-wrap: anywhere;
  text-align: right;
}

.account-card-badge,
.account-reserve-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill, 20px);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(159,148,136,0.08);
  line-height: 1.25;
  white-space: nowrap;
}

.account-reserve-badge.active {
  color: var(--accent-strong, var(--accent));
  border-color: color-mix(in srgb, var(--accent) 36%, var(--border));
  background: var(--accent-soft);
}

.account-reserve-badge.off {
  background: rgba(159,148,136,0.08);
}

.account-form,
.account-compact-form {
  display: grid;
  gap: 14px;
}

.modal-close-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.account-alert {
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  margin-bottom: 12px;
}

.account-alert.error {
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.3);
  color: var(--red);
}

.account-alert.success {
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.28);
  color: var(--green);
}

.account-field {
  min-width: 0;
}

.account-field-compact {
  max-width: 420px;
}

.account-security-form {
  max-width: 520px;
}

.account-field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}

.account-form-control,
.account-form-select,
.account-field input {
  width: 100%;
  height: 38px;
  min-height: 38px;
  box-sizing: border-box;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 8px;
  outline: none;
}

.account-field input,
.account-form-control {
  font-family: var(--font-mono);
}

.account-form-select {
  appearance: auto;
}

.account-panel-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.account-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted, var(--muted));
  margin-bottom: 16px;
}

.account-checkline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.account-checkline input {
  width: auto;
  margin: 0;
}

.account-percent-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-percent-input input {
  max-width: 112px;
}

.account-percent-input span {
  color: var(--muted);
  font-size: 13px;
}

.account-alert[hidden],
.account-field[hidden],
.account-panel-hint[hidden] {
  display: none !important;
}

.account-panel-submit {
  width: auto;
  min-height: 38px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.account-panel-submit:hover {
  background: var(--accent-strong);
  color: var(--bg);
  opacity: 1;
}

.account-panel-submit:disabled,
.account-panel-secondary:disabled {
  cursor: not-allowed;
  opacity: .6;
}

.account-panel-submit-sm {
  min-width: 78px;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.account-panel-secondary {
  width: auto;
  min-height: 38px;
  box-sizing: border-box;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.account-panel-secondary:hover {
  border-color: var(--accent);
  background: var(--surface-soft, var(--surface2));
  color: var(--accent-strong);
  opacity: 1;
}

.account-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.account-own-id-block {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
}

.account-own-id-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.account-own-id-copy strong {
  font-size: 12px;
  color: var(--text);
}

.account-own-id-copy code {
  width: fit-content;
  max-width: 100%;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.account-rename-modal {
  display: grid;
  gap: 16px;
  width: min(620px, 100%);
}

.account-rename-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.account-rename-modal-head h2 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 18px;
  letter-spacing: 0;
}

.account-rename-modal-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.account-rename-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.account-rename-confirm {
  grid-column: 1 / -1;
}

.account-rename-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.asset-reserve-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  container-type: inline-size;
}

.account-card > .asset-reserve-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.account-card > .target-account-card,
.account-card > .target-asset-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.asset-reserve-card.is-compact {
  margin-top: 0;
}

/* Paired sections (Reserva / Objetivo) en /mi-cuenta */
.account-paired-section .account-card-body {
  display: grid;
  gap: 10px;
}
.account-paired-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0;
}
.account-paired-row .account-checkline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  color: var(--text);
}
.account-paired-row .account-field-inline {
  display: inline-flex;
  margin: 0;
}
.account-paired-row .account-percent-input { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.account-paired-row .account-percent-input input {
  width: 70px;
  height: 30px;
  padding: 3px 8px;
  font-size: 12px;
}
.account-paired-row .account-percent-input span { font-size: 12px; color: var(--muted); }
.account-paired-hint {
  flex: 1 1 140px;
  margin: 0;
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
}
.account-paired-row .account-panel-submit-sm,
.account-paired-row .account-panel-submit {
  margin-left: auto;
  min-height: 30px;
  padding: 4px 12px;
  font-size: 12px;
}
.account-paired-error { flex-basis: 100%; margin: 0; font-size: 11px; }
.account-paired-error[hidden] { display: none; }
.account-paired-divider {
  height: 1px;
  margin: 4px 0 2px;
  background: var(--border);
  opacity: 0.7;
}

/* Inner cards paired: sin padding/border propios para integrarse al wrapper */
.is-paired.asset-reserve-card,
.is-paired.target-account-card,
.is-paired.target-asset-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  gap: 6px;
}
.is-paired .asset-reserve-head,
.is-paired .target-card-head {
  padding: 0;
  margin: 0 0 4px;
  border: 0;
  gap: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.is-paired .asset-reserve-head h2,
.is-paired .target-card-head h2 { display: none; }
.is-paired.target-account-card .target-card-head { display: none; }
.is-paired .asset-reserve-head h3,
.is-paired .target-card-head h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.is-paired .asset-reserve-head p,
.is-paired .target-card-head p { display: none; }
.is-paired .target-card-head .target-status {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 8px;
  min-height: 20px;
}
.is-paired .target-account-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.is-paired .target-inline-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  grid-template-columns: none;
}
.is-paired .target-pct-wrap input,
.is-paired .target-pct {
  height: 30px;
  padding: 4px 8px;
  font-size: 12px;
  width: 80px;
}
.is-paired .target-save,
.is-paired .target-secondary-action {
  min-height: 30px;
  padding: 4px 12px;
  font-size: 12px;
}
.is-paired .target-save { margin-left: auto; }

.asset-reserve-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.asset-reserve-head .form-hint,
.asset-reserve-head .account-panel-hint {
  margin: 2px 0 0;
  line-height: 1.35;
}

.asset-reserve-list {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  overflow-y: visible;
  overflow-x: hidden;
  padding-right: 0;
}

.asset-reserve-empty,
.asset-reserve-error {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  padding: 4px 0;
}

.asset-reserve-error {
  color: var(--red);
}

.asset-editor-shell {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.asset-editor-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

/* Layout legacy ya no se usa; queda como fallback inocuo */
.asset-editor-current,
.asset-editor-footer { display: none; }

/* Toolbar inline para Reserva/Objetivo por activo */
.asset-editor-inline {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.asset-editor-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
}

.asset-editor-select-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.asset-editor-select-inline select {
  width: auto;
  min-width: 90px;
  max-width: 160px;
  height: 30px;
  padding: 3px 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
}

.asset-editor-shell .account-card-badge {
  margin: 0;
  padding: 3px 9px;
  min-height: 22px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.asset-editor-controls {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-left: auto;
  min-width: 0;
}

.asset-editor-controls .asset-reserve-mode,
.asset-editor-controls .target-asset-mode {
  width: auto;
  min-width: 150px;
  max-width: 220px;
  height: 30px;
  padding: 4px 8px;
}

.asset-editor-controls .asset-reserve-pct-wrap,
.asset-editor-controls .target-pct-wrap { max-width: 78px; }

.asset-editor-controls .asset-reserve-pct,
.asset-editor-controls .target-pct {
  height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}

.asset-editor-controls .asset-reserve-save,
.asset-editor-controls .target-save {
  min-height: 30px;
  padding: 4px 12px;
  font-size: 12px;
}

@container (max-width: 560px) {
  .asset-editor-controls { margin-left: 0; width: 100%; }
}

@media (max-width: 560px) {
  .asset-editor-controls { margin-left: 0; width: 100%; }
  .asset-editor-controls .asset-reserve-save,
  .asset-editor-controls .target-save { flex: 1 1 auto; }
}

.asset-editor-feedback {
  color: var(--green);
  font-weight: 600;
  text-align: right;
}

.asset-reserve-status {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.asset-reserve-mode,
.asset-reserve-pct {
  width: 100%;
  min-width: 0;
  height: 36px;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 12px;
  line-height: 1.2;
  outline: none;
}

.asset-reserve-mode {
  padding: 6px 10px;
  text-overflow: ellipsis;
}

.asset-reserve-pct {
  max-width: 72px;
  padding: 6px 8px;
  font-family: var(--font-mono);
  text-align: right;
}

.asset-reserve-pct-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 86px;
}

.asset-reserve-pct-wrap.is-disabled {
  visibility: hidden;
}

.asset-reserve-pct-wrap span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.asset-reserve-pct[hidden] {
  display: none;
}

.asset-reserve-save {
  width: auto;
  min-width: 78px;
  min-height: 34px;
  padding: 6px 9px;
  font-size: 12px;
  white-space: nowrap;
}

.asset-reserve-save.btn-accent,
.target-save.btn-accent {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--bg);
  box-shadow: none;
}

.asset-reserve-save.btn-accent:hover,
.target-save.btn-accent:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--bg);
  opacity: 1;
}

.asset-reserve-editor-error,
.target-editor-error {
  grid-column: 1 / -1;
  color: var(--red);
  font-size: 12px;
  line-height: 1.35;
}

.asset-reserve-editor-error[hidden],
.target-editor-error[hidden],
.asset-editor-feedback[hidden] {
  display: none;
}

.target-settings,
.target-card,
.target-account-card,
.target-asset-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.target-card,
.target-account-card,
.target-asset-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  container-type: inline-size;
}

.target-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.target-card-head .form-hint,
.target-card-head .account-panel-hint {
  margin: 2px 0 0;
  line-height: 1.35;
}

.target-account-block {
  display: grid;
  grid-template-columns: minmax(110px, max-content) minmax(118px, max-content) minmax(130px, max-content);
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.target-asset-list {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  overflow-y: visible;
  overflow-x: hidden;
  padding-right: 0;
}

.target-status {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.target-mode,
.target-pct {
  width: 100%;
  min-width: 0;
  height: 36px;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 12px;
  line-height: 1.2;
  outline: none;
}

.target-mode {
  padding: 6px 10px;
  text-overflow: ellipsis;
}

.target-pct {
  max-width: 72px;
  padding: 6px 8px;
  font-family: var(--font-mono);
  text-align: right;
}

.target-inline-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.target-pct-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 86px;
}

.target-pct-wrap.is-disabled {
  visibility: hidden;
}

.target-pct-wrap span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.target-asset-editor .target-save {
  width: auto;
  min-width: 78px;
  min-height: 34px;
  padding: 6px 9px;
  font-size: 12px;
  white-space: nowrap;
}

.target-secondary-action {
  width: auto;
  min-height: 38px;
  padding: 8px 14px;
  font-size: 13px;
  white-space: nowrap;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.target-secondary-action:hover {
  background: var(--surface-soft, var(--surface2));
  border-color: var(--accent);
  color: var(--accent-strong);
  opacity: 1;
}

.target-empty,
.target-error {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  padding: 4px 0;
}

.target-error {
  grid-column: 1 / -1;
  color: var(--red);
}

.target-error[hidden] {
  display: none;
}

@container (max-width: 420px) {
  .asset-editor-current,
  .asset-editor-controls {
    grid-template-columns: 1fr;
  }

  .asset-editor-controls .asset-reserve-save,
  .asset-editor-controls .target-save {
    width: 100%;
  }

  .asset-reserve-status,
  .target-status {
    white-space: normal;
  }
}

@container (max-width: 430px) {
  .target-account-block {
    grid-template-columns: 1fr;
  }

  .target-account-block .target-inline-field,
  .target-account-block .target-save,
  .target-account-block .target-secondary-action {
    grid-column: 1 / -1;
  }

  .target-account-block .target-save,
  .target-account-block .target-secondary-action {
    width: 100%;
  }

  .asset-editor-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .asset-editor-feedback {
    text-align: left;
  }

  .asset-reserve-save,
  .target-asset-editor .target-save {
    width: 100%;
  }
}

@media (max-width: 980px) {
  .account-page-grid,
  .account-page-grid-single {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .target-account-block {
    grid-template-columns: minmax(92px, max-content) minmax(118px, max-content);
  }
}

@media (max-width: 520px) {
  .account-page-header,
  .account-card-header,
  .account-card-header-with-badge,
  .account-profile-row {
    align-items: stretch;
    flex-direction: column;
  }

  .account-page-summary,
  .account-profile-row dd {
    text-align: left;
  }

  .account-card {
    padding: 18px;
  }

  .account-card-actions,
  .account-panel-submit {
    width: 100%;
  }

  .account-own-id-block,
  .account-rename-modal-head,
  .account-rename-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .account-own-id-block .account-panel-secondary,
  .account-rename-actions .account-panel-secondary {
    width: 100%;
  }

  .account-rename-grid {
    grid-template-columns: 1fr;
  }

  .target-account-block {
    grid-template-columns: minmax(52px, .65fr) minmax(100px, 1.35fr);
  }

  .target-secondary-action {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-bottom: 32px;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 8px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  white-space: nowrap;
}

tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) td { background: var(--table-zebra); }
tr:hover td { background: var(--table-hover); }

.empty-cell {
  padding: 22px 18px !important;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

.empty-cell-action {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.td-label { font-family: var(--font-main); font-weight: 500; }
td.money,
th.money {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.table-sort-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: inherit;
  gap: 4px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: inherit;
  cursor: pointer;
}
.table-sort-button:hover,
.table-sort-button.active {
  color: var(--accent);
}
.table-sort-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.table-sort-indicator {
  display: inline-flex;
  width: 10px;
  min-width: 10px;
  justify-content: center;
  color: var(--accent);
  font-size: 11px;
  line-height: 1;
}

.table-sm th,
.table-sm td { font-size: 11px; }

.compact-table th,
.compact-table td {
  font-size: 11px;
  padding: 6px 9px;
}

.cash-movements-table-wrapper {
  max-width: 100%;
  overflow-x: visible;
}

.cash-movements-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.cash-movements-table th,
.cash-movements-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.cash-movements-table .col-date {
  width: 16%;
  overflow: visible;
  text-overflow: clip;
}
.cash-movements-table .col-account { width: 14%; }
.cash-movements-table .col-type { width: 30%; }
.cash-movements-table .col-amount {
  width: 12%;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cash-movements-table .col-note {
  width: 16%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
  overflow-wrap: normal;
}
.cash-movements-table .col-actions {
  width: 12%;
  text-align: right;
}

.cash-movements-table-compact .col-date { width: 20%; }
.cash-movements-table-compact .col-type { width: 42%; }
.cash-movements-table-compact .col-amount { width: 16%; }
.cash-movements-table-compact .col-note { width: 22%; }

.cash-movements-table-gestion .col-date { width: 16%; }
.cash-movements-table-gestion .col-type { width: 30%; }
.cash-movements-table-gestion .col-amount { width: 12%; }
.cash-movements-table-gestion .col-note { width: 16%; }
.cash-movements-table-gestion .col-balance {
  width: 14%;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cash-movements-table-gestion .col-actions { width: 12%; }

.cash-movements-table .movement-cell-inner {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
  vertical-align: middle;
}

.cash-movements-table .pill-event,
.cash-movements-table .movement-label {
  display: inline-block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.cash-movements-table .movement-cell-inner .pill-event {
  flex: 1 1 auto;
}

.cash-movements-table .movement-cell-inner .badge-muted {
  flex: 0 0 auto;
}

.cash-movements-table .table-actions,
.cash-movements-table .action-buttons,
.cash-movements-table .gestion-caja-actions {
  display: inline-flex;
  gap: 4px;
  justify-content: flex-end;
}

.cash-movements-table .icon-btn {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
}

/* ─── TABLE ACTION BUTTONS (unified) ─────────────────────────────────────── */
.table-action-btn {
  min-width: 32px;
  width: auto;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.table-action-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.table-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.table-action-edit {
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.32);
  background: rgba(96, 165, 250, 0.12);
}

.table-action-edit:hover:not(:disabled) {
  color: #eff6ff;
  border-color: rgba(96, 165, 250, 0.46);
  background: rgba(96, 165, 250, 0.18);
}

.table-action-delete {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.34);
  background: rgba(248, 113, 113, 0.14);
}

.table-action-delete:hover:not(:disabled) {
  color: #fee2e2;
  border-color: rgba(248, 113, 113, 0.48);
  background: rgba(248, 113, 113, 0.20);
}

.table-action-neutral {
  color: var(--muted);
  border-color: var(--border);
  background: transparent;
}

.table-action-neutral:hover:not(:disabled) {
  color: var(--text);
  border-color: rgba(96, 165, 250, 0.30);
  background: rgba(96, 165, 250, 0.08);
}

/* Light mode improvements for table action buttons */
body.light .table-action-edit {
  color: #1d4ed8;
  border-color: rgba(29, 78, 216, 0.28);
  background: rgba(59, 130, 246, 0.10);
}

body.light .table-action-edit:hover:not(:disabled) {
  color: #1e40af;
  border-color: rgba(29, 78, 216, 0.42);
  background: rgba(59, 130, 246, 0.16);
}

body.light .table-action-delete {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(239, 68, 68, 0.10);
}

body.light .table-action-delete:hover:not(:disabled) {
  color: #991b1b;
  border-color: rgba(220, 38, 38, 0.42);
  background: rgba(239, 68, 68, 0.16);
}

body.light .table-action-neutral {
  color: var(--text);
  border-color: var(--border);
}

body.light .table-action-neutral:hover:not(:disabled) {
  color: var(--accent-strong);
  border-color: var(--border);
  background: rgba(212, 163, 95, 0.12);
}

@media (max-width: 760px) {
  .cash-movements-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cash-movements-table {
    min-width: 720px;
  }
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

/* ─── RESPONSIVE TABLET (max 1024px) ────────────────────────────────────── */
@media (max-width: 1024px) {
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
  .charts-3 { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 24px 16px; }
}

/* ─── RESPONSIVE MOBILE (max 640px) ─────────────────────────────────────── */
@media (max-width: 640px) {
  .main { padding: 20px 12px; }

  .selectors { width: 100%; }

  .selectors select { flex: 1; }

  .cards-4,
  .cards-3 { grid-template-columns: repeat(2, 1fr); }

  .cards-2 { grid-template-columns: 1fr; }

  .cards-4 > .card:last-child:nth-child(odd),
  .cards-3 > .card:last-child:nth-child(odd) { grid-column: span 2; }

  .card { padding: 14px 16px; }

  .card-value { font-size: 18px; word-break: break-all; }

  table { min-width: auto; }
  th, td { padding: 6px 8px; font-size: 11px; }
  .compact-table th,
  .compact-table td { padding: 5px 7px; }

  .hide-mobile { display: none !important; }

  .td-rvm-name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .td-rvm-val { white-space: nowrap; }

  .charts-2,
  .charts-3 { grid-template-columns: 1fr; }

  .app-modal-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .app-modal-content,
  .account-card { padding: 18px; }
  .account-page-grid,
  .account-page-grid-single { grid-template-columns: 1fr; }
  .account-card-header,
  .account-profile-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .account-profile-row dd { text-align: left; }
  .tooltip-bubble { max-width: 220px; }
  .version-dropdown {
    width: min(300px, calc(100vw - 20px));
    min-width: 0;
  }

  .chart-wrap { height: 140px; }
  .chart-wrap.tall { height: 180px; }

  .chart-card { padding: 16px 14px; }
}
/* ─── PRINT ─────────────────────────────────────────────────────────────── */
@media print {
  /* Ocultar todo usando visibility para no romper el layout del target */
  body * { visibility: hidden; }

  /* Mostrar solo el bloque seleccionado */
  .print-target,
  .print-target * { visibility: visible; }

  /* Posicionar en la esquina superior izquierda */
  .print-target {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: #fff;
    color: #111;
  }

  /* Tipografía y colores de tabla para impresión */
  .print-target .block-title {
    color: #111;
    border-bottom-color: #ccc;
    font-size: 13px;
  }

  .print-target .table-card {
    background: #fff;
    border: none;
    box-shadow: none;
  }

  .print-target table th {
    background: #f4f4f4;
    color: #111;
    border-bottom: 1px solid #ccc;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-target table td {
    color: #111;
    border-bottom-color: #eee;
  }

  .print-target .pill {
    border: 1px solid currentColor;
  }

  /* Ocultar el botón en la impresión */
  .print-target button { visibility: hidden; }
}

/* ─── LOGIN: password toggle ──────────────────────────────────────────────── */
.pw-toggle-wrap {
  position: relative;
}

.pw-toggle-btn {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 0 8px 8px 0;
  transition: color 0.15s;
  padding: 0;
  z-index: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.pw-toggle-btn:hover,
.pw-toggle-btn:focus-visible {
  color: var(--text);
  outline: none;
}

.pw-toggle-btn:focus-visible {
  box-shadow: 0 0 0 2px var(--accent);
  border-radius: 0 8px 8px 0;
}

/* ─── LOGIN: PWA install ──────────────────────────────────────────────────── */
.pwa-install-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 18px;
}

.pwa-install-icon {
  flex-shrink: 0;
  color: var(--accent);
  display: flex;
  align-items: center;
}

.pwa-install-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pwa-install-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.pwa-install-sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.pwa-install-action {
  flex-shrink: 0;
  background: var(--accent);
  color: #0d0f14;
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.pwa-install-action:hover {
  opacity: 0.88;
}

@media (max-width: 480px) {
  .pwa-install-card {
    flex-wrap: wrap;
    gap: 10px;
  }
  .pwa-install-action {
    width: 100%;
    padding: 10px;
    text-align: center;
  }
}

/* ─── TABLE PAGINATION ────────────────────────────────────────────────────── */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.table-pagination-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  min-width: 44px;
  text-align: center;
}

.table-pag-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 1rem;
  line-height: 1;
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.table-pag-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.table-pag-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

@media (max-width: 640px) {
  .table-pagination {
    flex-wrap: wrap;
  }
}

/* ── Pantalla de mantenimiento ───────────────────────────────────────────── */
.maintenance-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 220px);
  padding: 32px 16px;
}

.maintenance-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 40px 36px 32px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.maintenance-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--accent) 35%,
    var(--accent) 65%,
    transparent 100%);
  opacity: 0.85;
}

.maintenance-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 22px;
}

.maintenance-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.maintenance-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 22px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--accent);
}

.maintenance-icon svg {
  width: 30px;
  height: 30px;
  display: block;
}

.maintenance-title {
  font-family: var(--font-display, var(--font-main));
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.maintenance-text {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 auto 24px;
  max-width: 36ch;
}

.maintenance-message {
  text-align: left;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  margin: 0 0 24px;
  white-space: pre-wrap;
  word-break: break-word;
}

.maintenance-message-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.maintenance-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 4px;
}

.maintenance-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease,
              color 0.15s ease, transform 0.15s ease;
}

.maintenance-btn-primary {
  background: var(--accent);
  color: #0d0f14;
  border: 1px solid var(--accent);
}

.maintenance-btn-primary:hover {
  background: var(--accent-strong, var(--accent));
  border-color: var(--accent-strong, var(--accent));
}

.maintenance-btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.maintenance-btn-ghost:hover {
  background: var(--surface2);
  border-color: var(--border-strong, var(--border));
}

.maintenance-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.maintenance-footnote {
  display: block;
  margin-top: 24px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

@media (max-width: 480px) {
  .maintenance-card {
    padding: 32px 22px 26px;
    border-radius: 14px;
  }

  .maintenance-title {
    font-size: 20px;
  }

  .maintenance-text {
    font-size: 13px;
  }

  .maintenance-btn {
    flex: 1 1 100%;
    min-width: 0;
  }
}

@media print {
  .maintenance-wrap {
    min-height: 0;
  }
  .maintenance-card {
    box-shadow: none;
  }
}
