@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:opsz,wght@9..144,600;9..144,700&display=swap");

:root {
  --bg: #F3F0EA;
  --bg2: #E8E2D6;
  --surface: #FFFDF8;
  --border: #D9D2C6;
  --text: #3E547F;
  --muted: #5C6B86;
  --primary: #C2410C;
  --primary-600: #9A3412;
  --accent: #0F7DCC;
  --sky: #41A9D5;
  --navy: #3E547F;
  --navy-ink: #2C3D5C;
  --on-navy: #F7F4EE;
  --orange: #FF8000;
  --crisis: #B91C1C;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: Fraunces, Georgia, serif;
  --sidebar-w: 260px;
}
*{ box-sizing:border-box }
html,body{ margin:0; padding:0; font-family:var(--font-body); background:var(--bg); color:var(--text) }
html.i18n-booting .sidebar-nav,
html.i18n-booting .brand,
html.i18n-booting #authButton,
html.i18n-booting #sidebarLoggedIn { /* keep layout stable; text swaps in place */ }
/* Do not hide/opacity-fade sidebar on EN pending — that caused visible flicker. */
html.i18n-en-pending .sidebar-nav,
html.i18n-en-pending .brand { opacity: 1; }
html.i18n-switching,
html.i18n-switching * {
  transition: none !important;
  animation: none !important;
}
h1,h2,.hero h1,.brand,.edu-hero-title,.login-header h1{
  font-family:var(--font-display);
}
.container{ width:100%; max-width:1200px; margin:0 auto; padding:0 24px }

/* Layout */
.layout{ display:flex; min-height:100vh; }
.sidebar{
  width:var(--sidebar-w);
  min-width:var(--sidebar-w);
  flex:0 0 var(--sidebar-w);
  border-right:1px solid var(--navy-ink);
  padding:20px;
  background:var(--navy) !important;
  color:var(--on-navy);
  position:sticky;
  top:0;
  z-index:2;
  align-self:flex-start;
  height:100vh;
  max-height:100vh;
  min-height:100vh;
  overflow-x:hidden;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
}

/* Brand with Logo */
.brand-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(247,244,238,0.22);
}
.sidebar-brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}
.sidebar-close-btn {
    display: none;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin-left: auto;
    align-items: center;
    justify-content: center;
    background: rgba(247,244,238,0.12);
    color: var(--on-navy);
    border: 1px solid rgba(247,244,238,0.35);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.45rem;
    line-height: 1;
    padding: 0;
}
.sidebar-close-btn:hover,
.sidebar-close-btn:focus {
    background: rgba(194,65,12,0.9);
    outline: 2px solid var(--on-navy);
    outline-offset: 2px;
}
.sidebar-staff-hint {
    display: none;
    margin: 0.25rem 0 0;
    padding: 0.55rem 0.75rem;
    font-size: 0.78rem;
    line-height: 1.4;
    color: rgba(247,244,238,0.82);
    border: 1px dashed rgba(247,244,238,0.28);
    border-radius: 10px;
}
.sidebar-staff-locked {
    display: contents;
}
.sidebar-lang {
    padding: 0 0 1rem;
    width: 100%;
}

.brand-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: var(--surface);
    border-radius: 10px;
    padding: 4px;
}

