/* Layout fixes shared by public and account pages. */
html, body { min-width: 0; }
main, section, nav, article, form { min-width: 0; }
img, video, canvas { max-width: 100%; }
input, select, textarea { max-width: 100%; }
pre { max-width: 100%; overflow-x: auto; }
a[href^="mailto:"] { overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.footer-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 1.5rem; }
.footer-brand, .footer-contact { grid-column: 1 / -1; min-width: 0; }
.footer-links { min-width: 0; }
.contact-card { width: 100%; min-width: 0; }
.contact-card p, .contact-card a { overflow-wrap: anywhere; }
.contact-brand img { flex: 0 0 40px; }
.contact-brand span { font-size: clamp(1.2rem, 2vw, 1.5rem); line-height: 1.2; }
.team-podium > div { min-width: 0; }
.team-role { background-color: #6366f1; color: white; }
.team-member-heading { flex-wrap: wrap; }
.team-member-heading h4 { max-width: 100%; }
.team-rank { font-size: 11px; color: #6b7280; }
.dark .team-rank { color: #9ca3af; }
.invoice-header { gap: 1rem; flex-wrap: wrap; }
.invoice-header > a { min-width: 0; }
.invoice-header #timerDisplay { flex: 0 0 auto; font-size: clamp(1.125rem, 4.5vw, 1.5rem); }
.invoice-info { overflow-wrap: anywhere; }
.invoice-price > div { gap: .75rem; }
.invoice-price > div > span:last-child { flex-shrink: 0; }
.invoice-actions { min-width: 0; }
.invoice-actions button:disabled { opacity: .6; cursor: wait; }
.terms-shell { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.terms-layout { display: grid; gap: 24px; padding-top: 32px; padding-bottom: 48px; }
.terms-sidebar, .terms-document { border: 1px solid #e5e7eb; border-radius: 20px; background: #fff; padding: 24px; min-width: 0; }
.dark .terms-sidebar, .dark .terms-document { border-color: #1f2937; background: #111827; }
.terms-sidebar a { display: block; padding: 8px 0; color: #6366f1; font-size: 14px; }
.terms-document section { scroll-margin-top: 88px; margin-bottom: 28px; }
.terms-document h2 { margin-bottom: 12px; font-size: 20px; font-weight: 700; }
.terms-document p, .terms-document li { line-height: 1.8; font-size: 15px; color: #4b5563; }
.dark .terms-document p, .dark .terms-document li { color: #d1d5db; }
.terms-document p + p { margin-top: 12px; }
.terms-document ul { padding-left: 20px; list-style: disc; }
.terms-document a { color: #6366f1; overflow-wrap: anywhere; }
@media (min-width: 768px) and (max-width: 1023px) {
  .footer-brand, .footer-contact { grid-column: auto; }
  .footer-brand { grid-column: 1; grid-row: 1; }
  .footer-contact { grid-column: 2; grid-row: 1 / span 2; }
  .footer-links { grid-column: 1; }
}
@media (min-width: 900px) {
  .invoice-page .invoice-shell { max-width: 960px; }
  .invoice-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 32px; align-items: start; }
  .invoice-instructions { grid-column: 1 / -1; }
  .invoice-info { grid-column: 1; grid-row: 2; }
  .invoice-price { grid-column: 1; grid-row: 3; }
  .invoice-actions { grid-column: 2; grid-row: 2 / span 2; position: sticky; top: 88px; }
  .terms-layout { grid-template-columns: 240px minmax(0, 1fr); align-items: start; }
  .terms-sidebar { position: sticky; top: 88px; }
}
@media (min-width: 1024px) {
  .footer-layout { grid-template-columns: minmax(0, 1.2fr) minmax(0, .65fr) minmax(0, .8fr) minmax(280px, 1.35fr); }
  .footer-brand, .footer-contact { grid-column: auto; }
}
@media (max-width: 380px) {
  .invoice-header, .invoice-content { padding-left: 16px; padding-right: 16px; }
  .contact-card { padding: 20px; }
  .terms-shell { padding-left: 16px; padding-right: 16px; }
  .terms-sidebar, .terms-document { padding: 20px; }
}
