:root {
  --pub-bg: #e8eaed;
  --pub-ink: #1f2937;
  --pub-muted: #6b7280;
  --pub-line: #e5e7eb;
  --pub-accent: #1d4ed8;
  --pub-accent-hover: #1e40af;
  --pub-card: #ffffff;
  --pub-surface-2: #f3f4f6;
  --font: "Manrope", "Segoe UI", sans-serif;
  --display: "Outfit", "Avenir Next", sans-serif;
}

html[data-theme="dark"] {
  --pub-bg: #0f1419;
  --pub-ink: #e7ecf1;
  --pub-muted: #9aa5b5;
  --pub-line: #2a3441;
  --pub-accent: #5b8def;
  --pub-accent-hover: #7aa3f5;
  --pub-card: #1a222d;
  --pub-surface-2: #232c38;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--pub-bg);
  color: var(--pub-ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

a { color: var(--pub-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.pub-topbar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0 1.5rem;
  height: 64px;
  background: var(--pub-card);
  border-bottom: 1px solid var(--pub-line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--pub-line);
  background: var(--pub-surface-2);
  color: var(--pub-ink);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: color-mix(in srgb, var(--pub-accent) 14%, var(--pub-surface-2));
  color: var(--pub-accent);
}

.theme-toggle-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  position: relative;
}

.theme-toggle-icon-moon {
  border-radius: 50%;
  box-shadow: inset -3px -1px 0 1px currentColor;
}

.theme-toggle-icon-sun {
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 2px transparent;
}

.theme-toggle-icon-sun::before,
.theme-toggle-icon-sun::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  opacity: 0.55;
}

.theme-toggle-icon-sun::after {
  inset: -5px;
  opacity: 0.3;
  border-style: dashed;
}

html[data-theme="dark"] .theme-toggle-icon-moon { display: none; }
html:not([data-theme="dark"]) .theme-toggle-icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle-icon-sun { display: inline-block; }
html:not([data-theme="dark"]) .theme-toggle-icon-moon { display: inline-block; }

.pub-topbar-minimal {
  justify-content: space-between;
}

.pub-topbar-minimal .pub-nav,
.pub-topbar-minimal .nav-toggle {
  display: none !important;
}

.pub-brand {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--pub-ink);
  text-decoration: none;
}

.pub-brand:hover { color: var(--pub-accent); text-decoration: none; }

.pub-topbar nav,
.pub-topbar .pub-nav {
  display: flex;
  gap: 0.25rem;
  flex: 1;
}

.pub-topbar nav a,
.pub-topbar .pub-nav a {
  color: var(--pub-muted);
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
}

.pub-topbar nav a.is-active,
.pub-topbar nav a:hover,
.pub-topbar .pub-nav a.is-active,
.pub-topbar .pub-nav a:hover {
  background: #eff6ff;
  color: var(--pub-accent);
  text-decoration: none;
}

.nav-toggle {
  display: none !important;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  border: 1px solid var(--pub-line);
  background: var(--pub-card);
  border-radius: 6px;
  padding: 0.4rem 0.65rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--pub-ink);
  cursor: pointer;
}

.nav-toggle-bars {
  width: 16px;
  height: 12px;
  display: inline-block;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 5px / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 10px / 100% 2px no-repeat;
}