.brand{ font-weight:700; letter-spacing:.3px; font-size:1.2rem; margin-bottom:0; color:var(--on-navy); }
.sidebar-nav{ display:flex; flex-direction:column; gap:10px; margin:16px 0 20px }
.sidebar-link{
  text-align:left;
  background:transparent;
  color:var(--on-navy);
  border:1px solid rgba(247,244,238,0.22);
  border-left:3px solid transparent;
  padding:10px 12px;
  border-radius:10px;
  cursor:pointer;
  text-decoration:none;
  display:flex;
  align-items:center;
  font-size:.95rem;
  line-height:1.4;
  min-height:40px;
  word-wrap:break-word;
  white-space:normal;
}
.sidebar-link:visited{ color:var(--on-navy) }
.sidebar-link:hover, .sidebar-link:focus{
  background:rgba(255,128,0,0.16);
  border-color:rgba(255,128,0,0.45);
  color:#fff;
  outline:2px solid var(--on-navy);
  outline-offset:2px;
}
.sidebar-link.is-active{
  background:rgba(255,128,0,0.22);
  border-color:rgba(255,128,0,0.55);
  border-left-color:var(--orange);
  color:#fff;
  font-weight:600;
}
.sidebar-link[disabled]{ opacity:.5; cursor:not-allowed }
.sidebar-auth .btn{ width:100% }
/* Beat Bootstrap (loaded on /stt-live) so EL/EN match every other page */
.sidebar .btn,
.sidebar #langEN,
.sidebar #langEL{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  box-sizing:border-box !important;
  width:auto !important;
  flex:1 1 0 !important;
  min-height:36px !important;
  padding:8px 12px !important;
  border-radius:24px !important;
  font-size:0.875rem !important;
  font-weight:600 !important;
  line-height:1.2 !important;
  letter-spacing:0.02em !important;
  text-transform:none !important;
  box-shadow:none !important;
  transition:none !important;
  --bs-btn-padding-x:12px;
  --bs-btn-padding-y:8px;
  --bs-btn-font-size:0.875rem;
  --bs-btn-border-radius:24px;
}
.sidebar .btn-outline-light,
.sidebar #langEN.btn-outline-light,
.sidebar #langEL.btn-outline-light{
  background:transparent !important;
  color:var(--on-navy) !important;
  border:1px solid rgba(247,244,238,0.45) !important;
}
.sidebar .btn-outline-light:hover,
.sidebar #langEN.btn-outline-light:hover,
.sidebar #langEL.btn-outline-light:hover{
  background:rgba(247,244,238,0.12) !important;
  color:#fff !important;
  border-color:rgba(247,244,238,0.55) !important;
}
.sidebar .btn-primary,
.sidebar #langEN.btn-primary,
.sidebar #langEL.btn-primary{
  background:var(--primary) !important;
  color:#fff !important;
  border:1px solid var(--primary) !important;
}
.sidebar .btn-primary:hover,
.sidebar #langEN.btn-primary:hover,
.sidebar #langEL.btn-primary:hover{
  background:var(--primary-600) !important;
  border-color:var(--primary-600) !important;
  color:#fff !important;
}
.sidebar .btn-group{
  display:flex !important;
  gap:0.5rem !important;
  width:100% !important;
  box-shadow:none !important;
}
.sidebar .btn-group > .btn{
  border-radius:24px !important;
  margin:0 !important;
}
.sidebar .profile-sidebar-label{
  font-size: 0.62rem !important;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247,244,238,0.5) !important;
  margin: 0 0 0.35rem !important;
}
.sidebar-user{
  order: 1;
  margin-top: 0 !important;
  margin-bottom: 0.85rem;
  padding: 0 !important;
  border-top: none !important;
}
.sidebar-user-row{
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.sidebar-user-row .sidebar-link{
  flex: 1;
  min-width: 0;
}
.sidebar-notif-btn{
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(247,244,238,0.22);
  background: rgba(15, 23, 42, 0.22);
  color: var(--on-navy);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.sidebar-notif-btn:hover,
.sidebar-notif-btn:focus{
  background: rgba(255,128,0,0.16);
  border-color: rgba(255,128,0,0.45);
  color: #fff;
  outline: 2px solid var(--on-navy);
  outline-offset: 2px;
}
.sidebar-notif-btn svg{
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar-notif-badge{
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--orange, #ff8000);
  color: #0f172a;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  display: none;
}
.sidebar-notif-badge.is-on{ display: inline-block; }

/* Notifications panel (dropdown, not legal modal) */
.sidebar-notif-wrap{
  position: relative;
  flex-shrink: 0;
}
.notif-panel{
  display: none;
  position: fixed;
  z-index: 10080;
  width: min(360px, calc(100vw - 24px));
  max-height: min(420px, calc(100vh - 24px));
  overflow: auto;
  background: #fff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}
.notif-panel.is-open{ display: block; }
.notif-panel-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
  position: sticky;
  top: 0;
}
.notif-panel-head h3{
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}
.notif-panel-mark{
  border: none;
  background: transparent;
  color: #C2410C;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.notif-panel-mark:hover{ text-decoration: underline; }
.notif-panel-list{
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
}
.notif-panel-list > li{ margin: 0; }
.notif-item{
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 0.65rem;
  width: 100%;
  margin: 0;
  padding: 0.75rem 1rem;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  border-radius: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}
.notif-item:hover,
.notif-item:focus{
  background: #fff7ed;
  outline: none;
}
.notif-item:last-child{ border-bottom: none; }
.notif-item.is-unread{ background: #fff7ed; }
.notif-item.is-unread:hover{ background: #ffedd5; }
.notif-item-copy{
  display: block;
  min-width: 0;
}
.notif-dot{
  width: 8px;
  height: 8px;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: #94a3b8;
}
.notif-item.is-unread .notif-dot{ background: #C2410C; }
.notif-item-title{
  display: block;
  margin: 0 0 0.2rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}
.notif-item-body{
  display: block;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #475569;
}
.notif-item-meta{
  display: block;
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.notif-panel-empty{
  padding: 1.25rem 1rem;
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
}
.notif-panel-foot{
  padding: 0.65rem 1rem 0.85rem;
  border-top: 1px solid #e5e7eb;
  background: #f8fafc;
}
.notif-panel-foot button{
  width: 100%;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
}
.notif-panel-foot button:hover{
  border-color: #C2410C;
  color: #C2410C;
}
body.sidebar-collapsed .sidebar-notif-wrap{
  width: 100%;
  display: flex;
  justify-content: center;
}

.sidebar-nav{ order: 2; flex: 1 1 auto; }
.sidebar-auth{ order: 3; margin-top: 0.35rem !important; }
.sidebar-user .sidebar-link,
.sidebar-user .sidebar-link:visited{
  display: flex !important;
  width: 100%;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(247,244,238,0.22);
  background: rgba(15, 23, 42, 0.22);
  min-height: 0;
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1.3;
  color: var(--on-navy);
}
.sidebar-user .sidebar-link:hover,
.sidebar-user .sidebar-link:focus{
  background: rgba(255,128,0,0.16);
  border-color: rgba(255,128,0,0.45);
  color: #fff;
}
.sidebar-user #sidebarUserName{
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-auth .btn:not(.btn-primary){
  background: transparent;
  color: var(--on-navy);
  border: 1px solid rgba(247,244,238,0.35);
}
.sidebar-auth .btn:not(.btn-primary):hover{
  background: rgba(247,244,238,0.1);
  color: #fff;
}
.sidebar-toggle{
  order: -1;
  align-self: flex-end;
  width: 32px;
  height: 32px;
  margin: 0 0 0.65rem;
  padding: 0;
  flex-shrink: 0;
  border: 1px solid rgba(247,244,238,0.35);
  background: transparent;
  color: var(--on-navy);
  border-radius: 8px;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}
.sidebar-toggle:hover,
.sidebar-toggle:focus{
  background: rgba(255,128,0,0.16);
  border-color: rgba(255,128,0,0.45);
  color: #fff;
  outline: 2px solid var(--on-navy);
  outline-offset: 2px;
}
body.sidebar-collapsed .sidebar{
  width: 72px;
  min-width: 72px;
  flex-basis: 72px;
  padding: 14px 10px;
  overflow-x: hidden;
  overflow-y: auto;
  align-items: center;
  min-height: 100vh;
  height: 100vh;
  max-height: 100vh;
  align-self: flex-start;
  background: var(--navy) !important;
}
body.sidebar-collapsed .brand{
  display: none;
}
body.sidebar-collapsed .brand-container{
  justify-content: center;
  border-bottom: 1px solid rgba(247,244,238,0.18);
  margin: 0 0 0.65rem;
  padding: 0 0 0.65rem;
  width: 100%;
}
body.sidebar-collapsed .brand-logo{
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
body.sidebar-collapsed .sidebar-nav,
body.sidebar-collapsed .sidebar-auth,
body.sidebar-collapsed .sidebar > div:has(#langEN){
  display: none !important;
}
body.sidebar-collapsed .sidebar-user{
  display: flex !important;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: auto !important;
  margin-bottom: 0;
  padding: 0.75rem 0 0 !important;
  border-top: 1px solid rgba(247,244,238,0.18);
  gap: 0.45rem;
  flex-shrink: 0;
}
body.sidebar-collapsed .profile-sidebar-label,
body.sidebar-collapsed #sidebarUserName{
  display: none !important;
}
body.sidebar-collapsed .sidebar-user-row{
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}
body.sidebar-collapsed .sidebar-user-row .sidebar-link{
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0 !important;
  justify-content: center;
  border-radius: 12px;
  gap: 0;
}
body.sidebar-collapsed .sidebar-notif-btn{
  width: 42px;
  height: 42px;
  border-radius: 12px;
}
body.sidebar-collapsed .sidebar-toggle{
  align-self: center;
  margin: 0 0 0.65rem;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(247,244,238,0.08);
}
.profile-initials-sm{
  width:32px;
  height:32px;
  flex-shrink: 0;
  border-radius:50%;
  background:linear-gradient(135deg, var(--navy-ink), var(--accent));
  color:#fff;
  font-size:0.75rem;
  font-weight:700;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.content{
  flex:1;
  min-width:0;
  padding:28px 12px 28px 28px;
}

/* Footer is full-width, after the sidebar+content row — never overlay */
body.has-app-footer {
  background: var(--bg);
}
body.has-app-footer .layout {
  min-height: 100vh;
  align-items: flex-start;
}
/* Stick tools rail to the viewport while main content scrolls */
.sidebar,
body.has-app-footer .sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  max-height: 100vh;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}
body.has-app-footer.sidebar-collapsed .sidebar,
body.sidebar-collapsed .sidebar {
  align-self: flex-start;
  width: 72px;
  min-width: 72px;
  height: 100vh;
  max-height: 100vh;
}
body.has-app-footer .app-footer {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0;
}

/* Buttons */
.btn{ background:var(--bg2); color:var(--text); border:1px solid var(--border); padding:10px 14px; border-radius:24px; cursor:pointer }
.btn:hover{ background:#DED6C8 }
.btn:focus-visible{ outline:2px solid var(--navy); outline-offset:2px }
.btn-primary{ background:var(--primary); color:#fff; border-color:var(--primary) }
.btn-primary:hover{ background:var(--primary-600); border-color:var(--primary-600) }
.w-full{ width:100% }

/* Sections */
.section{ display:none; padding:12px 0 28px }
.section.is-active{ display:block }
.is-locked .locked{ padding:16px; background:var(--bg2); border:1px dashed var(--border); border-radius:12px; color:var(--muted) }
.card{ background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:20px; margin:16px 0 }
.status{ margin-top:8px; min-height:20px; color:var(--accent) }
.note{ margin-top:8px; color:var(--muted); font-size:.92rem }

/* Hero */
.hero{
  position:relative;
  background:radial-gradient(circle at 0 0,rgba(194,65,12,0.10) 0,transparent 55%),
            radial-gradient(circle at 100% 100%,rgba(15,125,204,0.12) 0,transparent 55%),
            linear-gradient(180deg,var(--surface),transparent);
  border:1px solid var(--border);
  border-radius:20px;
  padding:40px 32px;
  margin-bottom:24px;
}
.hero h1{
  font-size:2.4rem;
  margin:0 0 10px;
  letter-spacing:.2px;
}
.hero .lead{
  font-size:1.05rem;
  color:var(--muted);
  margin:0 0 20px;
  max-width:34rem;
}
.hero-ctas{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

/* Split hero layout (overview) */
.hero-split{
  display:flex;
  align-items:stretch;
  justify-content:space-between;
  overflow:hidden;
}
.hero-main{
  position:relative;
  z-index:2;
  flex:2;
  min-width:0;
}
.hero-aside{
  position:relative;
  z-index:2;
  flex:1.4;
  min-width:260px;
  margin-left:32px;
  display:flex;
  flex-direction:column;
  gap:16px;
  align-items:flex-end;
}
.hero-overline{
  font-size:.78rem;
  font-weight:500;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:#94a3b8;
}
.hero-split .hero-ctas{
  margin-top:18px;
}

/* Inline logo row */
.hero-logo-inline{
  display:flex;
  align-items:center;
  gap:.9rem;
  margin-bottom:.9rem;
}
.hero-logo-inline-img{
  width:76px;
  height:76px;
  border-radius:12px;
  object-fit:contain;
  background:#fff;
  padding:6px;
  box-shadow:0 10px 30px rgba(15,23,42,0.22);
  border:1px solid rgba(148,163,184,0.45);
}
.hero-logo-inline-text{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.hero-logo-inline-title{
  font-size:.78rem;
  font-weight:700;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:#0f172a;
}


/* 1018 badge + stats */
.hero-1018-pill{
  background:#b91c1c;
  color:#fef2f2;
  padding:10px 16px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  gap:10px;
  box-shadow:0 10px 30px rgba(153,27,27,0.35);
}
.hero-1018-label{
  font-size:.68rem;
  text-transform:uppercase;
  letter-spacing:.12em;
  opacity:.9;
}
.hero-1018-number{
  font-size:1.35rem;
  font-weight:800;
}
.hero-1018-badge{
  font-size:.78rem;
  font-weight:600;
  padding:3px 8px;
  border-radius:999px;
  background:#fef2f2;
  color:#b91c1c;
}
.hero-stats-grid{
  margin-top:10px;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  width:100%;
  max-width:260px;
}
.hero-stat-card{
  background:var(--navy-ink);
  color:var(--on-navy);
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(148,163,184,0.5);
  backdrop-filter:blur(10px);
  box-shadow:0 10px 30px rgba(15,23,42,0.35);
}
.hero-stat-label{
  display:block;
  font-size:.7rem;
  line-height:1.4;
  color:rgba(247,244,238,0.78);
  opacity:.9;
}
.hero-stat-value{
  display:block;
  margin-top:4px;
  font-size:1.15rem;
  font-weight:700;
}

/* Hero Logo - Left Aligned */
.hero-header-with-logo {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.hero-logo {
    max-width: 180px;
    height: auto;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
    border-radius: 12px;
    background: white;
    padding: 0.5rem;
    border: 1px solid rgba(0,0,0,0.05);
}

.hero-logo:hover {
    transform: scale(1.05);
}

.hero-text-content {
    flex: 1;
    text-align: left;
}

.hero-text-content h1 {
    margin: 0 0 0.5rem;
}

.hero-text-content .lead {
    margin: 0;
}

.hero-with-logo {
    background: linear-gradient(135deg, rgba(194, 65, 12, 0.06) 0%, rgba(15, 125, 204, 0.08) 100%),
                linear-gradient(180deg, var(--surface), transparent);
}

/* Overview hero visual (infographic as soft background) */
.overview-hero {
    position: relative;
    overflow: hidden;
}

.overview-hero-visual {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    pointer-events: none;
    opacity: 0.10;
}

.overview-hero-image {
    max-width: 640px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
}

@media (max-width: 768px) {
    .overview-hero-visual {
        justify-content: center;
        opacity: 0.14;
    }
    .overview-hero-image {
        max-width: 420px;
    }
}

/* Overview visual cards (derived from infographic) */
.overview-visual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin: 24px 0 12px;
}

/* Merged overview: 3 panels only */
.overview-merged-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 24px 0 20px;
}
@media (max-width: 900px) {
    .overview-merged-grid { grid-template-columns: 1fr; }
}
.overview-merged-card .overview-visual-text { font-size: 0.9rem; line-height: 1.6; }

/* Single merged About KLIMAKA block */
.overview-about-merged { margin: 20px 0 24px; }
.overview-about-card {
    position: relative;
    padding: 1.5rem 1.75rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}
.overview-about-card .overview-section-title {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0 0 0.35rem;
    font-size: 2.05rem;
    color: var(--navy);
}
.overview-about-kicker {
    margin: 0 0 1.6rem;
    color: var(--muted);
    font-size: 1.02rem;
}
.overview-story {
    list-style: none;
    margin: 0 0 1.75rem;
    padding: 0.5rem 0 0.35rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
}
.overview-story::before {
    content: "";
    position: absolute;
    left: 8%;
    right: 8%;
    top: 30px;
    height: 2px;
    background: linear-gradient(90deg, #F6D7B8 0%, var(--primary) 50%, #C4DCE8 100%);
    opacity: 0.9;
}
.overview-story-step {
    flex: 1 1 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-align: center;
    position: relative;
    z-index: 1;
    min-width: 88px;
}
.overview-story-node {
    min-width: 64px;
    height: 64px;
    padding: 0 0.55rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--navy);
    background: #fff;
    border: 1.5px solid var(--border);
    box-shadow: 0 0 0 8px #fff, 0 8px 18px rgba(62, 84, 127, 0.08);
}
.overview-story-node-accent {
    min-width: 72px;
    color: var(--primary);
    background: #FFF0E0;
    border-color: #F6D7B8;
    font-size: 1.05rem;
}
.overview-story-node-quiet {
    min-width: 18px;
    width: 18px;
    height: 18px;
    padding: 0;
    background: #F6D7B8;
    border-color: #F6D7B8;
    box-shadow: 0 0 0 8px #fff;
}
.overview-story-meta {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--primary);
}
.overview-story-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--navy);
    line-height: 1.25;
}
@media (max-width: 767px) {
    .overview-story::before { display: none; }
    .overview-story-node { box-shadow: 0 8px 18px rgba(62, 84, 127, 0.08); }
}
.overview-about-blocks {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
    margin-bottom: 0.5rem;
}
@media (min-width: 768px) {
    .overview-about-blocks { grid-template-columns: repeat(6, 1fr); }
    .overview-about-block-who { grid-column: span 4; flex-direction: row; align-items: flex-start; }
    .overview-about-block-helpline { grid-column: span 2; }
    .overview-about-block-units,
    .overview-about-block-services,
    .overview-about-block-training,
    .overview-about-block-mail { grid-column: span 3; }
    .overview-about-block-platform { grid-column: 1 / -1; }
}
.overview-about-block {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 1.15rem 1.2rem 1.2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid #F6D7B8;
    border-radius: 20px;
    box-shadow: 0 4px 14px rgba(62, 84, 127, 0.04);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.overview-about-block:hover {
    transform: translateY(-2px);
    border-color: #F6D7B8;
    box-shadow: 0 10px 22px rgba(62, 84, 127, 0.08);
}
.overview-about-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: #FFF0E0;
    border: 1px solid #F6D7B8;
    border-radius: 50%;
}
.overview-about-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}
.overview-about-block-content { flex: 1; min-width: 0; }
.overview-about-block-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 0.4rem;
}
.overview-about-intro {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--muted);
    margin: 0;
}
.overview-about-block .overview-about-intro { margin-top: 0; }
.overview-about-helpline-num {
    font-family: var(--font-display);
    font-size: 2.35rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.04em;
    color: #F6D7B8;
    margin: 0.1rem 0 0.4rem;
}
.overview-about-block-helpline {
    background: linear-gradient(160deg, var(--navy-ink) 0%, var(--navy) 100%);
    border-color: var(--navy-ink);
    border-left-color: #F6D7B8;
    justify-content: center;
}
.overview-about-block-helpline .overview-about-icon {
    background: rgba(255, 253, 248, 0.1);
    border-color: rgba(246, 215, 184, 0.45);
    color: #F6D7B8;
}
.overview-about-block-helpline .overview-about-block-title,
.overview-about-block-helpline .overview-about-intro {
    color: var(--on-navy);
}
.overview-about-block-helpline:hover {
    border-color: #F6D7B8;
}
.overview-about-block-platform {
    flex-direction: row;
    align-items: center;
    gap: 1.1rem;
    background: linear-gradient(135deg, #FFF0E0 0%, #EAF4FB 100%);
    border-color: #C4DCE8;
    padding: 1.2rem 1.4rem;
}
.overview-about-block-platform .overview-about-icon {
    width: 52px;
    height: 52px;
    background: #fff;
}
.overview-about-card .overview-contact-strip { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.overview-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.overview-contact-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--primary);
    display: inline-flex;
}
.overview-contact-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.overview-visual-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    background: radial-gradient(circle at 0 0, rgba(59,130,246,0.05) 0, transparent 55%),
                radial-gradient(circle at 100% 100%, rgba(14,116,144,0.05) 0, transparent 55%),
                #ffffff;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.overview-visual-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    border-color: #bfdbfe;
}

.overview-visual-icon {
    width: 72px;
    height: auto;
    margin-bottom: 0.25rem;
}

.overview-visual-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.overview-visual-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #334155;
    margin: 0;
}

@media (max-width: 768px) {
    .hero-header-with-logo {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
    }
    
    .hero-text-content {
        text-align: center;
    }
    
    .hero-logo {
        max-width: 140px;
    }
}

/* Features */
.feature-cards{ display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:16px; margin-top: 8px; }
.feature-cards .card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.feature h3{ margin:0 0 6px }
.feature .link{ color:var(--primary) }
.feature .soon{ color:#f59e0b; font-weight:600 }
.feature .lock{ color:#ef4444; font-weight:600 }

/* KLIMAKA Information & Overview blocks */
.overview-about-section { margin: 28px 0 24px; }
.overview-section-title {
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 20px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.overview-blocks {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-bottom: 20px;
}
@media (max-width: 768px) {
    .overview-blocks { grid-template-columns: 1fr; }
}
.overview-block {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.overview-block:hover {
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.1);
    border-color: #cbd5e1;
}
.overview-block-highlight {
    background: linear-gradient(135deg, #FFF0E0, #EAF4FB);
    border-color: #C4DCE8;
}
.overview-block-highlight:hover { border-color: var(--accent); }
.overview-block-title {
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 8px;
    letter-spacing: 0.02em;
}
.overview-block-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #334155;
    margin: 0;
}
.overview-contact-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-top: 4px;
}
.overview-contact-card-title {
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 12px;
}
.overview-contact-strip { margin-top: 0; }

.klimaka-info{ display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:20px; margin:24px 0 }
.klimaka-info .card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.klimaka-info h3{ color:var(--text); margin:0 0 12px; font-size:1.3rem }
.klimaka-info p{ line-height:1.6; margin:0 0 16px }
.klimaka-info ul { margin: 0 0 0 1.25rem; padding: 0; }
.info-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:12px; margin-top:16px }
.info-item{ padding:8px 12px; background:#f8fafc; border-radius:8px; font-size:0.9rem; border: 1px solid #e2e8f0 }
.info-item strong{ color:var(--text) }
.info-item a{ color:var(--primary); text-decoration:none }
.info-item a:hover{ text-decoration:underline }

/* ========================================
   MODERN EDUCATIONAL REPOSITORY STYLES
   ======================================== */

/* Hero Section */
.edu-hero {
    background:
        radial-gradient(circle at 0 0, rgba(255,128,0,0.18) 0, transparent 55%),
        radial-gradient(circle at 100% 100%, rgba(65,169,213,0.18) 0, transparent 55%),
        linear-gradient(135deg, var(--navy-ink) 0%, var(--navy) 48%, var(--accent) 100%);
    padding: 2rem 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    color: white;
}

.edu-hero-content {
    max-width: 900px;
    margin: 0 auto;
}

.edu-hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 0.75rem;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.edu-hero-subtitle {
    font-size: 1.1rem;
    text-align: center;
    margin: 0 0 2rem;
    opacity: 0.95;
    line-height: 1.6;
}

/* Search Bar */
.edu-search-bar {
    position: relative;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.edu-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.edu-search-input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 3rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.edu-search-input:focus {
    outline: none;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.edu-search-clear {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
}

.edu-search-clear:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Stats */
.edu-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.edu-stat {
    text-align: center;
}

.edu-stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.edu-stat-label {
    display: block;
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Container */
.edu-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* Sidebar */
.edu-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Upload Card */
.edu-upload-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}
.edu-upload-head {
    padding: 1rem 1rem 0.35rem;
    background:
        radial-gradient(circle at 0 0, rgba(194,65,12,0.12) 0, transparent 58%),
        linear-gradient(180deg, #fff, var(--surface));
}
.edu-upload-badge {
    display: inline-block;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 700;
}
.edu-upload-title {
    margin: 0.2rem 0 0.3rem;
    font-family: var(--font-display);
    font-size: 1.35rem;
    color: var(--navy);
}
.edu-upload-lead {
    margin: 0 0 0.5rem;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.edu-upload-toggle {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-600) 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    transition: all 0.2s;
}

.edu-upload-toggle:hover {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--navy) 100%);
}

.upload-chevron {
    transition: transform 0.3s;
}

.edu-upload-toggle[aria-expanded="true"] .upload-chevron {
    transform: rotate(180deg);
}

.edu-upload-form {
    padding: 1rem;
    background: #f9fafb;
}

.edu-upload-form .form-group {
    margin-bottom: 1rem;
}

.edu-upload-form label {
    display: block;
    font-size: 0.875rem;
  font-weight: 600;
    margin-bottom: 0.375rem;
    color: #374151;
}

.edu-upload-form input[type="file"],
.edu-upload-form select,
.edu-upload-form textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.edu-upload-form input:focus,
.edu-upload-form select:focus,
.edu-upload-form textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-upload,
.btn-cancel {
    flex: 1;
    padding: 0.625rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-upload {
    background: #3b82f6;
    color: white;
}

.btn-upload:hover {
    background: #2563eb;
}

.btn-cancel {
    background: white;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.btn-cancel:hover {
    background: #f9fafb;
}

.upload-status {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    padding: 0.5rem;
    border-radius: 6px;
    text-align: center;
}

/* Filter Groups */
.edu-filter-group {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
}

.edu-filter-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #374151;
    margin: 0 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    cursor: pointer;
    padding-right: 1rem;
}

.edu-filter-title::after {
    content: '▾';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #9ca3af;
}

.edu-filter-group.collapsed .edu-filter-title::after {
    transform: translateY(-50%) rotate(-90deg);
}

.edu-filter-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.edu-filter-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    background: transparent;
    border: 1px solid transparent;
  border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-size: 0.875rem;
    color: #374151;
}

.edu-filter-item:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
}

.edu-filter-item.active {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: var(--text);
  font-weight: 600;
}

/* "All" options use a neutral pill so they stand apart */
.edu-filter-item[data-format="all"].active,
.edu-filter-item[data-filter="all"].active,
.edu-filter-item[data-date="any"].active {
    background: #e5e7eb;
    border-color: #cbd5e1;
    color: #111827;
}

.filter-icon {
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    flex-shrink: 0;
    color: var(--navy);
    background: #FFF0E0;
    border: 1px solid #F6D7B8;
    border-radius: 999px;
    min-width: 2.5rem;
    padding: 0.15rem 0.4rem;
    text-align: center;
}

.filter-name {
    flex: 1;
}

.filter-count {
    background: #f3f4f6;
    color: #6b7280;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.edu-filter-item.active .filter-count {
    background: #dbeafe;
    color: var(--text);
}

.edu-filter-item[data-format="all"].active .filter-count,
.edu-filter-item[data-filter="all"].active .filter-count,
.edu-filter-item[data-date="any"].active .filter-count {
    background: #d1d5db;
    color: #111827;
}

/* Format-specific filter colors */
.edu-filter-item[data-format="pdf"].active {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.edu-filter-item[data-format="video"].active {
    background: #ecfdf3;
    border-color: #bbf7d0;
    color: #166534;
}

.edu-filter-item[data-format="slides"].active {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.edu-filter-item[data-format="document"].active {
    background: #f5f3ff;
    border-color: #ddd6fe;
    color: #5b21b6;
}

/* Main Content */
.edu-main {
    min-height: 500px;
}

/* Toolbar */
.edu-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.edu-results-info {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.edu-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.edu-active-filters {
    margin-top: 0.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.edu-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    background: #e5e7eb;
    color: #374151;
}

.edu-chip-query {
    background: #dbeafe;
    color: #1d4ed8;
}

.edu-chip-saved {
    background: #fef3c7;
    color: #92400e;
}

.edu-chip-collection,
.edu-chip-format,
.edu-chip-date {
    background: #f3f4f6;
    color: #374151;
}

.edu-view-toggle {
    display: flex;
    gap: 0.5rem;
    background: #f3f4f6;
    padding: 0.25rem;
    border-radius: 8px;
}

.view-btn {
    padding: 0.5rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
}

.view-btn:hover {
    background: white;
    color: #374151;
}

.view-btn.active {
    background: white;
    color: #3b82f6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Materials Grid */
.edu-materials {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.5rem;
}

.edu-materials.list-view {
    grid-template-columns: 1fr;
}

/* Material Card */
.edu-material-card,
.repo-item {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    overflow: visible;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.edu-material-card:hover,
.repo-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    border-color: #3b82f6;
}

.list-view .edu-material-card,
.list-view .repo-item {
    flex-direction: column;
}

/* Preview Section */
.material-preview,
.repo-preview {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.list-view .material-preview,
.list-view .repo-preview {
    display: none;
}

.material-preview img,
.material-preview iframe,
.repo-preview img,
.repo-preview iframe,
.embed-container iframe,
.video-thumbnail-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.material-type-badge,
.repo-type-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.075em;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    backdrop-filter: blur(4px);
    z-index: 10;
}

.material-type-badge.video,
.repo-type-badge.video {
    background: #059669;
    color: white;
}

.material-type-badge.pdf,
.repo-type-badge.pdf {
    background: #dc2626;
    color: white;
}

.material-type-badge.slides,
.repo-type-badge.slides {
    background: #2563eb;
    color: white;
}

.material-type-badge.document,
.repo-type-badge.document {
    background: #7c3aed;
    color: white;
}

.material-content,
.repo-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.material-category {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #3b82f6;
    background: #eff6ff;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    width: fit-content;
    font-weight: 600;
}

.material-title,
.repo-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.35rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.material-description,
.repo-desc {
    font-size: 1.05rem;
    color: var(--muted);
    line-height: 1.65;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.material-footer,
.repo-card-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    min-height: 3rem;
}

.material-date,
.repo-date {
    font-size: 0.8125rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Compact list-view adjustments */
.edu-materials.list-view .repo-title {
    font-size: 1.5rem;
}

.edu-materials.list-view .repo-desc {
    -webkit-line-clamp: 3;
    line-clamp: 3;
    font-size: 1.05rem;
}

.edu-materials.list-view .edu-material-card {
    padding-top: 0.25rem;
}

/* New compact card layout pieces */
.repo-card-main {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 0.9rem 1rem 0.5rem 1rem;
}

.edu-material-card-small .repo-card-main {
    padding: 0.75rem 0.75rem 0.5rem 0.75rem;
    gap: 1rem;
}

.repo-icon {
    width: 44px;
    height: 44px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    background: #FFF0E0;
    color: var(--navy);
    border: 1px solid #F6D7B8;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    z-index: 2;
}

/* Type label on top + cover under it, left of title/description */
.repo-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
    width: 168px;
}

.repo-inline-thumb {
    position: relative;
    width: 168px;
    height: 126px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    background: #f1f5f9;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.repo-inline-thumb:hover:not(:disabled) {
    border-color: #93c5fd;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.15);
    transform: translateY(-1px);
}

.repo-inline-thumb:disabled {
    cursor: default;
    opacity: 0.9;
}

.repo-inline-thumb-ph {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #1d4ed8;
    background: linear-gradient(145deg, #eff6ff 0%, #e2e8f0 100%);
    z-index: 0;
}

.repo-inline-thumb-ph.format-pdf { color: #b91c1c; background: linear-gradient(145deg, #fef2f2, #fee2e2); }
.repo-inline-thumb-ph.format-video { color: #166534; background: linear-gradient(145deg, #ecfdf3, #d1fae5); }
.repo-inline-thumb-ph.format-slides { color: #1d4ed8; background: linear-gradient(145deg, #eff6ff, #dbeafe); }
.repo-inline-thumb-ph.format-document { color: #5b21b6; background: linear-gradient(145deg, #f5f3ff, #ede9fe); }
.repo-inline-thumb-ph.format-audio { color: #86198f; background: linear-gradient(145deg, #fdf4ff, #f5d0fe); }
.repo-inline-thumb-ph.format-image { color: #0F7DCC; background: linear-gradient(145deg, #eff9ff, #dbeafe); }

.repo-inline-thumb-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.2s ease;
    background: transparent;
}

.repo-inline-thumb-img.is-loaded {
    opacity: 1;
}

.edu-material-card-small .repo-left {
    width: 132px;
}

.edu-material-card-small .repo-inline-thumb {
    width: 132px;
    height: 99px;
    border-radius: 12px;
}

@media (max-width: 640px) {
    .repo-left {
        width: 120px;
    }
    .repo-inline-thumb {
        width: 120px;
        height: 90px;
    }
    .repo-card-main {
        gap: 0.9rem;
    }
}

.repo-text {
    flex: 1;
    min-width: 0;
}

.repo-meta {
    font-size: 0.8125rem;
    color: #6b7280;
}

.edu-meta-chips {
    margin: 0.35rem 0 0.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.edu-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    font-size: 0.72rem;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #4b5563;
}

.edu-chip-level {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.edu-chip-audience {
    border-color: #bbf7d0;
    background: #ecfdf3;
    color: #166534;
}

.edu-chip-focus {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #c2410c;
}

.edu-chip-core {
    border-color: #facc15;
    background: #fef9c3;
    color: #854d0e;
}

.edu-chip-supplementary {
    border-style: dashed;
}

.edu-chip-sensitivity {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.edu-chip-supervision {
    border-color: #a5b4fc;
    background: #eef2ff;
    color: #3730a3;
}

.edu-social-proof {
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: #6b7280;
}

.edu-social-quote {
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: #4b5563;
    font-style: italic;
}

.repo-analytics {
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: #6b7280;
}

.edu-save-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0.2rem;
    margin-right: 0.25rem;
    color: #9ca3af;
    transition: color 0.2s ease, transform 0.15s ease;
    border-radius: 4px;
}

.edu-save-btn .edu-save-icon {
    font-size: 1.15rem;
    display: inline-block;
    line-height: 1;
}

.edu-save-btn:hover:not(.is-disabled) {
    color: var(--primary);
    transform: translateY(-1px);
}

.edu-save-btn.is-saved,
.edu-save-btn.is-saved .edu-save-icon {
    color: var(--primary);
}
.edu-save-btn.is-saved .edu-save-icon {
    fill: var(--primary);
}

.edu-save-btn.is-disabled {
    cursor: default;
    opacity: 0.6;
}

.edu-saved-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    padding: 0.35rem 0.75rem;
    background: #f9fafb;
    color: #6b7280;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.edu-saved-toggle .edu-saved-icon {
    color: #9ca3af;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.edu-saved-toggle:hover {
    border-color: #eab308;
    color: #1f2937;
}

.edu-saved-toggle:hover .edu-saved-icon {
    color: #eab308;
}

.edu-saved-toggle.is-active {
    border-color: #eab308;
    background: #fefce8;
    color: #1f2937;
}

.edu-saved-toggle.is-active .edu-saved-icon,
.edu-saved-toggle[data-active="true"] .edu-saved-icon {
    color: #eab308;
}

.edu-saved-toggle.is-active,
.edu-saved-toggle[data-active="true"] {
    background: #fefce8;
    border-color: #eab308;
    color: #1f2937;
}

.repo-actions-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.25rem 1rem 0.5rem 1rem;
    border-top: 1px solid #f1f5f9;
}

/* Color-coding for file format icons — solid chips (match filter pills) */
.repo-icon.format-pdf {
    background: #dc2626;
    color: #fff;
    border-color: #b91c1c;
}

.repo-icon.format-video {
    background: #059669;
    color: #fff;
    border-color: #047857;
}

.repo-icon.format-slides {
    background: #2563eb;
    color: #fff;
    border-color: #1d4ed8;
}

.repo-icon.format-document {
    background: #7c3aed;
    color: #fff;
    border-color: #6d28d9;
}

.repo-icon.format-audio {
    background: #fdf2ff;
    color: #86198f;
}

/* Video Play Overlay */
.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    pointer-events: none;
}

.video-thumbnail-preview:hover .video-play-overlay {
    background: rgba(59, 130, 246, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-thumbnail-preview {
    cursor: pointer;
    position: relative;
    width: 100%;
    height: 100%;
}

.material-actions {
    display: flex;
    gap: 0.5rem;
}

.material-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.material-btn.primary {
    background: #3b82f6;
    color: white;
    border: none;
}

.material-btn.primary:hover {
    background: #2563eb;
}

.material-btn.secondary {
    background: white;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.material-btn.secondary:hover {
    background: #f9fafb;
}

.material-btn.danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.material-btn.danger:hover {
    background: #fee2e2;
}

/* Empty State */
.edu-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #94a3b8;
}

.empty-icon {
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.edu-empty h3 {
    font-size: 1.25rem;
    color: #64748b;
    margin: 0 0 0.5rem;
}

.edu-empty p {
    font-size: 0.875rem;
    color: #94a3b8;
    margin: 0;
}

/* Loading State */
.edu-loading {
    text-align: center;
    padding: 4rem 2rem;
}

.loader {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.edu-loading p {
    color: #94a3b8;
    font-size: 0.875rem;
}

/* Embed Containers */
.embed-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: #f9fafb;
}

.embed-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #9ca3af;
    font-size: 0.875rem;
}

.preview-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    color: #6b7280;
}

/* Repo Actions Menu */
.repo-actions-menu {
    position: relative;
}

.repo-menu-trigger {
    background: rgba(255,255,255,0.9);
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.repo-menu-trigger:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.repo-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 180px;
    z-index: 100;
    display: none;
}

.repo-menu-dropdown.active {
    display: block;
}

/* Editors’ picks row */
.edu-editors-row {
    margin-bottom: 1.5rem;
    padding: 1rem 0 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.edu-editors-header h3 {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
}

.edu-editors-header p {
    margin: 0;
    font-size: 0.8rem;
    color: #6b7280;
}

.edu-editors-scroller {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.edu-editors-scroller::-webkit-scrollbar {
    height: 6px;
}

.edu-editors-scroller::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 999px;
}

/* Search history dropdown */
.edu-search-history-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 0.25rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    z-index: 30;
    padding: 0.25rem 0;
}

.edu-search-history-item {
    width: 100%;
    padding: 0.4rem 0.75rem;
    text-align: left;
    background: transparent;
    border: none;
    font-size: 0.85rem;
    color: #374151;
    cursor: pointer;
}

.edu-search-history-item:hover {
    background: #f3f4f6;
}

/* ------------------------------------------------------------------ */
/* Education reviews (stars, comments, tags)                          */
/* ------------------------------------------------------------------ */

.repo-feedback {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border, #e5e7eb);
    font-size: 0.875rem;
}

.review-summary-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.review-summary-stars {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.review-summary-text {
    color: var(--muted, #6b7280);
    font-size: 0.8rem;
}

.edu-star {
    font-size: 1rem;
    color: #d1d5db;
}

.edu-star.filled {
    color: #fbbf24;
}

.repo-feedback-inline-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.review-cta-btn,
.review-toggle-list {
    border: none;
    background: transparent;
    color: #2563eb;
    font-size: 0.8rem;
    padding: 0;
    cursor: pointer;
}

.review-cta-btn:hover,
.review-toggle-list:hover {
    text-decoration: underline;
}

.review-actions-inline {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.15rem;
    margin-bottom: 0.25rem;
}

.review-form {
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.review-rating-input,
.review-comment-input,
.review-tags-input {
    margin-bottom: 0.5rem;
}

.review-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 0.25rem;
}

.review-stars-input {
    display: inline-flex;
    gap: 0.15rem;
}

.edu-star-input {
    border: none;
    background: transparent;
    font-size: 1.2rem;
    cursor: pointer;
    color: #d1d5db;
    padding: 0 0.05rem;
}

.edu-star-input.selected {
    color: #fbbf24;
}

.review-comment-input textarea {
    width: 100%;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    resize: vertical;
}

.review-comment-input textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.review-tags-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.review-tag-chip {
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 0.15rem 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
    color: #4b5563;
}

.review-tag-chip.selected {
    background: #e0f2fe;
    border-color: #38bdf8;
    color: #0369a1;
}

.review-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.review-status {
    font-size: 0.75rem;
    color: #6b7280;
}

.review-list {
    margin-top: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    max-height: 260px;
    overflow-y: auto;
    padding: 0.5rem 0.75rem;
}

.review-loading,
.review-empty,
.review-error {
    font-size: 0.8rem;
    color: #6b7280;
}

.review-item {
    padding: 0.35rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.review-item:last-child {
    border-bottom: none;
}

.review-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.15rem;
}

.review-item-stars {
    display: inline-flex;
    gap: 0.05rem;
}

.review-item-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: #9ca3af;
}

.review-item-author {
    font-weight: 600;
    color: #4b5563;
}

.review-item-dot {
    font-size: 0.7rem;
}

.review-item-comment {
    font-size: 0.8rem;
    color: #4b5563;
}

.review-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    margin-bottom: 0.15rem;
}

.review-tag-pill {
    font-size: 0.7rem;
    border-radius: 999px;
    background: #e5e7eb;
    color: #374151;
    padding: 0.05rem 0.4rem;
}

.review-user-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.5rem;
}

.review-user-input {
    width: 100%;
    border-radius: 0.375rem;
    border: 1px solid #d4d4d8;
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
}

.review-user-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.18);
}

.review-add-tag {
    margin-top: 0.35rem;
}

.review-custom-tag-input {
    width: 100%;
    border-radius: 999px;
    border: 1px dashed #d4d4d8;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    color: #4b5563;
}

.review-custom-tag-input::placeholder {
    color: #9ca3af;
}

.review-custom-tag-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

/* Overview partners strip — sliding logo carousel */
.overview-partners {
    margin: 2.25rem auto 0 auto;
    max-width: 100%;
    padding-inline: 0.5rem;
}

.overview-partners-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.overview-partners-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
}

.overview-partners-subtitle {
    font-size: 0.78rem;
    color: #6b7280;
    max-width: 640px;
}

.overview-partners-logos {
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%);
    padding: 0.5rem 0;
}

.partners-track {
    display: flex;
    align-items: center;
    gap: 2rem;
    width: max-content;
    animation: partners-scroll 45s linear infinite;
}

.partners-track:hover {
    animation-play-state: paused;
}

.partner-logo {
    flex-shrink: 0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 100px;
    padding: 0.35rem 0.5rem;
    background: transparent;
    border: none;
    box-shadow: none;
}

.partner-logo-figure {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
}

.partner-logo img {
    max-height: 40px;
    max-width: 88px;
    width: auto;
    height: auto;
    object-fit: contain;
    vertical-align: middle;
    mix-blend-mode: multiply;
}

.partner-logo-name {
    font-size: 0.7rem;
    font-weight: 500;
    color: #475569;
    text-align: center;
    line-height: 1.2;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@keyframes partners-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@media (max-width: 640px) {
    .overview-partners-logos { mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%); }
    .partner-logo { min-width: 80px; }
    .partner-logo-figure { height: 32px; }
    .partner-logo img { max-height: 32px; max-width: 72px; }
    .partner-logo-name { font-size: 0.65rem; max-width: 90px; }
    .partners-track { gap: 1.25rem; animation-duration: 35s; }
}

/* Reviews modal */
.review-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 1rem;
}

.review-modal.active {
    display: flex;
}

.review-modal-dialog {
    width: 100%;
    max-width: 640px;
    max-height: 80vh;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.review-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 60%, #2563eb 100%);
    color: #ffffff;
}

.review-modal-title {
    font-size: 1rem;
    font-weight: 600;
}

.review-modal-subtitle {
    font-size: 0.8rem;
    opacity: 0.9;
}

.review-modal-close {
    border: none;
    background: rgba(15,23,42,0.35);
    color: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
}

.review-modal-close:hover {
    background: rgba(15,23,42,0.6);
}

.review-modal-body {
    padding: 0.85rem 1.2rem 1rem 1.2rem;
    overflow-y: auto;
}

.repo-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: #374151;
    font-size: 0.875rem;
}

.repo-menu-item:hover {
    background: #f9fafb;
}

.repo-menu-item-danger {
    color: #dc2626;
}

.repo-menu-item-danger:hover {
    background: #fef2f2;
}

/* ========== AI Tools Repository (Klimaka navy / cream / terracotta) ========== */
#section-ai-tools .edu-hero-content { max-width: 920px; }
.aitools-hero .edu-hero-title { text-align: left; }
.aitools-hero .edu-hero-subtitle {
    text-align: left;
    color: rgba(247, 244, 238, 0.88);
    margin-bottom: 1.25rem;
}
.aitools-search {
    max-width: none;
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    position: relative;
}
.aitools-search-field {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}
.aitools-search-field .edu-search-icon {
    left: 0.85rem;
}
.aitools-search-field .edu-search-input {
    width: 100%;
    padding-right: 2.6rem;
}
.aitools-search-clear,
.aitools-search .aitools-search-clear {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}
.aitools-prompt-preset {
    display: block;
    width: 100%;
    margin-bottom: 0.45rem;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(247, 244, 238, 0.28);
    background: rgba(255, 253, 248, 0.14);
    color: var(--on-navy, #F7F4EE);
    font-size: 0.85rem;
}
.aitools-prompt-preset option {
    color: #111;
}
.aitools-smart-search-btn {
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(247, 244, 238, 0.35);
    background: linear-gradient(135deg, rgba(200, 169, 110, 0.35), rgba(255, 253, 248, 0.12));
    color: var(--on-navy, #F7F4EE);
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.aitools-smart-search-btn:hover:not(:disabled) {
    border-color: var(--orange, #C8A96E);
    background: linear-gradient(135deg, rgba(200, 169, 110, 0.55), rgba(255, 253, 248, 0.18));
    transform: translateY(-1px);
}
.aitools-smart-search-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}
.aitools-smart-search-hint {
    margin: 0 0 1rem;
    min-height: 1.1em;
    font-size: 0.8rem;
    color: rgba(247, 244, 238, 0.78);
}
.aitools-scan-results {
    margin-top: 0.85rem;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    background: rgba(255, 253, 248, 0.1);
    border: 1px solid rgba(200, 169, 110, 0.35);
}
.aitools-scan-results-title {
    margin: 0 0 0.55rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(247, 244, 238, 0.95);
}
.aitools-scan-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 220px;
    overflow-y: auto;
}
.aitools-scan-results-list li {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: rgba(247, 244, 238, 0.9);
}
.aitools-scan-badge {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
}
.aitools-scan-badge-added {
    background: rgba(72, 187, 120, 0.28);
    color: #b8f0cd;
}
.aitools-scan-badge-updated {
    background: rgba(200, 169, 110, 0.3);
    color: #f0e0b8;
}
.aitools-scan-results-actions {
    margin-top: 0.55rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.aitools-scan-results-actions button {
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    border: 1px solid rgba(247, 244, 238, 0.3);
    background: rgba(255, 253, 248, 0.12);
    color: rgba(247, 244, 238, 0.95);
    cursor: pointer;
}
.aitools-scan-results-actions button:hover {
    border-color: var(--orange, #C8A96E);
}
.aitools-scan-card {
    background: rgba(255, 253, 248, 0.12);
    border: 1px solid rgba(247, 244, 238, 0.22);
    border-radius: 16px;
    padding: 1rem 1.15rem;
    backdrop-filter: blur(6px);
}
.aitools-custom-prompt-wrap { margin-bottom: 0.75rem; }
.aitools-custom-prompt-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(247, 244, 238, 0.82);
    margin-bottom: 0.35rem;
}
.aitools-custom-prompt {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid rgba(247, 244, 238, 0.28);
    border-radius: 12px;
    background: rgba(255, 253, 248, 0.14);
    color: var(--on-navy);
    font-family: var(--font-body);
    font-size: 0.9rem;
    resize: vertical;
    min-height: 56px;
}
.aitools-custom-prompt:focus {
    outline: none;
    border-color: var(--orange);
    background: rgba(255, 253, 248, 0.22);
}
.aitools-custom-prompt::placeholder { color: rgba(247, 244, 238, 0.55); }
.aitools-custom-prompt-hint {
    display: block;
    font-size: 0.75rem;
    color: rgba(247, 244, 238, 0.72);
    margin-top: 0.35rem;
}
.aitools-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}
.aitools-actions .btn-primary {
    color: #fff;
    border-radius: 8px;
    padding: 0.55rem 1.1rem;
    font-weight: 600;
}
.aitools-actions .btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.aitools-status { font-size: 0.85rem; color: rgba(247, 244, 238, 0.82); }
.aitools-scan-progress-wrap {
    margin-top: 0.75rem;
    padding: 0.65rem 0;
}
.aitools-scan-progress-bar {
    height: 6px;
    background: rgba(247, 244, 238, 0.22);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.45rem;
}
.aitools-scan-progress-fill {
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, var(--orange), var(--primary));
    border-radius: 999px;
    animation: aitools-progress-slide 1.2s ease-in-out infinite;
}
@keyframes aitools-progress-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}
.aitools-scan-progress-text { margin: 0; font-size: 0.85rem; color: rgba(247, 244, 238, 0.9); }

.aitools-container { margin-top: 0.25rem; }
.aitools-tabs {
    display: inline-flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px;
    gap: 4px;
    margin-bottom: 1rem;
}
.aitools-tab {
    border: none;
    background: transparent;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}
.aitools-tab:hover {
    background: var(--bg2);
    color: var(--navy);
}
.aitools-tab-active {
    background: var(--navy);
    color: var(--on-navy);
}
.aitools-tab-active:hover {
    background: var(--navy-ink);
    color: var(--on-navy);
}
@media (max-width: 768px) {
    .aitools-tabs { width: 100%; justify-content: center; flex-wrap: wrap; }
    .aitools-tab { flex: 1 0 auto; text-align: center; }
    .aitools-hero .edu-hero-title,
    .aitools-hero .edu-hero-subtitle { text-align: center; }
}

.aitools-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 0.85rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}
.aitools-results-info { font-weight: 600; color: var(--navy); }
.aitools-rows-label { font-size: 0.85rem; color: var(--muted); margin-left: auto; }
.aitools-rows-label select {
    margin: 0 0.25rem;
    padding: 0.3rem 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--navy);
    font-family: var(--font-body);
}
.aitools-page-info { font-size: 0.85rem; color: var(--muted); }
.aitools-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
}
.aitools-filters select {
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--navy);
    font-size: 0.85rem;
    font-family: var(--font-body);
}
.aitools-pagination {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.5rem 0;
}
.aitools-pagination .btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--navy);
}
.aitools-pagination .btn-sm:hover { border-color: var(--navy); }

.aitools-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
}
.aitools-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.aitools-table th,
.aitools-table td {
    padding: 0.8rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.aitools-table th {
    background: var(--navy);
    color: var(--on-navy);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}
.aitools-th-sort { cursor: pointer; user-select: none; }
.aitools-th-sort:hover { background: var(--navy-ink) !important; }
.sort-indicator { font-weight: 700; margin-left: 2px; color: var(--orange); }
.aitools-table tbody tr:hover { background: #F7F2EA; }
.aitools-table tbody tr:nth-child(even) { background: #FBF8F2; }
.aitools-table tbody tr:nth-child(even):hover { background: #F7F2EA; }
.aitools-name { font-weight: 600; color: var(--navy); max-width: 180px; }
.aitools-desc { max-width: 220px; color: var(--muted); }
.aitools-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
    background: var(--bg2);
    color: var(--navy);
}
.aitools-media { background: #DCE8F5; color: var(--navy); }
.aitools-media-web_app { background: #DCE8F5; color: var(--navy); }
.aitools-media-mobile_app { background: #E4DFF0; color: var(--navy-ink); }
.aitools-media-research_paper { background: #F3E4DC; color: var(--primary-600); }
.aitools-media-article { background: #F6E8D4; color: #9A3412; }
.aitools-media-api { background: #D9EAF6; color: var(--accent); }
.aitools-media-research { background: #F3E4DC; color: var(--primary-600); }
.aitools-badge.cell-high { background: #E4EFE4; color: #1F6B3A; }
.aitools-badge.cell-medium { background: #F6E8D4; color: #9A3412; }
.aitools-badge.cell-low { background: #F4DCD8; color: var(--crisis); }
.aitools-cost { font-weight: 600; }
.aitools-cost.cost-free { color: #1F6B3A; background: #E4EFE4; padding: 0.2rem 0.4rem; border-radius: 4px; }
.aitools-cost.cost-freemium { color: #9A3412; background: #F6E8D4; padding: 0.2rem 0.4rem; border-radius: 4px; }
.aitools-cost.cost-subscription { color: var(--accent); background: #D9EAF6; padding: 0.2rem 0.4rem; border-radius: 4px; }
.aitools-pricing { color: var(--muted); font-size: 0.8rem; }
.aitools-cat { background: #DCE8F5; color: var(--navy); }
.aitools-cat-cbt { background: #DCE8F5; color: var(--navy); }
.aitools-cat-psychiatry { background: #F3E4DC; color: var(--primary-600); }
.aitools-cat-psychotherapy { background: #E4DFF0; color: var(--navy-ink); }
.aitools-cat-crisis { background: #F4DCD8; color: var(--crisis); }
.aitools-cat-assessment { background: #E4EFE4; color: #1F6B3A; }
.aitools-cat-mindfulness { background: #D9EAF6; color: var(--accent); }
.aitools-cat-dbt { background: #E4DFF0; color: var(--navy-ink); }
.aitools-cat-suicide_prevention,
.aitools-cat-suicide-prevention { background: #F4DCD8; color: var(--crisis); }
.aitools-cat-research { background: #F3E4DC; color: var(--primary-600); }
.aitools-cat-other { background: var(--bg2); color: var(--muted); }
.aitools-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}
.aitools-link:hover { color: var(--primary-600); text-decoration: underline; }
.aitools-date { white-space: nowrap; font-size: 0.8rem; color: var(--muted); }
.aitools-empty {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 16px;
    color: var(--muted);
}
.aitools-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .edu-container {
        grid-template-columns: 1fr;
    }
    
    .edu-sidebar {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .edu-filter-group {
        min-width: 250px;
    }
    
    .edu-materials {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .edu-hero-title {
        font-size: 2rem;
    }
    
    .edu-stats {
        gap: 1.5rem;
    }
    
    .edu-materials {
        grid-template-columns: 1fr;
    }
    
    .list-view .material-preview,
    .list-view .repo-preview {
    width: 100%;
        height: 250px;
    }
    
    .list-view .edu-material-card,
    .list-view .repo-item {
        flex-direction: column;
    }
    
    .material-preview,
    .repo-preview {
        height: 220px;
    }
}

/* Preview Modal */
.preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.preview-modal.active {
    display: flex;
}

.preview-content {
    background: white;
    border-radius: 12px;
    width: 85vw;
    height: 80vh;
    max-width: 1000px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.preview-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a202c;
}

.preview-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.preview-close:hover {
    background: #f3f4f6;
    color: #1a202c;
}

.preview-body {
    flex: 1;
    overflow: hidden;
    padding: 0.5rem;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.preview-iframe {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: none;
    border-radius: 8px;
    flex: 1;
}

.preview-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    justify-content: flex-end;
}

.preview-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-btn.primary {
    background: #3b82f6;
    color: white;
    border: none;
}

.preview-btn.primary:hover {
    background: #2563eb;
}

.preview-btn.secondary {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #e5e7eb;
}

.preview-btn.secondary:hover {
    background: #e5e7eb;
}

/* Chatbot Layout */
#section-chatbot.section.is-active {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 72px);
    max-height: calc(100vh - 72px);
    min-height: 0;
    padding-bottom: 0;
    overflow: hidden;
}
.chatbot-page-head {
    flex: 0 0 auto;
}
.chatbot-page-head h2 {
    margin: 0 0 0.4rem;
}
.chat-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 0.9rem;
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
}

.chat-side {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.chat-title {
    font-size: 1rem;
    font-weight: 650;
    color: var(--navy);
    padding-bottom: 0;
    border-bottom: none;
}

.chat-prompts {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.prompt-heading {
    font-size: 0.72rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem;
}

.chip.prompt {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.4rem 0.6rem;
    text-align: left;
    font-size: 0.8rem;
    line-height: 1.3;
    cursor: pointer;
    white-space: normal;
    word-break: break-word;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.chip.prompt:hover {
    background: #fff7ed;
    border-color: var(--primary);
    color: var(--navy);
}

.chat-main {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.chat-mode-hint {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: var(--muted);
    max-width: 42rem;
}
.chat-patient-ctx {
    margin-bottom: 0;
    padding: 0.65rem 0.7rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.chat-patient-ctx-note {
    margin: 0.35rem 0 0.7rem;
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.45;
}
.chat-patient-ctx-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    margin: 0.45rem 0 0.2rem;
}
.chat-session-actions {
    display: flex;
    gap: 0.4rem;
    margin: 0.55rem 0 0.4rem;
}
.chat-session-list {
    max-height: 160px;
    overflow-y: auto;
    font-size: 0.8rem;
}
.chat-session-row {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.28rem 0;
    color: #0f172a;
}
.chat-session-row input { margin-top: 0.15rem; }
.chat-session-empty { color: #64748b; font-size: 0.78rem; padding: 0.25rem 0; }
#section-chatbot.is-rag .chat-patient-ctx { display: none; }
.chat-mode-tabs { margin-bottom: 0.75rem; }
.chat-passages {
    margin-top: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.chat-passages-heading {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--navy);
    font-weight: 600;
}
.chat-passage-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
}
.chat-passage-title {
    font-weight: 650;
    color: var(--navy);
    font-size: 0.95rem;
}
.chat-passage-meta {
    margin-top: 0.2rem;
    font-size: 0.75rem;
    color: var(--muted);
}
.chat-passage-text {
    margin: 0.45rem 0 0;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text);
}
.chat-passage-link {
    display: inline-block;
    margin-top: 0.45rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}
.chat-passage-link:hover { text-decoration: underline; }

.rag-panel {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0.85rem 1rem;
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 12px;
}
.rag-panel-kicker {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 700;
}
.rag-panel-title {
    margin: 0.2rem 0 0.85rem;
    font-weight: 650;
    color: var(--navy);
}
.rag-results { display: flex; flex-direction: column; gap: 0.7rem; }
.rag-empty { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.rag-safety {
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--primary);
    background: var(--surface);
    color: var(--navy);
    font-weight: 600;
    font-size: 0.875rem;
}
.rag-hit-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.rag-hit-rank { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.rag-score-badge {
    background: var(--navy);
    color: var(--on-navy, #F7F4EE);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}
#section-chatbot.is-rag #chat-messages,
.chat-messages[hidden] {
    display: none !important;
}
.rag-hl {
    background: #F4D58D;
    color: #111111;
    padding: 0 0.12em;
    border-radius: 3px;
    font-weight: 650;
}
.rag-topk-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 650;
    color: var(--navy);
    white-space: nowrap;
}
.rag-topk-wrap[hidden] { display: none !important; }
.rag-topk-wrap select {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.35rem 0.45rem;
    background: #fff;
    color: var(--navy);
    font-weight: 650;
}
.chat-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}
.chat-confirm-overlay[hidden] { display: none !important; }
.chat-confirm-dialog {
    width: min(420px, 100%);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.15rem 1.2rem 1rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}
.chat-confirm-dialog h3 {
    margin: 0 0 0.4rem;
    font-size: 1.15rem;
    color: var(--navy);
}
.chat-confirm-dialog p {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}
.chat-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
}
.chat-confirm-danger {
    background: #b42318 !important;
    border-color: #b42318 !important;
    color: #fff !important;
}

.chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.msg {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    max-width: 85%;
    line-height: 1.6;
}

.msg.sys {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: var(--text);
    align-self: flex-start;
}

.msg.tip {
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
    align-self: flex-start;
    font-size: 0.9375rem;
}

.msg.user {
    background: #3b82f6;
    color: white;
    align-self: flex-end;
}

.msg.assistant {
    background: white;
    border: 1px solid #e5e7eb;
    color: #1f2937;
    align-self: flex-start;
}

.chat-input {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.chat-input input {
    flex: 1;
}

.chat-shell {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 0;
    padding: 0.85rem;
    overflow: hidden;
}
.chat-side-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.chat-new-btn {
    padding: 0.28rem 0.65rem;
    font-size: 0.74rem;
    font-weight: 700;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
.chat-new-btn:hover {
    filter: brightness(1.05);
}
.chat-new-btn-main {
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
}
.chat-history-item.is-active {
    border-color: var(--primary);
    background: #fff7ed;
    box-shadow: inset 0 0 0 1px rgba(194, 65, 12, 0.18);
}
.chat-history-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.65rem 0.7rem;
    flex: 0 0 auto;
}
.chat-history-list {
    max-height: 148px;
    overflow-y: auto;
}
.chat-history-empty {
    padding: 0.4rem;
    color: var(--muted);
    font-size: 0.8rem;
    text-align: center;
}
.chat-history-item {
    padding: 0.45rem 0.5rem;
    margin-bottom: 0.35rem;
    background: #f8fafc;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid var(--border);
}
.chat-history-item:hover {
    border-color: var(--primary);
    background: #fff7ed;
}
.chat-history-title {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--navy);
}
.chat-history-preview {
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 0.12rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.chat-history-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.3rem;
    font-size: 0.68rem;
    color: #9ca3af;
}
.delete-chat-btn {
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.12rem 0.35rem;
    cursor: pointer;
    font-size: 0.68rem;
}
.chat-prompt-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.chat-side-note {
    margin-top: 0;
    font-size: 0.72rem;
    line-height: 1.4;
}
.chat-side .patient-combo,
.chat-side .patient-combo-trigger,
.chat-side .patient-combo-label {
    max-width: 100%;
    min-width: 0;
}
.chat-side .patient-combo-label,
.chat-side .patient-combo-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}
.chat-composer-box .rag-topk-wrap {
    padding-right: 0.35rem;
    border-right: 1px solid var(--border);
    margin-right: 0.15rem;
}
.rag-loading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.35rem 0.15rem;
}
.rag-side-help .chip.prompt {
    width: 100%;
}
.chat-main-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex: 0 0 auto;
}
.medical-evidence-toggle {
    padding: 0.55rem 0.65rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.medical-evidence-toggle label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}
.medical-evidence-toggle small {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.35;
}
.chat-composer {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 0 0 auto;
    margin-top: auto;
}
.chat-composer-box {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    padding: 0.35rem 0.35rem 0.35rem 0.85rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(62, 84, 127, 0.06);
    width: 100%;
    box-sizing: border-box;
}
.chat-composer-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(200, 169, 110, 0.18);
}
.chat-composer-box input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.95rem;
    padding: 0.55rem 0.2rem;
    color: var(--navy);
}
.chat-send-btn {
    border-radius: 999px !important;
    padding: 0.55rem 1.1rem !important;
    min-width: 5.5rem;
    flex-shrink: 0;
}
.chat-typing {
    display: inline-flex;
    gap: 0.28rem;
    align-items: center;
    height: 1.1rem;
}
.chat-typing span {
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 50%;
    background: var(--navy);
    opacity: 0.35;
    animation: chat-typing-dot 1s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
.chat-typing-label {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: var(--muted);
}
@keyframes chat-typing-dot {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.3; }
    40% { transform: translateY(-3px); opacity: 1; }
}
.msg.is-typing { max-width: 12rem; }
.rag-side-help {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
#section-chatbot.is-rag .chat-prompts {
    order: -1;
}
#section-chatbot.is-rag .chat-messages { display: none !important; }
#section-chatbot.is-rag .chat-main { min-height: 0; }

@media (max-width: 980px) {
    .chat-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(420px, 1fr);
    }
    #section-chatbot.is-rag .chat-layout {
        grid-template-columns: 1fr;
    }
    .chat-side {
        max-height: 280px;
    }
    .chat-messages {
        min-height: 320px;
    }
}

/* Questionnaire System */
.questionnaire-header {
    background: linear-gradient(135deg, #eff6ff 0%, #f3f4f6 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.questionnaire-header h3 {
    margin: 0 0 1rem;
    color: #1a202c;
}

.questionnaire-header ol {
    margin: 0;
    padding-left: 1.5rem;
    line-height: 2;
}

.q-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.q-section h4 {
    margin: 0 0 1rem;
    color: #1a202c;
    font-size: 1.125rem;
}

.q-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.q-form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9375rem;
}

.q-select, .q-input {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
}

.q-select:focus, .q-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.q-select:disabled {
    background: #f9fafb;
    cursor: not-allowed;
}

.q-stats {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.q-stat-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    flex: 1;
}

.q-stat-label {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.q-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
}

.q-notes-card {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 1rem;
}

.q-notes-content {
    color: #92400e;
    line-height: 1.7;
}

.q-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.q-category-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem;
    transition: all 0.2s;
}

.q-category-card:has(.q-category-checkbox:checked) {
    border-color: #3b82f6;
    background: #eff6ff;
}

.q-category-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.q-category-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.q-category-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    flex: 1;
    font-weight: 600;
}

.q-category-icon {
    font-size: 1.5rem;
}

.q-category-name {
    color: #1a202c;
}

.q-category-questions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.q-questions-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.q-questions-select {
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.q-actions {
    display: flex;
    justify-content: center;
    padding-top: 1rem;
}

.q-questionnaire-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.q-questionnaire-header h4 {
    margin: 0;
}

.q-questionnaire-actions {
    display: flex;
    gap: 0.75rem;
}

.q-questionnaire-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.q-questionnaire-category {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
}

.q-category-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #3b82f6;
    font-size: 1.125rem;
}

.q-question-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: white;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.q-question-number {
    font-weight: 700;
    color: #3b82f6;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.q-question-content {
    flex: 1;
}

.q-question-text {
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.q-scale {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.q-scale-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s;
    flex: 1;
}

.q-scale-option:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.q-scale-option:has(input:checked) {
    border-color: #3b82f6;
    background: #3b82f6;
    color: white;
}

.q-scale-option input {
    display: none;
}

.q-scale-option span {
    font-weight: 700;
    font-size: 1.125rem;
}

.q-scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #6b7280;
}

.q-choices {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.q-choice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.q-choice:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.q-choice:has(input:checked) {
    border-color: #3b82f6;
    background: #eff6ff;
}

.q-choice input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.q-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: all 0.2s;
}

.q-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.q-prompt-display {
    margin-top: 1rem;
}

.q-prompt-box {
    background: #fffbeb;
    border: 2px solid #fbbf24;
    border-radius: 10px;
    padding: 1.25rem;
}

.q-prompt-box strong {
    display: block;
    margin-bottom: 0.75rem;
    color: #92400e;
    font-size: 1.0625rem;
}

.q-prompt-text {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #374151;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
    margin: 0;
    font-family: inherit;
}

@media (max-width: 768px) {
    .q-categories-grid {
        grid-template-columns: 1fr;
    }
    
    .q-stats {
        flex-direction: column;
    }
    
    .q-questionnaire-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .q-questionnaire-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .q-scale {
        flex-wrap: wrap;
    }
    
    .q-prompt-text {
        font-size: 0.875rem;
        max-height: 300px;
    }
}

/* Footer Styling — one fused block, not a pinned dock */
.app-footer {
    background: var(--navy);
    border-top: 3px solid var(--orange);
    padding: 1.5rem 1.5rem 1.1rem;
    margin-top: 0;
    color: rgba(247,244,238,0.78);
}
.footer-fused {
    max-width: 1200px;
    margin: 0 auto;
}
.footer-fused .footer-container {
    gap: 1.25rem 2rem;
    margin-bottom: 0.9rem;
    grid-template-columns: minmax(180px, 1.2fr) minmax(160px, 0.9fr) minmax(180px, 1fr);
}
.footer-fused .footer-section {
    gap: 0.35rem;
}
.footer-fused .footer-section h4 {
    margin: 0 0 0.2rem;
    font-size: 0.72rem;
}
.footer-fused .footer-section a,
.footer-fused .footer-contact,
.footer-fused .footer-description {
    font-size: 0.78rem;
    line-height: 1.45;
}
.footer-fused .footer-logo {
    height: 28px;
    max-width: 110px;
    margin-bottom: 0.35rem;
}
.footer-contact .footer-dock-crisis {
    align-self: flex-start;
    margin: 0.15rem 0 0.35rem;
}
.footer-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(247,244,238,0.16);
}
.footer-bottom-line {
    margin: 0;
    font-size: 0.72rem;
    color: rgba(247,244,238,0.55);
    flex: 1 1 auto;
}
.footer-dock-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--on-navy);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
}
.footer-logo-dock {
    height: 28px;
    max-width: 96px;
    margin: 0;
}
.footer-dock-crisis {
    background: var(--orange);
    color: #fff !important;
    font-weight: 800;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    text-decoration: none;
    white-space: nowrap;
}
.footer-dock-crisis:hover { color: #fff !important; filter: brightness(1.05); }
.footer-faq-link {
    color: var(--orange);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.footer-faq-link:hover { text-decoration: underline; }
.footer-dock-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    flex: 1 1 auto;
}
.footer-dock-nav a {
    color: rgba(247,244,238,0.92);
    font-size: 0.82rem;
    font-weight: 600;
}
.footer-dock-nav a[href="/faq"] {
    color: var(--orange);
}
.footer-dock-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.65rem;
}
.footer-dock-legal .footer-legal-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: rgba(247,244,238,0.7);
    font-size: 0.75rem;
    cursor: pointer;
}
.footer-dock-legal .footer-legal-btn:hover { color: var(--orange); }

/* STT live — page scroll + voice meter */
.stt-page-progress {
  position: sticky;
  top: 0.6rem;
  z-index: 8;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.9rem 0.8rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 2px rgba(62, 84, 127, 0.06);
}
.stt-page-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}
#page-progress-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--navy);
  margin: 0;
}
.stt-page-progress-track {
  height: 8px;
  background: var(--bg2);
  border-radius: 999px;
  overflow: hidden;
}
#page-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--navy) 0%, var(--orange) 100%);
  border-radius: 999px;
  transition: width 0.2s ease;
}
.stt-live-meter-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}
.stt-live-meter-card .stt-live-meter-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.stt-live-meter {
  height: 14px;
  background: var(--bg2);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}
.stt-live-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--navy) 0%, var(--orange) 72%, var(--crisis) 100%);
  border-radius: 999px;
  transition: width 0.1s ease-out;
}
.stt-live-meter-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--navy);
  z-index: 1;
  pointer-events: none;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-section h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--on-navy);
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-section a {
    color: rgba(247,244,238,0.78);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: var(--orange);
}

.footer-logo {
    width: auto;
    height: 40px;
    max-width: 140px;
    object-fit: contain;
    object-position: left center;
    display: block;
    margin-bottom: 0.75rem;
}

.footer-section .footer-legal-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    text-align: left;
    color: rgba(247,244,238,0.78);
    transition: color 0.2s;
}

.footer-section .footer-legal-btn:hover {
    color: var(--orange);
}

.footer-description {
    font-size: 0.875rem;
    line-height: 1.6;
    color: rgba(247,244,238,0.78);
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(247,244,238,0.22);
    font-size: 0.8125rem;
    color: rgba(247,244,238,0.72);
}

.footer-bottom a {
    color: var(--orange);
    text-decoration: none;
}

.footer-bottom a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .app-footer {
        padding: 2rem 1rem 1.5rem;
    }
}

/* Searchable patient picker — matches Bootstrap .form-select (white field, not gray button) */
.patient-combo {
  position: relative;
  width: 100%;
  z-index: 1;
}

.patient-combo.open {
  z-index: 1050;
}

.patient-combo.disabled {
  opacity: 0.65;
  pointer-events: none;
}

.patient-combo > select.patient-combobox-native {
  display: none !important;
}

/* Same look as native <select class="form-select"> */
.patient-combo-trigger {
  display: block;
  width: 100%;
  padding: 0.375rem 2.25rem 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.patient-combo-trigger:hover:not(.is-disabled) {
  border-color: #86b7fe;
}

.patient-combo.open .patient-combo-trigger {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.patient-combo-trigger.is-disabled {
  cursor: not-allowed;
  background-color: #e9ecef;
  opacity: 1;
}

.patient-combo-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: transparent;
  color: inherit;
}

.patient-combo-label.placeholder {
  color: #6c757d;
}

.patient-combo-menu {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 1051;
  display: flex;
  flex-direction: column;
  max-height: 300px;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.patient-combo-menu[hidden] {
  display: none !important;
}

.patient-combo-search-wrap {
  padding: 0.5rem;
  border-bottom: 1px solid #dee2e6;
  background: #fff;
  flex-shrink: 0;
}

.patient-combo-search {
  margin: 0;
  border-radius: 0.35rem;
  font-size: 0.95rem;
}

.patient-combo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.patient-combo-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  margin: 0;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #212529;
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  transition: background-color 0.12s ease;
}

.patient-combo-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patient-combo-count {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.patient-combo-item:last-child {
  border-bottom: none;
}

.patient-combo-item:hover,
.patient-combo-item.is-hover {
  background-color: #e9ecef;
  color: #212529;
}

.patient-combo-item.selected {
  background-color: #e7f1ff;
  color: #0a58ca;
  font-weight: 500;
}

.patient-combo-item.selected:hover,
.patient-combo-item.selected.is-hover {
  background-color: #cfe2ff;
  color: #084298;
}

.patient-combo-item-new {
  color: #0d6efd;
  font-weight: 600;
  border-bottom: 1px solid #dee2e6;
}

.patient-combo-empty {
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  color: #6c757d;
  font-style: italic;
  cursor: default;
  background: #fff;
  border-bottom: none;
}

.patient-loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 0.35rem;
}

.patient-combo.is-loading .patient-combo-trigger {
  color: #6c757d;
}

.q-form-group .patient-combo-trigger {
  border-radius: 8px;
  border-color: #e5e7eb;
  padding: 0.75rem 2.25rem 0.75rem 0.75rem;
}

.q-form-group .patient-combo-trigger:hover:not(.is-disabled) {
  border-color: #3b82f6;
}

.q-form-group .patient-combo.open .patient-combo-trigger {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.card .card-body:has(.patient-combo.open) {
  overflow: visible;
}

/* Platform journal card (overview) */
.platform-journal {
  margin: 1.5rem 0 2rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid #c7d2fe;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 55%, #faf5ff 100%);
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.08);
  position: relative;
}

.platform-journal-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.platform-journal-header h3 {
  margin: 0;
  flex: 1;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
}

.platform-journal-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1d4ed8;
  background: #dbeafe;
  border-radius: 999px;
  flex-shrink: 0;
}

.platform-journal-close {
  border: none;
  background: rgba(255, 255, 255, 0.8);
  color: #64748b;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}

.platform-journal-close:hover {
  background: #fff;
  color: #0f172a;
}

.platform-journal-lead {
  margin: 0 0 0.75rem;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.55;
}

.platform-journal-preview {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: #334155;
  font-size: 0.92rem;
  line-height: 1.6;
}

.platform-journal-preview li {
  margin-bottom: 0.35rem;
}

.platform-journal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.platform-journal-actions .btn-link-legal {
  font-size: 0.85rem;
  color: #64748b;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

.platform-journal-actions .btn-link-legal:hover {
  color: #2563eb;
}

/* Legal / journal modal */
.legal-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(15, 23, 42, 0.55);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.legal-modal.active {
  display: flex;
}

body.legal-modal-open {
  overflow: hidden;
}

.legal-modal-panel {
  background: #fff;
  border-radius: 14px;
  width: min(720px, 100%);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
  border: 1px solid #e2e8f0;
}

.legal-modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.legal-modal-header h3 {
  margin: 0;
  flex: 1;
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
}

.legal-modal-close {
  border: none;
  background: #f1f5f9;
  color: #64748b;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.legal-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.legal-modal-updated {
  padding: 0.5rem 1.35rem 0;
  font-size: 0.8rem;
  color: #64748b;
  flex-shrink: 0;
}

.legal-modal-body {
  padding: 1rem 1.35rem 1.35rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  font-size: 0.94rem;
  line-height: 1.65;
  color: #334155;
}
@media (max-width: 600px) {
  .legal-modal {
    padding: 0;
    align-items: flex-end;
  }
  .legal-modal-panel {
    width: 100%;
    max-height: min(92dvh, 900px);
    border-radius: 16px 16px 0 0;
  }
}

.legal-section {
  margin-bottom: 1.25rem;
}

.legal-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.5rem;
}

.legal-section p {
  margin: 0 0 0.5rem;
}

.legal-list {
  margin: 0.35rem 0 0;
  padding-left: 1.25rem;
}

.legal-list li {
  margin-bottom: 0.35rem;
}

.legal-intro {
  margin: 0 0 1rem;
  color: #475569;
}

.journal-week {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.journal-week:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.journal-week-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.journal-week-label {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}

.journal-week-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
}

.journal-week-items {
  margin: 0;
  padding-left: 1.2rem;
}

.journal-week-items li {
  margin-bottom: 0.35rem;
}
.journal-week-items li.is-highlight {
  background: #fff7ed;
  border-left: 3px solid #C2410C;
  padding: 0.45rem 0.65rem;
  margin-left: -0.65rem;
  border-radius: 8px;
  font-weight: 600;
  color: #0f172a;
}
.journal-week-preview {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.notif-preview-hint {
  margin: 1rem 0 0.75rem;
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.45;
}
.notif-preview-open-all {
  display: block;
  width: 100%;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
}
.notif-preview-open-all:hover {
  border-color: #C2410C;
  color: #C2410C;
}

.footer-legal-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
  justify-content: center;
}

.footer-legal-links .footer-legal-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--orange);
  cursor: pointer;
  font-size: inherit;
  text-decoration: underline;
}

.footer-legal-links .footer-legal-btn:hover {
  color: #fff;
}

.footer-legal-sep {
  color: #94a3b8;
  user-select: none;
}

.login-legal-note {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border, #e5e7eb);
  font-size: 0.8rem;
  line-height: 1.5;
  color: #64748b;
  text-align: center;
}

.login-legal-note button {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  font-size: inherit;
}

/* Shared tool-page shell so staff pages match overview chrome */
.stt-embed {
  display: block;
  width: 100%;
  min-height: calc(100vh - 48px);
  border: 0;
  background: var(--bg);
  border-radius: 16px;
}
.content .hero h1,
.content .hero .lead {
  color: var(--text);
}
.content .hero h1 {
  font-family: var(--font-display);
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
}
.hero-section {
  text-align: center;
  padding: 40px 32px;
  background:
    radial-gradient(circle at 0 0, rgba(194,65,12,0.10) 0, transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(15,125,204,0.12) 0, transparent 55%),
    linear-gradient(180deg, var(--surface), transparent);
  border: 1px solid var(--border);
  border-radius: 20px;
  margin-bottom: 24px;
  color: var(--text);
  box-shadow: none;
}
.hero-section h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0 0 10px;
  color: var(--text);
  font-weight: 700;
}
.stt-hero-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  background:
    radial-gradient(circle at 0 0, rgba(194,65,12,0.10) 0, transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(15,125,204,0.12) 0, transparent 55%),
    linear-gradient(180deg, var(--surface), transparent);
  border: 1px solid var(--border);
  border-radius: 20px;
  flex-wrap: wrap;
}
.stt-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.4vw, 2.65rem);
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.stt-hero-sub {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0.25rem 0 0;
}

