.dashboard {
  display: grid;
  gap: clamp(20px, 2.5vw, 32px);
  max-width: var(--content-max);
  margin: 0 auto;
}

.auth-locked .dashboard {
  opacity: 0.4;
  pointer-events: none;
  filter: blur(1px);
}

.auth-locked .locked-overlay {
  display: grid;
}

.locked-overlay {
  display: none;
  position: fixed;
  inset: 0;
  place-items: center;
  z-index: 30;
  background: rgba(250, 246, 240, 0.75);
  backdrop-filter: blur(3px);
}

.locked-card {
  background: #fff;
  border-radius: 18px;
  padding: 20px 24px;
  border: 1px solid rgba(30, 27, 22, 0.12);
  box-shadow: 0 18px 40px rgba(30, 27, 22, 0.12);
  text-align: center;
  max-width: 360px;
}

.locked-card h3 {
  margin: 0 0 8px;
}

.locked-card p {
  margin: 0 0 16px;
  color: var(--muted);
}

.brand-lock {
  position: fixed;
  inset: 0;
  background: rgba(246, 241, 230, 0.85);
  backdrop-filter: blur(6px);
  display: none;
  place-items: center;
  z-index: 40;
}

.brand-lock-card {
  width: min(420px, 90vw);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
  text-align: center;
}

.brand-lock-card h3 {
  margin: 0 0 8px;
  font-family: "Spectral", serif;
  font-size: 1.4rem;
}

.brand-lock-card p {
  margin: 0 0 16px;
  color: var(--muted);
}

.brand-locked .bottom-nav {
  display: none;
}

.brand-locked .nav .nav-link {
  opacity: 0.35;
  pointer-events: none;
}

.brand-locked .nav .nav-link[href="/brand-settings.html"] {
  opacity: 1;
  pointer-events: auto;
}

.site-header {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.nav {
  flex-wrap: nowrap;
  overflow: hidden;
  gap: 12px;
  align-items: center;
  padding: 4px 0;
  min-width: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  line-height: 1;
}

.dashboard-nav {
  display: flex;
  gap: 12px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(30, 27, 22, 0.06);
  width: fit-content;
}

.nav-link {
  border: none;
  background: transparent;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}

.nav-link.active {
  background: #1e1b16;
  color: #fff;
}

.hero-strip {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: clamp(22px, 3vw, 32px);
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(31, 143, 122, 0.12), transparent 32%),
    linear-gradient(120deg, rgba(255, 241, 214, 0.98), rgba(246, 240, 228, 0.94));
  border: 1px solid rgba(30, 27, 22, 0.1);
  box-shadow: var(--shadow-soft);
}

.onboarding-top {
  margin-bottom: 20px;
}

.hero-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.status-card {
  background: rgba(255, 251, 244, 0.9);
  border-radius: 20px;
  padding: 16px 18px;
  border: 1px solid var(--card-border);
  display: grid;
  gap: 8px;
  min-width: min(220px, 100%);
}

.status-card strong {
  font-size: 1.2rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  align-items: start;
}

.panel {
  background: linear-gradient(180deg, rgba(255, 251, 244, 0.95), rgba(255, 247, 235, 0.9));
  padding: clamp(18px, 2.4vw, 24px);
  border-radius: 24px;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-soft);
  align-self: start;
}

.danger-zone {
  border: 1px solid rgba(192, 57, 43, 0.2);
  background: #fff4f1;
}

.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px dashed rgba(30, 27, 22, 0.2);
  background: rgba(255, 253, 247, 0.92);
  margin: 16px 0 0;
}

.demo-banner p {
  margin: 4px 0 0;
  color: var(--muted);
}

.demo-only {
  display: none;
}

.demo-mode .demo-only {
  display: block;
}

.demo-mode #locked-overlay {
  display: none !important;
}

.signed-in .demo-banner {
  display: none !important;
}

.signed-in .demo-only {
  display: none !important;
}

.recurring-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.recurring-fields {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  padding: 16px;
  border-radius: 18px;
  border: 1px dashed rgba(30, 27, 22, 0.15);
  background: #fffaf1;
}

