/* ==========================================================================
   Fonts - IBM Plex Sans Arabic, self-hosted (400/500/600/700, Arabic+Latin)
   ========================================================================== */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-400-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFC, U+200C-200E;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-500-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFC, U+200C-200E;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-600-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFC, U+200C-200E;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-700-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFC, U+200C-200E;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F;
}

/* ==========================================================================
   Design tokens - from the palette in requirements.md
   ========================================================================== */
:root {
  --color-primary-900: #074D31;
  --color-primary-800: #106440;
  --color-primary-700: #1B8354;
  --color-primary-500: #54C08A;
  --color-primary-300: #79D6A5;
  --color-primary-200: #A8E4C5;
  --color-primary-100: #D3F1E1;
  --color-primary-50:  #EAF8F1;

  --color-accent-gold: #A67A2C;
  --color-bg-warm: #FBF9F4;
  --color-border-warm: #EDEEE6;

  --color-bg-page: #F9FAFB;
  --color-bg-surface: #FFFFFF;
  --color-border: #E9ECEF;
  --color-border-strong: #D5D9DD;

  --color-text-primary: #1F2937;
  --color-text-secondary: #4B5563;
  --color-text-muted: #6B7280;
  --color-text-faint: #8B949E;

  --color-danger: #B3261E;
  --color-danger-bg: #FCEEEE;
  --color-warning: #A67A2C;
  --color-warning-bg: #FBF3E4;
  --color-success: var(--color-primary-700);
  --color-success-bg: var(--color-primary-50);

  --font-family-base: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, Arial, sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(7, 77, 49, 0.06);
  --shadow-md: 0 8px 24px rgba(7, 77, 49, 0.08);
  --shadow-lg: 0 16px 40px rgba(7, 77, 49, 0.12);

  --transition-fast: 120ms ease;
}

/* ==========================================================================
   Base
   ========================================================================== */
* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  font-family: var(--font-family-base);
  font-size: 17px;
  line-height: 1.75;
  color: var(--color-text-primary);
  background-color: var(--color-bg-page);
}

/* ==========================================================================
   Background decoration - subtle, data-inspired edge treatment. Fixed to
   the viewport edges, z-index:-1 so it always sits above the plain page
   background but behind every real element (navbar/footer's own opaque
   backgrounds cover it there; the card's opaque background covers it in
   the center) - it can only ever show through empty page margins.
   ========================================================================== */
.bg-decor {
  position: fixed;
  top: 0;
  bottom: 0;
  width: clamp(90px, 9vw, 200px);
  z-index: -1;
  color: var(--color-primary-800);
  pointer-events: none;
  overflow: hidden;
}
.bg-decor svg {
  display: block;
  width: 100%;
  height: 100%;
}
/* Physical left/right (not logical inset-inline) - these are fixed edge
   decorations tied to actual viewport sides, independent of text direction. */
.bg-decor--right { right: 0; }
.bg-decor--left { left: 0; }

@media (max-width: 991.98px) {
  .bg-decor { width: clamp(60px, 7vw, 130px); }
}

@media (max-width: 575.98px) {
  .bg-decor { display: none; }
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--color-primary-900);
  line-height: 1.4;
}

a {
  color: var(--color-primary-700);
  text-decoration: none;
}
a:hover { color: var(--color-primary-800); text-decoration: underline; }

label, .form-label {
  font-weight: 500;
  font-size: 1rem;
  color: var(--color-text-primary);
}

.text-muted { color: var(--color-text-muted) !important; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.5rem;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
}

.btn-primary {
  background-color: var(--color-primary-700);
  border-color: var(--color-primary-700);
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--color-primary-800);
  border-color: var(--color-primary-800);
}
.btn-primary:disabled {
  background-color: var(--color-primary-300);
  border-color: var(--color-primary-300);
}

.btn-outline-primary {
  color: var(--color-primary-700);
  border-color: var(--color-primary-700);
}
.btn-outline-primary:hover {
  background-color: var(--color-primary-700);
  border-color: var(--color-primary-700);
}