.edu-upload-toggle-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}
.edu-upload-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}
.edu-upload-form {
  background: var(--bg);
}
.edu-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 168px;
  padding: 1.25rem 0.85rem;
  border: 1.5px dashed #d7c4b2;
  border-radius: 16px;
  background:
    repeating-linear-gradient(-45deg, transparent, transparent 8px, rgba(194,65,12,0.03) 8px, rgba(194,65,12,0.03) 16px),
    #fffdf9;
  cursor: pointer;
  text-align: center;
  color: var(--text);
}
.edu-dropzone-orb {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
}
.edu-dropzone.is-dragover,
.edu-dropzone:hover {
  border-color: var(--primary);
  background: #fff7f1;
}
.edu-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.edu-dropzone-icon { font-size: 1.6rem; }
.edu-dropzone-title { font-weight: 700; font-size: 0.95rem; }
.edu-dropzone-sub { font-size: 0.8rem; color: var(--muted); }
.edu-file-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.edu-file-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e8e4dc;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}
.edu-file-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}
.edu-file-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  flex-shrink: 0;
}
.edu-file-card-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.edu-file-remove {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2rem;
}
.edu-file-remove:hover { color: #b42318; }
.edu-file-field-label {
  margin: 0.35rem 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}
.edu-file-card .edu-file-cat,
.edu-file-card .edu-file-desc {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  font-size: 0.82rem;
  background: #fafaf8;
  color: #0f172a;
  font-family: inherit;
}
.edu-file-card .edu-file-desc {
  resize: vertical;
  min-height: 2.6rem;
  line-height: 1.4;
}
.edu-file-card .edu-file-cat:focus,
.edu-file-card .edu-file-desc:focus {
  outline: 2px solid rgba(194, 65, 12, 0.35);
  border-color: #C2410C;
  background: #fff;
}
.edu-file-list li,
.edu-file-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.82rem;
}
.edu-file-row-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  justify-content: space-between;
}
.edu-file-row-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.edu-file-row-name {
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #0f172a;
}
.edu-file-row-size { color: var(--muted); font-size: 0.75rem; }
.edu-file-row select {
  max-width: 11.5rem;
  font-size: 0.78rem;
  padding: 0.28rem 0.4rem;
}
.edu-file-prog {
  height: 7px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 0.35rem;
}
.edu-file-prog > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.18s ease;
}
.edu-file-card.is-uploading .edu-file-prog > span,
.edu-file-row.is-uploading .edu-file-prog > span { background: var(--navy); }
.edu-file-card.is-done .edu-file-prog > span,
.edu-file-row.is-done .edu-file-prog > span { width: 100%; background: #2f6f4e; }
.edu-file-card.is-error .edu-file-prog > span,
.edu-file-row.is-error .edu-file-prog > span { background: #b42318; }
.edu-file-status {
  font-size: 0.75rem;
  color: var(--muted);
}
.edu-file-row.is-done .edu-file-status { color: #2f6f4e; font-weight: 650; }
.edu-file-row.is-error .edu-file-status { color: #b42318; }

/* Shared STT / Live STT hero */
.stt-hero-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  flex-wrap: wrap;
}
.stt-hero-left { display: flex; align-items: center; gap: 1rem; flex: 1; min-width: 200px; }
.stt-hero-icon { width: 56px; height: 56px; object-fit: contain; }
.stt-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.4vw, 2.65rem);
  font-weight: 700;
  color: var(--navy-ink) !important;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.stt-hero-sub { font-size: 1.05rem; color: #64748b !important; margin: 0.35rem 0 0; }
#chatHistoryHeading.prompt-heading {
  color: var(--navy-ink);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}
.stt-hero-visual { height: 64px; width: auto; max-width: 180px; object-fit: contain; opacity: 0.85; }
@media (max-width: 576px) {
  .stt-hero-banner { flex-direction: column; align-items: flex-start; }
  .stt-hero-visual { max-width: 120px; }
}
.edu-load-error {
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.9rem;
  line-height: 1.45;
}
.edu-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin: 0.5rem 0 1.25rem;
}
.edu-folder-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 1.15rem 1rem 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  box-shadow: 0 8px 22px rgba(62, 84, 127, 0.06);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.edu-folder-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}
.edu-folder-icon {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--primary);
    background: #FFF0E0;
    border: 1px solid #F6D7B8;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
}
.edu-folder-name { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; line-height: 1.2; }
.edu-folder-desc { font-size: 0.92rem; color: var(--muted); line-height: 1.4; }
.edu-folder-count { font-size: 0.9rem; color: var(--muted); }
.edu-materials[hidden],
.edu-folder-grid[hidden],
.edu-library-crumb[hidden],
.edu-load-error[hidden] {
  display: none !important;
}
.edu-library-crumb {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  color: var(--muted);
}
.edu-crumb-back {
  border: none;
  background: none;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  padding: 0;
}
.edu-edit-dialog {
  height: auto;
  max-height: 90vh;
  width: min(520px, 92vw);
}
.edu-edit-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1rem 1.25rem 0;
}
.edu-edit-form label { font-weight: 600; font-size: 0.88rem; color: var(--text); }
.edu-edit-form input,
.edu-edit-form select,
.edu-edit-form textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: var(--surface);
  color: var(--text);
}
.edu-edit-status { min-height: 1.2rem; font-size: 0.85rem; color: var(--muted); }
.preview-media {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: auto;
  padding: 0.5rem;
}
.preview-media[hidden],
.preview-iframe[hidden] {
  display: none !important;
}
.edu-dup-copy {
  padding: 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.edu-dup-list {
  list-style: none;
  margin: 0;
  padding: 0 1.25rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 40vh;
  overflow: auto;
}
.edu-dup-choices {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.35rem;
  font-size: 0.88rem;
}
.edu-preview-fallback {
  position: absolute;
  top: 0.75rem;
  left: 1rem;
  color: #fff;
}

/* ============================================================
   MOBILE LAYOUT FIXES — generated by mobile-audit (Sep 2026)
   Target viewports: 375×812, 390×844 (iPhone 12/15 range)
   ============================================================ */

/* --- Mobile hamburger button (hidden on desktop) --- */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1200;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  background: var(--navy);
  color: var(--on-navy);
  border: 1px solid rgba(247,244,238,0.35);
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  box-shadow: 0 2px 10px rgba(15,23,42,0.28);
  transition: background 0.18s ease;
  padding: 0;
}
.mobile-menu-btn:hover,
.mobile-menu-btn:focus {
  background: rgba(194,65,12,0.9);
  outline: 2px solid var(--on-navy);
  outline-offset: 2px;
}