.recurring-fields .full {
  grid-column: 1 / -1;
}

.recurring-fields.is-active {
  display: grid;
}

.accordion {
  border: 1px solid rgba(30, 27, 22, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  padding: 0;
  overflow: hidden;
}

.accordion + .accordion {
  margin-top: 12px;
}

.accordion summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.accordion summary::after {
  content: "+";
  font-size: 1.1rem;
  color: var(--muted);
}

.accordion[open] summary::after {
  content: "–";
}

.accordion summary::-webkit-details-marker {
  display: none;
}

.accordion-body {
  padding: 14px 16px 18px;
  border-top: 1px solid rgba(30, 27, 22, 0.06);
  display: grid;
  gap: 12px;
}

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

.panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.panel-tabs {
  display: flex;
  gap: 8px;
}

.tab {
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 6px 12px;
  background: #fff;
  font-size: 0.85rem;
  cursor: pointer;
}

.tab.active {
  background: #1e1b16;
  color: #fff;
}

.panel-subtitle {
  margin-top: 16px;
  font-size: 1rem;
  color: var(--muted);
}

.panel-divider {
  height: 1px;
  background: rgba(30, 27, 22, 0.08);
  margin: 20px 0;
}

.inline-form {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr auto;
  gap: 12px;
  margin-top: 16px;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
  margin-top: 12px;
  align-items: start;
  grid-auto-rows: min-content;
}

.create-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: clamp(18px, 2.6vw, 28px);
  align-items: start;
}

.filter-shell {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(30, 27, 22, 0.06);
}

.filter-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  gap: 12px;
  flex-wrap: wrap;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.list-header {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}

input,
select {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: #fff;
  font-size: 0.95rem;
}

textarea {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: #fff;
  font-size: 0.95rem;
  resize: vertical;
}

.field-stack {
  display: grid;
  gap: 6px;
  align-self: start;
}

.field-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  line-height: 1.2;
}

/* Keep reply email input consistent with other fields */

.reminder-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(30, 27, 22, 0.08);
  background: rgba(255, 255, 255, 0.9);
}

.custom-offset {
  border-radius: 16px;
  padding: 8px 12px;
  gap: 6px;
}

.custom-offset input {
  max-width: 160px;
}

.full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.form-actions .form-note {
  flex-basis: 100%;
}

.is-hidden {
  display: none;
}

.brand-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(30, 27, 22, 0.08);
  background: #fff;
  margin-top: 10px;
  box-shadow: 0 12px 22px rgba(30, 27, 22, 0.04);
}

.summary-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.summary-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 6px;
}

.summary-title {
  font-size: 1.2rem;
  font-weight: 600;
}

.summary-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.summary-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(30, 27, 22, 0.1);
  display: grid;
  place-items: center;
  font-weight: 700;
  overflow: hidden;
  padding: 0;
}

.deliverability-card {
  display: grid;
  gap: 16px;
  margin-top: 12px;
}

.onboarding-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.onboarding-steps {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  margin-bottom: 8px;
}

.onboarding-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(30, 27, 22, 0.08);
  background: #fff;
}

#onboarding-panel .form-note {
  margin-top: 10px;
  display: block;
}

.onboarding-step h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.onboarding-step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.step-pill {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #1e1b16;
  color: #fff8e7;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 0.85rem;
}

.onboarding-hidden {
  display: none;
}

.deliverability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.deliverability-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(30, 27, 22, 0.08);
  background: #fff;
}

.status-pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(30, 27, 22, 0.1);
  background: #f7f4ee;
  color: #6b5a4d;
}

.status-pill.ok {
  background: #e6f6ea;
  border-color: rgba(34, 197, 94, 0.35);
  color: #1f7a3b;
}

.status-pill.warn {
  background: #fff2cc;
  border-color: rgba(242, 201, 76, 0.6);
  color: #7a4b00;
}

.status-pill.bad {
  background: #ffe6e0;
  border-color: rgba(228, 87, 46, 0.4);
  color: #c0392b;
}

