/* ============================================================
   1. TOKENS
   ============================================================ */
:root {
  --horizon-bg:            #05091F;
  --horizon-bg-card:       #0d1229;
  --horizon-bg-card-lift:  #131a38;
  --horizon-bg-hover:      #161c3a;
  --horizon-bg-overlay:    #090e26;
  --horizon-border:        #1f2747;
  --horizon-border-strong: #2a3457;
  --horizon-accent:        #03A1EF;
  --horizon-accent-bright: #38b8f3;
  --horizon-accent-dim:    #0477b0;
  --horizon-accent-glow:   rgba(3, 161, 239, 0.22);
  --horizon-warm:          #E46F71;
  --horizon-warm-dim:      #b7545e;
  --horizon-warm-glow:     rgba(228, 111, 113, 0.2);
  --horizon-soft:          #7488B0;
  --horizon-soft-dim:      #52648c;
  --horizon-success:       #86EFAC;
  --horizon-text:          #d4d4d4;
  --horizon-text-bright:   #fafafa;
  --horizon-text-dim:      #666c84;
  --horizon-text-whisper:  #3a4566;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans:    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', Menlo, Monaco, Consolas, monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --radius-xl: 28px;
  --shadow-card: 0 24px 60px -22px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.4);
  --shadow-lift:  0 42px 80px -28px rgba(0,0,0,0.75), 0 2px 12px rgba(0,0,0,0.5);
  --glow-accent:  0 0 32px rgba(3,161,239,0.32);
  --glow-warm:    0 0 32px rgba(228,111,113,0.28);
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body.horizon-body {
  background: var(--horizon-bg);
  color: var(--horizon-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01" on, "cv11" on;
}

*:focus { outline: none; }
*:focus-visible {
  outline: 2px solid var(--horizon-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Scrollbars */
scrollbar-width: thin;
scrollbar-color: var(--horizon-border-strong) transparent;

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--horizon-border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--horizon-soft-dim); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   3. STARFIELD
   ============================================================ */
.horizon-starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1px 1px at 17% 12%, rgba(255,255,255,0.65) 50%, transparent 100%),
    radial-gradient(1px 1px at 63% 8%,  rgba(255,255,255,0.42) 50%, transparent 100%),
    radial-gradient(1px 1px at 84% 24%, rgba(255,255,255,0.55) 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 41% 32%, rgba(3,161,239,0.45) 50%, transparent 100%),
    radial-gradient(1px 1px at 8% 45%,  rgba(255,255,255,0.32) 50%, transparent 100%),
    radial-gradient(1px 1px at 92% 58%, rgba(255,255,255,0.48) 50%, transparent 100%),
    radial-gradient(1px 1px at 27% 72%, rgba(255,255,255,0.38) 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 68% 80%, rgba(228,111,113,0.40) 50%, transparent 100%),
    radial-gradient(1px 1px at 52% 91%, rgba(255,255,255,0.52) 50%, transparent 100%),
    radial-gradient(1px 1px at 14% 96%, rgba(255,255,255,0.28) 50%, transparent 100%),
    radial-gradient(1px 1px at 38% 55%, rgba(255,255,255,0.36) 50%, transparent 100%),
    radial-gradient(1px 1px at 76% 42%, rgba(255,255,255,0.44) 50%, transparent 100%);
  opacity: 0.9;
  animation: horizon-starfield-breathe 14s ease-in-out infinite;
}

.horizon-starfield::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 45% at 20% 12%, rgba(3,161,239,0.14), transparent 70%),
    radial-gradient(ellipse 55% 50% at 88% 78%, rgba(228,111,113,0.08), transparent 72%),
    radial-gradient(ellipse 100% 60% at 50% 120%, rgba(3,161,239,0.06), transparent 70%);
  pointer-events: none;
}

@keyframes horizon-starfield-breathe {
  0%, 100% { opacity: 0.72; }
  50%       { opacity: 1; }
}

/* ============================================================
   4. TYPOGRAPHY
   ============================================================ */
.horizon-display--xl {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 5.75rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-optical-sizing: auto;
  color: var(--horizon-text-bright);
}

.horizon-display--lg {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-optical-sizing: auto;
  color: var(--horizon-text-bright);
}

.horizon-display--md {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-optical-sizing: auto;
  color: var(--horizon-text-bright);
}

.horizon-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--horizon-soft);
  display: block;
  margin-bottom: 0.5rem;
}

.horizon-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

/* ============================================================
   5. ANIMATIONS
   ============================================================ */