.pub-actions {
  display: flex;
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.95rem;
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--pub-accent);
  color: #fff;
}
.btn-primary:hover { background: var(--pub-accent-hover); color: #fff; }

.btn-secondary {
  background: var(--pub-card);
  border-color: var(--pub-line);
  color: var(--pub-ink);
}
.btn-secondary:hover { background: var(--pub-surface-2); color: var(--pub-ink); }

.hero {
  padding: 4rem 1.5rem 3rem;
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 400;
  line-height: 1.1;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.hero p {
  color: var(--pub-muted);
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto 1.75rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-hero {
  padding: 1.05rem 2.4rem;
  font-size: 1.2rem;
  border-radius: 10px;
  min-width: min(100%, 280px);
  box-shadow: 0 10px 28px rgba(29, 78, 216, 0.28);
  letter-spacing: -0.01em;
}

.btn-hero:hover {
  box-shadow: 0 12px 32px rgba(29, 78, 216, 0.34);
  transform: translateY(-1px);
}

.invoice-demo {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem 2.4rem;
  display: flex;
  justify-content: center;
}

.invoice-demo-sheet {
  background: #fff;
  border: 1px solid var(--pub-line);
  border-radius: 10px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.22), 0 2px 8px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  width: min(620px, 100%);
}

.invoice-demo-sheet img {
  display: block;
  width: 100%;
  height: auto;
}

.features {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex !important; }

  .pub-topbar {
    flex-wrap: wrap;
    height: auto;
    min-height: 56px;
    padding: 0.7rem 1rem;
    gap: 0.65rem;
  }

  .pub-topbar .pub-nav,
  .pub-topbar nav {
    display: none;
    flex: 1 1 100%;
    flex-direction: column;
    gap: 0.2rem;
    order: 3;
  }

  .pub-topbar.is-nav-open .pub-nav,
  .pub-topbar.is-nav-open nav {
    display: flex;
  }

  .pub-actions {
    display: none;
    flex: 1 1 100%;
    order: 4;
    gap: 0.5rem;
  }

  .pub-topbar.is-nav-open .pub-actions {
    display: flex;
  }

  /* Landing/minimal header: keep auth CTAs visible (no hamburger). */
  .pub-topbar-minimal .pub-actions {
    display: flex;
    flex: 0 0 auto;
    order: 2;
    margin-left: auto;
  }

  .pub-topbar-minimal .pub-actions .btn {
    flex: 0 0 auto;
  }

  .pub-actions .btn {
    flex: 1;
  }

  .features { grid-template-columns: 1fr; }

  .hero {
    padding: 2.4rem 1rem 1.75rem;
  }

  .hero h1 {
    font-size: clamp(2rem, 9vw, 2.7rem);
  }

  .hero p {
    font-size: 1rem;
    margin-bottom: 1.25rem;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .invoice-demo {
    padding: 0 1rem 1.75rem;
  }

  .features {
    padding: 0 1rem 2.25rem;
  }

  .content-page {
    padding: 1.75rem 1rem 2.25rem;
  }

  .content-page h1 {
    font-size: 1.8rem;
  }

  .pub-footer {
    padding: 1.5rem 1rem 1.25rem;
  }

  .pub-footer-inner {
    flex-direction: column;
    gap: 1.25rem;
  }

  .pub-footer-links {
    gap: 0.75rem 1rem;
  }
}

@media (min-width: 861px) {
  .nav-toggle {
    display: none !important;
  }

  .pub-topbar .pub-nav,
  .pub-topbar nav {
    display: flex !important;
  }

  .pub-actions {
    display: flex !important;
  }
}

@media (max-width: 480px) {
  .pub-brand {
    font-size: 1.2rem;
  }

  .nav-toggle-label {
    display: none;
  }
}

.feature-card {
  background: var(--pub-card);
  border: 1px solid var(--pub-line);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.feature-card p {
  margin: 0;
  color: var(--pub-muted);
  font-size: 0.92rem;
}

.content-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

.content-page h1 {
  font-family: var(--display);
  font-size: 2.2rem;
  font-weight: 400;
  margin: 0 0 0.5rem;
}

.content-page .lead {
  color: var(--pub-muted);
  margin: 0 0 2rem;
}

.content-page h2 {
  font-size: 1.1rem;
  margin: 1.75rem 0 0.5rem;
}

.content-page h3 {
  font-size: 1rem;
  margin: 1.25rem 0 0.4rem;
}

.content-page p,
.content-page li {
  color: var(--pub-ink);
}

.content-page ul,
.content-page ol {
  padding-left: 1.25rem;
}

.content-page blockquote {
  margin: 0.9rem 0;
  padding: 0.7rem 0.9rem;
  border-left: 3px solid var(--pub-line);
  background: var(--pub-surface-2);
  color: var(--pub-ink);
  font-size: 0.95rem;
}

.content-page strong {
  color: var(--pub-ink);
}

.content-page .flash {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 0.92rem;
}

.content-page .flash-success {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.content-page .flash-error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.content-page .field {
  margin-bottom: 0.9rem;
}

.content-page .field label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.88rem;
}

.content-page .field .optional {
  font-weight: 500;
  color: var(--pub-muted);
}

.content-page .field input,
.content-page .field textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--pub-line);
  border-radius: 6px;
  font: inherit;
  background: #fff;
  color: var(--pub-ink);
}

.content-page .field textarea {
  resize: vertical;
  min-height: 8rem;
}

.content-page .captcha-field .captcha-input {
  display: flex;
  align-items: stretch;
  max-width: 10rem;
}

.content-page .captcha-field .captcha-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 0.7rem;
  border: 1px solid var(--pub-line);
  border-right: 0;
  border-radius: 6px 0 0 6px;
  background: #f3f4f6;
  color: var(--pub-muted);
  font-weight: 600;
}