.btn-danger { background-color: var(--color-danger); border-color: var(--color-danger); }

.btn.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
.btn-outline-primary.is-loading::after,
.btn-outline-secondary.is-loading::after {
  border: 2px solid rgba(27, 131, 84, 0.35);
  border-top-color: var(--color-primary-700);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form-control {
  font-size: 1.05rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border-color: var(--color-border-strong);
}
.form-control:focus {
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 0.2rem rgba(84, 192, 138, 0.25);
}
.form-control.input-lg {
  font-size: 1.25rem;
  padding: 1rem 1.25rem;
}

.text-danger, .field-validation-error {
  color: var(--color-danger) !important;
  font-size: 0.95rem;
}
.input-validation-error {
  border-color: var(--color-danger) !important;
}

/* ==========================================================================
   Cards / surfaces
   ========================================================================== */
.card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.stat-card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-label {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}
.stat-card .stat-value {
  color: var(--color-primary-900);
  font-size: 2.25rem;
  font-weight: 700;
}

/* ==========================================================================
   Total-links counter (public page) - a confident, official-looking stat
   plaque rather than a light pill, positioned at the left of the hero area.
   Light mint tint (same tokens as .alert-success elsewhere in this file) -
   not the saturated dark plaque this replaced.
   ========================================================================== */
.total-links-badge {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, var(--color-primary-50) 0%, var(--color-primary-100) 100%);
  border: 1px solid var(--color-primary-200);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.75rem;
  box-shadow: var(--shadow-sm);
  max-width: 100%;
}
.total-links-icon {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--color-primary-700);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.total-links-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  text-align: start;
}
.total-links-value {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--color-primary-900);
  font-variant-numeric: tabular-nums;
}
.total-links-label {
  font-size: 0.95rem;
  color: var(--color-primary-700);
  font-weight: 600;
}

@media (max-width: 576px) {
  .total-links-badge {
    padding: 0.7rem 1.25rem;
    gap: 0.75rem;
  }
  .total-links-icon {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.05rem;
  }
  .total-links-value {
    font-size: 1.6rem;
  }
  .total-links-label {
    font-size: 0.85rem;
  }
}

/* ==========================================================================
   Character-count indicator (original + short URL fields)
   ========================================================================== */
.char-count {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--color-primary-50);
  color: var(--color-primary-800);
  font-size: 0.85rem;
  font-weight: 600;
}
.char-count__label {
  color: var(--color-text-muted);
  font-weight: 500;
}
.char-count__value {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Link details modal - consolidated link info + stats (no separate page).
   Larger, high-contrast type throughout for readability at a glance.
   ========================================================================== */
/* Wider than Bootstrap's default modal-xl breakpoint gap (992-1199px still
   fell back to modal-lg's 800px) - this is meant to feel like a small
   dashboard panel, not a narrow dialog. */
@media (min-width: 992px) {
  #link-details-modal .modal-dialog {
    max-width: 960px;
  }
}
@media (min-width: 1200px) {
  #link-details-modal .modal-dialog {
    max-width: 1100px;
  }
}
#link-details-modal .modal-dialog.modal-dialog-scrollable .modal-content {
  max-height: 88vh;
}

.link-details-modal .modal-header,
.link-details-modal .modal-body,
.link-details-modal .modal-footer {
  padding: 1.5rem 1.75rem;
}
.link-details-modal .modal-title {
  font-size: 1.35rem;
  font-weight: 700;
}
.link-details-row {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--color-border);
}
.link-details-row:last-of-type {
  border-bottom: none;
}
.link-details-row--split {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.link-details-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.link-details-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}
.link-details-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-primary-900);
  word-break: break-all;
  line-height: 1.4;
  flex-grow: 1;
}
.ld-status-badge {
  font-size: 1rem;
  padding: 0.4rem 0.9rem;
  font-weight: 700;
}
.link-details-modal .stat-label {
  font-size: 1rem;
}
.link-details-modal .stat-value {
  font-size: 2.1rem;
}
.link-details-modal h6 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
}
.link-details-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 1.05rem;
}
.link-details-list-item:last-child {
  border-bottom: none;
}
.link-details-list-item .link-details-list-count {
  font-weight: 700;
  color: var(--color-primary-900);
  font-variant-numeric: tabular-nums;
}
.link-details-day-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.link-details-day-label {
  width: 7rem;
  flex-shrink: 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}
