/* ==========================================================================
   University App Portal — Editorial Civic Directory Styles
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-primary);
  background-color: var(--bg-canvas);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 16px;
}

@media (min-width: 640px) {
  .container {
    padding-inline: 24px;
  }
}

/* ==========================================================================
   Skip Link (Accessibility)
   ========================================================================== */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  background: var(--accent-brand);
  color: var(--accent-brand-ink);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s var(--ease-out);
}

.skip-link:focus {
  top: 12px;
}

/* ==========================================================================
   Top Announcement Banner
   ========================================================================== */
.announcement-bar {
  background: var(--ann-info-bg);
  color: var(--ann-info-text);
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.announcement-bar[data-type="warning"] {
  background: var(--ann-warn-bg);
  color: var(--ann-warn-text);
}

.announcement-bar[data-type="urgent"] {
  background: var(--ann-urgent-bg);
  color: var(--ann-urgent-text);
}

.announcement-bar[hidden] {
  display: none;
}

.announcement-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 10px;
}

.announcement-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
}

.announcement-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.announcement-text {
  margin: 0;
  line-height: 1.45;
}

.announcement-link {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.announcement-link:hover {
  opacity: 0.88;
}

.announcement-close {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: inherit;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

.announcement-close:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* ==========================================================================
   Compact Civic Header
   ========================================================================== */
.site-header {
  background: var(--bg-canvas);
  border-top: 3px solid var(--accent-brand);
  border-bottom: 1px solid var(--border-hairline);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo {
  width: auto;
  height: 52px;
  max-width: 46px;
  object-fit: contain;
  display: block;
}

.brand-copy {
  min-width: 0;
}

.brand-kicker {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-brand);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

@media (min-width: 640px) {
  .brand-title {
    font-size: 1.38rem;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-utility {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding-inline: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn-utility:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

.btn-notif {
  position: relative;
}

.btn-notif[data-push-state="off"] {
  border-style: dashed;
  border-color: var(--border-strong);
  color: var(--text-secondary);
}

.btn-notif[data-push-state="off"] .icon-bell-on,
.btn-notif[data-push-state="off"] .push-status-dot {
  display: none;
}

.btn-notif[data-push-state="on"] {
  background: var(--accent-brand-soft);
  border-color: var(--accent-brand);
  color: var(--accent-brand);
  font-weight: 600;
}

.btn-notif[data-push-state="on"] .icon-bell-off {
  display: none;
}

.push-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1E8E5A;
  box-shadow: 0 0 0 2px var(--bg-surface);
  flex-shrink: 0;
}

.notif-unread-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #C92A2A;
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.notif-unread-badge[hidden] {
  display: none;
}

.btn-utility--primary {
  background: var(--accent-brand);
  border-color: var(--accent-brand);
  color: var(--accent-brand-ink);
}

.btn-utility--primary:hover {
  background: var(--accent-brand-hover);
  border-color: var(--accent-brand-hover);
}

.btn-utility--icon {
  width: 38px;
  padding: 0;
}

.btn-utility svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-utility .btn-label-mobile-hide {
  display: none;
}

.icon-sun {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

@media (min-width: 560px) {
  .btn-utility .btn-label-mobile-hide {
    display: inline;
  }
}

/* ==========================================================================
   Sticky Command Bar (Search + Role Tabs)
   ========================================================================== */
.command-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(248, 246, 250, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-hairline);
  transition: box-shadow 0.2s ease;
}

[data-theme="dark"] .command-bar {
  background: rgba(22, 20, 26, 0.92);
}

.command-bar.is-stuck {
  box-shadow: var(--shadow-sticky);
}

.command-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-block: 14px;
}

/* Search Box */
.search-box {
  position: relative;
  width: 100%;
}

@media (min-width: 860px) {
  .command-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  .search-box {
    flex: 1 1 340px;
    max-width: 500px;
  }
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 44px;
  padding: 0 72px 0 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-brand);
  box-shadow: 0 0 0 3px var(--accent-brand-soft);
}

.search-kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  pointer-events: none;
  display: none;
}

@media (min-width: 768px) {
  .search-kbd {
    display: inline-block;
  }
}

.search-kbd[hidden] {
  display: none;
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.search-clear[hidden] {
  display: none;
}

.search-clear:hover {
  color: var(--text-primary);
  background: var(--border-hairline);
}

/* Role Segmented Control */
.role-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
  margin-bottom: -2px;
}

.role-tabs::-webkit-scrollbar {
  display: none;
}

.role-tab {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.role-tab:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.role-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--role-all);
}

.role-tab[data-role="student"] .role-dot { background: var(--role-student); }
.role-tab[data-role="staff"] .role-dot { background: var(--role-staff); }
.role-tab[data-role="public"] .role-dot { background: var(--role-public); }

.role-count {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  min-width: 22px;
  text-align: center;
}

.role-tab[aria-pressed="true"] {
  background: var(--accent-brand);
  border-color: var(--accent-brand);
  color: var(--accent-brand-ink);
  font-weight: 600;
}

.role-tab[aria-pressed="true"] .role-dot {
  background: currentColor;
}

.role-tab[aria-pressed="true"] .role-count {
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
}

[data-theme="dark"] .role-tab[aria-pressed="true"] .role-count {
  background: rgba(0, 0, 0, 0.22);
}

/* ==========================================================================
   Main Content & Sections
   ========================================================================== */
.portal-main {
  flex: 1 0 auto;
  padding-block: 24px 56px;
}

.portal-section {
  margin-bottom: 34px;
}

.portal-section:last-child {
  margin-bottom: 0;
}

.portal-section[hidden] {
  display: none;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-hairline);
}