.content-page .captcha-field .captcha-input input {
  max-width: none;
  width: 100%;
  border-radius: 0 6px 6px 0;
}

.content-page .captcha-hint {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--pub-muted);
}

.blog-empty {
  color: var(--pub-muted);
}

.blog-list {
  display: grid;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.blog-card {
  padding: 1.15rem 0 1.25rem;
  border-bottom: 1px solid var(--pub-line);
}

.blog-card:last-child {
  border-bottom: 0;
}

.blog-date {
  display: block;
  font-size: 0.82rem;
  color: var(--pub-muted);
  margin-bottom: 0.35rem;
}

.blog-card-title {
  margin: 0 0 0.45rem;
  font-size: 1.25rem;
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.blog-card-title a {
  color: inherit;
  text-decoration: none;
}

.blog-card-title a:hover {
  text-decoration: underline;
}

.blog-excerpt {
  margin: 0 0 0.65rem;
  color: #374151;
}

.blog-read {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--pub-ink);
}

.blog-back {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
}

.blog-back a {
  color: var(--pub-muted);
  text-decoration: none;
}

.blog-back a:hover {
  color: var(--pub-ink);
  text-decoration: underline;
}

.blog-post .blog-date {
  margin-bottom: 0.55rem;
}

.blog-body {
  margin-top: 0.5rem;
}

.blog-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.blog-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.92rem;
}

.blog-body th,
.blog-body td {
  border: 1px solid var(--pub-line);
  padding: 0.45rem 0.55rem;
  text-align: left;
}

.blog-body pre,
.blog-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
}

.blog-body pre {
  overflow-x: auto;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border: 1px solid var(--pub-line);
  border-radius: 8px;
}

.pub-footer {
  border-top: 1px solid var(--pub-line);
  background: var(--pub-card);
  margin-top: 2rem;
  padding: 2rem 1.5rem 1.5rem;
}

.pub-footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.pub-footer p {
  margin: 0.35rem 0 0;
  color: var(--pub-muted);
  font-size: 0.9rem;
}

.pub-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: start;
}

.pub-footer-links a {
  font-size: 0.9rem;
  color: var(--pub-muted);
}

.pub-copy {
  max-width: 960px;
  margin: 1.5rem auto 0;
  text-align: center;
  color: var(--pub-muted);
  font-size: 0.82rem;
}

/* Quick create invoice */
.create-invoice {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.create-invoice-intro h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 400;
  letter-spacing: -0.02em;
}

.create-invoice-intro p {
  margin: 0.45rem 0 1.1rem;
  color: var(--pub-muted);
  max-width: 40rem;
}

.create-invoice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.create-invoice-editor .invoice-form-block {
  margin-top: 1.15rem;
}

.create-invoice-editor .invoice-form-block .section-title {
  margin-top: 0;
}