@keyframes horizon-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes horizon-pop-in {
  0%   { opacity: 0; transform: scale(0.85); }
  70%  { transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes horizon-pulse-accent {
  0%   { box-shadow: 0 0 0 0 rgba(3,161,239,0.55); }
  70%  { box-shadow: 0 0 0 18px rgba(3,161,239,0); }
  100% { box-shadow: 0 0 0 0 rgba(3,161,239,0); }
}

.horizon-stagger > * {
  animation: horizon-fade-up 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.horizon-stagger > *:nth-child(1)  { animation-delay: 0.05s; }
.horizon-stagger > *:nth-child(2)  { animation-delay: 0.12s; }
.horizon-stagger > *:nth-child(3)  { animation-delay: 0.19s; }
.horizon-stagger > *:nth-child(4)  { animation-delay: 0.26s; }
.horizon-stagger > *:nth-child(5)  { animation-delay: 0.33s; }
.horizon-stagger > *:nth-child(6)  { animation-delay: 0.40s; }
.horizon-stagger > *:nth-child(n+7) { animation-delay: 0.45s; }

/* ============================================================
   6. APP SHELL
   ============================================================ */
.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  z-index: 1;
}

/* ============================================================
   7. SIDEBAR
   ============================================================ */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: rgba(13, 18, 41, 0.85);
  border-right: 1px solid var(--horizon-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow-y: auto;
}

.sidebar__header {
  padding: 1.75rem 1.5rem 1.25rem;
  border-bottom: 1px dashed var(--horizon-border);
}

.sidebar__logo {
  width: 140px;
  height: auto;
  display: block;
}

.sidebar__section-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--horizon-text-whisper);
  padding: 1.25rem 1.5rem 0.5rem;
}

.sidebar__nav {
  flex: 1;
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar__filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--horizon-text-dim);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  width: 100%;
}

.sidebar__filter:hover {
  background: var(--horizon-bg-hover);
  color: var(--horizon-text);
}

.sidebar__filter.is-active {
  background: rgba(3, 161, 239, 0.08);
  border-color: var(--horizon-accent-dim);
  color: var(--horizon-text-bright);
  box-shadow: 0 0 0 1px rgba(3, 161, 239, 0.24);
}

.sidebar__filter.is-active .sidebar__filter-label {
  color: var(--horizon-accent-bright);
}

.sidebar__filter-count {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--horizon-text-whisper);
  min-width: 1.5rem;
  text-align: right;
}

.sidebar__actions {
  padding: 1rem 1.25rem;
  border-top: 1px dashed var(--horizon-border);
}

.sidebar__stats {
  padding: 0.75rem 1.5rem 1.25rem;
}

/* ============================================================
   8. MAIN CONTENT
   ============================================================ */
.main-content {
  padding: clamp(1.75rem, 3.5vw, 3rem);
  overflow-y: auto;
  min-height: 100vh;
}

.main-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.search-bar {
  flex: 1;
  position: relative;
}

.search-bar__icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--horizon-soft);
  pointer-events: none;
  width: 16px;
  height: 16px;
}

.search-bar__input {
  width: 100%;
  padding-left: 2.75rem !important;
}

/* ============================================================
   9. RESOURCE GRID
   ============================================================ */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

/* ============================================================
   10. RESOURCE CARD
   ============================================================ */
.resource-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: clamp(1.25rem, 2vw, 1.75rem);
  background: linear-gradient(180deg,
    rgba(19, 26, 56, 0.6) 0%,
    rgba(13, 18, 41, 0.88) 100%);
  border: 1px solid var(--horizon-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  transition:
    transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1),
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease;
}

.resource-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 1.75rem;
  right: 1.75rem;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--horizon-accent) 50%, transparent 100%);
  opacity: 0.4;
  transition: opacity 0.3s ease, box-shadow 0.3s ease;
}

.resource-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 15% 0%,
    rgba(3, 161, 239, 0.08) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.resource-card:hover {
  transform: translateY(-4px);
  border-color: var(--horizon-border-strong);
  box-shadow: var(--shadow-lift);
  background: linear-gradient(180deg,
    rgba(22, 28, 58, 0.75) 0%,
    rgba(13, 18, 41, 0.92) 100%);
}

.resource-card:hover::before {
  opacity: 1;
  box-shadow: 0 0 14px var(--horizon-accent);
}

.resource-card:hover::after {
  opacity: 1;
}