.link-details-day-track {
  flex-grow: 1;
  height: 0.9rem;
  border-radius: 999px;
  background: var(--color-bg-surface-alt, var(--color-border));
}
.link-details-day-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--color-primary-500);
  /* Width set via one of the .link-details-day-fill--N classes below (N is the
     nearest multiple of 10), not inline style="" - the CSP here has no
     style-src 'unsafe-inline', so JS never sets element.style directly. */
  width: 0%;
}
.link-details-day-fill--10  { width: 10%; }
.link-details-day-fill--20  { width: 20%; }
.link-details-day-fill--30  { width: 30%; }
.link-details-day-fill--40  { width: 40%; }
.link-details-day-fill--50  { width: 50%; }
.link-details-day-fill--60  { width: 60%; }
.link-details-day-fill--70  { width: 70%; }
.link-details-day-fill--80  { width: 80%; }
.link-details-day-fill--90  { width: 90%; }
.link-details-day-fill--100 { width: 100%; }
.link-details-day-count {
  width: 2.5rem;
  text-align: end;
  font-weight: 700;
  font-size: 1.05rem;
}

/* ==========================================================================
   Alerts
   ========================================================================== */
.alert {
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 1rem;
}
.alert-success { background-color: var(--color-success-bg); color: var(--color-primary-900); border-color: var(--color-primary-200); }
.alert-danger  { background-color: var(--color-danger-bg); color: var(--color-danger); border-color: #F3D3D1; }
.alert-warning { background-color: var(--color-warning-bg); color: var(--color-accent-gold); border-color: var(--color-border-warm); }

/* ==========================================================================
   Navbar - official/institutional style: light neutral background, dark
   neutral text, and a green filled-pill active state.
   ========================================================================== */
.site-navbar {
  background-color: var(--color-bg-page);
  border-bottom: 2px solid var(--color-primary-700);
}
.site-navbar__inner {
  display: flex;
  align-items: center;
  padding-block: 0.9rem;
  flex-wrap: wrap;
}

.site-navbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--color-primary-900);
}
.site-navbar__brand:hover { color: var(--color-primary-900); text-decoration: none; }
.site-navbar__logo {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--color-primary-50);
  color: var(--color-primary-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

.site-navbar__toggler {
  display: none;
  margin-inline-start: auto;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-primary-800);
  font-size: 1.25rem;
  padding: 0.4rem 0.75rem;
}

.site-navbar__collapse {
  align-items: center;
  margin-inline-start: 2.5rem;
}

.site-navbar__nav {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
}

.site-navbar__nav-link {
  display: inline-block;
  color: var(--color-text-primary);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.55rem 1.4rem;
  border-radius: 999px;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.site-navbar__nav-link:hover {
  background-color: var(--color-primary-50);
  color: var(--color-primary-800);
  text-decoration: none;
}
.site-navbar__nav-link.active {
  background-color: var(--color-primary-700);
  color: #fff;
}
.site-navbar__nav-link.active:hover {
  background-color: var(--color-primary-800);
  color: #fff;
}

.site-navbar__utility {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.site-navbar__lang {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--color-border-strong);
  color: var(--color-text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--color-bg-surface);
}
.site-navbar__lang i { color: var(--color-primary-700); }

@media (min-width: 992px) {
  .site-navbar__collapse {
    display: flex !important;
    flex: 1;
    justify-content: space-between;
  }
}

@media (max-width: 991.98px) {
  .site-navbar__toggler { display: inline-flex; align-items: center; }
  .site-navbar__collapse {
    flex-basis: 100%;
    margin-inline-start: 0;
  }
  .site-navbar__collapse.show {
    margin-top: 1rem;
  }
  .site-navbar__nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    margin-bottom: 1rem;
  }
  .site-navbar__nav-link { text-align: center; }
  .site-navbar__utility { justify-content: center; }
}