@media (max-width: 780px) {
  .brand-summary {
    grid-template-columns: 1fr;
    justify-items: start;
  }
}
.upload-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.upload-row input[type="file"] {
  flex: 1;
}

.or-divider {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin: 6px 0;
}

.logo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 16px;
  margin-top: 4px;
  align-items: stretch;
}

.logo-card {
  background: #fff;
  border: 1px solid rgba(30, 27, 22, 0.08);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 10px;
  box-shadow: 0 8px 18px rgba(30, 27, 22, 0.04);
}

.logo-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.logo-hint {
  color: var(--muted);
  font-size: 0.8rem;
}

.logo-or {
  align-self: center;
  justify-self: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px dashed rgba(30, 27, 22, 0.2);
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  background: rgba(30, 27, 22, 0.04);
}

.file-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(30, 27, 22, 0.2);
  background: #fffaf1;
  color: #3b2f2a;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

.file-pill input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-name {
  font-size: 0.85rem;
  color: var(--muted);
  min-width: 120px;
}

.logo-disabled {
  padding: 16px;
  border-radius: 14px;
  border: 1px dashed rgba(30, 27, 22, 0.2);
  background: rgba(30, 27, 22, 0.04);
  color: var(--muted);
  font-size: 0.9rem;
}

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

  .logo-or {
    justify-self: center;
  }
}

.preview-card {
  background: linear-gradient(180deg, rgba(255, 250, 241, 0.96), rgba(255, 244, 224, 0.9));
  border-radius: 24px;
  padding: 20px;
  border: 1px solid rgba(30, 27, 22, 0.08);
  display: grid;
  gap: 16px;
  position: sticky;
  top: 28px;
  box-shadow: var(--shadow-soft);
}

.preview-toggle summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-toggle summary::after {
  content: "▾";
  font-size: 0.9rem;
  color: var(--muted);
}

.preview-toggle[open] summary::after {
  content: "▴";
}

.preview-stack {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.email-preview {
  background: rgba(255, 255, 255, 0.88);
  border-radius: 16px;
  border: 1px solid rgba(30, 27, 22, 0.08);
  padding: 16px;
  font-size: 0.9rem;
}

.email-subject {
  font-weight: 600;
  margin-bottom: 10px;
}

.email-body {
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.pdf-preview {
  background: rgba(255, 255, 255, 0.88);
  border-radius: 16px;
  border: 1px solid rgba(30, 27, 22, 0.08);
  padding: 18px;
  font-size: 0.9rem;
  display: grid;
  gap: 12px;
}

@media (max-width: 640px) {
  .pdf-preview {
    overflow-x: auto;
  }
}

.pdf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pdf-brand {
  font-weight: 700;
  letter-spacing: 0.08em;
}

.pdf-muted {
  color: var(--muted);
  font-size: 0.8rem;
}

.pdf-section {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.pdf-line {
  height: 1px;
  background: rgba(30, 27, 22, 0.1);
}

.pdf-row {
  display: flex;
  justify-content: space-between;
}

.pdf-row.total {
  font-weight: 700;
}

.pdf-footer {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(30, 27, 22, 0.04);
  color: var(--muted);
  font-size: 0.85rem;
}

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

  .preview-card {
    position: static;
  }
}

@media (max-width: 640px) {
  .grid-form {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .panel {
    padding: 18px;
  }

  .preview-card {
    padding: 16px;
  }
}

.list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.line-items {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  width: 100%;
}

.line-item-card {
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(30, 27, 22, 0.08);
  background: rgba(255, 255, 255, 0.9);
  display: grid;
  gap: 10px;
}

.line-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

.line-row.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
}

.line-field {
  display: grid;
  gap: 6px;
}

.line-field label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.line-field input {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: #fff;
  font-size: 0.9rem;
  width: 100%;
}

.line-field.total {
  text-align: right;
}

.line-total {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(30, 27, 22, 0.04);
  border: 1px dashed rgba(30, 27, 22, 0.1);
}

.line-row.compact .ghost.small.danger {
  align-self: end;
  justify-self: end;
}

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

  .line-row.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .line-row.compact {
    grid-template-columns: 1fr;
  }

  .line-totals {
    grid-template-columns: 1fr;
  }
}

.line-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: #fffaf1;
  border: 1px solid rgba(30, 27, 22, 0.08);
}