/* --- Tablet: tighten content padding (768–1024) --- */
@media (max-width: 1024px) {
  .content {
    padding: 24px 16px 24px 20px;
  }
}

/* --- Mobile: 600px and below --- */
@media (max-width: 600px) {
  /* Show hamburger button */
  .mobile-menu-btn {
    display: flex !important;
  }

  /* Sidebar: fixed off-canvas overlay, slides in from left */
  .sidebar,
  body.has-app-footer .sidebar,
  body.sidebar-collapsed .sidebar,
  body.has-app-footer.sidebar-collapsed .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100dvh !important;
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 100vh !important;
    width: min(88vw, 300px) !important;
    min-width: 0 !important;
    flex-basis: min(88vw, 300px) !important;
    z-index: 1100;
    transform: translateX(-105%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1),
                box-shadow 0.28s ease;
    box-shadow: none;
    align-self: unset !important;
    overflow-y: auto;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 16px 28px !important;
    flex-direction: column;
    display: flex !important;
    align-items: stretch !important;
  }
  .sidebar-close-btn { display: none; }
  body.sidebar-mobile-open .sidebar-close-btn { display: flex !important; }
  body.sidebar-mobile-open .mobile-menu-btn {
    display: none !important;
  }
  .sidebar-staff-locked { display: none !important; }
  .sidebar-staff-hint { display: block; }
  .sidebar-nav { width: 100%; }
  .sidebar-link { width: 100%; }

  /* Restore sidebar content collapsed classes on mobile */
  body.sidebar-collapsed .sidebar-nav,
  body.sidebar-collapsed .sidebar-auth,
  body.sidebar-collapsed .sidebar > div:has(#langEN) {
    display: flex !important;
  }
  body.sidebar-collapsed .sidebar-nav { flex-direction: column !important; }
  body.sidebar-collapsed .brand { display: block !important; }
  body.sidebar-collapsed .brand-container { justify-content: flex-start !important; }
  body.sidebar-collapsed .brand-logo { width: 40px !important; height: 40px !important; }
  body.sidebar-collapsed .sidebar-user { display: flex !important; }
  body.sidebar-collapsed .profile-sidebar-label,
  body.sidebar-collapsed #sidebarUserName { display: inline !important; }
  body.sidebar-collapsed .sidebar-user-row { flex-direction: row !important; }
  body.sidebar-collapsed .sidebar-user-row .sidebar-link {
    width: auto !important; height: auto !important; min-height: 40px !important;
    padding: 8px 10px !important; justify-content: flex-start !important; gap: 0.5rem !important;
  }
  body.sidebar-collapsed .sidebar-notif-btn { width: 36px !important; height: 36px !important; }
  body.sidebar-collapsed .sidebar-toggle { display: none !important; }

  /* Open state: slide in, add scrim */
  body.sidebar-mobile-open .sidebar {
    transform: translateX(0) !important;
    box-shadow: 4px 0 32px rgba(15,23,42,0.35) !important;
  }

  /* Backdrop scrim when sidebar is open */
  body.sidebar-mobile-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.48);
    z-index: 1099;
    pointer-events: auto;
  }

  /* Layout: content takes full width (no sidebar space) */
  .layout {
    display: block !important;
  }

  /* Content: full width, account for hamburger height at top */
  .content {
    padding: 68px 14px 28px 14px !important;
    min-width: 0;
    overflow-x: hidden;
  }

  /* Prevent any content from causing horizontal scroll */
  body, html {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Tables: scroll horizontally instead of breaking layout */
  .content table,
  .card table,
  table.table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  /* Hero text: scale down for small screens */
  h1, .hero h1, .edu-hero-title, .land-hero h1 {
    font-size: clamp(1.35rem, 6vw, 2rem) !important;
  }
  h2 { font-size: clamp(1.15rem, 5vw, 1.6rem) !important; }

  /* Feature cards: single column */
  .feature-cards {
    grid-template-columns: 1fr !important;
  }

  /* Overview grids: single column */
  .overview-merged-grid,
  .overview-blocks,
  .overview-visual-grid {
    grid-template-columns: 1fr !important;
  }

  /* Ensure all buttons meet 44px touch target */
  .btn,
  button:not(.mobile-menu-btn):not(.sidebar-toggle) {
    min-height: 44px;
  }
  .sidebar-link { min-height: 44px !important; }

  /* Hero split: stack vertically */
  .hero.hero-split,
  .hero-split { flex-direction: column !important; }

  /* Hero CTA buttons */
  .hero-ctas {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
  .hero-ctas .btn { text-align: center; }

  /* Container: minimal padding */
  .container { padding: 0 8px; }

  /* Cards: reduce padding */
  .card { padding: 14px 14px; }

  /* Certificate sheet: collapse heavy padding */
  .el-cert-sheet {
    padding: 1.5rem 1.25rem 1.2rem 1.1rem !important;
    max-width: 100% !important;
    border-radius: 8px;
  }
  .el-cert-ribbon {
    width: 1.5rem !important;
  }
  .el-cert-ribbon span {
    font-size: 0.58rem !important;
  }
  .el-cert-title {
    font-size: 1.25rem !important;
  }
  .el-cert-signrow {
    grid-template-columns: 1fr !important;
    text-align: center;
    max-width: 100% !important;
  }
  .el-cert-sig,
  .el-cert-seal {
    grid-column: 1 !important;
    justify-self: center !important;
  }
  .el-cert-wm { inset: 0 1.5rem 0 0 !important; }

  /* elearning: learn-layout already at 860px but enforce on mobile */
  .learn-layout { grid-template-columns: 1fr !important; }
  .learn-toc { position: static !important; }

  /* Login card */
  .login-card { padding: 24px 18px !important; }

  /* Footer */
  .footer-fused .footer-container {
    grid-template-columns: 1fr !important;
  }

  /* Forms */
  input, select, textarea {
    font-size: 16px !important; /* prevents iOS zoom on focus */
  }

  /* Questionnaire page */
  .q-categories-grid { grid-template-columns: 1fr !important; }

  /* AI tools grid */
  .aitools-grid,
  .aitools-cards { grid-template-columns: 1fr !important; }

  /* AI tools: keep filters usable */
  .aitools-toolbar { padding: 0.65rem 0.75rem; }
  .aitools-rows-label { margin-left: 0; }
  .aitools-filters select { width: 100%; min-height: 44px; }

  /* Hide sidebar toggle inside sidebar (replaced by mobile-menu-btn) */
  .sidebar-toggle { display: none !important; }
}

/* --- Very small screens: 375px --- */
@media (max-width: 390px) {
  .content { padding: 64px 10px 24px 10px !important; }
  .hero-ctas { gap: 8px; }
  .el-cert-sheet { padding: 1.2rem 0.9rem 1rem 0.85rem !important; }
  .el-cert-title { font-size: 1.1rem !important; }
}

/* ========================================
   EDUCATION CATALOG CHROME (Skillshare-adapted)
   Scoped to #section-education — cards untouched
   ======================================== */

#section-education .edu-hero--catalog {
    background: transparent;
    color: var(--text);
    padding: 0 0 1.25rem;
    margin: 0 0 0;
    border-radius: 0;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: none;
}