/* ==========================================================================
   Footer - deep institutional-green gradient carrying a data-visualization
   motif (connected nodes, network edges, a small ascending bar-chart
   cluster) confined to the top-right and bottom-left corners via ::before/
   ::after, plus a faint full-area dot-grid for texture. Corner graphics sit
   at z-index:-1 so they never compete with real content. Capped with a fine
   gold accent line. Text/link colors are inverted to light tones for
   contrast - structure and content are unchanged.
   ========================================================================== */
.site-footer {
  position: relative;
  z-index: 0; /* forces a real stacking context so the -1 corner graphics
                 below render behind this element's own content instead of
                 escaping to the page's ancestor stacking context */
  overflow: hidden;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Ccircle cx='2' cy='2' r='1.3' fill='%23ffffff' fill-opacity='0.05'/%3E%3C/svg%3E"),
    linear-gradient(135deg, var(--color-primary-900) 0%, var(--color-primary-800) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  padding-bottom: 1.5rem;
}
.site-footer::before,
.site-footer::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 150px;
  height: 106px;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='170' viewBox='0 0 240 170'%3E%3Cg stroke='%23ffffff' stroke-opacity='0.14' stroke-width='1' fill='none'%3E%3Cline x1='24' y1='34' x2='78' y2='60'/%3E%3Cline x1='78' y1='60' x2='128' y2='28'/%3E%3Cline x1='78' y1='60' x2='66' y2='108'/%3E%3Cline x1='66' y1='108' x2='118' y2='128'/%3E%3Cline x1='128' y1='28' x2='176' y2='50'/%3E%3Cline x1='176' y1='50' x2='210' y2='24'/%3E%3Cline x1='66' y1='108' x2='24' y2='134'/%3E%3C/g%3E%3Cg fill='%23ffffff' fill-opacity='0.22'%3E%3Ccircle cx='24' cy='34' r='3'/%3E%3Ccircle cx='128' cy='28' r='3'/%3E%3Ccircle cx='118' cy='128' r='3'/%3E%3Ccircle cx='176' cy='50' r='3'/%3E%3Ccircle cx='24' cy='134' r='2.5'/%3E%3C/g%3E%3Cg fill='%23A67A2C' fill-opacity='0.5'%3E%3Ccircle cx='78' cy='60' r='4.5'/%3E%3Ccircle cx='66' cy='108' r='4'/%3E%3Ccircle cx='210' cy='24' r='3'/%3E%3C/g%3E%3Cg fill='%23ffffff' fill-opacity='0.10'%3E%3Crect x='168' y='95' width='7' height='22'/%3E%3Crect x='179' y='83' width='7' height='34'/%3E%3Crect x='190' y='70' width='7' height='47'/%3E%3Crect x='201' y='88' width='7' height='29'/%3E%3C/g%3E%3C/svg%3E");
}
.site-footer::before {
  top: 0;
  inset-inline-end: 0;
}
.site-footer::after {
  bottom: 0;
  inset-inline-start: 0;
  transform: rotate(180deg);
}
.site-footer__accent {
  height: 1px;
  background-color: var(--color-accent-gold);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 2.5rem;
  padding-block: 3rem 2rem;
}
.site-footer__brand,
.site-footer__brand:hover {
  margin-bottom: 0.9rem;
  color: #ffffff;
}
.site-footer__desc {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.92rem;
  line-height: 1.8;
  margin: 0;
  max-width: 32rem;
}
.site-footer__heading {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}
.site-footer__links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.site-footer__links a {
  color: rgba(255, 255, 255, 0.82);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.site-footer__links a:hover { color: var(--color-accent-gold); text-decoration: none; }
.site-footer__links li { display: flex; align-items: center; gap: 0.55rem; }
.site-footer__links i { color: var(--color-primary-300); width: 1.1em; text-align: center; }

.site-footer__divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  margin: 0 0 1.25rem;
}
.site-footer__bottom { text-align: center; }
.site-footer__copyright {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.88rem;
}

