/* api_collab specific styles — extends pibico.css */

body {
  background: linear-gradient(135deg, #2c5171 0%, #4682b4 50%, #6a9bc3 100%);
  min-height: 100vh;
  margin: 0;
  font-family: 'Figtree', 'Inter', sans-serif;
  color: #1a1a1a;
}

html, body { height: 100%; }
.app-layout, .app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
}

.app-header-title { text-decoration: none; }
.app-header-title .brand-mark { display: inline-flex; align-items: baseline; }
.app-header-title .bm-pibi { color: #4682b4; font-weight: 600; }
.app-header-title .bm-collab { color: #fba100; font-weight: 700; }

/* === Page-level module finger tabs (between navbar and main) === */
.pibico-tab-row {
  display: flex; justify-content: center; gap: 6px;
  flex-wrap: wrap; row-gap: 2px;
  flex-shrink: 0;
  padding: 8px 12px 0;
  position: relative; z-index: 5;
}
.pibico-tab-row .pibico-tab {
  min-width: 56px; padding: 6px 10px 5px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; cursor: pointer; text-decoration: none;
  color: rgba(255,255,255,0.85);
  border: 0; background: none;
  font-family: 'Inter', sans-serif; white-space: nowrap;
  transition: color 0.15s;
}
.pibico-tab-row .pibico-tab:hover { color: #fff; }
.pibico-tab-row .pibico-tab.active { color: var(--tab-color, #fff); }
/* All non-active tabs share a fixed flex basis to keep row widths consistent
   when wrap pushes active to its own row via order:1. Avoids "row 1 tabs
   narrow, row 2 tabs wide" stretching from justify-content:stretch on flex-wrap. */
.pibico-tab-row .pibico-tab { flex: 0 0 auto; }
.pibico-tab-row:not(.md-finger-tabs):not(.nm-tabs):not(.new-meet-tabs):not(.se-tabs) .pibico-tab.active {
  order: 1;
  /* Active goes to last position so when row wraps it lands alone on bottom row
     touching content. flex-grow only when JS adds .active-alone (active is the
     only tab on its visual row) — avoids stretching when siblings share row. */
}
.pibico-tab-row:not(.md-finger-tabs):not(.nm-tabs):not(.new-meet-tabs):not(.se-tabs) .pibico-tab.active.active-alone {
  flex-grow: 1;
  max-width: 100%;
}
.pibico-tab-row .pibico-tab svg { width: 18px; height: 18px; }
.pibico-tab-row .pibico-tab-label { font-size: 9px; font-weight: 500; line-height: 1; letter-spacing: 0.3px; }
.pibico-tab-row .pibico-tab.active .pibico-tab-label { font-weight: 700; }
.pibico-tab-row .pibico-tab[href*="/voice"]    { --tab-color:#dbeafe; }
.pibico-tab-row .pibico-tab[href*="/meetings"] { --tab-color:#bfdbfe; }
.pibico-tab-row .pibico-tab[href*="/idealab"]  { --tab-color:#fde68a; }
.pibico-tab-row .pibico-tab[href*="/scripts"]  { --tab-color:#a7f3d0; }
.pibico-tab-row .pibico-tab[href*="/notes"]    { --tab-color:#ddd6fe; }
.pibico-tab-row .pibico-tab[href*="/polls"]    { --tab-color:#fbcfe8; }
.pibico-tab-row .pibico-tab[href*="/actions"]  { --tab-color:#fbbf24; }

/* Language dropdown — flag + label, api_memo pattern */
.pibico-lang-dropdown { position: relative; font-family: 'Inter', sans-serif; }
.pibico-lang-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.5);
  cursor: pointer; font-size: 11px; font-weight: 500; color: #2c5171;
}
.pibico-lang-btn:hover { background: rgba(255,255,255,0.7); }
.pibico-flag {
  width: 22px; height: 22px; border-radius: 50%; overflow: hidden;
  flex-shrink: 0; border: 1px solid rgba(0,0,0,0.1); display: inline-flex;
}
.pibico-flag svg { display:block; width:100%; height:100%; }
.pibico-lang-arrow { font-size: 8px; color: #999; margin-left: 1px; }
.pibico-lang-menu {
  display: none; position: absolute; top: 100%; right: 0; margin-top: 4px;
  background: rgba(255,255,255,0.98); border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.08);
  overflow: hidden; min-width: 130px; z-index: 1500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.pibico-lang-menu.open { display: block; }
.pibico-lang-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; font-size: 11px; color: #333;
  cursor: pointer; transition: background 0.15s;
}
.pibico-lang-opt:hover { background: rgba(70,130,180,0.08); }
.pibico-lang-opt.selected { font-weight: 600; color: #2c5171; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 1400;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.app-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: #2c5171;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: visible;
}

.app-header-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2c5171;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}
.app-header-btn:hover {
  background: rgba(44, 81, 113, 0.1);
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px;
  overflow: hidden;
  min-height: 0;
}

/* === Generic two-card layout (used by all module list pages) === */
.two-card-page {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; gap: 8px;
  overflow: hidden;
  padding: 8px; box-sizing: border-box;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8f9fa 0%, #e8e6dc 100%);
}
.two-card-row,
.voice-body-row,
.meet-body-row,
.actions-body-row {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: var(--tc-left-w, 380px) 12px 1fr;
  grid-template-rows: 1fr;
  gap: 0; overflow: hidden;
}
.splitter {
  cursor: col-resize;
  position: relative; user-select: none; touch-action: none;
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
  background: transparent;
}
.splitter::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 5px; width: 2px;
  border-radius: 1px;
  background: rgba(255,255,255,0.7);
  transition: background 0.15s, width 0.15s, left 0.15s;
}
.splitter::after {
  content: "⋮⋮"; color: #2c5171;
  font-size: 12px; font-weight: 700; letter-spacing: -3px;
  background: rgba(255,255,255,0.95);
  padding: 6px 2px; border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  position: relative; line-height: 1; pointer-events: none;
  z-index: 1;
}
.splitter:hover::before { background: #4682b4; width: 4px; left: 4px; }
.splitter:hover::after { background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.25); }
.splitter.dragging::before { background: #2c5171; width: 4px; left: 4px; }
body.col-resizing { cursor: col-resize !important; user-select: none; }
body.col-resizing * { user-select: none !important; }
@media (max-width: 1024px) {
  .two-card-row,
  .voice-body-row,
  .meet-body-row,
  .actions-body-row { grid-template-columns: var(--tc-left-w, 280px) 6px 1fr; }
}
@media (max-width: 768px) {
  /* Mobile: minimal padding around cards — maximize viewport usage (canon pibIdealab) */
  .two-card-page {
    padding: 3px !important;
    gap: 3px !important;
    border-radius: 8px !important;
  }
  .tc-list-card,
  .tc-detail-card,
  .voice-app .voice-history-card,
  .voice-app .voice-active-card,
  .meet-list-card,
  .meet-detail-card {
    border-radius: 8px !important;
  }
  /* api_memo pattern: sidebar full width, content hidden until selected */
  .two-card-row,
  .voice-body-row,
  .meet-body-row,
  .actions-body-row {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    grid-auto-rows: 1fr;
  }
  .splitter { display: none; }
  .tc-list-card,
  .voice-app .voice-history-card,
  .meet-list-card {
    width: 100% !important; max-width: none !important;
    height: 100% !important;
    display: flex !important; flex-direction: column !important;
  }
  .tc-detail-card,
  .voice-app .voice-active-card,
  .meet-detail-card { display: none !important; }
  body.mobile-editor .tc-list-card,
  body.mobile-editor .voice-app .voice-history-card,
  body.mobile-editor .meet-list-card { display: none !important; }
  body.mobile-editor .tc-detail-card,
  body.mobile-editor .voice-app .voice-active-card,
  body.mobile-editor .meet-detail-card { display: flex !important; flex-direction: column !important; }
  .pibico-tab-row {
    flex-direction: row !important;
    width: auto !important;
    overflow-x: auto;
    justify-content: flex-start !important;
  }
  .pibico-tab { padding: 4px 8px 3px !important; min-width: 48px !important; width: auto !important; }
  .pibico-tab svg { width: 14px !important; height: 14px !important; }
  .pibico-tab-label { font-size: 8px !important; }
  /* Lang dropdown: keep flag, hide label, keep arrow */
  .pibico-lang-btn { padding: 4px 6px; gap: 3px; }
  .pibico-lang-btn #lang-flag-current { display: inline-flex !important; }
  .pibico-lang-btn #lang-label-current { display: none !important; }
  /* Prevent zoom on iOS focus */
  input, textarea, select { font-size: 16px !important; }
  /* Slide panels full-width on mobile */
  .slide-panel,
  .slide-panel.wide {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
}
@media (max-width: 400px) {
  .app-header { padding: 0 10px; }
  .app-main { padding: 4px !important; }
}
/* Touch-coarse: reveal hover-only actions, enforce 44px min targets.
 * Scoped to small screens so desktop browsers advertising hover:none
 * (Linux X11, some kiosks) keep the compact 24px control sizes. */
/* Unified button heights (32px everywhere) — applies on mobile + desktop, all modules */
.icon-btn, .icon-btn-ghost, .icon-btn-primary,
.tb-btn, .ne-icon, .fb-tool, .play-btn, .mic-btn,
.vh-pg-btn {
  width: 32px !important; height: 32px !important;
  min-width: 32px; min-height: 32px;
  padding: 0 !important;
  font-size: 13px;
  box-sizing: border-box;
}
.vh-pg-input { width: 38px !important; height: 32px !important; padding: 0 4px !important; box-sizing: border-box !important; }
.vh-pg-size { height: 32px !important; padding: 0 4px !important; box-sizing: border-box !important; }
.vh-pagination { gap: 4px !important; padding: 4px 0 !important; align-items: center !important; }
.vh-pg-of { font-size: 12px; align-self: center; }

@media (max-width: 768px) and ((hover: none) or (pointer: coarse)) {
  .li-actions,
  .list-card-actions,
  .proj-actions,
  .vh-list-actions { opacity: 1 !important; pointer-events: auto !important; height: auto !important; }
  /* Defensive override for any module declaring smaller font */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
  textarea, select,
  [contenteditable="true"], [contenteditable=""] { font-size: 16px !important; }
}
.tc-list-card {
  min-width: 0;
  display: flex; flex-direction: column; min-height: 0;
  position: relative;
  border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
}
.tc-list-card .pibico-glass { position:absolute; inset:0; background:#fff; pointer-events:none; z-index:1; }
.tc-list-card .pibico-tab-row {
  position: relative; z-index: 3;
  display: flex; justify-content: center; gap: 4px;
  flex-wrap: wrap; row-gap: 2px;
  flex-shrink: 0; padding: 6px 4px 0;
}
.tc-list-card .pibico-tab {
  flex: 0 0 64px; min-width: 48px; max-width: 110px; padding: 6px 5px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; cursor: pointer; text-decoration: none;
  color: #2c5171;
  border: 0; background: none;
  font-family: 'Inter', sans-serif; white-space: nowrap;
  transition: color 0.15s;
}
.tc-list-card .pibico-tab:hover { color: #1e3a52; }
.tc-list-card .pibico-tab.active { color: var(--tab-color, #2c5171); }
.tc-list-card .pibico-tab svg { width: 16px; height: 16px; }
.tc-list-card .pibico-tab-label { font-size: 8px; font-weight: 500; line-height: 1; }
.tc-list-card .pibico-tab.active .pibico-tab-label { font-weight: 600; }
.tc-list-card .pibico-tab[href*="/voice"]    { --tab-color:#2c5171; }
.tc-list-card .pibico-tab[href*="/meetings"] { --tab-color:#1e40af; }
.tc-list-card .pibico-tab[href*="/idealab"]  { --tab-color:#92400e; }
.tc-list-card .pibico-tab[href*="/scripts"]  { --tab-color:#047857; }
.tc-list-card .pibico-tab[href*="/notes"]    { --tab-color:#5b21b6; }
.tc-list-card .pibico-tab[href*="/polls"]    { --tab-color:#be185d; }
.tc-list-card .pibico-tab[href*="/actions"]  { --tab-color:#b45309; }
.tc-list-card .pibico-tab[href*="/tasks"]    { --tab-color:#0f766e; }
.tc-list-card .pibico-content,
.tc-list-card .tc-content {
  position: relative; z-index: 2;
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; overflow: hidden;
  padding: 3px;
}
.tc-list-card .vh-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px 6px; flex-shrink: 0;
  border-bottom: 1px solid rgba(70,130,180,0.1);
  gap: 6px;
}
.tc-list-card .vh-card-header h3 { margin: 0; font-size: 13px; font-weight: 600; color: #2c5171; line-height: 1; flex: 1; }
.tc-list-card .vh-card-header .icon-btn-primary {
  width: 24px; height: 24px; padding: 0; border-radius: 6px; border: 0;
  background: #2c5171; color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1;
}
.tc-list-card .vh-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 18px; padding: 0 6px;
  background: rgba(70,130,180,0.12); color: #2c5171;
  border-radius: 999px; font-size: 11px; font-weight: 600;
}
.tc-list-card .vh-search {
  display: flex; align-items: center; gap: 6px;
  margin: 3px 0; padding: 4px 8px;
  background: #f0f4f8; border-radius: 6px; flex-shrink: 0;
}
.tc-list-card .vh-search svg { color: #9ca3af; flex-shrink: 0; }
.tc-list-card .vh-search input { flex: 1; border: 0; outline: none; background: transparent; font-size: 12px; color: #2c5171; }
.tc-list-card .vh-list { flex: 1; overflow-y: auto; padding: 0; }
.tc-list-card .vh-item,
.tc-list-card .tc-item {
  display: flex; flex-direction: column; gap: 1px;
  padding: 4px 6px; margin: 0 0 2px 0;
  border-radius: 4px; cursor: pointer;
  background: rgba(70,130,180,0.08);
  transition: background 0.12s, transform 0.1s;
}
.tc-list-card .vh-item:hover,
.tc-list-card .tc-item:hover { background: rgba(70,130,180,0.18); transform: translateX(2px); }
.tc-list-card .vh-item.active,
.tc-list-card .tc-item.active { background: rgba(70,130,180,0.28); }

.tc-detail-card {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; min-height: 0;
  background: #fff; border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
  padding: 16px 20px 12px;
}
.tc-detail-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  color: #9aa5b1; font-size: 13px; padding: 32px;
}

/* (legacy 900px stacked layout removed — superseded by 768px single-card mobile rule above) */

.welcome-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 32px 40px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  color: #1a1a1a;
  max-width: 560px;
  width: 100%;
}
.welcome-card h1 {
  margin: 0 0 8px 0;
  font-size: 24px;
  color: #2c5171;
}
.welcome-card p { margin: 0 0 16px 0; line-height: 1.4; color: #555; }

/* Dashboard / module grid */
.dashboard-page {
  width:100%; height:100%; padding:8px; overflow-y:auto; box-sizing:border-box;
  display:flex; flex-direction:column; gap:12px;
  background: linear-gradient(180deg, #f8f9fa 0%, #e8e6dc 100%);
  border-radius: 16px;
}
.dashboard-hero {
  background:#fff; border-radius:12px; padding:16px 20px 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}
.dashboard-hero h1 { margin:0 0 3px 0; font-size:18px; font-weight:600; line-height:1; color:#2c5171; }
.dashboard-hero p { margin:0; font-size:12px; line-height:1.4; color:#777; }
.module-grid {
  display:grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap:12px;
}
.module-card {
  display:flex; align-items:center; gap:12px;
  background:#fff; border-radius:12px; padding:16px 20px 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  text-decoration:none; color:inherit;
  transition: transform 0.12s, box-shadow 0.12s;
}
.module-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,0.14); }
.mod-thumb {
  width:44px; height:44px; border-radius:10px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, #4682b4 0%, #2c5171 100%);
  color:#fff;
}
.mod-voice .mod-thumb { background: linear-gradient(135deg, #4682b4, #2c5171); }
.mod-meet .mod-thumb { background: linear-gradient(135deg, #6a9bc3, #4682b4); }
.mod-scripts .mod-thumb { background: linear-gradient(135deg, #10b981, #047857); }
.mod-notes .mod-thumb { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.mod-body { display:flex; flex-direction:column; gap:3px; min-width:0; }
.mod-body h3 { margin:0; font-weight:600; font-size:14px; line-height:1; color:#2c5171; }
.mod-body p { margin:0; font-size:12px; line-height:1.4; color:#777; }

.app-footer {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.65);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 13px;
  color: #2c5171;
}
.app-footer a { color: #2c5171; text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }
.footer-sep { opacity: 0.4; }

/* Shared floating trash button on history cards (canonical pattern from voice .vh-del) */
.meeting-card, .script-card, .note-card { position: relative; }
.list-card-del {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px;
  background: rgba(255,255,255,0.6); color: #b85a5a;
  cursor: pointer; opacity: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: opacity 0.12s, background 0.12s, color 0.12s;
  z-index: 5;
}
.meeting-card:hover .list-card-del,
.script-card:hover .list-card-del,
.note-card:hover .list-card-del { opacity: 1; }
.list-card-del:hover { background: #dc3545; color: #fff; }
.list-card-del:disabled { opacity: 0.5; cursor: default; }
.list-card-del svg { width: 12px; height: 12px; }

.list-card-actions {
  position: absolute; bottom: 4px; right: 4px;
  display: inline-flex; flex-direction: row; gap: 3px;
  opacity: 0; transition: opacity 0.12s;
  z-index: 5;
}
.meeting-card:hover .list-card-actions,
.script-card:hover .list-card-actions,
.note-card:hover .list-card-actions { opacity: 1; }
.list-card-actions .list-card-del,
.list-card-actions .list-card-act {
  position: static; transform: none; opacity: 1;
  width: 20px; height: 20px;
}
.list-card-actions .list-card-act svg,
.list-card-actions .list-card-del svg { width: 11px; height: 11px; }
.list-card-act {
  padding: 0; border: 0; border-radius: 6px;
  background: rgba(255,255,255,0.6); color: #4682b4;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.list-card-act:hover { background: #4682b4; color: #fff; }
.list-card-act:disabled { opacity: 0.5; cursor: default; }
.list-card-act svg { width: 12px; height: 12px; }

/* Slide panel */
.panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  z-index: 1499;
}
.panel-backdrop.open { display: block; }
/* Body scroll-lock when any backdrop/panel open (mobile UX) */
body:has(.panel-backdrop.open) { overflow: hidden; }
body:has(.slide-panel.open) { overflow: hidden; }

.slide-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 45%;
  min-width: 360px;
  max-width: 600px;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 1500;
  display: flex;
  flex-direction: column;
}
.slide-panel.open { transform: translateX(0); }
.slide-panel.wide { width: 45vw !important; max-width: 820px !important; min-width: 360px; }
.slide-panel.expanded { width: 100vw !important; max-width: 100vw !important; min-width: 0 !important; }
.slide-panel-header {
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.slide-panel-header h2,
.slide-panel-header h3 { margin: 0; font-size: 14px; font-weight: 600; color: #2c5171; line-height: 1; }

/* Hide elements on mobile to reduce navbar clutter */
@media (max-width: 768px) {
  .hide-on-mobile { display: none !important; }
  .app-header-title span { display: none; }

  /* Minimal padding to maximize mobile viewport (PWA loses space to OS chrome).
   * Outer wrapper gets 3px lateral; inner content keeps 6px breathing room. */
  .app-main { padding: 3px !important; }
  .two-card-page { padding: 3px !important; gap: 3px !important; border-radius: 10px !important; }
  .pibico-content { padding: 6px !important; }
  .slide-panel-body { padding: 6px !important; }
  .slide-panel-header { padding: 6px 8px !important; }
  .slide-panel-footer { padding: 6px 8px !important; }

  /* Prevent iOS Safari auto-zoom on input focus (requires font-size >= 16px) */
  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  input[type="number"],
  input[type="password"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="time"],
  input:not([type]),
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* Body: scrolls; vertical compact stack */
.slide-panel-body {
  padding: 10px 14px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Help panel — align bullets with h2/h3 titles, indent text after bullet */
#help-body ul {
  list-style: disc outside;
  padding-left: 18px;
  margin: 4px 0 8px;
}
#help-body li {
  padding-left: 6px;
  margin-bottom: 4px;
}
#help-body li::marker {
  color: #4682b4;
}
#help-body h3,
#help-body h4 {
  margin: 16px 0 6px;
}
#help-body h3:first-child,
#help-body h4:first-child {
  margin-top: 4px;
}

/* Form wrapper inside slide-panel-body. Lets body scroll naturally while
 * footer (sibling of body) sticks via slide-panel flex column. Do NOT set
 * flex:1 + overflow:hidden here — it clips form content beyond the visible
 * body height, breaking vertical scroll on mobile. */
.panel-form { display: flex; flex-direction: column; gap: 8px; }

/* Icon buttons — global so any module can use them. Equal height for visual rhythm. */
.icon-btn-primary {
  width: 32px; height: 32px; border-radius: 8px; border: 0; cursor: pointer;
  background: #2c5171; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.icon-btn-primary:hover { background: #1e3a52; transform: translateY(-1px); }
.icon-btn-ghost {
  width: 32px; height: 32px; border-radius: 8px; border: 0; cursor: pointer;
  background: transparent; color: #577793;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.icon-btn-ghost:hover { background: rgba(44,81,113,0.08); color: #2c5171; }
.icon-btn-ghost.danger { color: #b91c1c; }
.icon-btn-ghost.danger:hover { background: rgba(185,28,28,0.08); color: #991b1b; }

/* Sticky footer for slide-panel actions (Cancel / Save / Create / etc) */
.slide-panel-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  flex-shrink: 0;
}

/* Canonical .field (label above input, full width, compact) */
.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  margin: 0;
}
.field > span {
  font-size: 11px;
  color: #577793;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.field input[type="text"], .field input[type="email"], .field input[type="search"],
.field input[type="number"], .field input[type="datetime-local"], .field input[type="date"],
.field input[type="url"], .field input[type="tel"], .field input[type="password"],
.field textarea, .field select {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 9px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  line-height: 1.3;
}
.field textarea { resize: vertical; min-height: 80px; }
.field textarea[rows="5"], .field textarea[rows="6"], .field textarea[rows="7"], .field textarea[rows="8"] { min-height: 120px; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: #4682b4;
  box-shadow: 0 0 0 2px rgba(70,130,180,0.15);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.field-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #2c5171;
  padding: 3px 0;
}

/* Buttons reusable in panels */
.btn-primary {
  padding: 6px 14px; border: 0; border-radius: 6px; cursor: pointer;
  background: #2c5171; color: #fff; font-size: 13px; font-weight: 500; line-height: 1.4;
}
.btn-primary:hover { background: #1e3a52; }
.btn-primary:disabled { opacity: 0.5; cursor: default; }
.btn-ghost {
  padding: 6px 14px; border: 1px solid #d1d5db; border-radius: 6px; cursor: pointer;
  background: #fff; color: #577793; font-size: 13px; line-height: 1.4;
}
.btn-ghost:hover { background: #f0f4f8; }
.btn-danger-ghost {
  padding: 6px 14px; border: 1px solid #dc2626; border-radius: 6px; cursor: pointer;
  background: transparent; color: #dc2626; font-size: 13px; line-height: 1.4;
}
.btn-danger-ghost:hover { background: rgba(220,38,38,0.08); }
.btn-danger-ghost:disabled { opacity: 0.5; cursor: default; }

/* Public share page — common styling across all modules */
.share-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  color: #2c5171;
  font-size: 13px;
  border-bottom: 1px solid #d0dcea;
  box-shadow: 0 1px 4px rgba(44,81,113,0.08);
}
.share-bar .share-brand {
  display: inline-flex; align-items: center; gap: 6px;
  color: #2c5171; text-decoration: none; font-weight: 600;
}
.share-bar .share-divider { color: #9ca3af; }
.share-bar strong { color: #2c5171; font-weight: 600; }
/* Read-only mode badge — global pseudo-element badge for shared/read-only pages */
body.collab-read-only::before,
body.meeting-read-only::before,
body.script-read-only::before,
body.tasks-read-only::before {
  content: "🔒 Solo lectura";
  position: fixed; top: 8px; right: 12px; z-index: 9999;
  background: rgba(70,130,180,0.92); color: #fff;
  padding: 4px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 600;
  pointer-events: none;
}

/* sh-pill — small badge style consistent across share pages (mirror meeting/share.html) */
.sh-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.sh-pill.accepted { background: #d1fae5; color: #047857; }
.sh-pill.declined { background: #fee2e2; color: #dc3545; }
.sh-pill.pending  { background: #fef3c7; color: #92400e; }
.sh-pill.readonly { background: #cffafe; color: #0e7490; }
.share-bar .share-pdf-btn,
.share-bar .btn-secondary {
  padding: 5px 12px; border-radius: 6px;
  background: #4682b4; color: #fff;
  text-decoration: none; font-size: 12px; font-weight: 600;
}
.share-bar .share-pdf-btn:hover,
.share-bar .btn-secondary:hover { background: #2c5171; }
.share-page {
  padding: 20px 16px;
  max-width: 1200px;
  margin: 0 auto;
}
.share-card {
  background: #fff; border-radius: 16px;
  box-shadow: 0 6px 24px rgba(44,81,113,0.18);
  padding: 20px; color: #2e4d6f; box-sizing: border-box;
}
.share-loading { text-align: center; color: #577793; padding: 40px 0; }

/* Floating action buttons — bottom-right of card, square rounded matching icon-btn-primary */
.card-floating-actions {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 10;
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
}
.card-floating-actions .fab-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #2c5171;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  transition: background 0.15s, box-shadow 0.15s;
}
.card-floating-actions .fab-btn:hover {
  background: #1e3a52;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.card-floating-actions .fab-btn.fab-secondary {
  background: #fff;
  color: #2c5171;
  border: 1px solid #e5e7eb;
}
.card-floating-actions .fab-btn.fab-secondary:hover { background: #f0f4f8; }
.card-floating-actions .fab-btn svg { width: 16px; height: 16px; }
@media (max-width: 768px) {
  .card-floating-actions { right: 8px; bottom: 8px; }
  .card-floating-actions .fab-btn { width: 36px; height: 36px; }
  .card-floating-actions .fab-btn svg { width: 18px; height: 18px; }
}

/* Language toggle in navbar */
.app-lang-toggle { display:inline-flex; gap:0; background:rgba(70,130,180,0.1); border-radius:6px; padding:2px; margin-right:6px; }
.lang-opt { padding:3px 8px; border:0; background:transparent; color:#2c5171; cursor:pointer; font-size:11px; font-weight:600; border-radius:4px; line-height:1; }
.lang-opt:hover { background:rgba(70,130,180,0.15); }
.lang-opt.active { background:#2c5171; color:#fff; }

/* Credit badge */
.credit-badge {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:28px; height:24px; padding:0 8px;
  background:linear-gradient(135deg,#4682b4,#2c5171); color:#fff;
  border-radius:999px; font-size:11px; font-weight:700; line-height:1;
  font-family:'JetBrains Mono','Inter',monospace;
  box-shadow:0 1px 3px rgba(0,0,0,0.15);
  cursor:default;
}

/* Header tier chip + profile panel badge */
.header-tier-chip {
  display:inline-flex; align-items:center; justify-content:center;
  height:24px; padding:0 10px;
  border:0; border-radius:999px;
  font-family:'Raleway','Inter',sans-serif;
  font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.6px;
  line-height:1; cursor:pointer;
  box-shadow:0 1px 3px rgba(0,0,0,0.18);
  transition:filter 0.15s ease;
}
.header-tier-chip:hover { filter:brightness(1.08); }

.tier-badge {
  display:inline-block;
  padding:3px 12px;
  border-radius:999px;
  font-family:'Raleway','Inter',sans-serif;
  font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.6px;
  line-height:1;
}

.tier-basic       { background:#e5e7eb; color:#4b5563; }
.tier-pro         { background:linear-gradient(135deg,#ff8c3c,#e2680c); color:#fff; }
.tier-enterprise  { background:linear-gradient(135deg,#d4af37,#a6841a); color:#fff; }

/* Profile panel tier section */
.tier-section {
  margin:8px 0 16px;
  padding:14px 14px 12px;
  border-radius:14px;
  background:rgba(70,130,180,0.06);
  border:1px solid rgba(70,130,180,0.18);
}
.tier-section .tier-row {
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  margin-bottom:10px;
}
.tier-section .tier-label { font-size:12px; color:#577793; font-weight:600; }
.tier-section .tier-credits { display:flex; flex-direction:column; gap:6px; margin:8px 0; }
.tier-section .tier-credit-row { display:flex; align-items:center; gap:8px; font-size:12px; color:#475569; }
.tier-section .tier-credit-bar { flex:1; height:4px; background:#e2e8f0; border-radius:2px; overflow:hidden; }
.tier-section .tier-credit-bar-fill { height:100%; background:linear-gradient(90deg,#10b981,#059669); border-radius:2px; transition:width 0.3s ease; }
.tier-section .tier-credit-bar-fill.warn { background:linear-gradient(90deg,#f59e0b,#d97706); }
.tier-section .tier-credit-bar-fill.exhausted { background:linear-gradient(90deg,#dc2626,#991b1b); }
.tier-section .tier-actions { display:flex; flex-direction:column; gap:6px; margin-top:8px; }

/* Avatar button */
.avatar-btn {
  background:linear-gradient(135deg,#4682b4,#2c5171) !important;
  color:#fff; font-weight:700; font-size:13px; line-height:1;
  text-transform:uppercase; letter-spacing:0.5px;
}
.avatar-btn:hover { filter:brightness(1.1); background:linear-gradient(135deg,#4682b4,#2c5171) !important; }
.avatar-big {
  width:64px; height:64px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg,#4682b4,#2c5171); color:#fff;
  font-size:24px; font-weight:700; text-transform:uppercase;
  margin:8px 0;
}

/* Pagination font compact — match api_idealab canon (override anti-zoom 16px global) */
.vh-pg-input,
.vh-pg-size,
.vh-pg-btn,
.vh-pg-of {
  font-size: 11px !important;
}
.vh-pg-btn { font-size: 13px !important; }