.create-invoice-editor > .section-title {
  margin-top: 1.25rem;
}

.create-invoice-actions {
  margin-top: 0.9rem;
}

.create-invoice-preview-wrap {
  position: sticky;
  top: 80px;
}

.create-preview-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 0.85rem;
  margin-bottom: 0.55rem;
}

.create-preview-modes {
  display: inline-flex;
  border: 1px solid var(--pub-line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--pub-card);
}

.create-preview-modes button {
  border: 0;
  background: transparent;
  color: var(--pub-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}

.create-preview-modes button + button {
  border-left: 1px solid var(--pub-line);
}

.create-preview-modes button.is-active {
  background: var(--pub-accent);
  color: #fff;
}

.create-invoice-preview-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pub-muted);
}

.create-invoice-preview-scaler {
  width: 100%;
  aspect-ratio: 210 / 297;
  overflow: hidden;
  position: relative;
  background: #d1d5db;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

html[data-theme="dark"] .create-invoice-preview-scaler {
  background: #2a3441;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.create-invoice-preview-wrap.is-digital .create-invoice-preview-scaler {
  display: none;
}

.create-invoice-preview-wrap .invoice-page {
  position: absolute;
  top: 0;
  left: 0;
  width: 210mm;
  min-height: 297mm;
  max-width: none;
  margin: 0;
  transform: scale(var(--preview-scale, 0.5));
  transform-origin: top left;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.create-invoice-preview-wrap .invoice-page .created-by {
  display: none !important;
}

.create-digi-preview {
  display: none;
  border: 1px solid var(--pub-line);
  border-radius: 14px;
  background:
    radial-gradient(700px 280px at 8% -20%, rgba(29, 78, 216, 0.1), transparent 55%),
    var(--pub-surface-2);
  padding: 0.85rem;
  max-height: min(78vh, 920px);
  overflow: auto;
}

html[data-theme="dark"] .create-digi-preview {
  background:
    radial-gradient(700px 280px at 8% -20%, rgba(91, 141, 239, 0.12), transparent 55%),
    var(--pub-surface-2);
}

.create-invoice-preview-wrap.is-digital .create-digi-preview {
  display: grid;
  gap: 0.75rem;
}

.create-digi-card {
  background: var(--pub-card);
  border: 1px solid var(--pub-line);
  border-radius: 14px;
  padding: 1rem 1.05rem;
}

.create-digi-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.9rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--pub-line);
}

.create-digi-company {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.create-digi-id {
  text-align: right;
}

.create-digi-kicker {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pub-muted);
}

.create-digi-id strong {
  display: block;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.create-digi-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 0.9rem;
  font-size: 0.88rem;
}

.create-digi-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pub-muted);
  margin-bottom: 0.2rem;
}

.create-digi-strong {
  font-weight: 700;
}

.create-digi-muted {
  color: var(--pub-muted);
  white-space: pre-wrap;
}

.create-digi-balance {
  margin-top: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: var(--pub-surface-2);
}

.create-digi-balance strong {
  display: block;
  font-size: 1.05rem;
}

.create-digi-balance .hint {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  color: var(--pub-muted);
}

.create-digi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  margin-bottom: 0.75rem;
}

.create-digi-table th,
.create-digi-table td {
  padding: 0.4rem 0.25rem;
  border-bottom: 1px solid var(--pub-line);
  text-align: left;
}

.create-digi-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.create-digi-totals {
  display: grid;
  gap: 0.25rem;
  font-size: 0.88rem;
  margin-left: auto;
  width: min(220px, 100%);
}

.create-digi-total-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.create-digi-total-row.is-grand {
  margin-top: 0.25rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--pub-line);
  font-weight: 700;
}

.create-digi-pay-title {
  margin: 0.15rem 0 0.55rem;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.create-digi-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.create-digi-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--pub-line);
  background: var(--pub-surface-2);
  font-size: 0.75rem;
  font-weight: 600;
}