@media (max-width: 767.98px) {
  .site-footer__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  .site-footer__links { align-items: center; }
  .site-footer__links li { justify-content: center; }
  .site-footer__desc { max-width: none; }
}

.page-shell {
  min-height: calc(100% - 140px);
}

/* ==========================================================================
   Primary "shorten URL" call-to-action - large rounded pill, the single
   most prominent action on the public page.
   ========================================================================== */
.btn-shorten {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border-radius: 999px;
  padding: 1.1rem 2.5rem;
  font-size: 1.3rem;
  font-weight: 700;
  background-color: var(--color-primary-700);
  border-color: var(--color-primary-700);
  color: #fff;
}
.btn-shorten i { font-size: 0.8em; }
.btn-shorten:hover,
.btn-shorten:focus {
  background-color: var(--color-primary-800);
  border-color: var(--color-primary-800);
  color: #fff;
}
.btn-shorten:disabled {
  background-color: var(--color-primary-300);
  border-color: var(--color-primary-300);
}

@media (max-width: 576px) {
  .btn-shorten {
    padding: 0.95rem 1.75rem;
    font-size: 1.1rem;
  }
}

/* ==========================================================================
   Global loader overlay
   ========================================================================== */
#global-loader {
  position: fixed;
  inset: 0;
  background: rgba(249, 250, 251, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 100ms ease;
}
#global-loader.is-visible {
  opacity: 1;
  visibility: visible;
}
#global-loader .loader-spinner {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 4px solid var(--color-primary-200);
  border-top-color: var(--color-primary-700);
  animation: spin 0.8s linear infinite;
}

/* ==========================================================================
   Toasts
   ========================================================================== */
.toast-container {
  z-index: 2100;
  top: 1rem !important;
}

.app-toast {
  min-width: 320px;
  max-width: min(90vw, 420px);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.85rem 1rem;
  border-inline-start: 4px solid var(--color-primary-700);
}
.app-toast-icon {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-inline-end: 0.75rem;
  font-size: 1rem;
  background: var(--color-success-bg);
  color: var(--color-primary-700);
}
.app-toast-body {
  flex: 1;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text-primary);
}

.app-toast-danger { border-inline-start-color: var(--color-danger); }
.app-toast-danger .app-toast-icon { background: var(--color-danger-bg); color: var(--color-danger); }

.app-toast-warning { border-inline-start-color: var(--color-accent-gold); }
.app-toast-warning .app-toast-icon { background: var(--color-warning-bg); color: var(--color-accent-gold); }

.app-toast-info { border-inline-start-color: var(--color-primary-500); }
.app-toast-info .app-toast-icon { background: var(--color-primary-50); color: var(--color-primary-700); }

@media (max-width: 576px) {
  .app-toast {
    min-width: 0;
    width: calc(100vw - 2rem);
  }
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-content {
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  border-bottom: 1px solid var(--color-border);
}
.modal-footer {
  border-top: 1px solid var(--color-border);
}
.modal-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.modal-icon.icon-danger { background: var(--color-danger-bg); color: var(--color-danger); }
.modal-icon.icon-warning { background: var(--color-warning-bg); color: var(--color-accent-gold); }
.modal-icon.icon-success { background: var(--color-success-bg); color: var(--color-primary-700); }

/* ==========================================================================
   Utility
   ========================================================================== */
.text-primary-brand { color: var(--color-primary-700) !important; }
.bg-brand-soft { background-color: var(--color-primary-50); }

@media (max-width: 576px) {
  body { font-size: 16px; }
  .stat-card .stat-value { font-size: 1.75rem; }
}