#section-education .edu-hero-content--catalog {
    max-width: none;
    margin: 0;
    text-align: left;
}

#section-education .edu-catalog-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}

#section-education .edu-hero--catalog .edu-hero-title {
    font-family: var(--font-body);
    font-size: clamp(1.85rem, 2.6vw, 2.35rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--navy-ink);
    text-align: left;
    text-shadow: none;
    margin: 0;
    line-height: 1.15;
}

#section-education .edu-hero--catalog .edu-hero-subtitle {
    font-size: 0.95rem;
    color: #6b7280;
    text-align: left;
    opacity: 1;
    margin: 0 0 1rem;
    max-width: 42rem;
    line-height: 1.5;
}

#section-education .edu-hero--catalog .edu-search-bar {
    max-width: 28rem;
    margin: 0 0 1rem;
}

#section-education .edu-hero--catalog .edu-search-input {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    box-shadow: none;
    padding: 0.7rem 2.75rem 0.7rem 2.75rem;
    background: #fff;
}

#section-education .edu-hero--catalog .edu-search-input:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(62, 84, 127, 0.12);
}

#section-education .edu-stats--catalog {
    justify-content: flex-start;
    gap: 1.75rem;
    padding-top: 0.15rem;
}

#section-education .edu-stats--catalog .edu-stat {
    text-align: left;
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