.line-totals span {
  color: var(--muted);
  font-size: 0.85rem;
}

.line-totals strong {
  font-size: 1rem;
}

.pdf-items {
  display: grid;
  gap: 8px;
}

@media (max-width: 640px) {
  .pdf-items {
    min-width: 520px;
  }
}

.pdf-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.4fr) minmax(0, 0.7fr) minmax(0, 0.6fr) minmax(0, 0.8fr);
  gap: 6px;
  font-size: 0.8rem;
  align-items: center;
}

.pdf-item-row span:nth-child(1) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-item-row span:nth-child(2),
.pdf-item-row span:nth-child(3),
.pdf-item-row span:nth-child(4),
.pdf-item-row span:nth-child(5) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pdf-item-row.header {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.65rem;
  color: var(--muted);
  line-height: 1.2;
}

.skeleton-item {
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(30, 27, 22, 0.08);
  display: grid;
  gap: 10px;
}

.skeleton-line {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(30, 27, 22, 0.06) 25%,
    rgba(30, 27, 22, 0.12) 50%,
    rgba(30, 27, 22, 0.06) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
}

.skeleton-line.short {
  width: 40%;
}

.skeleton-line.medium {
  width: 60%;
}

.skeleton-line.long {
  width: 80%;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.list-item {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(30, 27, 22, 0.08);
  gap: 12px;
  box-shadow: 0 8px 18px rgba(30, 27, 22, 0.04);
}

.invoice-client {
  font-weight: 600;
  font-size: 1rem;
}

.invoice-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.badge {
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff5e0;
  border: 1px solid rgba(30, 27, 22, 0.12);
  font-weight: 600;
}

.invoice-tags {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
}

.badge.amount {
  background: #fffaf1;
}

.badge.overdue {
  background: #ffe6e0;
  border-color: rgba(228, 87, 46, 0.4);
  color: #c0392b;
}

.badge.due {
  background: #fff2cc;
  border-color: rgba(242, 201, 76, 0.6);
  color: #7a4b00;
}

.badge.soon {
  background: #fff2cc;
  border-color: rgba(242, 201, 76, 0.6);
  color: #7a4b00;
}

.badge.scheduled {
  background: #eef2ff;
  border-color: rgba(59, 130, 246, 0.3);
  color: #2f5bb7;
}

.badge.paid {
  background: #e6f6ea;
  border-color: rgba(34, 197, 94, 0.55);
  color: #1f7a3b;
}

.ghost.small {
  padding: 6px 10px;
  font-size: 0.8rem;
}

.cta.small {
  padding: 6px 12px;
  font-size: 0.8rem;
  box-shadow: none;
}

.client-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ghost.small.danger {
  border-color: rgba(192, 57, 43, 0.35);
  color: #c0392b;
}

.auth-divider {
  margin: 16px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.auth-google {
  width: 100%;
  justify-content: center;
  gap: 8px;
}

.trial-banner {
  background: #fff2cc;
  border: 1px solid rgba(242, 201, 76, 0.6);
  color: #5c3a00;
  padding: 13px 16px;
  border-radius: 16px;
  font-weight: 600;
  margin: 16px 0 0;
  min-height: 44px;
}

.usage-banner {
  background: #eef2ff;
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #1f2f65;
  padding: 13px 16px;
  border-radius: 16px;
  font-weight: 600;
  margin: 12px 0 0;
  min-height: 44px;
}

body.app .trial-banner,
body.app .usage-banner {
  margin-left: 292px;
  width: calc(100% - 292px - clamp(20px, 3vw, 44px) * 2);
  max-width: calc(var(--content-max) + 16px);
  margin-right: auto;
}

body.app.sidebar-collapsed .trial-banner,
body.app.sidebar-collapsed .usage-banner {
  margin-left: 128px;
  width: calc(100% - 128px - clamp(20px, 3vw, 44px) * 2);
}

.banner-loading {
  opacity: 0.6;
}

.status-card strong {
  min-height: 1.3em;
  display: inline-block;
}

.status-card.loading strong {
  color: transparent;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(30, 27, 22, 0.08) 25%,
    rgba(30, 27, 22, 0.16) 50%,
    rgba(30, 27, 22, 0.08) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  width: 60px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 12, 8, 0.4);
  display: grid;
  place-items: center;
  z-index: 50;
}

.modal[hidden] {
  display: none;
}

.modal-card {
  background: #fffaf1;
  border-radius: 24px;
  padding: 24px;
  width: min(420px, 92vw);
  box-shadow: 0 24px 60px rgba(30, 27, 22, 0.3);
  border: 1px solid rgba(30, 27, 22, 0.1);
  display: grid;
  gap: 12px;
}

.modal-close {
  justify-self: end;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
}

.crop-modal-card {
  width: min(720px, 94vw);
  max-height: 88vh;
  overflow: auto;
  gap: 16px;
}

.modal-title {
  margin: 0;
  font-size: 1.2rem;
}

.modal-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
}