.create-digi-qr-wrap {
  display: flex;
  justify-content: center;
  margin: 0.35rem 0 0.75rem;
  padding: 0.65rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--pub-line);
}

.create-digi-qr {
  display: block;
  width: 160px;
  height: 160px;
  image-rendering: pixelated;
}

.create-digi-address {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  word-break: break-all;
  background: var(--pub-surface-2);
  border: 1px solid var(--pub-line);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
}

.create-digi-empty {
  color: var(--pub-muted);
  font-size: 0.88rem;
  margin: 0;
}

#pay_to_address.is-invalid {
  border-color: #dc2626;
}

.pay-address-hint.is-error {
  color: #dc2626;
}

html[data-theme="dark"] .pay-address-hint.is-error {
  color: #fca5a5;
}

html[data-theme="dark"] #pay_to_address.is-invalid {
  border-color: #f87171;
}

.create-invoice-stage {
  transition: filter 0.25s ease;
}

.create-invoice-stage.is-blurred {
  filter: blur(7px);
  pointer-events: none;
  user-select: none;
}

body.register-modal-open {
  overflow: hidden;
}

.register-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.register-modal[hidden] {
  display: none !important;
}

.register-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.register-modal-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1.35rem 1.35rem 1.2rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  animation: register-modal-in 0.22s ease;
}

@keyframes register-modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.register-modal-panel h2 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
}

.register-modal-panel > .hint {
  margin: 0 0 1rem;
  color: var(--pub-muted);
  font-size: 0.9rem;
}

.register-modal-panel .flash {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.register-modal-panel .flash-error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

html[data-theme="dark"] .register-modal-panel .flash-error {
  background: rgba(220, 38, 38, 0.18);
  color: #fca5a5;
  border-color: rgba(252, 165, 165, 0.35);
}

.register-modal-panel .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}

.register-modal-panel .field {
  margin-bottom: 0.85rem;
}

.register-modal-panel .field label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 600;
  font-size: 0.88rem;
}

.register-modal-panel .field .optional {
  font-weight: 500;
  color: var(--pub-muted);
}

.register-modal-panel .field input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--pub-line);
  border-radius: 8px;
  font: inherit;
  background: var(--pub-card);
  color: var(--pub-ink);
  box-sizing: border-box;
}

.register-modal-panel .field input:focus {
  outline: none;
  border-color: var(--pub-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pub-accent) 22%, transparent);
}

.register-modal-panel .captcha-field .captcha-input {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--pub-line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--pub-card);
}

.register-modal-panel .captcha-field .captcha-prefix {
  padding: 0.55rem 0.65rem;
  background: var(--pub-surface-2);
  color: var(--pub-muted);
  font-weight: 600;
  border-right: 1px solid var(--pub-line);
}

.register-modal-panel .captcha-field .captcha-input input {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.register-modal-panel .captcha-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
}

.register-modal-panel .auth-foot {
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--pub-muted);
}

.register-modal-panel.card {
  background: var(--pub-card);
  border: 1px solid var(--pub-line);
  border-radius: 14px;
}

.register-modal-close {
  position: absolute;
  top: 0.55rem;
  right: 0.65rem;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--pub-muted);
  cursor: pointer;
  padding: 0.2rem 0.45rem;
}

.register-modal-close:hover {
  color: var(--pub-ink);
}

@media (max-width: 520px) {
  .register-modal-panel .form-grid {
    grid-template-columns: 1fr;
  }
}

.create-invoice-body .flash {
  margin-bottom: 1rem;
}

@media (max-width: 980px) {
  .create-invoice-grid {
    grid-template-columns: 1fr;
  }

  .create-invoice-preview-wrap {
    position: static;
    order: -1;
  }
}

@media (max-width: 640px) {
  .create-invoice {
    padding: 1rem 0.85rem 2.5rem;
  }

  .create-invoice-body .form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .create-invoice-body .form-grid > .field:not(.full) {
    min-width: 0;
  }

  .create-digi-meta {
    grid-template-columns: 1fr;
  }
}