#section-education .edu-stats--catalog .edu-stat-number {
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy-ink);
    margin: 0;
}

#section-education .edu-stats--catalog .edu-stat-label {
    font-size: 0.8rem;
    color: #6b7280;
    opacity: 1;
    font-weight: 500;
}

#section-education .edu-container--catalog {
    margin-top: 1.5rem;
    gap: 2.25rem;
    grid-template-columns: 260px 1fr;
}

#section-education .edu-sidebar {
    gap: 0;
    border-right: 1px solid #eef0f3;
    padding-right: 1.25rem;
}

#section-education .edu-filter-group {
    background: transparent;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid #eef0f3;
    padding: 0 0 1.15rem;
    margin: 0 0 1.15rem;
    box-shadow: none;
}

#section-education .edu-filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

#section-education .edu-filter-title {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 700;
    color: #374151;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 0.85rem;
    cursor: default;
    padding-right: 0;
}

#section-education .edu-filter-title::after {
    display: none;
}

#section-education .edu-filter-list {
    gap: 0.2rem;
}

#section-education .edu-filter-item {
    border-radius: 6px;
    padding: 0.45rem 0.55rem;
    border: 1px solid transparent;
    color: #374151;
    font-weight: 500;
}

#section-education .edu-filter-item:hover {
    background: #f3f4f6;
    border-color: transparent;
}