.card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.card__type-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--horizon-border);
  border-radius: var(--radius-sm);
  color: var(--horizon-soft);
  white-space: nowrap;
  flex-shrink: 0;
}

.card__type-badge--pdf   { color: var(--horizon-warm); border-color: var(--horizon-warm-dim); }
.card__type-badge--url   { color: var(--horizon-accent-bright); border-color: var(--horizon-accent-dim); }
.card__type-badge--content { color: var(--horizon-success); border-color: rgba(134, 239, 172, 0.3); }

.card__title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 500;
  color: var(--horizon-text-bright);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.card__comment-preview {
  font-size: 0.85rem;
  color: var(--horizon-text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}

.card__content-preview {
  font-size: 0.83rem;
  color: var(--horizon-text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
  font-style: italic;
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--horizon-border);
  margin-top: auto;
}

.card__date {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--horizon-text-whisper);
  letter-spacing: 0.08em;
}

.card__size {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--horizon-text-whisper);
}

/* ============================================================
   11. TAG PILLS
   ============================================================ */
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.6rem;
  border: 1px solid var(--horizon-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--horizon-soft);
  cursor: pointer;
  user-select: none;
  background: transparent;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  white-space: nowrap;
}

.tag-pill:hover {
  border-color: var(--horizon-border-strong);
  color: var(--horizon-text);
}

.tag-pill.is-selected {
  border-color: var(--horizon-accent-dim);
  color: var(--horizon-accent-bright);
  background: var(--horizon-accent-glow);
}

/* ============================================================
   12. MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 9, 31, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay[hidden] { display: none; }

.modal-card {
  position: relative;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg,
    rgba(19, 26, 56, 0.82) 0%,
    rgba(13, 18, 41, 0.95) 100%);
  border: 1px solid var(--horizon-border);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2.25rem 2rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: horizon-pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.modal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 68px;
  height: 2px;
  background: var(--horizon-accent);
  box-shadow: 0 0 18px var(--horizon-accent), 0 0 40px rgba(3,161,239,0.55);
}

.modal-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.modal-card__title {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
}

.modal-card__close {
  background: transparent;
  border: 1px solid var(--horizon-border);
  border-radius: var(--radius-sm);
  color: var(--horizon-text-dim);
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.modal-card__close:hover {
  border-color: var(--horizon-warm-dim);
  color: var(--horizon-warm);
  background: var(--horizon-warm-glow);
}

/* ============================================================
   13. FORM
   ============================================================ */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Type selector */
.type-selector__options {
  display: flex;
  gap: 0.65rem;
}

.type-option {
  flex: 1;
  cursor: pointer;
}

.type-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.type-option__label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.5rem;
  border: 1px solid var(--horizon-border);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--horizon-text-dim);
  background: var(--horizon-bg-card);
  transition: border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.type-option input:checked + .type-option__label {
  border-color: var(--horizon-accent-dim);
  color: var(--horizon-accent-bright);
  background: var(--horizon-accent-glow);
  box-shadow: 0 0 0 1px rgba(3, 161, 239, 0.2);
}

/* Inputs */
.horizon-field__input {
  padding: 0.9rem 1rem;
  background: var(--horizon-bg-card);
  border: 1px solid var(--horizon-border);
  border-radius: var(--radius-md);
  color: var(--horizon-text-bright);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  font-weight: 500;
  width: 100%;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.horizon-field__input::placeholder {
  color: var(--horizon-text-whisper);
  font-weight: 400;
}

.horizon-field__input:hover {
  border-color: var(--horizon-border-strong);
}

.horizon-field__input:focus {
  border-color: var(--horizon-accent);
  background: var(--horizon-bg-overlay);
  box-shadow: 0 0 0 4px rgba(3,161,239,0.12), 0 0 24px rgba(3,161,239,0.14);
  outline: none;
}

.horizon-field__textarea {
  resize: vertical;
  min-height: 90px;
  font-family: var(--font-sans);
}

/* File drop zone */
.file-drop-zone {
  position: relative;
  border: 1px dashed var(--horizon-border);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  background: var(--horizon-bg-card);
  min-height: 100px;
  cursor: pointer;
}

.file-drop-zone:hover,
.file-drop-zone.is-drag-over {
  border-color: var(--horizon-accent);
  background: var(--horizon-accent-glow);
}

.file-drop-zone__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.file-drop-zone__label {
  font-size: 0.85rem;
  color: var(--horizon-text-dim);
  pointer-events: none;
}

.file-drop-zone__label u {
  color: var(--horizon-accent-bright);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.file-drop-zone__filename {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--horizon-accent-bright);
  pointer-events: none;
}

/* Tag selector in form */
.tag-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 32px;
}