.section-title-group {
  display: flex;
  align-items: center;
  gap: 9px;
}

.section-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.section-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.section-note {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Quick Search Hints */
.quick-hints {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.quick-hint-chip {
  appearance: none;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.quick-hint-chip:hover {
  border-color: var(--accent-brand);
  color: var(--accent-brand);
  background: var(--accent-brand-soft);
}

/* ==========================================================================
   Directory Grid & App Card (Editorial Tactile Style)
   ========================================================================== */
.app-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (min-width: 1024px) {
  .app-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

/* Compact App Tiles Grid (My Pins & Featured Services) */
.app-grid--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 480px) {
  .app-grid--compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .app-grid--compact {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (min-width: 1080px) {
  .app-grid--compact {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 12px;
  }
}

.app-card--compact .app-card-link {
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 16px 8px 12px;
}

.app-card--compact .app-icon-wrap {
  width: 40px;
  height: 40px;
}

.app-card--compact .app-icon-wrap svg {
  width: 20px;
  height: 20px;
}

.app-card--compact .app-compact-label {
  margin: 0;
  width: 100%;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-card--compact .pin-btn {
  top: 5px;
  right: 5px;
  width: 26px;
  height: 26px;
}

.app-card--compact .pin-btn svg {
  width: 13px;
  height: 13px;
}

.app-card--compact .compact-status-dot {
  position: absolute;
  top: 9px;
  left: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  pointer-events: none;
}

.compact-status-dot--new { background: var(--status-new-text); }
.compact-status-dot--maintenance { background: var(--status-maint-text); }
.compact-status-dot--intranet { background: var(--status-intra-text); }

.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: transform 0.18s var(--ease-out), border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
  overflow: hidden;
}

.app-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card-hover);
  background: var(--bg-surface-hover);
}

.app-card--featured {
  border-top: 3px solid var(--accent-gold);
}

.app-card--maintenance {
  background: var(--bg-subtle);
  border-style: dashed;
}

.app-card-link {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px 16px;
  text-decoration: none;
  flex: 1 1 auto;
}

.app-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-right: 34px; /* space for pin button */
}

.app-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  color: var(--accent-brand);
  border: 1px solid var(--border-hairline);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.app-card:hover .app-icon-wrap {
  background: var(--accent-brand);
  color: var(--accent-brand-ink);
  border-color: var(--accent-brand);
}

.app-icon-wrap svg {
  width: 21px;
  height: 21px;
}

.app-heading {
  min-width: 0;
  flex: 1 1 auto;
}

.app-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
}

.app-short {
  display: inline-block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.app-desc {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-meta {
  margin-top: auto;
  padding-top: 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.app-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 500;
}

.role-pill--student {
  background: var(--role-student-soft);
  color: var(--role-student);
}

.role-pill--staff {
  background: var(--role-staff-soft);
  color: var(--role-staff);
}

.role-pill--public {
  background: var(--role-public-soft);
  color: var(--role-public);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.73rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.status-badge--new {
  background: var(--status-new-bg);
  color: var(--status-new-text);
  border-color: var(--status-new-border);
}

.status-badge--maintenance {
  background: var(--status-maint-bg);
  color: var(--status-maint-text);
  border-color: var(--status-maint-border);
}

.status-badge--intranet {
  background: var(--status-intra-bg);
  color: var(--status-intra-text);
  border-color: var(--status-intra-border);
}

.mobile-app-pill {
  background: var(--accent-brand-soft);
  color: var(--accent-brand);
  border-color: var(--border-strong);
}

.external-arrow {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  transition: transform 0.18s var(--ease-out), color 0.18s ease;
  flex-shrink: 0;
}

.app-card:hover .external-arrow {
  color: var(--accent-brand);
  transform: translate(2px, -2px);
}

/* Pin Button (Positioned cleanly in top-right) */
.pin-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pin-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--border-hairline);
}

.pin-btn[aria-pressed="true"] {
  color: var(--pin-active);
  background: var(--pin-active-bg);
  border-color: rgba(184, 107, 20, 0.25);
}

.pin-btn svg {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   Empty & Error States
   ========================================================================== */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 44px 20px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.empty-state[hidden] {
  display: none;
}

.empty-state h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.empty-state p {
  margin: 0 0 16px;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  padding-block: 22px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 720px) {
  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.footer-link:hover {
  color: var(--accent-brand);
}

/* ==========================================================================
   iOS Install Guide Modal
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(17, 20, 18, 0.56);
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-dialog {
  width: 100%;
  max-width: 440px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  padding: 22px 24px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  appearance: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.modal-close:hover {
  background: var(--bg-subtle);
}

.modal-desc {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.ios-steps {
  margin: 14px 0 18px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.93rem;
  color: var(--text-secondary);
}

.ios-steps strong {
  color: var(--text-primary);
}

.pwa-https-warning {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: var(--radius-md);
  background: var(--status-maint-bg);
  border: 1px solid var(--status-maint-border);
  color: var(--status-maint-text);
  font-size: 0.84rem;
  line-height: 1.5;
}

.pwa-https-warning[hidden] {
  display: none;
}

.pwa-https-warning p {
  margin: 6px 0 0;
}

.pwa-https-warning code {
  font-family: var(--font-mono);
  font-size: 0.8em;
  word-break: break-all;
}

/* ==========================================================================
   In-App Notification Center Modal
   ========================================================================== */
.modal-dialog--notif {
  max-width: 520px;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
}

.notif-status-banner {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.notif-status-banner[data-push-state="on"] {
  background: var(--status-new-bg);
  border-color: var(--status-new-border);
}

.notif-status-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 220px;
}

.notif-status-copy strong {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.notif-status-copy span {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.notif-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-hairline);
}

.notif-feed-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 2px;
}

.notif-empty {
  text-align: center;
  padding: 28px 14px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
  font-size: 0.88rem;
}

.notif-item {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
  background: var(--bg-canvas);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notif-item--unread {
  border-left: 3px solid #C92A2A;
  background: var(--bg-surface);
}

.notif-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.notif-item-title {
  margin: 0;
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.notif-new-pill {
  background: #C92A2A;
  color: #FFFFFF;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.notif-item-body {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.48;
  white-space: pre-line;
}

.notif-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.notif-item-link {
  color: var(--accent-brand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ==========================================================================
   Mobile Native App Download & QR Modal
   ========================================================================== */
.modal-dialog--mobile-app {
  max-width: 500px;
}

.mobile-store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin: 16px 0 12px;
}

.mobile-store-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
  background: var(--bg-canvas);
  text-align: center;
}

.mobile-store-card strong {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.mobile-store-qr {
  width: 148px;
  height: 148px;
  padding: 8px;
  background: #FFFFFF;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  display: block;
}

.mobile-store-btn {
  width: 100%;
  text-decoration: none;
}

.mobile-app-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================================
   Toast Notification (Offline / Update / Pin Feedback)
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  z-index: 90;
  background: var(--text-primary);
  color: var(--bg-canvas);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-modal);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s var(--ease-out);
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast-action {
  background: var(--accent-brand);
  color: var(--accent-brand-ink);
  border: 0;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