#section-education .edu-filter-item.active,
#section-education .edu-filter-item[data-format="all"].active,
#section-education .edu-filter-item[data-filter="all"].active,
#section-education .edu-filter-item[data-date="any"].active,
#section-education .edu-filter-item[data-format="pdf"].active,
#section-education .edu-filter-item[data-format="video"].active,
#section-education .edu-filter-item[data-format="slides"].active,
#section-education .edu-filter-item[data-format="document"].active,
#section-education .edu-filter-item[data-format="image"].active,
#section-education .edu-filter-item[data-format="audio"].active {
    background: var(--navy-ink);
    border-color: var(--navy-ink);
    color: #fff;
    font-weight: 600;
}

#section-education .edu-filter-item .filter-icon {
    font-family: var(--font-body);
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #4b5563;
    border-radius: 4px;
    min-width: 2.1rem;
    padding: 0.12rem 0.3rem;
}

#section-education .edu-filter-item.active .filter-icon {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
}

#section-education .edu-filter-item .filter-count {
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 4px;
}

#section-education .edu-filter-item.active .filter-count,
#section-education .edu-filter-item[data-format="all"].active .filter-count,
#section-education .edu-filter-item[data-filter="all"].active .filter-count,
#section-education .edu-filter-item[data-date="any"].active .filter-count {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