.tag-create {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.tag-create__input {
  flex: 1;
  padding: 0.55rem 0.85rem !important;
  font-size: 0.85rem !important;
}

/* Form actions */
.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--horizon-border);
  margin-top: 0.25rem;
}

/* ============================================================
   14. RESOURCE VIEW (modal consultation mode)
   ============================================================ */
.resource-view__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.resource-view__title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 500;
  color: var(--horizon-text-bright);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.resource-view__date {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--horizon-text-whisper);
  letter-spacing: 0.08em;
}

.resource-view__comment-section {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--horizon-bg-card);
  border: 1px solid var(--horizon-border);
  border-radius: var(--radius-md);
}

.resource-view__comment-label {
  margin-bottom: 0.5rem;
}

.resource-view__comment-text {
  font-size: 0.9rem;
  color: var(--horizon-text);
  line-height: 1.55;
  white-space: pre-wrap;
}

.resource-view__content-section {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--horizon-bg-card);
  border: 1px solid var(--horizon-border);
  border-radius: var(--radius-md);
}

.resource-view__content-text {
  font-size: 0.9rem;
  color: var(--horizon-text);
  line-height: 1.6;
  white-space: pre-wrap;
}

.resource-view__url {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--horizon-accent-bright);
  word-break: break-all;
  margin-top: 0.5rem;
}

.resource-view__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--horizon-border);
}

/* ============================================================
   15. BUTTONS
   ============================================================ */
.horizon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1.35rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1),
    box-shadow 0.2s,
    border-color 0.2s,
    color 0.2s;
  white-space: nowrap;
  border: none;
}

.horizon-btn--primary {
  background: var(--horizon-accent);
  color: #001523;
  box-shadow: 0 0 0 1px var(--horizon-accent-dim), var(--glow-accent);
  width: 100%;
}

.horizon-btn--primary:hover:not(:disabled) {
  background: var(--horizon-accent-bright);
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--horizon-accent-bright), 0 0 44px rgba(3,161,239,0.42);
}

.horizon-btn--primary:active:not(:disabled) {
  transform: translateY(0);
}

.horizon-btn--ghost {
  background: transparent;
  border: 1px solid var(--horizon-border);
  color: var(--horizon-text);
}

.horizon-btn--ghost:hover:not(:disabled) {
  border-color: var(--horizon-border-strong);
  background: var(--horizon-bg-hover);
}

.horizon-btn--danger {
  background: transparent;
  border: 1px solid var(--horizon-border);
  color: var(--horizon-text-dim);
}

.horizon-btn--danger:hover:not(:disabled) {
  border-color: var(--horizon-warm-dim);
  color: var(--horizon-warm);
  background: var(--horizon-warm-glow);
}

.horizon-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

/* ============================================================
   16. TOAST
   ============================================================ */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: var(--horizon-bg-card);
  color: var(--horizon-text-bright);
  padding: 0.9rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--horizon-border);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-card);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast--success {
  border-color: rgba(134, 239, 172, 0.45);
  box-shadow: var(--shadow-card), 0 0 24px rgba(134, 239, 172, 0.15);
}

.toast--error {
  border-color: var(--horizon-warm-dim);
  box-shadow: var(--shadow-card), var(--glow-warm);
}

/* ============================================================
   17. EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: clamp(3rem, 8vw, 6rem) 2rem;
  text-align: center;
  color: var(--horizon-text-dim);
}

.empty-state p:first-child {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--horizon-text-whisper);
}

/* ============================================================
   18. RESPONSIVE — 768px breakpoint
   ============================================================ */
@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
    border-right: none;
    border-bottom: 1px solid var(--horizon-border);
  }

  .sidebar__header {
    padding: 0;
    border-bottom: none;
  }

  .sidebar__logo { width: 100px; }

  .sidebar__nav {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0;
    flex: 1;
    gap: 0.4rem;
  }

  .sidebar__filter {
    width: auto;
    flex: none;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }

  .sidebar__section-label { display: none; }

  .sidebar__actions {
    border-top: none;
    padding: 0;
  }

  .sidebar__actions .horizon-btn--primary {
    width: auto;
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
  }

  .sidebar__stats { display: none; }

  .main-content {
    padding: 1.25rem;
  }

  .modal-card {
    padding: 1.75rem 1.5rem 1.5rem;
    border-radius: var(--radius-lg);
  }
}
