/* Bottom navigation + create sheet only (extracted from styles.css) for pages that don't load styles.css (unlock.html). */
:root {
  
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-subtle: #f1f5f9;
  --color-text: #0f172a;
  --color-subtitle: #64748b;
  --color-text-primary: var(--color-text);
  --color-text-secondary: var(--color-subtitle);
  --color-text-muted: #64748b;
  --color-primary: #2563eb;
  --color-brand: var(--color-primary);
  --color-accent: var(--color-primary);
  --color-primary-hover: #1d4ed8;
  --color-primary-active: #1e40af;
  --color-primary-light: rgba(37, 99, 235, 0.08);
  --color-error: #dc2626;
  --color-error-bg: #fef2f2;
  --color-danger: var(--color-error);
  --color-danger-hover: #b91c1c;
  --color-danger-bg: var(--color-error-bg);
  --color-success: #047857;
  --color-success-bg: #ecfdf5;
  --color-warning: #b45309;
  --color-warning-bg: #fffbeb;
  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;

  
  --font-size-page-title: clamp(1.75rem, 5vw, 2.25rem);
  --font-size-section-title: clamp(1.5rem, 4vw, 2rem);
  --font-size-card-title: 1.125rem;
  --font-size-body: 1rem;
  --font-size-meta: 0.875rem;
  --font-size-label: 0.8125rem;
  --line-height-tight: 1.3;
  --line-height-body: 1.6;

  
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;

  
  --nav-height: 4rem;
  --radius-sm: 0.5rem;
  --radius: 0.75rem;
  --radius-md: var(--radius);
  --radius-lg: 1rem;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);

  
  --content-width: 60rem;
  --home-content-width: max(75rem, min(92vw, 90rem)); /* PO 2026-10-30: grows with wide screens, up to 1440px */
  --search-content-width: 62.5rem;
  --reading-width: 45rem;
  --form-width: 35rem;
  --page-gutter: 1.5rem;
  --page-gutter-mobile: 1rem;
  --card-gap: var(--space-4);
  --section-gap: var(--space-8);
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.22);
}
body.create-page .klw-global-create {
  display: none;
}
.klw-global-create {
  display: none;
}
@media (max-width: 768px) {
  .klw-global-create {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    padding: 0.35rem 0.75rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
  }
  .klw-global-create__inner {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.25rem;
    align-items: end;
    max-width: 28rem;
    margin: 0 auto;
  }
  .klw-global-create__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-height: 2.75rem;
    font-size: 0.6875rem;
    color: var(--color-subtitle);
    text-decoration: none;
    text-align: center;
  }
  .klw-global-create__item--primary {
    position: relative;
    top: -0.65rem;
  }
  .klw-global-create__plus {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    background: var(--color-primary);
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    box-shadow: var(--shadow-md);
  }
  .klw-global-create__item-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
  }
  .klw-global-create__badge {
    position: absolute;
    top: 0;
    right: 0.15rem;
    min-width: 1.1rem;
    max-width: 2rem;
    padding: 0 0.2rem;
    border-radius: 999px;
    background: var(--color-danger, #dc2626);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
.notifications-page .klw-global-create {
  display: block;
}
@media (max-width: 768px) {
  body.has-bottom-nav:not(.create-page) .navbar__links > a.navbar__link {
    display: none;
  }
  body.has-bottom-nav .klw-global-create__inner {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    max-width: 32rem;
  }
  body.has-bottom-nav .klw-global-create__item {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.2;
  }
  body.has-bottom-nav:not(.create-page) .navbar {
    flex-wrap: nowrap;
  }
  body.has-bottom-nav:not(.create-page) .navbar__actions {
    width: auto;
    flex: 0 1 auto;
    margin-left: auto;
    justify-content: flex-end;
  }
  body.has-bottom-nav:not(.create-page) .navbar__links {
    flex: 0 1 auto;
  }
  body.has-bottom-nav:not(.create-page) .navbar__spacer {
    display: none;
  }
  body.has-bottom-nav:not(.create-page) .navbar .lang-selector,
  .navbar--home .lang-selector {
    order: -1;
  }
}
@media (min-width: 769px) {
  .notifications-page .klw-global-create--mobile {
    display: none;
  }
}
@media (max-width: 768px) {
  .notifications-page .klw-global-create--desktop {
    display: none;
  }
}
button.klw-global-create__item {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
html.klw-create-sheet-open,
html.klw-create-sheet-open body {
  overflow: hidden;
}
.klw-create-sheet {
  position: fixed;
  inset: 0;
  z-index: 400;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
}
.klw-create-sheet[open],
.klw-create-sheet--fallback:not([hidden]) {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.klw-create-sheet::backdrop {
  background: transparent;
}
.klw-create-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.klw-create-sheet__panel {
  position: relative;
  width: 100%;
  max-width: 32rem;
  max-height: 85vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  padding: 1rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--color-surface);
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.18);
}
.klw-create-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}
.klw-create-sheet__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}
.klw-create-sheet__close {
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-surface-subtle);
  color: var(--color-text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.klw-create-sheet__close:focus-visible,
.klw-create-sheet__item:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.klw-create-sheet__group-title {
  margin: 1rem 0 0.5rem;
  font-size: var(--font-size-label);
  font-weight: 600;
  color: var(--color-text-secondary);
}
.klw-create-sheet__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.klw-create-sheet__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 3rem;
  box-sizing: border-box;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}
.klw-create-sheet__item--primary {
  grid-column: 1 / -1;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.2rem;
  min-height: 4.25rem;
  background: linear-gradient(135deg, #eef4ff, #f5f0ff);
  border-color: #d6e2fb;
}
.klw-create-sheet__item--primary .klw-create-sheet__item-label { font-size: 1.05rem; font-weight: 700; }
.klw-create-sheet__item-desc { font-size: 0.85rem; color: #64748b; font-weight: 400; }
.klw-create-sheet__item:hover {
  border-color: var(--color-border-strong);
}
.klw-create-sheet__item--recommended {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary-active);
}
.klw-create-sheet__badge {
  flex-shrink: 0;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
}
@media (min-width: 769px) {
  .klw-create-sheet[open],
  .klw-create-sheet--fallback:not([hidden]) {
    align-items: center;
  }
  .klw-create-sheet__panel {
    border-radius: var(--radius-lg);
    padding-bottom: 1.25rem;
  }
}