#section-education .edu-toolbar {
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid #e5e7eb;
}

#section-education .edu-results-info {
    font-size: 0.95rem;
    color: #374151;
    font-weight: 600;
}

#section-education .edu-view-toggle {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.2rem;
    gap: 0.15rem;
}

#section-education .view-btn {
    border-radius: 6px;
    color: #6b7280;
}

#section-education .view-btn:hover {
    background: #f3f4f6;
    color: var(--navy-ink);
}

#section-education .view-btn.active {
    background: var(--navy-ink);
    color: #fff;
    box-shadow: none;
}

#section-education .edu-editors-header h3 {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #374151;
    margin: 0 0 0.35rem;
}

#section-education .edu-editors-header p {
    color: #6b7280;
    font-size: 0.88rem;
    margin: 0;
}

#section-education .edu-library-crumb {
    font-size: 0.88rem;
    color: #6b7280;
    margin-bottom: 0.85rem;
}

#section-education .edu-crumb-back {
    color: var(--navy);
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

@media (max-width: 900px) {
    #section-education .edu-container--catalog {
        grid-template-columns: 1fr;
    }
    #section-education .edu-sidebar {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid #eef0f3;
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 768px) {
    #section-education .edu-hero--catalog .edu-hero-title {
        font-size: 1.65rem;
    }
    #section-education .edu-stats--catalog {
        gap: 1rem;
        flex-direction: column;
    }
}

/* ========================================
   EDUCATION UPLOAD CARD — catalog chrome
   ======================================== */

#section-education .edu-upload-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: none;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

#section-education .edu-upload-head {
    padding: 0.95rem 1rem 0.55rem;
    background: #fff;
    border-bottom: 1px solid #eef0f3;
}

#section-education .edu-upload-badge {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b7280;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    margin-bottom: 0.35rem;
}

#section-education .edu-upload-title {
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--navy-ink);
    margin: 0.15rem 0 0.25rem;
}

#section-education .edu-upload-lead {
    margin: 0;
    color: #6b7280;
    font-size: 0.8rem;
    line-height: 1.45;
}

#section-education .edu-upload-form {
    padding: 0.9rem 1rem 1rem;
    background: #fff;
}

#section-education .edu-dropzone {
    min-height: 140px;
    padding: 1.1rem 0.85rem;
    border: 1.5px dashed #cbd5e1;
    border-radius: 8px;
    background: #f9fafb;
    color: var(--navy-ink);
    gap: 0.35rem;
}

#section-education .edu-dropzone-orb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--navy-ink);
    font-size: 1.05rem;
}

#section-education .edu-dropzone-title {
    font-family: var(--font-body);
    font-weight: 650;
    font-size: 0.9rem;
    color: var(--navy-ink);
}

#section-education .edu-dropzone-sub {
    font-size: 0.75rem;
    color: #6b7280;
    max-width: 16rem;
    line-height: 1.4;
}

#section-education .edu-dropzone.is-dragover,
#section-education .edu-dropzone:hover {
    border-color: var(--navy);
    background: #f3f5f8;
}

#section-education .edu-upload-form .form-actions {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

#section-education .btn-upload,
#section-education .btn-cancel {
    flex: none;
    width: 100%;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    min-width: 0;
    box-sizing: border-box;
}

#section-education .btn-upload {
    background: var(--navy-ink);
    color: #fff;
    border-radius: 8px;
    font-weight: 650;
    letter-spacing: 0.01em;
}

#section-education .btn-upload:hover {
    background: var(--navy);
}

#section-education .btn-cancel {
    background: #fff;
    color: #4b5563;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-weight: 600;
}

#section-education .btn-cancel:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: var(--navy-ink);
}

#section-education .upload-status {
    border-radius: 8px;
    background: #f3f4f6;
    color: #374151;
}