.crop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.crop-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 220px);
  gap: 18px;
  align-items: start;
}

.crop-panel {
  display: grid;
  gap: 16px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(30, 27, 22, 0.08);
  background: #fff;
}

.crop-group {
  display: grid;
  gap: 8px;
}

.crop-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.crop-toggle {
  display: flex;
  gap: 8px;
}

.crop-toggle .chip-btn.active {
  background: #fff5e0;
  border-color: rgba(228, 87, 46, 0.35);
}

.crop-help {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.chip-btn {
  border-radius: 999px;
  border: 1px solid rgba(30, 27, 22, 0.12);
  background: #fff;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.85rem;
}

.chip-btn.active {
  background: #fff5e0;
  border-color: rgba(228, 87, 46, 0.35);
}

.crop-frame {
  width: min(560px, 100%);
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  max-height: 48vh;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(30, 27, 22, 0.1);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.crop-frame img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  transform-origin: center;
  cursor: grab;
  user-select: none;
}

.crop-frame img:active {
  cursor: grabbing;
}

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

.crop-mask {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at center,
    rgba(0, 0, 0, 0) 52%,
    rgba(0, 0, 0, 0.2) 53%
  );
  pointer-events: none;
}

.crop-safe {
  position: absolute;
  width: 76%;
  height: 76%;
  border-radius: 50%;
  border: 2px dashed rgba(228, 87, 46, 0.35);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  pointer-events: none;
}

@media (max-width: 880px) {
  .crop-body {
    grid-template-columns: 1fr;
  }

  .crop-frame {
    max-height: 44vh;
  }
}

@media (max-width: 980px) {
  .hero-strip {
    flex-direction: column;
    align-items: flex-start;
  }

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

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

@media (max-width: 1100px) {
  body.app .trial-banner,
  body.app .usage-banner,
  body.app.sidebar-collapsed .trial-banner,
  body.app.sidebar-collapsed .usage-banner {
    margin-left: 0;
    width: auto;
    max-width: var(--content-max);
    margin-right: 0;
  }
}

@media (max-width: 720px) {
  .inline-form {
    grid-template-columns: 1fr;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .panel-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .dashboard-nav {
    width: 100%;
    flex-wrap: wrap;
  }

  .list-header {
    display: none;
  }

  .list-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .invoice-tags {
    width: 100%;
    justify-content: flex-start;
  }

  .client-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .filter-title select,
  .filter-title input,
  .filter-title button,
  .filter-title .ghost,
  .filter-title .cta {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .hero-strip {
    border-radius: 24px;
  }

  .panel {
    border-radius: 20px;
  }

  .status-card {
    width: 100%;
  }

  .filter-shell {
    padding: 12px;
  }

  .form-actions > .cta,
  .form-actions > .ghost {
    width: 100%;
    justify-content: center;
  }
}
