/* PlaySketch — light palette */
:root {
  --od-bg-body: #eef1f6;
  --od-bg-body-gradient: linear-gradient(180deg, #e8edf3 0%, #eef1f6 100%);
  --od-text: #1e293b;
  --od-text-muted: #64748b;
  --od-border: #cbd5e1;
  --od-surface: #ffffff;
  --od-surface-2: #f8fafc;
  --od-nav-bg: #1e293b;
  --od-nav-text: #f8fafc;
  --od-nav-muted: #94a3b8;
  --od-nav-border: #334155;
  --od-designer-bg: #e4e9ef;
  --od-designer-panel: #f1f4f7;
  --od-designer-panel-head: #475569;
  --od-designer-tool-text: #334155;
  --od-designer-tool-hover: #e2e8f0;
  --od-designer-tool-active-bg: #dbeafe;
  --od-designer-tool-active-text: #1d4ed8;
  --od-designer-canvas-bg: #d8dfe8;
  --od-designer-bar: #1e293b;
  --ds-frames-column-width: 300px;
  --od-modal-bg: #ffffff;
  --od-modal-text: #1e293b;
  --od-modal-muted: #64748b;
  --od-modal-border: #cbd5e1;
  --od-modal-input-bg: #ffffff;
  --od-overlay: rgba(15, 23, 42, 0.45);
  --od-accent: #2563eb;
  --od-accent-hover: #1d4ed8;
  --od-row-selected: #dbeafe;
}

[data-theme="dark"] {
  --od-bg-body: #0f172a;
  --od-bg-body-gradient: linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
  --od-text: #e2e8f0;
  --od-text-muted: #94a3b8;
  --od-border: #334155;
  --od-surface: #1e293b;
  --od-surface-2: #162032;
  --od-nav-bg: #0f172a;
  --od-nav-text: #f8fafc;
  --od-nav-muted: #94a3b8;
  --od-nav-border: #1e293b;
  --od-designer-bg: #0f172a;
  --od-designer-panel: #1e293b;
  --od-designer-panel-head: #334155;
  --od-designer-tool-text: #e2e8f0;
  --od-designer-tool-hover: #334155;
  --od-designer-tool-active-bg: #1e3a5f;
  --od-designer-tool-active-text: #93c5fd;
  --od-designer-canvas-bg: #0b1220;
  --od-designer-bar: #0f172a;
  --od-modal-bg: #1e293b;
  --od-modal-text: #f1f5f9;
  --od-modal-muted: #94a3b8;
  --od-modal-border: #334155;
  --od-modal-input-bg: #0f172a;
  --od-overlay: rgba(0, 0, 0, 0.72);
  --od-accent: #3b82f6;
  --od-accent-hover: #2563eb;
  --od-row-selected: #1e3a5f;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--od-bg-body-gradient);
  color: var(--od-text);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

html {
  height: 100%;
  height: 100dvh;
}

/* PWA install + offline */
.pwa-install-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(90deg, #1e3a5f 0%, #0f172a 100%);
  border-bottom: 1px solid #334155;
  flex-shrink: 0;
  z-index: 120;
}
.pwa-install-bar[hidden] { display: none !important; }
.pwa-install-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pwa-install-text strong { font-size: 13px; color: #f8fafc; }
.pwa-install-text span { font-size: 12px; color: #94a3b8; line-height: 1.4; }
.pwa-install-actions { display: flex; gap: 8px; flex-shrink: 0; }
.pwa-install-primary {
  background: #2563eb;
  border: none;
  color: white;
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.pwa-install-primary:hover { background: #1d4ed8; }
.pwa-install-ghost {
  background: transparent;
  border: 1px solid #475569;
  color: #cbd5e1;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.pwa-update-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(90deg, #14532d 0%, #0f172a 100%);
  border-bottom: 1px solid #166534;
  flex-shrink: 0;
  z-index: 121;
}
.pwa-update-bar[hidden] { display: none !important; }
.pwa-update-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pwa-update-text strong { font-size: 13px; color: #f0fdf4; }
.pwa-update-text span { font-size: 12px; color: #86efac; line-height: 1.4; }
.pwa-offline-badge {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 160;
  background: #422006;
  color: #fde68a;
  border: 1px solid #b45309;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  pointer-events: none;
}
.pwa-offline-badge[hidden] { display: none !important; }

.cloud-sync-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  margin-right: 8px;
}
.cloud-sync-badge[hidden] { display: none !important; }
.cloud-sync-syncing { background: #fef9c3; border-color: #fde047; color: #854d0e; }
.cloud-sync-synced { background: #dcfce7; border-color: #86efac; color: #166534; }
.cloud-sync-offline { background: #f1f5f9; border-color: #cbd5e1; color: #64748b; }
.cloud-sync-error { background: #fee2e2; border-color: #fecaca; color: #b91c1c; }
.org-settings-cloud-help {
  font-size: 12px;
  color: var(--od-modal-muted);
  line-height: 1.45;
  margin-bottom: 10px;
}
.org-settings-btn-cloud {
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
  color: #1d4ed8 !important;
}
.welcome-cloud-note { color: #0369a1; }

@media (display-mode: standalone) {
  .pwa-install-bar { display: none !important; }
}

/* ORGANIZER SCREEN */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
}
.hero-badge { font-size: 11px; letter-spacing: 0.12em; color: #3b82f6; font-weight: 600; }
.hero-title { font-size: 28px; font-weight: 700; margin-top: 2px; }
.hero-sub { font-size: 13px; color: #94a3b8; }
.hero-btn { background: #3b82f6; border: none; color: white; padding: 10px 20px; border-radius: 8px; font-size: 13px; cursor: pointer; font-weight: 600; }
.hero-btn:hover { background: #2563eb; }

.hero-btn.secondary-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f1f5f9;
}
.hero-btn.secondary-btn:hover {
  background: #334155;
}

.organizer-grid { display: grid; grid-template-columns: 480px 1fr; gap: 24px; padding: 0 24px 24px 24px; height: calc(100vh - 110px); }
.library-panel { background: #0f172a; border: 1px solid #1e293b; border-radius: 12px; padding: 20px; display: flex; flex-direction: column; }
.panel-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }

.library-tabs { display: flex; border-bottom: 1px solid #1e293b; margin-bottom: 12px; }
.library-tab { padding: 8px 16px; font-size: 12px; font-weight: 600; color: #64748b; cursor: pointer; }
.library-tab.active { color: #3b82f6; border-bottom: 2px solid #3b82f6; }

input.search { width: 100%; padding: 8px 12px; background: #020617; border: 1px solid #1e293b; border-radius: 6px; color: white; font-size: 13px; margin-bottom: 16px; }
.play-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }

.play-item { background: #1e293b; padding: 12px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; border: 1px solid transparent; }
.play-item:hover { border-color: #3b82f6; }
.play-name { font-size: 14px; font-weight: 600; }
.play-meta { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.play-actions { display: flex; gap: 4px; }
.play-action { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: #0f172a; border-radius: 4px; font-size: 12px; color: #94a3b8; }
.play-action:hover { background: #3b82f6; color: white; }

.dashboard-panel { display: flex; flex-direction: column; gap: 24px; overflow-y: auto; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { background: #0f172a; border: 1px solid #1e293b; padding: 20px; border-radius: 12px; }
.stat-val { font-size: 24px; font-weight: 700; color: #3b82f6; }
.stat-lbl { font-size: 12px; color: #94a3b8; margin-top: 4px; }

.recent-box { background: #0f172a; border: 1px solid #1e293b; border-radius: 12px; padding: 20px; flex: 1; }

/* DESIGNER SCREEN — layout defined below in NEW DESIGNER LAYOUT block */

/* LEFT TOOLBAR */
.left-toolbar { background: #0f172a; border-right: 1px solid #1e293b; display: flex; flex-direction: column; align-items: center; padding: 16px 0; gap: 20px; }
.brand-icon { font-size: 20px; font-weight: 800; color: #3b82f6; margin-bottom: 10px; }
.tool-btn-rect { width: 44px; height: 44px; background: #1e293b; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 16px; color: #94a3b8; cursor: pointer; border: 1px solid transparent; transition: all 0.15s ease; }
.tool-btn-rect span { font-size: 9px; font-weight: 600; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.05em; }
.tool-btn-rect:hover { background: #2563eb; color: white; }
.tool-btn-rect.active { background: #3b82f6; color: white; border-color: #60a5fa; }
.toolbar-divider { width: 30px; height: 1px; background: #1e293b; margin: 5px 0; }

/* SIDEBAR FRAMES */
.sidebar-frames { background: #090d16; border-right: 1px solid #1e293b; display: flex; flex-direction: column; padding: 16px; }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.sidebar-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; }
.frame-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 4px; }
.frame-item { background: #0f172a; border: 2px solid #1e293b; border-radius: 8px; padding: 8px; cursor: pointer; transition: all 0.2s ease; position: relative; }
.frame-item:hover { border-color: #475569; }
.frame-item.active { border-color: #3b82f6; background: #1e293b; }
.frame-item.dragging { opacity: 0.4; border-color: #7c3aed; }
.frame-item.drag-over { border-color: #7c3aed; background: #1e1040; transform: scale(1.02); }
.frame-drag-handle { font-size: 16px; color: #475569; text-align: center; cursor: grab; margin-bottom: 4px; letter-spacing: 2px; }
.frame-drag-handle:active { cursor: grabbing; }
.frame-thumb { width: 100%; height: 110px; background: transparent; border-radius: 4px; object-fit: contain; border: 1px solid #1e293b; }
.frame-label { font-size: 11px; font-weight: 600; text-align: center; margin-top: 6px; color: #e2e8f0; }

.frame-controls-side { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; border-top: 1px solid #1e293b; padding-top: 16px; }
.side-ctrl-btn { width: 100%; padding: 10px; background: #1e293b; border: 1px solid #334155; border-radius: 6px; color: white; font-size: 12px; font-weight: 600; cursor: pointer; text-align: center; }
.side-ctrl-btn:hover { background: #334155; }
.side-ctrl-btn.primary { background: #3b82f6; border-color: #2563eb; }
.side-ctrl-btn.primary:hover { background: #2563eb; }

/* CANVAS WORKSPACE — kept for legacy refs */
#court-container { width: 100%; height: 100%; }

/* ==============================
   NEW DESIGNER LAYOUT
   ============================== */

#screen-designer {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: var(--od-designer-bg);
  overflow: hidden;
}
#screen-designer.active {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 90;
}

/* TOP BAR — match PlayBank header */
.ds-topbar {
  height: auto;
  min-height: 58px;
  background: linear-gradient(180deg, #fff 0%, #f9fafb 100%);
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  flex-shrink: 0;
  gap: 12px;
}
.ds-topbar-left { display: flex; align-items: center; gap: 8px; }
.ds-back-btn {
  background: #fff;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.ds-back-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #111827;
}
.ds-topbar-center { display: flex; align-items: center; gap: 10px; flex: 1; justify-content: center; min-width: 0; }
.ds-play-title-text {
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(360px, 42vw);
}
.ds-edit-details-btn {
  flex-shrink: 0;
  font-weight: 600;
}
.ds-topbar-right { display: flex; align-items: center; gap: 6px; }
.ds-nav-btn {
  background: #fff;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex; align-items: center; gap: 5px;
}
.ds-nav-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #111827;
}
.ds-btn-green { background: #16a34a !important; border-color: #15803d !important; color: white !important; }
.ds-btn-green:hover { background: #15803d !important; border-color: #166534 !important; color: #fff !important; }
.ds-btn-purple { background: #7c3aed !important; border-color: #6d28d9 !important; color: white !important; }
.ds-btn-purple:hover { background: #6d28d9 !important; }

/* BODY */
.ds-body {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) var(--ds-frames-column-width) 310px;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── LEFT PANEL ── */
.ds-left-panel {
  background: var(--od-designer-panel);
  border-right: 1px solid var(--od-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
  min-width: 0;
}

.ds-panel-section { border-bottom: 1px solid var(--od-border); }

.ds-panel-heading {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffffff;
  background: var(--od-designer-panel-head);
  padding: 11px 12px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ds-tool-list { display: flex; flex-direction: column; }

.ds-tool-group {
  border-bottom: 1px solid var(--od-border);
}
.ds-tool-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border: none;
  background: var(--od-surface-2);
  color: var(--od-text);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: left;
}
.ds-tool-group-toggle:hover { background: var(--od-designer-tool-hover); }
.ds-tool-group-chevron {
  font-size: 12px;
  color: #94a3b8;
  transition: transform 0.15s;
}
.ds-tool-group.open .ds-tool-group-chevron { transform: rotate(0deg); }
.ds-tool-group:not(.open) .ds-tool-group-chevron { transform: rotate(-90deg); }
.ds-tool-group-menu {
  display: none;
  flex-direction: column;
}
.ds-tool-group.open .ds-tool-group-menu { display: flex; }
.ds-tool-group:has(.ds-tool-item.active):not([data-tool-group="actions"]) .ds-tool-group-toggle {
  color: #2563eb;
}
.ds-tool-group[data-tool-group="actions"] .ds-tool-group-toggle,
.ds-tool-group[data-tool-group="actions"]:has(.ds-tool-item.active) .ds-tool-group-toggle {
  color: #0f172a;
}
.ds-tool-group-menu .ds-tool-item {
  padding-left: 18px;
  font-size: 16px;
}

.ds-panel-group-toggle {
  background: var(--od-designer-panel-head);
  color: #ffffff;
}
.ds-panel-group-toggle:hover {
  background: #1e3a5f;
}
.ds-panel-group-toggle .ds-tool-group-chevron {
  color: rgba(255, 255, 255, 0.75);
}
.ds-panel-group-body {
  background: var(--od-surface);
}
.ds-panel-group-body .ds-prop-row:last-of-type {
  border-bottom: none;
}
.ds-panel-group-body .ds-options-sub {
  border-top: 1px solid #e5e9ee;
}

.ds-tool-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-size: 17px;
  font-weight: 500;
  color: var(--od-designer-tool-text);
  cursor: pointer;
  border-bottom: 1px solid var(--od-border);
  transition: background 0.12s, box-shadow 0.12s;
  user-select: none;
}
.ds-tool-item:hover { background: var(--od-designer-tool-hover); }
.ds-tool-item.active {
  background: var(--od-designer-tool-active-bg);
  color: var(--od-designer-tool-active-text);
  font-weight: 700;
  border-left: 4px solid #2563eb;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}
.ds-tool-name { flex: 1; min-width: 0; }
.ds-tool-shortcut {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
  padding: 2px 6px;
  border-radius: 5px;
  flex-shrink: 0;
}
.ds-tool-item.active .ds-tool-shortcut {
  color: var(--od-designer-tool-active-text);
  background: rgba(37, 99, 235, 0.15);
}
.ds-tool-icon { font-size: 20px; width: 24px; text-align: center; flex-shrink: 0; }
.ds-cone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ds-cone-icon svg { display: block; }
.ds-tool-delete { color: #dc2626; }
.ds-tool-delete:hover { background: #fee2e2; }
.ds-chevron { margin-left: auto; font-size: 10px; color: #94a3b8; }

.ds-options-sub { padding: 8px 0; border-top: 1px solid #e5e9ee; }
.ds-options-label { font-size: 14px; font-weight: 700; letter-spacing: 0.08em; color: #64748b; text-transform: uppercase; padding: 0 12px 6px; }

/* ── CANVAS CENTER ── */
.ds-canvas-area {
  display: flex;
  flex-direction: column;
  background: var(--od-designer-canvas-bg);
  overflow: hidden;
  min-height: 0;
}

.ds-center-stack {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 12px 18px 10px;
  gap: 0;
}

.ds-court-block {
  flex-shrink: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-bottom: 0;
  width: min(100%, 1180px);
  margin-left: auto;
  margin-right: auto;
  --court-pad-left: 8px;
  --court-pad-right: 8px;
}

.ds-court-chrome {
  box-sizing: border-box;
  width: 100%;
  padding-left: var(--court-pad-left);
  padding-right: var(--court-pad-right);
}

.ds-court-zoom {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--od-border);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(6px);
}

.ds-court-zoom-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--od-text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ds-court-zoom-btn:hover {
  background: var(--od-designer-tool-hover);
}

.ds-court-zoom-label {
  min-width: 44px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--od-text-muted);
  user-select: none;
}

.ds-canvas-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  height: min(780px, calc(100vh - 280px));
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
  touch-action: none;
  padding: 8px;
}

#court-container {
  width: 100%;
  height: 100%;
  min-height: 280px;
  flex: 1 1 auto;
  max-width: 1180px;
  max-height: 780px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  touch-action: none;
}

#court-touch-layer {
  position: absolute;
  inset: 0;
  z-index: 50;
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
  background: transparent;
  pointer-events: none;
}

#court-touch-layer.is-active {
  cursor: crosshair;
}

.court-placement-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.court-touch-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 55;
  display: none;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
}

@media (pointer: coarse), (max-width: 900px) {
  .court-touch-actions {
    display: flex;
  }
}

.touch-device .court-touch-actions {
  display: flex;
}

.court-touch-btn {
  min-height: 48px;
  min-width: 132px;
  padding: 10px 14px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.court-touch-btn-offense {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
}

.court-touch-btn-defense {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}

.court-touch-btn:active {
  transform: scale(0.97);
}

/* Editor directly under frame actions */
.ds-frame-actions {
  flex-shrink: 0;
  width: 100%;
  margin: 10px 0 0;
  padding: 10px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--od-border);
}

.ds-editor-stack {
  flex-shrink: 0;
  width: 100%;
  margin: 0;
  padding: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ds-editor-heading {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--od-text-muted);
  text-transform: uppercase;
}

.ds-player-label-editor {
  padding: 10px;
  background: var(--od-surface);
  border-radius: 8px;
  border: 1px solid var(--od-border);
}

.ds-player-label-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--od-text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ds-player-label-editor input {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--od-border);
  border-radius: 6px;
  font-size: 15px;
  color: var(--od-text);
  background: var(--od-surface);
  outline: none;
}

.ds-player-label-hint {
  font-size: 12px;
  color: var(--od-text-muted);
  margin-top: 4px;
}

.notes-editor-main {
  width: 100%;
  height: 140px;
  min-height: 120px;
  resize: vertical;
  font-size: 16px;
}

.notes-rich-editor {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--od-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--od-surface);
}

.notes-format-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  background: var(--od-surface-2);
  border-bottom: 1px solid var(--od-border);
}

.notes-fmt-btn {
  min-width: 34px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--od-border);
  border-radius: 6px;
  background: var(--od-surface);
  color: var(--od-text);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notes-fmt-btn:hover {
  background: var(--od-designer-tool-hover);
  border-color: var(--od-accent);
}

.notes-fmt-btn .notes-fmt-u { text-decoration: underline; }
.notes-fmt-list-icon { font-size: 13px; font-weight: 700; letter-spacing: -0.02em; }

.notes-fmt-sep {
  width: 1px;
  height: 22px;
  background: var(--od-border);
  margin: 0 2px;
}

.notes-fmt-color-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 32px;
  border: 1px solid var(--od-border);
  border-radius: 6px;
  background: var(--od-surface);
  cursor: pointer;
}

.notes-fmt-color-wrap:hover { border-color: var(--od-accent); }

.notes-fmt-color-icon {
  font-size: 15px;
  line-height: 1;
  pointer-events: none;
}

.notes-fmt-color {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
}

.notes-fmt-size-wrap {
  display: inline-flex;
  align-items: center;
  height: 32px;
}

.notes-fmt-size {
  height: 32px;
  min-width: 72px;
  padding: 0 8px;
  border: 1px solid var(--od-border);
  border-radius: 6px;
  background: var(--od-surface);
  color: var(--od-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.notes-fmt-size:focus {
  outline: 2px solid var(--od-accent);
  outline-offset: 1px;
}

.notes-fmt-align-icon {
  display: block;
  width: 16px;
  height: 12px;
  background: linear-gradient(to bottom, currentColor 0 2px, transparent 2px 4px, currentColor 4px 6px, transparent 6px 8px, currentColor 8px 10px, transparent 10px 12px);
  opacity: 0.85;
}

.notes-fmt-align-icon.align-left {
  mask: linear-gradient(to right, #000 0 55%, transparent 55%);
  -webkit-mask: linear-gradient(to right, #000 0 55%, transparent 55%);
}

.notes-fmt-align-icon.align-center {
  mask: linear-gradient(to right, transparent 0 22%, #000 22% 78%, transparent 78%);
  -webkit-mask: linear-gradient(to right, transparent 0 22%, #000 22% 78%, transparent 78%);
}

.notes-fmt-align-icon.align-right {
  mask: linear-gradient(to right, transparent 0 45%, #000 45%);
  -webkit-mask: linear-gradient(to right, transparent 0 45%, #000 45%);
}

.notes-editor-rich {
  border: none;
  border-radius: 0;
  min-height: 120px;
  height: 140px;
  overflow-y: auto;
  outline: none;
  line-height: 1.55;
}

.notes-editor-rich:empty::before {
  content: attr(data-placeholder);
  color: var(--od-text-muted);
  pointer-events: none;
}

.notes-editor-rich ul,
.notes-editor-rich ol,
.org-preview-frame-notes ul,
.org-preview-frame-notes ol,
#pres-notes-text ul,
#pres-notes-text ol,
.frame-notes ul,
.frame-notes ol {
  padding-left: 1.4em;
  margin: 0.35em 0;
}

.notes-editor-rich:focus {
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.18);
}

[data-theme="dark"] .notes-fmt-color-wrap { background: var(--od-surface-2); }
[data-theme="dark"] #notes-fmt-color { color-scheme: dark; }

/* Vertical frames column — between court and Notes panel */
.ds-frames-column {
  background: var(--od-designer-panel);
  border-left: 1px solid var(--od-border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.ds-frames-column-head {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--od-text-muted);
  text-transform: uppercase;
  padding: 12px 12px 8px;
  border-bottom: 1px solid var(--od-border);
}

.ds-thumb-list-vertical {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Legacy horizontal strip — unused */
.ds-frames-strip {
  flex-shrink: 0;
  width: min(100%, 1180px);
  margin: 12px auto 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.ds-frames-strip-head {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--od-text-muted);
  text-transform: uppercase;
}

.ds-thumb-list-horizontal {
  display: flex;
  flex-direction: row;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 8px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* FRAME BAR */
.ds-frame-bar {
  background: var(--od-designer-bar);
  border-top: 1px solid #1e2d3d;
  display: flex;
  align-items: center;
  padding: 0 12px;
  height: 50px;
  gap: 8px;
  flex-shrink: 0;
}
.ds-frame-bar-left { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.ds-frame-tab {
  padding: 7px 18px;
  border-radius: 5px 5px 0 0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: #3d4f63;
  color: #94a3b8;
  border: 1px solid #4a6278;
  border-bottom: none;
  white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.ds-frame-tab.active { background: #dde2e8; color: #1e293b; border-color: #8fa0b3; }
.ds-frame-tab:hover:not(.active) { background: #4a6278; color: white; }
.ds-frame-bar-actions { display: flex; gap: 5px; flex-shrink: 0; }
.ds-frame-btn {
  padding: 7px 13px;
  background: #3d4f63;
  border: 1px solid #4a6278;
  color: #e2e8f0;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.ds-frame-btn:hover { background: #4a6278; }
.ds-frame-btn-danger { color: #f87171; border-color: #7f1d1d; }
.ds-frame-btn-danger:hover { background: #7f1d1d; color: white; }
.ds-frame-btn-accent {
  background: #16a34a;
  border-color: #15803d;
  color: #fff;
  font-weight: 700;
}
.ds-frame-btn-accent:hover { background: #15803d; color: #fff; }

/* TIMELINE */
.ds-timeline {
  background: #1e2d3d;
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  flex-shrink: 0;
  overflow-x: auto;
}
.ds-timeline-scroll { display: flex; gap: 8px; }
.timeline-frame {
  min-width: 90px; max-width: 90px; height: 26px;
  background: #2c3e50; border: 1px solid #3d4f63;
  border-radius: 4px; padding: 4px 8px; cursor: pointer;
  display: flex; align-items: center;
  font-size: 12px; font-weight: 600; color: #94a3b8;
}
.timeline-frame.active { border-color: #3b82f6; background: #1d4ed8; color: white; }

/* ── RIGHT PANEL ── */
.ds-right-panel {
  background: var(--od-designer-panel);
  border-left: 1px solid var(--od-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.ds-right-panel > .ds-panel-section:first-of-type {
  min-height: 0;
}

.ds-notes-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.ds-notes-section > .ds-panel-heading {
  flex-shrink: 0;
}

.ds-tab-pane {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px;
}

.ds-tab-pane.is-flex:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ds-tab-pane[hidden] {
  display: none !important;
}

.ds-prop-row {
  display: flex;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid #e5e9ee;
  gap: 8px;
}
.ds-prop-label { font-size: 16px; color: var(--od-text-muted); font-weight: 600; min-width: 60px; }
.ds-prop-hint { font-size: 12px; color: var(--od-text-muted); line-height: 1.4; opacity: 0.85; }
.ds-prop-value { font-size: 16px; color: var(--od-text); font-weight: 500; }

.ds-prop-row-stack {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.ds-segment-switch {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 8px;
  background: var(--od-surface-2, #eef2f6);
  border: 1px solid #e5e9ee;
}

.ds-segment-opt {
  flex: 1;
  border: none;
  border-radius: 6px;
  padding: 7px 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  color: var(--od-text-muted);
  transition: background 0.12s, color 0.12s;
}

.ds-segment-opt.active {
  background: #fff;
  color: var(--od-accent, #2563eb);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .ds-segment-switch {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .ds-segment-opt.active {
  background: #334155;
  color: #93c5fd;
}

.ds-properties-color-panel {
  padding: 12px 14px 14px;
  border-top: 1px solid #e5e9ee;
  background: var(--od-surface);
}
.ds-properties-color-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--od-text-muted);
  margin-bottom: 10px;
}
.ds-properties-color-swatches {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ds-color-swatch {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  background: var(--swatch, #000);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}
.ds-color-swatch:hover {
  transform: scale(1.06);
}
.ds-color-swatch.active {
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.35), inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}
.ds-color-swatch-custom {
  background:
    conic-gradient(from 180deg, #ef4444, #eab308, #22c55e, #3b82f6, #a855f7, #ef4444);
  position: relative;
}
.ds-color-swatch-custom[style*="--swatch"] {
  background: var(--swatch);
}
.ds-color-swatch-custom::after {
  content: "+";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}
.ds-color-swatch-custom[style*="--swatch"]::after {
  content: "";
}
.ds-properties-color-custom-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.line-action-type-editor {
  padding: 8px 12px 10px;
  border-bottom: 1px solid #e5e9ee;
}
.line-action-type-editor[hidden] { display: none !important; }
.line-action-type-editor-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--od-text-muted);
  margin-bottom: 6px;
}
.line-action-type-hint {
  margin: 8px 2px 0;
  padding: 0;
}
.line-action-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}
.line-action-type-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 5px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #1e293b;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.1;
}
.line-action-type-btn:hover,
.line-action-type-btn:focus-visible {
  border-color: #94a3b8;
  background: #f8fafc;
}
.line-action-type-btn.active {
  border-color: var(--fd-red, #9e1b32);
  background: rgba(158, 27, 50, 0.08);
  color: var(--fd-red, #9e1b32);
}
.line-action-type-btn-icon {
  width: 22px;
  height: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.line-action-type-btn-icon svg {
  width: 22px;
  height: 16px;
  display: block;
}

/* Notes tabs inside right panel */
.ds-notes-tabs { display: flex; gap: 4px; }
.ds-notes-tab {
  font-size: 13px; font-weight: 600; padding: 4px 11px;
  border-radius: 4px; cursor: pointer; color: #94a3b8;
  background: rgba(255,255,255,0.1);
  text-transform: none; letter-spacing: 0;
}
.ds-notes-tab.active { background: white; color: #1d4ed8; }
.ds-notes-tab:hover:not(.active) { color: white; }

.notes-editor {
  width: 100%; height: 130px;
  background: var(--od-surface); border: 1px solid var(--od-border);
  border-radius: 6px; color: var(--od-text);
  padding: 10px; font-size: 15px; line-height: 1.5; resize: none;
}
.notes-editor:focus { border-color: #2563eb; outline: none; }

.ds-tab-pane select,
.ds-tab-pane input[type="text"] {
  padding: 8px 10px;
  border: 1px solid var(--od-border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--od-text);
  background: var(--od-surface);
}

.ds-anim-value {
  font-size: 14px;
  color: var(--od-text-muted);
}

.ds-stats-saved-msg {
  font-size: 13px;
  color: #16a34a;
  margin-top: 8px;
}

.ds-thumb-list {
  display: flex;
  gap: 8px;
}

/* Frame cards — vertical column beside court */
#frames-container .frame-item {
  background: var(--od-surface);
  border: 2px solid var(--od-border);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  min-height: 144px;
  box-sizing: border-box;
  overflow: hidden;
}

#frames-container .frame-item:hover { border-color: #93c5fd; }
#frames-container .frame-item.active { border-color: #2563eb; background: #eff6ff; }
#frames-container .frame-item.dragging { opacity: 0.4; border-color: #7c3aed; }
#frames-container .frame-item.drag-over {
  border-color: #7c3aed;
  background: #f5f3ff;
  box-shadow: inset 0 0 0 1px #7c3aed;
}

#frames-container .frame-drag-handle {
  font-size: 14px;
  color: #94a3b8;
  text-align: center;
  cursor: grab;
  margin-bottom: 3px;
  letter-spacing: 2px;
  line-height: 1;
}

#frames-container .frame-drag-handle:active { cursor: grabbing; }

#frames-container .frame-thumb {
  width: 100%;
  max-width: 100%;
  height: 108px;
  background: transparent;
  border-radius: 5px;
  object-fit: contain;
  border: 1px solid #e2e8f0;
  display: block;
}

#frames-container .frame-thumb-placeholder {
  background:
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  border: 1px dashed #cbd5e1;
  box-sizing: border-box;
}

#frames-container .frame-label {
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  margin-top: 6px;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Color swatches (reused) */
.color-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.color-swatch { width: 26px; height: 26px; border-radius: 5px; cursor: pointer; border: 2px solid transparent; }
.color-swatch.active { border-color: #1e293b; transform: scale(1.15); }

/* Per-action line colors */
.action-colors-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 10px 8px;
  max-height: 220px;
  overflow-y: auto;
}
.action-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 5px;
  cursor: pointer;
}
.action-color-row:hover { background: #e2e8f0; }
.action-color-row.active {
  background: #dbeafe;
  outline: 1px solid #93c5fd;
}
.action-color-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--od-text);
  flex: 1;
}
.action-color-input {
  width: 40px;
  height: 30px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  cursor: pointer;
  background: transparent;
}
.action-colors-reset {
  margin: 0 10px 10px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--od-text);
  background: var(--od-surface-2);
  border: 1px solid var(--od-border);
  border-radius: 6px;
  cursor: pointer;
  width: calc(100% - 20px);
}
.action-colors-reset:hover { background: var(--od-designer-tool-hover); }

.org-settings-line-colors-block {
  border-top: 1px solid var(--od-modal-border);
  margin-top: 12px;
  padding-top: 10px;
}
.org-settings-line-colors-block .org-settings-divider-label {
  margin-bottom: 8px;
}
.org-settings-line-colors-label {
  margin-top: 14px;
}
.org-settings-editor-colors-readonly .action-color-input,
.org-settings-editor-colors-readonly #designer-accent-color {
  pointer-events: none;
  opacity: 0.78;
  cursor: not-allowed;
}
.org-settings-editor-colors-readonly .action-color-row {
  cursor: default;
}

.org-settings-action-colors .action-colors-list {
  max-height: none;
  overflow: visible;
  padding: 0;
  gap: 2px;
}
.org-action-colors-list {
  padding: 0;
  max-height: none;
  overflow: visible;
}
.org-settings-action-colors .action-color-row {
  padding: 6px 8px;
}
.org-settings-action-colors .action-color-label {
  font-size: 13px;
}
.org-settings-action-colors .action-color-input {
  width: 48px;
  height: 32px;
  border-radius: 6px;
}
.org-action-colors-reset {
  margin: 8px 0 0;
  width: 100%;
  padding: 8px 12px;
}

/* ==============================
   PRESENTATION MODE
   ============================== */
#presentation-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 200;
  display: flex;
  flex-direction: column;
  user-select: none;
}
#pres-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
  gap: 16px;
}
.pres-header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.pres-header-titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#pres-playbook-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#pres-playbook-name[hidden] { display: none !important; }
#pres-play-name { font-size: 22px; font-weight: 800; color: #f1f5f9; letter-spacing: 0.02em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#pres-frame-counter { font-size: 14px; font-weight: 600; color: #64748b; background: #1e293b; padding: 6px 16px; border-radius: 20px; }
#pres-video-btn {
  background: #7c3aed;
  border: 1px solid #6d28d9;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
#pres-video-btn:hover { background: #6d28d9; }
#pres-video-btn[hidden] { display: none; }
#pres-close { background: transparent; border: 1px solid #334155; color: #94a3b8; padding: 8px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
#pres-close:hover { background: #1e293b; color: white; }
#pres-court-area { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #020617; }
#pres-court-img { max-width: 100%; max-height: 100%; object-fit: contain; position: absolute; pointer-events: none; z-index: 0; }
#pres-canvas { position: absolute; pointer-events: none; z-index: 1; }
#pres-notes-bar { background: #0f172a; border-top: 1px solid #1e293b; padding: 12px 28px; min-height: 52px; display: flex; align-items: center; flex-shrink: 0; }
#pres-notes-text { font-size: 15px; color: #cbd5e1; line-height: 1.5; font-style: italic; }
#pres-controls { display: flex; align-items: center; justify-content: center; gap: 24px; padding: 16px; background: #090d16; border-top: 1px solid #1e293b; flex-shrink: 0; }
#pres-prev, #pres-next, #pres-play-seq { background: #1e293b; border: 1px solid #334155; color: white; padding: 12px 24px; border-radius: 8px; font-size: 16px; font-weight: 700; cursor: pointer; min-width: 100px; }
#pres-prev:hover, #pres-next:hover, #pres-play-seq:hover { background: #334155; }
#pres-prev:disabled, #pres-next:disabled { opacity: 0.3; cursor: default; }
#pres-play-seq.active { background: #7c3aed; border-color: #6d28d9; }
#presentation-overlay.share-mode #pres-close { display: none; }
.pres-share-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  background: #1e293b;
  border: 1px solid #334155;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.pres-share-badge[hidden] { display: none !important; }
.pres-frame-strip {
  display: none;
  flex-shrink: 0;
  gap: 8px;
  padding: 10px 14px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  background: #0b1220;
  border-top: 1px solid #1e293b;
}
.pres-frame-strip:not([hidden]) { display: flex; }
.pres-frame-chip {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #e2e8f0;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  scroll-snap-align: center;
}
.pres-frame-chip.active {
  background: #7c3aed;
  border-color: #6d28d9;
  color: #fff;
}
.pres-nav-icon { display: inline; }
.pres-nav-label { display: inline; }

#presentation-overlay.share-mode {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
#presentation-overlay.share-mode #pres-header {
  padding: 10px 14px;
  padding-left: max(14px, env(safe-area-inset-left));
  padding-right: max(14px, env(safe-area-inset-right));
}
#presentation-overlay.share-mode #pres-play-name {
  font-size: 18px;
}
#presentation-overlay.share-mode #pres-court-area {
  flex: 1 1 auto;
  min-height: 0;
}
#presentation-overlay.share-mode #pres-notes-bar {
  padding: 10px 14px;
  padding-left: max(14px, env(safe-area-inset-left));
  padding-right: max(14px, env(safe-area-inset-right));
  max-height: 28vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#presentation-overlay.share-mode #pres-notes-text {
  font-size: 14px;
}
#presentation-overlay.share-mode #pres-controls {
  padding: 10px 12px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  gap: 10px;
}
#presentation-overlay.share-mode #pres-dots { display: none; }

@media (max-width: 720px) {
  #presentation-overlay.share-mode .pres-header-actions .pres-share-badge { display: none; }
  #presentation-overlay.share-mode::before {
    content: "PlaySketch";
    position: absolute;
    top: max(10px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    pointer-events: none;
    z-index: 2;
  }
  #presentation-overlay.share-mode #pres-prev,
  #presentation-overlay.share-mode #pres-next,
  #presentation-overlay.share-mode #pres-play-seq {
    min-width: 52px;
    min-height: 52px;
    padding: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  #presentation-overlay.share-mode #pres-play-seq {
    min-width: 56px;
    min-height: 56px;
  }
  #presentation-overlay.share-mode .pres-nav-label { display: none; }
  #presentation-overlay.share-mode .pres-nav-icon {
    font-size: 20px;
    line-height: 1;
  }
  #presentation-overlay.share-mode #pres-frame-counter {
    font-size: 13px;
    padding: 5px 12px;
  }
}

body.share-view-active #screen-welcome,
body.share-view-active #screen-organizer,
body.share-view-active #screen-designer,
body.share-view-active #screen-draw-pick,
body.share-view-active #screen-free-draw,
body.share-view-active #pwa-install-bar,
body.share-view-active #pwa-update-bar {
  display: none !important;
}
#pres-dots { display: flex; gap: 8px; align-items: center; }
.pres-dot { width: 10px; height: 10px; border-radius: 50%; background: #334155; cursor: pointer; transition: all 0.2s; }
.pres-dot.active { background: #7c3aed; transform: scale(1.4); }
.pres-dot:hover { background: #64748b; }

/* PREVIEW MODAL FRAMES */
.preview-frame {
  min-width: 280px;
  max-width: 320px;
  background: var(--od-surface);
  border: 1px solid var(--od-border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  color: var(--od-text);
}
.preview-frame img {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--od-border);
  background: transparent;
}
.preview-frame .preview-note {
  width: 100%;
  height: 90px;
  background: var(--od-modal-input-bg);
  border: 1px solid var(--od-border);
  border-radius: 6px;
  color: var(--od-text);
  padding: 8px;
  font-size: 12px;
  line-height: 1.5;
  resize: none;
}
.preview-frame .preview-note:focus {
  border-color: var(--od-accent);
  outline: none;
}
/* ==============================
   NEW ORGANIZER UI
   ============================== */

/* TOP NAV */
.org-topnav {
  height: 72px;
  min-height: 72px;
  background: var(--od-nav-bg);
  border-bottom: 1px solid var(--od-nav-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
}
.org-topnav-left { display: flex; align-items: center; gap: 16px; }
.org-hamburger { display: none; }
.org-brand { display: flex; align-items: center; }
.org-brand-logo { display: block; height: 52px; width: auto; object-fit: contain; max-width: 180px; }
.org-main-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid var(--od-nav-border);
  border-radius: 12px;
}
.org-main-tab {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
}
.org-main-tab:hover { color: #e2e8f0; background: rgba(255,255,255,0.06); }
.org-main-tab.active { background: #2563eb; color: #fff; }
.org-topnav-center { display: flex; align-items: center; gap: 12px; }
.org-topbtn {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  line-height: 1.2;
  min-height: 44px;
}
.org-topbtn-primary { background: #2563eb; color: white; }
.org-topbtn-primary:hover { background: #1d4ed8; }
.org-dropdown-chevron { font-size: 11px; opacity: 0.85; margin-left: 2px; }
.org-create-dropdown,
.org-share-dropdown { position: relative; }
.org-create-menu,
.org-share-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 190px;
  background: var(--od-modal-bg);
  border: 1px solid var(--od-modal-border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  padding: 6px;
  z-index: 200;
}
.org-share-menu { right: 0; left: auto; }
.org-create-menu-item,
.org-share-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--od-modal-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.org-create-menu-item:hover,
.org-share-menu-item:hover { background: var(--od-surface-2); }
.org-topbtn-green { background: #16a34a; color: white; }
.org-topbtn-green:hover { background: #15803d; }
.org-topbtn-blue { background: #2563eb; color: white; }
.org-topbtn-blue:hover { background: #1d4ed8; }
.org-topbtn-purple { background: #7c3aed; color: white; }
.org-topbtn-purple:hover { background: #6d28d9; }
.org-topbtn-ghost { background: transparent; border: 1px solid #334155; color: #cbd5e1; }
.org-topbtn-ghost:hover { background: #1e293b; }
.org-topnav-right { display: flex; align-items: center; gap: 14px; }
.org-avatar {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 10px;
  padding: 8px 16px 8px 8px;
  color: inherit;
  font: inherit;
  transition: background 0.15s, border-color 0.15s;
  min-height: 52px;
}
.org-avatar:hover {
  background: #334155;
  border-color: #64748b;
}
.org-avatar-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.org-avatar-label { font-size: 16px; color: #e2e8f0; font-weight: 700; }
.org-user-menu-wrap {
  position: relative;
}
.org-user-menu-wrap[hidden] { display: none !important; }
.org-user-menu-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #e2e8f0;
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  max-width: 220px;
  min-height: 52px;
}
.org-user-menu-btn:hover,
.org-user-menu-btn[aria-expanded="true"] {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.22);
}
.org-user-menu-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.org-user-menu-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.org-user-menu-chevron {
  font-size: 12px;
  opacity: 0.75;
  flex-shrink: 0;
}
.org-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  padding: 6px;
  z-index: 200;
}
.org-user-menu[hidden] { display: none !important; }
.org-user-menu-header {
  padding: 8px 10px 6px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 4px;
  word-break: break-word;
}
.org-user-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-radius: 7px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
}
.org-user-menu-item:hover { background: #f1f5f9; }
.org-user-menu-item-danger { color: #dc2626; }
.org-user-menu-item-danger:hover { background: #fef2f2; }

/* WELCOME / AUTH */
.welcome-screen {
  display: none;
  flex: 1;
  min-height: 0;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: linear-gradient(160deg, #0f172a 0%, #1e3a5f 45%, #0f172a 100%);
}
.welcome-screen.active { display: flex; }
.welcome-inner {
  width: min(860px, 100%);
  text-align: center;
  color: #f8fafc;
}
.welcome-logo { margin-bottom: 24px; max-width: min(800px, 96vw); height: auto; filter: drop-shadow(0 8px 24px rgba(0,0,0,0.35)); }
.welcome-title.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.welcome-tagline {
  font-size: 15px;
  color: #94a3b8;
  margin-bottom: 28px;
  line-height: 1.5;
}
.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.welcome-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.welcome-btn {
  width: 100%;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
}
.welcome-btn-primary {
  background: #2563eb;
  color: white;
}
.welcome-btn-primary:hover { background: #1d4ed8; }
.welcome-btn-secondary {
  background: rgba(255,255,255,0.1);
  color: #f8fafc;
  border: 1px solid rgba(255,255,255,0.2);
}
.welcome-btn-secondary:hover { background: rgba(255,255,255,0.16); }
.welcome-btn-draw {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  letter-spacing: 0.08em;
}
.welcome-btn-draw:hover { background: linear-gradient(135deg, #fb923c 0%, #f97316 100%); }

.draw-pick-screen {
  display: none;
  flex: 1;
  min-height: 0;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: linear-gradient(160deg, #0f172a 0%, #1e3a5f 45%, #0f172a 100%);
}
.draw-pick-screen.active { display: flex; }
.draw-pick-inner {
  width: min(720px, 100%);
  color: #f8fafc;
  text-align: center;
}
.draw-pick-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.draw-pick-back:hover { background: rgba(255,255,255,0.12); color: #f8fafc; }
.draw-pick-title {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.draw-pick-sub {
  margin: 0 0 28px;
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.5;
}
.draw-pick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 560px) {
  .draw-pick-grid { grid-template-columns: 1fr; }
}
.draw-pick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 14px 18px;
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.draw-pick-card:hover {
  border-color: #f97316;
  background: rgba(249,115,22,0.12);
  transform: translateY(-2px);
}
.draw-pick-court-img {
  width: 100%;
  max-height: 140px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(15,23,42,0.35);
}
.draw-pick-card-label {
  font-size: 16px;
  font-weight: 800;
  color: #f8fafc;
}
.draw-pick-card-hint {
  font-size: 12px;
  color: #94a3b8;
}

.free-draw-screen {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  background: #0b1220;
}
.free-draw-screen.active { display: flex; }
.free-draw-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
}
.free-draw-back {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #1e293b;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.free-draw-back:hover { background: #334155; }
.free-draw-tools {
  display: flex;
  gap: 8px;
}
.free-draw-tool {
  min-width: 88px;
  padding: 8px 16px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #1e293b;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.free-draw-tool:hover { background: #334155; color: #f8fafc; }
.free-draw-tool.active {
  background: #2563eb;
  border-color: #3b82f6;
  color: #fff;
}
.free-draw-tool[data-tool="erase"].active {
  background: #dc2626;
  border-color: #ef4444;
}
.free-draw-clear {
  padding: 8px 14px;
  border: 1px solid #7f1d1d;
  border-radius: 8px;
  background: rgba(127, 29, 29, 0.35);
  color: #fecaca;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.free-draw-clear:hover {
  background: rgba(220, 38, 38, 0.45);
  border-color: #ef4444;
  color: #fff;
}
.free-draw-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: #1a2332;
}
.free-draw-court-img,
.free-draw-canvas {
  position: absolute;
  display: block;
}
.free-draw-canvas {
  touch-action: none;
  cursor: crosshair;
}
.free-draw-canvas.tool-erase { cursor: cell; }

.welcome-guest-link {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 8px;
}
.welcome-guest-link:hover { color: #cbd5e1; }
.welcome-note {
  margin-top: 20px;
  font-size: 11px;
  color: #64748b;
  line-height: 1.5;
}
.welcome-expired-note {
  color: #fca5a5;
  font-size: 13px;
  font-weight: 600;
}
.welcome-inner.welcome-expired-mode .welcome-actions-row,
.welcome-inner.welcome-expired-mode #btn-welcome-signup,
.welcome-inner.welcome-expired-mode #btn-welcome-draw {
  display: none;
}
.welcome-inner.welcome-expired-mode .welcome-subscribe {
  margin-top: 8px;
  margin-left: auto;
  margin-right: auto;
  border-color: rgba(252, 165, 165, 0.35);
  background: rgba(69, 10, 10, 0.35);
}
.welcome-subscribe-plan {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: #93c5fd;
}
.welcome-subscribe-plan[hidden] { display: none !important; }
.onboarding-modal-box { width: min(480px, 94vw); }
.onboarding-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 6px;
  padding-bottom: 8px;
}
.onboarding-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.onboarding-option:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(147, 197, 253, 0.45);
}
.onboarding-option-muted { opacity: 0.92; }
.onboarding-option-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.onboarding-option-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.onboarding-option-text strong {
  font-size: 14px;
  font-weight: 700;
}
.onboarding-option-text span {
  font-size: 12px;
  line-height: 1.45;
  color: #94a3b8;
}
.welcome-subscribe {
  margin: 18px auto 0;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.35);
  max-width: 420px;
  width: min(420px, 100%);
  text-align: center;
}
.welcome-subscribe[hidden] { display: none !important; }
.welcome-subscribe-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: #e2e8f0;
}
.welcome-license-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  justify-content: center;
}
.welcome-subscribe .welcome-license-row {
  flex-direction: column;
  align-items: stretch;
}
.welcome-subscribe .welcome-license-input {
  min-width: 0;
  width: 100%;
}
.welcome-license-input {
  flex: 1;
  min-width: 180px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
  color: #f8fafc;
  font-size: 14px;
}
.welcome-subscribe-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.45;
}
.auth-error {
  font-size: 13px;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  text-align: left;
}
.auth-error[hidden] { display: none !important; }
.auth-switch-line {
  margin-top: 16px;
  font-size: 13px;
  color: var(--od-modal-muted);
  text-align: center;
}
.auth-switch-btn {
  background: none;
  border: none;
  color: #2563eb;
  font-weight: 700;
  cursor: pointer;
  padding: 0 4px;
  font-size: inherit;
}
.auth-switch-btn:hover { text-decoration: underline; }

.admin-panel-box {
  width: min(1700px, 99vw);
  max-width: 99vw;
  min-height: min(920px, 94vh);
  max-height: 96vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding: 32px 36px;
}
.admin-panel-box .modal-title {
  font-size: 24px;
}
.admin-panel-box .modal-subtitle {
  font-size: 15px;
  margin-bottom: 18px;
}
.admin-panel-box .admin-users-wrap {
  flex: 1;
  min-height: 520px;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin: 18px 0 22px;
}
.admin-billing-panel {
  margin-bottom: 22px;
  padding: 18px 20px;
  border: 1px solid var(--od-border);
  border-radius: 12px;
  background: var(--od-surface-2);
}
.admin-billing-help {
  font-size: 13px;
  color: var(--od-modal-muted);
  line-height: 1.45;
  margin-top: 4px;
}
.admin-billing-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}
.admin-billing-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.admin-billing-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--od-modal-muted);
}
.admin-billing-field input {
  padding: 10px 12px;
  border: 1px solid var(--od-modal-border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--od-modal-input-bg);
  color: var(--od-modal-text);
}
.admin-billing-save-btn {
  align-self: flex-start;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: var(--od-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.admin-billing-save-btn:hover { filter: brightness(1.05); }
.admin-billing-preview {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--od-border);
  border-radius: 12px;
  background: var(--od-surface-2);
}
.admin-billing-preview-status {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--od-text-muted);
  line-height: 1.45;
}
.admin-billing-preview-status-warn { color: #b45309; }
.admin-billing-preview-methods { margin-bottom: 12px; }
.admin-billing-preview-btn {
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid var(--od-accent);
  background: rgba(37, 99, 235, 0.1);
  color: var(--od-accent);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.admin-billing-preview-btn:hover { background: rgba(37, 99, 235, 0.16); }
.admin-payment-hint {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--od-text-muted);
  word-break: break-all;
}
.welcome-preview-badge {
  color: #fbbf24 !important;
  font-size: 12px !important;
  font-weight: 700;
}
.welcome-preview-exit { margin-bottom: 8px; }
.admin-payment-methods-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.admin-payment-method-card {
  padding: 12px;
  border: 1px solid var(--od-border);
  border-radius: 10px;
  background: var(--od-surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-payment-method-card-wide {
  grid-column: 1 / -1;
}
.admin-payment-enable {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--od-modal-text);
}
.admin-payment-method-card input[type="url"],
.admin-payment-method-card input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--od-modal-border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--od-modal-input-bg);
  color: var(--od-modal-text);
}
@media (max-width: 900px) {
  .admin-payment-methods-grid { grid-template-columns: 1fr; }
  .admin-billing-row { grid-template-columns: 1fr; }
}
.admin-license-tools {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--od-border);
}
.admin-license-tools-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 700;
  color: var(--od-modal-text);
  margin-bottom: 10px;
}
.admin-license-generate {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-license-generate input {
  width: 72px;
  padding: 6px 8px;
  border: 1px solid var(--od-modal-border);
  border-radius: 6px;
  font-size: 13px;
}
.admin-license-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}
.admin-license-empty {
  font-size: 13px;
  color: var(--od-modal-muted);
  padding: 8px 0;
}
.admin-license-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--od-border);
  border-radius: 8px;
  background: var(--od-surface);
}
.admin-license-row.used { opacity: 0.65; }
.admin-license-code {
  font-family: ui-monospace, monospace;
  font-size: 13px;
  font-weight: 700;
}
.admin-license-meta {
  flex: 1;
  font-size: 12px;
  color: var(--od-modal-muted);
}
.admin-license-copy-btn {
  padding: 4px 10px;
  border: 1px solid var(--od-border);
  border-radius: 6px;
  background: var(--od-surface-2);
  font-size: 12px;
  cursor: pointer;
}
.admin-status-trial {
  background: #fef3c7;
  color: #92400e;
}
.admin-status-subscribed {
  background: #dbeafe;
  color: #1d4ed8;
}
.admin-stat-card {
  background: var(--od-surface-2);
  border: 1px solid var(--od-border);
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
}
.admin-stat-num {
  display: block;
  font-size: 32px;
  font-weight: 800;
  color: var(--od-modal-text);
  line-height: 1.1;
}
.admin-stat-label {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  color: var(--od-modal-muted);
  font-weight: 600;
}
.admin-content-overview {
  margin-bottom: 22px;
  padding: 18px 20px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: linear-gradient(180deg, #eff6ff 0%, #f8fbff 100%);
}
.admin-content-overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.admin-content-overview-title {
  font-size: 16px;
  font-weight: 800;
  color: #1e3a8a;
  margin-bottom: 6px;
}
.admin-content-overview-text {
  font-size: 15px;
  color: #334155;
  line-height: 1.45;
}
.admin-view-all-btn {
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
  border-radius: 8px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.admin-view-all-btn:hover { background: #1d4ed8; border-color: #1d4ed8; }
.admin-users-wrap { overflow-x: auto; }
.admin-users-table {
  width: 100%;
  min-width: 1500px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 15px;
}
.admin-users-table th:nth-child(1),
.admin-users-table td:nth-child(1) { width: 16%; }
.admin-users-table th:nth-child(2),
.admin-users-table td:nth-child(2) { width: 10%; }
.admin-users-table th:nth-child(3),
.admin-users-table td:nth-child(3) { width: 9%; }
.admin-users-table th:nth-child(4),
.admin-users-table td:nth-child(4) { width: 14%; }
.admin-users-table th:nth-child(5),
.admin-users-table td:nth-child(5) { width: 12%; }
.admin-users-table th:nth-child(6),
.admin-users-table td:nth-child(6) { width: 18%; }
.admin-users-table th:nth-child(7),
.admin-users-table td:nth-child(7) { width: 21%; }
.admin-users-table th,
.admin-users-table td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--od-border);
  text-align: left;
  vertical-align: top;
}
.admin-users-table th {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--od-modal-muted);
}
.admin-user-name { font-weight: 700; font-size: 16px; color: var(--od-modal-text); }
.admin-user-email { font-size: 14px; color: var(--od-modal-muted); margin-top: 3px; word-break: break-word; }
.admin-status {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}
.admin-status-active { background: #dcfce7; color: #166534; }
.admin-status-unlimited { background: #e0e7ff; color: #3730a3; }
.admin-status-expired { background: #fee2e2; color: #b91c1c; }
.admin-expiry-controls { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.admin-trial-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.admin-trial-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--od-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-trial-days {
  width: 64px;
  padding: 6px 8px;
  border: 1px solid var(--od-border);
  border-radius: 6px;
  font-size: 13px;
}
.admin-trial-unit {
  font-size: 12px;
  color: var(--od-text-muted);
}
.admin-set-trial-btn { font-weight: 700; }
.admin-expiry-datetime {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 8px;
}
.admin-expiry-date,
.admin-expiry-time {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--od-modal-border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--od-modal-input-bg);
  color: var(--od-modal-text);
}
.admin-expiry-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-expiry-btn {
  border: 1px solid var(--od-modal-border);
  background: var(--od-surface-2);
  color: var(--od-modal-text);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.admin-expiry-btn:hover { background: var(--od-designer-tool-hover); }
.admin-expiry-btn-apply {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.admin-expiry-btn-apply:hover { background: #1d4ed8; }
.admin-clear-content-btn {
  margin-top: 6px;
  border: 1px solid #fcd34d;
  background: #fffbeb;
  color: #b45309;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.admin-clear-content-btn:hover { background: #fef3c7; }

.admin-devices-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}
.admin-devices-summary {
  font-weight: 700;
  color: var(--od-text);
}
.admin-devices-list {
  margin: 0;
  padding-left: 16px;
  color: var(--od-text-muted);
}
.admin-devices-list li { margin: 2px 0; }
.admin-device-kind {
  font-weight: 700;
  color: var(--od-text);
}
.admin-devices-empty {
  color: var(--od-text-muted);
  font-style: italic;
}
.admin-reset-devices-btn {
  align-self: flex-start;
  padding: 5px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.admin-reset-devices-btn:hover { background: #f8fafc; }
.admin-device-limits-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--od-border);
}
.admin-device-limits-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 12px;
  font-weight: 600;
}
.admin-section-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--od-text);
}
.org-settings-devices {
  margin: 12px 0 4px;
  padding-top: 12px;
  border-top: 1px solid var(--od-border);
}
.org-settings-devices-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--od-text);
}
.org-settings-devices-list em {
  font-style: normal;
  color: #16a34a;
  font-weight: 700;
}
.org-settings-devices-empty {
  color: var(--od-text-muted);
  list-style: none;
  margin-left: -18px;
}
.admin-delete-btn {
  margin-top: 6px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.admin-delete-btn:hover { background: #fee2e2; }
.admin-library-cell { display: flex; flex-direction: column; gap: 8px; min-width: 160px; }
.admin-library-summary-text { font-size: 14px; color: var(--od-modal-muted); line-height: 1.4; }
.admin-view-library-btn {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  width: fit-content;
}
.admin-view-library-btn:hover { background: #dbeafe; }
.admin-library-modal { width: min(960px, 98vw); min-height: min(720px, 88vh); max-height: 96vh; overflow: auto; display: flex; flex-direction: column; }
.admin-library-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}
.admin-library-summary span {
  font-size: 12px;
  font-weight: 700;
  color: #1e3a8a;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 5px 10px;
}
.admin-library-content { display: flex; flex-direction: column; gap: 14px; flex: 1; min-height: 480px; max-height: none; overflow: auto; }
.admin-library-section {
  border: 1px solid var(--od-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--od-surface-2);
}
.admin-library-section-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--od-modal-muted);
  padding: 10px 12px;
  background: var(--od-surface);
  border-bottom: 1px solid var(--od-border);
}
.admin-library-list { list-style: none; margin: 0; padding: 0; }
.admin-library-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--od-border);
}
.admin-library-item:last-child { border-bottom: none; }
.admin-library-item-main { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.admin-library-item-name { font-size: 14px; font-weight: 700; color: var(--od-modal-text); }
.admin-library-item-meta { font-size: 12px; color: var(--od-modal-muted); }
.admin-library-type {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 7px;
}
.admin-library-type-play { background: #dbeafe; color: #1d4ed8; }
.admin-library-type-drill { background: #fef3c7; color: #b45309; }
.admin-library-coach-block {
  border: 1px solid var(--od-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--od-surface);
}
.admin-library-coach-head {
  padding: 12px 14px;
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
}
.admin-library-coach-name {
  font-size: 14px;
  font-weight: 800;
  color: #1e3a8a;
}
.admin-library-coach-meta {
  margin-top: 3px;
  font-size: 12px;
  color: #475569;
}
.admin-library-section-nested {
  border: none;
  border-radius: 0;
  border-top: 1px solid var(--od-border);
  background: transparent;
}
.admin-library-section-nested .admin-library-section-title {
  background: var(--od-surface-2);
}
.admin-library-item-coach {
  font-size: 11px;
  font-weight: 700;
  color: #1d4ed8;
  margin-bottom: 4px;
}
.admin-library-empty {
  text-align: center;
  color: var(--od-modal-muted);
  font-size: 13px;
  padding: 28px 12px;
  background: var(--od-surface-2);
  border-radius: 10px;
  border: 1px dashed var(--od-border);
}
.admin-users-empty {
  text-align: center;
  color: var(--od-modal-muted);
  font-size: 15px;
  padding: 32px 12px;
}
.admin-panel-box .modal-actions { margin-top: 24px; }
.admin-panel-box .modal-cancel {
  padding: 10px 20px;
  font-size: 15px;
}
@media (max-width: 760px) {
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.print-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.print-page-setup-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin: 10px 0 14px;
  padding: 14px 16px;
  background: var(--od-surface-2);
  border: 1px solid var(--od-border);
  border-radius: 10px;
}
.print-page-setup-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 88px;
  cursor: pointer;
}
.print-page-setup-icon {
  width: 36px;
  height: 36px;
  background: #fff;
  border-radius: 6px;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.print-page-setup-icon-margins::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 2px solid #64748b;
  box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 6px #94a3b8;
}
.print-page-setup-icon-orientation::before {
  content: "";
  position: absolute;
  left: 8px; top: 7px;
  width: 12px; height: 16px;
  border: 2px solid #64748b;
  background: #fff;
  transform: rotate(-8deg);
  box-shadow: 12px 5px 0 -1px #fff, 12px 5px 0 1px #64748b;
}
.print-page-setup-icon-size::before {
  content: "";
  position: absolute;
  left: 9px; top: 8px;
  width: 16px; height: 20px;
  border: 2px solid #64748b;
  background: #fff;
}
.print-page-setup-icon-size::after {
  content: "";
  position: absolute;
  left: 5px; top: 4px;
  width: 10px; height: 10px;
  border-top: 2px solid #2563eb;
  border-left: 2px solid #2563eb;
}
.print-page-setup-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--od-modal-text);
}
.print-page-setup-select {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--od-text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 0 14px 0 0;
  cursor: pointer;
  text-align: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='%2394a3b8' d='M0 0l4 5 4-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
}
.print-page-setup-select:focus { outline: 2px solid var(--od-accent); outline-offset: 2px; }
@media (max-width: 520px) {
  .print-page-setup-bar { gap: 12px; }
  .print-page-setup-item { min-width: 76px; }
}
.print-settings-checks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 4px;
  padding: 12px 14px;
  background: var(--od-surface-2);
  border-radius: 8px;
  border: 1px solid var(--od-border);
}
.print-settings-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--od-modal-text);
  cursor: pointer;
}
.print-settings-check input { accent-color: var(--od-accent); width: 16px; height: 16px; }
.print-settings-locked select {
  opacity: 0.72;
  cursor: not-allowed;
}
@media (max-width: 520px) {
  .print-settings-grid { grid-template-columns: 1fr; }
}

.print-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: #0f172a;
}
.print-preview-overlay[hidden] { display: none !important; }
.print-preview-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #1e293b;
  color: #f8fafc;
  border-bottom: 1px solid #334155;
}
.print-preview-toolbar-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.print-preview-hint {
  font-size: 12px;
  color: #94a3b8;
}
.print-preview-toolbar-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.print-preview-loading[hidden],
.print-preview-frame[hidden] { display: none !important; }
.print-preview-frame {
  flex: 1 1 auto;
  width: 100%;
  border: none;
  background: #e2e8f0;
}
.print-preview-page-setup {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px 12px;
  flex-shrink: 0;
}
.print-preview-page-setup .fd-page-setup-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 64px;
}
.print-preview-page-setup .fd-page-setup-text {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}
.print-preview-page-setup .fd-page-setup-icon {
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 4px;
  position: relative;
}
.print-preview-page-setup .fd-page-setup-select {
  appearance: none;
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 600;
  padding: 0 10px 0 0;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='%2394a3b8' d='M0 0l4 5 4-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
}
.print-preview-loading {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 15px;
  font-weight: 600;
}
.print-preview-frame {
  flex: 1 1 auto;
  width: 100%;
  border: none;
  background: #e2e8f0;
}
@media (max-width: 640px) {
  .print-preview-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .print-preview-toolbar-actions {
    justify-content: flex-end;
  }
}
.org-settings-user {
  font-size: 13px;
  color: var(--od-text-muted);
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--od-surface-2);
  border-radius: 8px;
  line-height: 1.5;
}
.org-settings-access {
  font-size: 12px;
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  line-height: 1.45;
}
.org-settings-access-expired {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}
.org-settings-access-warn {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}
.org-settings-subscription {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--od-modal-border);
  border-radius: 10px;
  background: var(--od-surface-2);
}
.org-settings-subscription[hidden] { display: none !important; }
.org-settings-plan {
  font-size: 13px;
  font-weight: 700;
  color: var(--od-modal-text);
  margin-bottom: 10px;
}
.org-settings-btn-subscribe {
  background: #0ea5e9 !important;
  border-color: #0284c7 !important;
  color: #fff !important;
  margin-bottom: 10px;
}
.org-settings-btn-subscribe:hover { filter: brightness(1.05); }
.org-settings-btn-subscribe[hidden] { display: none !important; }
.org-settings-license-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.org-settings-license-input {
  flex: 1;
  min-width: 160px;
  padding: 10px 12px;
  border: 1px solid var(--od-modal-border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--od-modal-input-bg);
  color: var(--od-modal-text);
}
.org-settings-btn-license {
  flex-shrink: 0;
}
.org-settings-subscription-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--od-modal-muted);
  line-height: 1.45;
}
.org-payment-methods,
.welcome-payment-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.org-payment-methods[hidden],
.welcome-payment-methods[hidden] { display: none !important; }
.org-payment-methods-settings {
  justify-content: stretch;
  margin-bottom: 10px;
}
.payment-method-btn {
  padding: 9px 14px;
  border: 1px solid var(--od-border);
  border-radius: 8px;
  background: var(--od-surface);
  color: var(--od-text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.payment-method-btn:hover {
  border-color: var(--od-accent);
  background: var(--od-surface-2);
}
.payment-method-btn-settings {
  flex: 1 1 calc(50% - 4px);
  min-width: 140px;
  text-align: center;
}
.payment-method-btn-welcome,
.payment-method-btn-trial {
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.35);
  color: #e0f2fe;
}
.payment-method-btn-welcome:hover,
.payment-method-btn-trial:hover {
  background: rgba(14, 165, 233, 0.28);
}
.payment-method-btn-trial {
  color: #0369a1;
  background: #fff;
  border-color: #bae6fd;
}
.org-trial-banner-warn .payment-method-btn-trial {
  color: #b45309;
  background: #fff;
  border-color: #fde68a;
}

.org-trial-banner {
  flex-shrink: 0;
  padding: 12px 16px;
  background: #e0f2fe;
  border-bottom: 1px solid #bae6fd;
  color: #0369a1;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}
.org-trial-banner-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  text-align: center;
}
.org-trial-subscribe-btn {
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  background: #0ea5e9;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.org-trial-subscribe-btn:hover { background: #0284c7; }
.org-trial-subscribe-btn[hidden] { display: none !important; }
.org-trial-banner-warn {
  background: #fffbeb;
  border-bottom-color: #fde68a;
  color: #b45309;
}
.org-trial-banner[hidden] { display: none !important; }
[data-theme="dark"] .org-trial-banner {
  background: #1e3a5f;
  border-bottom-color: #334155;
  color: #93c5fd;
}
[data-theme="dark"] .org-trial-banner-warn {
  background: #422006;
  border-bottom-color: #78350f;
  color: #fcd34d;
}

.org-settings-btn-admin {
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
  color: #1d4ed8 !important;
}
.org-settings-btn-admin:hover { background: #dbeafe !important; }
.org-settings-btn-danger {
  color: #dc2626 !important;
  border-color: #fecaca !important;
  background: #fef2f2 !important;
}
.org-settings-btn-danger:hover { background: #fee2e2 !important; }

#screen-organizer { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; font-size: 16px; }
.org-body { display: flex; flex: 1; overflow: hidden; min-height: 0; }
.org-library-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--od-bg-body);
}

.practice-planner-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  flex-direction: column;
  background: var(--od-bg-body);
}
.practice-planner-overlay[hidden] {
  display: none !important;
}
.practice-planner-overlay .org-practice-shell {
  flex: 1;
  width: 100%;
  min-height: 0;
}
.practice-close-btn {
  padding: 8px 14px;
  border: 1px solid var(--od-border);
  border-radius: 8px;
  background: var(--od-surface);
  color: var(--od-text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.practice-close-btn:hover {
  background: var(--od-surface-2);
  color: var(--od-text);
}

.org-practice-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--od-bg-body);
}
.practice-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--od-border);
  background: var(--od-surface);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.practice-toolbar-title { font-size: 20px; font-weight: 800; color: var(--od-text); }
.practice-toolbar-sub { font-size: 13px; color: var(--od-text-muted); margin-top: 4px; }
.practice-toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.practice-export-btn { color: #7c3aed !important; border-color: #c4b5fd !important; }
.practice-live-btn { color: #16a34a !important; border-color: #86efac !important; font-weight: 800 !important; }
.practice-layout { display: flex; flex: 1; min-height: 0; overflow: hidden; }
.practice-sessions-panel {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--od-border);
  background: var(--od-surface);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.practice-sessions-head {
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--od-text-muted);
  border-bottom: 1px solid var(--od-border);
}
.practice-sessions-list { flex: 1; overflow: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.practice-sessions-empty { padding: 24px 12px; text-align: center; font-size: 13px; color: var(--od-text-muted); line-height: 1.5; }
.practice-session-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--od-border);
  background: var(--od-surface-2);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  color: var(--od-text);
}
.practice-session-card:hover { border-color: #93c5fd; background: var(--od-surface); }
.practice-session-card.active { border-color: #2563eb; background: #eff6ff; box-shadow: inset 0 0 0 1px #2563eb; }
[data-theme="dark"] .practice-session-card.active { background: #1e3a8a; }
.practice-session-card-date { font-size: 12px; font-weight: 700; color: #2563eb; }
.practice-session-card-title { font-size: 15px; font-weight: 800; margin-top: 4px; }
.practice-session-card-meta { font-size: 12px; color: var(--od-text-muted); margin-top: 4px; }
.practice-editor-panel { flex: 1; min-width: 0; overflow: auto; padding: 20px 24px; }
.practice-editor-empty { color: var(--od-text-muted); font-size: 15px; padding: 48px 12px; text-align: center; }
.practice-editor-fields { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.practice-field { display: flex; flex-direction: column; gap: 6px; min-width: 140px; }
.practice-field-grow { flex: 1; min-width: 220px; }
.practice-field-block { width: 100%; margin-bottom: 16px; }
.practice-field span { font-size: 12px; font-weight: 700; color: var(--od-text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.practice-field input,
.practice-field select,
.practice-field textarea {
  padding: 10px 12px;
  border: 1px solid var(--od-border);
  border-radius: 8px;
  background: var(--od-surface);
  color: var(--od-text);
  font-size: 14px;
}
.practice-items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--od-text-muted);
}
.practice-add-items-btn {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.practice-add-items-btn:hover { background: #dbeafe; }
.practice-items-list { display: flex; flex-direction: column; gap: 10px; }
.practice-items-empty {
  padding: 28px 16px;
  border: 1px dashed var(--od-border);
  border-radius: 10px;
  text-align: center;
  color: var(--od-text-muted);
  font-size: 14px;
}
.practice-item-row {
  display: grid;
  grid-template-columns: 28px 72px minmax(0, 1fr) 72px 52px 32px;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--od-border);
  border-radius: 10px;
  background: var(--od-surface);
}
.practice-item-missing { opacity: 0.7; border-style: dashed; }
.practice-item-order { font-size: 18px; font-weight: 900; color: var(--od-text-muted); padding-top: 8px; text-align: center; }
.practice-item-thumb {
  width: 72px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--od-surface-2);
  border: 1px solid var(--od-border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.practice-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.practice-item-name { font-size: 15px; font-weight: 800; color: var(--od-text); }
.practice-item-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--od-text-muted); margin-top: 4px; }
.practice-item-type { font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; font-size: 11px; }
.practice-item-type-play { color: #16a34a; }
.practice-item-type-drill { color: #2563eb; }
.practice-item-notes {
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--od-border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--od-surface-2);
  color: var(--od-text);
}
.practice-item-duration { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 700; color: var(--od-text-muted); }
.practice-item-duration input { width: 100%; padding: 8px; border: 1px solid var(--od-border); border-radius: 6px; font-size: 14px; font-weight: 700; }
.practice-item-move { display: flex; flex-direction: column; gap: 4px; }
.practice-item-move-btn {
  border: 1px solid var(--od-border);
  background: var(--od-surface-2);
  border-radius: 6px;
  width: 28px;
  height: 24px;
  cursor: pointer;
  font-size: 12px;
}
.practice-item-move-btn:disabled { opacity: 0.35; cursor: default; }
.practice-item-remove {
  border: none;
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.practice-editor-footer {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.practice-delete-session-btn {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* FastDraw-style top filter bar */
.org-filter-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--od-surface);
  border-bottom: 1px solid var(--od-border);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.org-filter-bar-fields {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex: 1;
  flex-wrap: wrap;
  min-width: 0;
}
.org-filter-bar-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--od-text-muted);
  min-width: 0;
}
.org-filter-bar-label > span { padding-left: 2px; }
.org-filter-bar-type {
  display: flex;
  gap: 4px;
  align-self: flex-end;
  padding-bottom: 1px;
}
.org-filter-chip {
  padding: 8px 13px;
  border-radius: 6px;
  border: 1px solid var(--od-border);
  background: var(--od-surface-2);
  color: var(--od-text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.org-filter-chip:hover { border-color: #93c5fd; color: var(--od-text); }
.org-filter-chip.active {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #fff;
}
.org-filter-favorites.active {
  background: #b45309;
  border-color: #92400e;
  color: #fff;
}
.org-filter-favorites:not(.active):hover { border-color: #fbbf24; color: #92400e; }
.org-filter-select {
  min-width: 130px;
  padding: 8px 11px;
  border: 1px solid var(--od-border);
  border-radius: 6px;
  background: var(--od-surface);
  color: var(--od-text);
  font-size: 14px;
}
.org-filter-bar-dropdown-wrap { min-width: 140px; }
.org-filter-bar-dropdown-wrap .org-filter-dropdown { margin-bottom: 0; }
.org-filter-bar-search-wrap { flex: 1; min-width: 160px; max-width: 280px; }
.org-filter-bar-primary {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.org-filter-more {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px dashed var(--od-border);
}
.org-filter-more-toggle {
  align-self: flex-end;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--od-border);
  background: var(--od-surface-2);
  color: var(--od-text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.org-filter-more-toggle:hover { border-color: #93c5fd; color: var(--od-text); }
.org-library-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px 0;
  font-size: 14px;
  color: var(--od-text-muted);
}
.org-crumb-sep { color: #94a3b8; user-select: none; }
.org-crumb-current { color: var(--od-text); font-weight: 700; }
.org-search-bar { margin-top: 0; width: 100%; }
.org-filter-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.org-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  flex-shrink: 0;
}
.org-bulk-bar[hidden] { display: none !important; }
.org-bulk-count {
  font-size: 14px;
  font-weight: 700;
  color: #1d4ed8;
}
.org-bulk-select-all-link {
  padding: 0;
  border: none;
  background: none;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
.org-bulk-select-all-link:hover { color: #1e3a8a; }
.org-bulk-select-all-link[hidden] { display: none !important; }
.org-bulk-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.org-bulk-btn {
  padding: 7px 13px;
  border-radius: 6px;
  border: 1px solid #93c5fd;
  background: #fff;
  color: #1e40af;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.org-bulk-btn:hover { background: #dbeafe; }
.org-bulk-btn-danger {
  color: #dc2626;
  border-color: #fca5a5;
}
.org-bulk-btn-danger:hover { background: #fef2f2; }
.org-bulk-btn-ghost {
  color: #64748b;
  border-color: #cbd5e1;
}
.org-bulk-btn-ghost:hover { background: #f8fafc; }

.org-filter-dropdown-inline .org-filter-dropdown-menu {
  min-width: 220px;
}

/* Split library + preview */
.org-library-split {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}
.org-library-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  flex: 0 0 52%;
  min-width: 320px;
  max-width: 65%;
  border-right: none;
}
.org-table-view {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.org-table-scroll {
  height: 100%;
  overflow: auto;
}
.org-play-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}
.org-play-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--od-surface-2);
}
.org-play-table th {
  text-align: left;
  padding: 12px 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--od-text-muted);
  border-bottom: 1px solid var(--od-border);
}
.org-play-table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--od-border);
  color: var(--od-text);
  vertical-align: middle;
}
.org-play-table tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}
.org-play-table tbody tr:hover { background: var(--od-surface-2); }
.org-play-table tbody tr.selected { background: var(--od-row-selected); }
.org-play-table .col-select {
  width: 40px;
  text-align: center;
  padding-left: 10px;
  padding-right: 6px;
}
.org-play-table .col-select input.org-play-row-check {
  width: 15px;
  height: 15px;
  accent-color: var(--od-accent);
  cursor: pointer;
  vertical-align: middle;
}
.org-play-table thead .col-select input.library-select-all-check {
  margin: 0;
}
.org-play-table .col-play-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.org-play-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.org-play-pin {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid var(--od-border);
  border-radius: 6px;
  background: var(--od-surface-2);
  color: #94a3b8;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.org-play-pin:hover { border-color: #fbbf24; color: #d97706; background: #fffbeb; }
.org-play-pin.pinned {
  border-color: #fbbf24;
  background: #fef3c7;
  color: #b45309;
}
.org-play-table tr.play-row-pinned { background: rgba(251, 191, 36, 0.08); }
.org-preview-pin-btn.pinned {
  border-color: #fbbf24 !important;
  background: #fef3c7 !important;
  color: #b45309 !important;
}
.org-play-table .col-frames {
  text-align: center;
  width: 72px;
  color: var(--od-text-muted);
}

.org-library-preview {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--od-surface);
  overflow: hidden;
}
.org-preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--od-border);
  flex-shrink: 0;
}
.org-preview-breadcrumb {
  font-size: 18px;
  font-weight: 700;
  color: var(--od-text);
  line-height: 1.35;
}
.org-preview-sub {
  font-size: 14px;
  color: var(--od-text-muted);
  margin-top: 4px;
}
.org-preview-edit-btn {
  padding: 9px 17px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.org-preview-edit-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.org-preview-edit-btn:not(:disabled):hover { background: #1d4ed8; }
.org-preview-edit-btn-primary {
  padding: 10px 20px;
  font-size: 15px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}
.org-preview-edit-btn-primary:not(:disabled):hover { background: #1d4ed8; }
.org-preview-duplicate-btn {
  padding: 9px 15px;
  background: #fff;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.org-preview-duplicate-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.org-preview-duplicate-btn:not(:disabled):hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #1e293b;
}
.org-preview-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.org-preview-delete-btn {
  padding: 9px 17px;
  background: transparent;
  color: #dc2626;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.org-preview-delete-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.org-preview-delete-btn:not(:disabled):hover {
  background: #fef2f2;
  border-color: #dc2626;
}
.org-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  border-bottom: 1px solid var(--od-border);
  font-size: 14px;
  color: var(--od-text-muted);
  flex-shrink: 0;
}
.org-preview-tool-btn {
  background: transparent;
  border: 1px solid var(--od-border);
  border-radius: 5px;
  padding: 5px 11px;
  cursor: pointer;
  font-size: 14px;
  color: var(--od-text);
  font-family: inherit;
}
.org-preview-tool-btn:not(:disabled):hover {
  background: var(--od-surface-2);
  border-color: var(--od-accent);
}
.org-preview-tool-btn:disabled {
  cursor: default;
  opacity: 0.55;
  color: var(--od-text-muted);
}
[data-theme="dark"] .org-preview-tool-btn {
  color: #ffffff;
}
[data-theme="dark"] .org-preview-tool-btn:disabled {
  color: rgba(255, 255, 255, 0.55);
}
.org-preview-frames {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 16px 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 12px;
  align-content: start;
  align-items: start;
}
.org-preview-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--od-text-muted);
  padding: 40px 20px;
  font-size: 15px;
}
.org-preview-empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 48px 24px;
  text-align: center;
}
.org-preview-empty-icon {
  width: 72px;
  height: 72px;
  border: 3px solid #cbd5e1;
  border-radius: 8px;
  margin-bottom: 20px;
  background: #f8fafc;
}
.org-preview-empty-title {
  font-size: 22px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
}
.org-preview-empty-text {
  margin: 0;
  font-size: 15px;
  color: #64748b;
  max-width: 280px;
  line-height: 1.45;
}

/* Library create mode (FastDraw-style split) */
.org-library-shell.is-create-mode .org-filter-bar-type .org-filter-type:not(.active) {
  opacity: 0.55;
}
.org-library-shell.is-create-mode .org-share-dropdown,
.org-library-shell.is-create-mode .org-filter-more-toggle {
  display: none;
}
.org-create-play-bar-btn {
  padding: 10px 22px;
  background: #c8102e;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 3px rgba(200, 16, 46, 0.35);
}
.org-create-play-bar-btn:hover { background: #a50d26; }
.org-create-play-bar-btn-ghost {
  background: #fff;
  color: #475569;
  border: 1px solid #cbd5e1;
  box-shadow: none;
}
.org-create-play-bar-btn-ghost:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.library-create-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}
.library-create-header {
  padding: 28px 32px 0;
  flex-shrink: 0;
}
.library-create-title {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
}
.library-create-subtitle {
  margin: 8px 0 0;
  font-size: 14px;
  color: #64748b;
}
.library-create-body {
  flex: 1;
  overflow: auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 480px;
}
.library-create-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.library-create-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 6px;
}
.library-create-field input,
.library-create-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: #1e293b;
}
.library-create-field input:focus,
.library-create-field select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.library-create-courts .court-option {
  flex: 1;
  text-align: center;
  padding: 12px 10px;
  border-radius: 4px;
}
.library-create-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 32px 24px;
  border-top: 1px solid var(--od-border);
  flex-shrink: 0;
}
.library-create-cancel-btn {
  padding: 10px 20px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  font-family: inherit;
}
.library-create-cancel-btn:hover { background: #f8fafc; }
.library-create-submit-btn {
  padding: 10px 24px;
  background: #c8102e;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.library-create-submit-btn:hover { background: #a50d26; }

.library-preview-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.playbook-logos-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.playbook-logo-slot-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--od-modal-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.org-preview-playbook-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.org-preview-playbook-logo img {
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--od-border);
  background: var(--od-surface-2);
}
.org-preview-playbook-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.org-preview-playbook-item {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--od-border);
  border-radius: 8px;
  background: var(--od-surface-2);
  color: var(--od-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.org-preview-playbook-item-thumb {
  width: 56px;
  height: 42px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--od-border);
  background: var(--od-surface);
  flex-shrink: 0;
}
.org-preview-playbook-item-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.org-preview-playbook-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.org-preview-playbook-item:hover {
  border-color: var(--od-accent);
  background: var(--od-surface);
}
.org-preview-playbook-item-kind {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--od-text-muted);
}
.org-preview-playbook-item-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.org-preview-playbook-item-meta {
  font-size: 12px;
  color: var(--od-text-muted);
}
.org-preview-frame-card {
  border: 1px solid var(--od-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--od-surface-2);
  align-self: start;
  width: 100%;
}
.org-preview-frame-title {
  padding: 7px 9px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--od-nav-bg);
  color: var(--od-nav-text);
}
.org-preview-frame-card img {
  width: 100%;
  height: auto;
  display: block;
  background: transparent;
  object-fit: contain;
  flex-shrink: 0;
}
.org-preview-frame-notes {
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--od-text);
  white-space: pre-wrap;
}
.org-preview-frame-notes.empty {
  color: var(--od-text-muted);
  font-style: italic;
}
.org-preview-frame-placeholder {
  width: 100%;
  min-height: 120px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  font-size: 11px;
}

@media (max-width: 1100px) {
  .org-preview-frames { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* LEFT FILTERS (legacy — removed from HTML, keep card styles) */
.org-filters {
  width: 300px;
  flex-shrink: 0;
  background: var(--od-surface-2);
  border-right: 1px solid var(--od-border);
  padding: 20px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.org-filters-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--od-text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.org-filters-subtitle {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  margin-top: 10px;
  margin-bottom: 6px;
}
.org-filter-group { display: flex; flex-direction: column; gap: 2px; }
.org-teams-group {
  max-height: 140px;
  overflow-y: auto;
  margin-bottom: 4px;
}
.org-playbooks-group {
  max-height: 120px;
  overflow-y: auto;
  margin-bottom: 4px;
}
.org-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  color: var(--od-text-muted);
  cursor: pointer;
  transition: background 0.15s;
}
.org-filter-item:hover { background: #e5e5e5; }
.org-filter-item.active { background: #dcdcdc; color: #1e293b; font-weight: 600; }
.org-filter-icon { font-size: 14px; }

.org-tag-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s;
}
.org-tag-item:hover { background: #e5e5e5; }
.org-tag-item.active { color: #2563eb; font-weight: 600; }
.org-tag-checkbox {
  width: 15px; height: 15px;
  border: 2px solid #cbd5e1;
  border-radius: 3px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px;
}
.org-tag-item.active .org-tag-checkbox { background: #2563eb; border-color: #2563eb; color: white; }

/* Filter dropdowns (teams + series) */
.org-filter-dropdown {
  position: relative;
  margin-bottom: 4px;
}
.org-filter-dropdown-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  background: var(--od-surface);
  border: 1px solid var(--od-border);
  border-radius: 7px;
  color: var(--od-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  line-height: 1.35;
}
.org-filter-dropdown-btn span:first-child {
  flex: 1;
  min-width: 0;
  white-space: normal;
  word-break: break-word;
}
.org-filter-dropdown-btn:hover { border-color: #93c5fd; }
.org-filter-dropdown-btn[aria-expanded="true"] {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.org-filter-dropdown-chevron {
  font-size: 11px;
  color: var(--od-text-muted);
  flex-shrink: 0;
}
.org-filter-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 60;
  max-height: 320px;
  overflow-y: auto;
  background: var(--od-surface);
  border: 1px solid var(--od-border);
  border-radius: 8px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.18);
  padding: 6px;
}
.org-filter-dropdown-menu[hidden] { display: none !important; }
.org-filter-dropdown-actions {
  display: flex;
  gap: 6px;
  padding: 4px 4px 8px;
  border-bottom: 1px solid var(--od-border);
  margin-bottom: 4px;
}
.org-filter-dropdown-action {
  flex: 1;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--od-border);
  border-radius: 5px;
  background: var(--od-surface-2);
  color: var(--od-text-muted);
  cursor: pointer;
}
.org-filter-dropdown-action:hover { border-color: #2563eb; color: #2563eb; }
.org-filter-dropdown-add {
  width: calc(100% - 8px);
  margin: 6px 4px 4px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  border: 1px dashed var(--od-border);
  border-radius: 6px;
  background: var(--od-surface-2);
  color: #2563eb;
  cursor: pointer;
}
.org-filter-dropdown-add:hover { background: #eff6ff; border-color: #93c5fd; }
.org-dropdown-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 7px 6px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--od-text);
}
.org-dropdown-row:hover { background: var(--od-surface-2); }
.org-dropdown-row.active { background: #dbeafe; color: #1d4ed8; font-weight: 600; }
.org-dropdown-row-label {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}
.org-dropdown-row-label span.org-dropdown-row-text {
  flex: 1;
  min-width: 0;
}
.org-dropdown-row-count {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--od-text-muted);
  background: var(--od-surface-2);
  padding: 1px 6px;
  border-radius: 10px;
  align-self: center;
}
.org-playbook-dropdown {
  flex: 1;
  min-width: 140px;
}
.org-playbook-dropdown .org-filter-dropdown-btn {
  width: 100%;
  min-width: 0;
}
.org-dropdown-row-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.org-dropdown-icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 5px;
  font-size: 13px;
  line-height: 1;
  border-radius: 4px;
  opacity: 0.75;
}
.org-dropdown-icon-btn:hover { opacity: 1; background: rgba(0,0,0,0.06); }
.org-dropdown-icon-btn.danger:hover { background: #fee2e2; }

.org-search {
  width: 100%;
  padding: 9px 11px;
  background: var(--od-surface);
  border: 1px solid var(--od-border);
  border-radius: 7px;
  color: var(--od-text);
  font-size: 14px;
  margin-top: 4px;
  outline: none;
}
.org-search:focus { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,0.15); }

/* CONTENT AREA */
.org-content {
  flex: 1;
  background: var(--od-bg-body);
  overflow-y: auto;
  padding: 24px;
}
.org-grid-view .org-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.org-card.selected {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

/* CARD */
.org-card {
  background: var(--od-surface);
  border-radius: 10px;
  border: 1px solid var(--od-border);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
}
.org-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.13); transform: translateY(-2px); }
.org-card-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: contain;
  object-position: center;
  background: #ececec;
  border-bottom: 1px solid var(--od-border);
  display: block;
  image-rendering: auto;
}
.org-card-thumb-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #ececec 0%, #e0e0e0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  border-bottom: 1px solid var(--od-border);
  color: #9ca3af;
}
.org-card-body { padding: 12px 14px; flex: 1; }
.org-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--od-text);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.org-card-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 0; }
.org-card-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}
.org-card-tag.offense { color: #16a34a; background: #f0fdf4; }
.org-card-tag.defense { color: #dc2626; background: #fef2f2; }
.org-card-tag.drill { color: #d97706; background: #fffbeb; }
.org-card-tag.general { color: #6366f1; background: #eef2ff; }
.org-card-tag.default { color: #475569; background: #ececec; }

.org-card-actions {
  padding: 10px 14px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 6px;
}
.org-card-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid #e2e8f0;
  background: white;
  cursor: pointer;
  color: #475569;
  display: flex; align-items: center; gap: 4px;
  transition: background 0.12s;
}
.org-card-btn:hover { background: #f1f5f9; }
.org-card-btn.delete { color: #dc2626; border-color: transparent; background: transparent; }
.org-card-btn.delete:hover { background: #fef2f2; }

/* Empty state */
.org-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}
.org-empty-icon { font-size: 48px; margin-bottom: 16px; }
.org-empty-title { font-size: 18px; font-weight: 700; color: #64748b; margin-bottom: 8px; }
.org-empty-sub { font-size: 14px; }

.org-favorites-section-head td {
  padding: 10px 12px 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--od-text-muted);
  background: var(--od-surface-2);
  border-bottom: 1px solid var(--od-border);
}

/* BOTTOM STATUS BAR */
.org-statusbar {
  height: 44px;
  background: var(--od-nav-bg);
  border-top: 1px solid var(--od-nav-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
}
.org-status-left { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: #94a3b8; }
.org-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }
.org-status-center { display: flex; align-items: center; gap: 8px; }
.org-stat-chip { font-size: 13px; font-weight: 600; color: #64748b; background: #1e293b; padding: 4px 10px; border-radius: 12px; }
.org-stat-chip span { color: #3b82f6; }
.org-status-right { display: flex; gap: 8px; }
.org-export-all-btn {
  font-size: 14px; font-weight: 600; padding: 7px 13px;
  background: #1e293b; border: 1px solid #334155;
  color: #94a3b8; border-radius: 6px; cursor: pointer;
}
.org-export-all-btn:hover { background: #334155; color: white; }

/* Settings panel */
.org-settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--od-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  overflow-y: auto;
}
.org-settings-box {
  background: var(--od-modal-bg);
  border: 1px solid var(--od-modal-border);
  border-radius: 14px;
  padding: 28px 36px 24px;
  width: min(980px, 96vw);
  height: auto;
  max-height: none;
  display: flex;
  flex-direction: column;
  overflow: visible;
  color: var(--od-modal-text);
  margin: auto;
}
.org-settings-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.org-settings-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
  padding-right: 0;
}
.org-settings-split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  align-items: start;
  border-top: 1px solid var(--od-modal-border);
  margin-top: 2px;
  padding-top: 10px;
}
.org-settings-split-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.org-settings-divider {
  border-top: 1px solid var(--od-modal-border);
  margin-top: 4px;
  padding-top: 12px;
}
.org-settings-divider-brand {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}
.org-settings-split-side .org-settings-divider:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}
.org-settings-divider-label {
  font-size: 12px;
  color: var(--od-modal-muted);
  margin-bottom: 8px;
}

.org-settings-brand-help {
  font-size: 12px;
  line-height: 1.5;
  color: var(--od-modal-muted);
  margin-bottom: 10px;
}

.org-settings-brand-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--od-modal-text);
}

.org-settings-brand-field input[type="text"] {
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--od-modal-border);
  background: var(--od-surface-2);
  color: var(--od-modal-text);
  font-size: 14px;
  font-weight: 400;
}

.org-settings-brand-color-field input[type="color"] {
  width: 72px;
  height: 44px;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--od-modal-border);
  background: var(--od-surface-2);
  cursor: pointer;
}

.org-settings-brand-logo {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--od-modal-text);
}
.org-theme-toggle {
  display: flex;
  gap: 8px;
}
.org-theme-btn {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--od-modal-border);
  background: var(--od-surface-2);
  color: var(--od-modal-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.org-theme-btn:hover { background: var(--od-designer-tool-hover); }
.org-theme-btn.active {
  background: var(--od-accent);
  border-color: var(--od-accent-hover);
  color: #fff;
}
.org-settings-sublabel {
  font-size: 11px;
  color: var(--od-modal-muted);
  margin: 12px 0 8px;
}
.org-player-display-toggle {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.org-player-display-btn {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--od-modal-border);
  background: var(--od-surface-2);
  color: var(--od-modal-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.org-player-display-btn:hover { background: var(--od-designer-tool-hover); }
.org-player-display-btn.active {
  background: var(--od-accent);
  border-color: var(--od-accent-hover);
  color: #fff;
}
.org-settings-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--od-modal-text);
  cursor: pointer;
  margin: 0;
}
.org-settings-check input {
  accent-color: var(--od-accent);
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
}
.org-settings-hint {
  font-size: 11px;
  color: var(--od-modal-muted);
  line-height: 1.45;
  margin: 8px 0 0;
}
.org-settings-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  flex-shrink: 0;
}
.org-settings-footer-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  min-width: 0;
}
.org-settings-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.org-settings-link:hover { color: #1d4ed8; }
.org-settings-build {
  font-size: 11px;
  color: var(--od-modal-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.pilot-guide-list {
  margin: 12px 0 0;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--od-modal-text);
}
.pilot-guide-list li { margin-bottom: 8px; }
.pilot-guide-box { max-width: 560px; }
.pilot-guide-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.pilot-guide-progress-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.pilot-guide-progress-bar::after {
  content: "";
  display: block;
  height: 100%;
  width: var(--pilot-pct, 0%);
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.pilot-guide-progress-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--od-modal-muted);
  white-space: nowrap;
}
.pilot-guide-checklist {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pilot-guide-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--od-modal-border);
  border-radius: 8px;
  background: var(--od-surface-2);
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
}
.pilot-guide-check-item:hover { border-color: #93c5fd; }
.pilot-guide-check-item input {
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}
.pilot-guide-check-item.done {
  opacity: 0.72;
}
.pilot-guide-check-item.done .pilot-guide-check-label {
  text-decoration: line-through;
}
.pilot-guide-section {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.pilot-guide-section-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 6px;
}
.pilot-guide-section-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--od-modal-text);
}
.pilot-guide-gym-list {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--od-modal-text);
}
.pilot-guide-gym-list li { margin-bottom: 6px; }
.pilot-guide-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.pilot-guide-action-btn {
  text-align: center;
  padding: 9px 8px;
  font-size: 12px;
}
@media (max-width: 520px) {
  .pilot-guide-actions { grid-template-columns: 1fr; }
}
.pilot-guide-note {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--od-surface-2);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--od-modal-muted);
}

/* Settings panel buttons */
.org-settings-btn {
  width: 100%; padding: 10px 14px;
  background: var(--od-surface-2);
  border: 1px solid var(--od-modal-border);
  color: var(--od-modal-text);
  border-radius: 7px; font-size: 13px;
  font-weight: 600; cursor: pointer; text-align: left;
}
.org-settings-btn:hover { background: var(--od-designer-tool-hover); }
.org-settings-close {
  background: #3b82f6; border: none; color: white;
  padding: 8px 18px; border-radius: 6px; cursor: pointer;
  font-size: 13px; font-weight: 600;
}

.modal-overlay { position: fixed; inset: 0; background: var(--od-overlay); display: none; align-items: center; justify-content: center; z-index: 100; }
.modal-overlay.active { display: flex; }
/* Practice planner overlay is z-index 140 — stack these modals above it */
#practice-add-modal.active,
#practice-template-modal.active {
  z-index: 160;
}
.modal-box { background: var(--od-modal-bg); border-radius: 14px; border: 1px solid var(--od-modal-border); padding: 24px; width: 450px; color: var(--od-modal-text); box-shadow: 0 20px 48px rgba(15, 23, 42, 0.12); }
.modal-box.admin-panel-box,
.modal-box-wide.admin-panel-box {
  width: min(1700px, 99vw);
  max-width: 99vw;
  min-width: min(1700px, 99vw);
}
.auth-modal-overlay {
  padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  align-items: flex-start;
  background: linear-gradient(160deg, #0f172a 0%, #1e3a5f 45%, #0f172a 100%);
}
@media (min-height: 640px) {
  .auth-modal-overlay { align-items: center; }
}
.auth-modal-box { text-align: center; }
.auth-modal-logo {
  display: block;
  margin: 0 0 8px;
  max-width: 168px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}
.auth-modal-tagline {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #94a3b8;
}
.modal-box.auth-modal-box {
  width: min(440px, 94vw);
  max-height: min(92dvh, 720px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  color: #f8fafc;
  backdrop-filter: blur(12px);
}
.auth-modal-top {
  padding: 20px 22px 0;
  flex-shrink: 0;
  text-align: left;
}
.auth-modal-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.auth-modal-heading .modal-title { margin: 0; color: #f8fafc; }
.auth-modal-top > .modal-title { color: #f8fafc; margin-bottom: 4px; }
.auth-trial-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #86efac;
  background: rgba(20, 83, 45, 0.55);
  border: 1px solid rgba(134, 239, 172, 0.35);
  border-radius: 999px;
  padding: 4px 10px;
  line-height: 1.2;
}
.auth-modal-body {
  padding: 10px 22px 4px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  text-align: left;
}
.auth-modal-footer {
  padding: 0 22px 18px;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
}
.auth-footnote {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: #64748b;
  text-align: center;
}
.auth-modal-box .modal-subtitle { margin-bottom: 0; color: #94a3b8; }
.auth-modal-box .modal-field { margin-bottom: 10px; }
.auth-modal-box .modal-field label { color: #94a3b8; }
.auth-modal-box .modal-field input {
  padding: 10px 11px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f8fafc;
}
.auth-modal-box .modal-field input::placeholder { color: #64748b; }
.auth-modal-box .modal-field input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.75);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
.auth-password-wrap { position: relative; }
.auth-password-wrap input { width: 100%; padding-right: 4.6rem; }
.auth-password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #93c5fd;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
}
.auth-password-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #bfdbfe;
}
.auth-modal-box .auth-error {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.35);
  border-color: rgba(252, 165, 165, 0.35);
}
.auth-modal-box .modal-title,
.auth-modal-box .modal-subtitle,
.auth-modal-box .modal-field,
.auth-modal-box .auth-error,
.auth-modal-box .modal-actions,
.auth-modal-box .auth-switch-line { text-align: left; }
.auth-modal-box .auth-switch-line,
.auth-modal-box .auth-footnote { text-align: center; }
.auth-modal-box .auth-switch-line { color: #94a3b8; margin-top: 12px; margin-bottom: 0; }
.auth-modal-box .auth-switch-btn { color: #93c5fd; }
.auth-modal-box .auth-switch-btn:hover { color: #bfdbfe; }
.auth-modal-box .modal-actions { margin-top: 14px; justify-content: stretch; }
.auth-modal-box .modal-actions .modal-cancel,
.auth-modal-box .modal-actions .modal-create {
  flex: 1;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
}
.auth-modal-box .modal-actions .modal-cancel {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f8fafc;
}
.auth-modal-box .modal-actions .modal-cancel:hover { background: rgba(255, 255, 255, 0.14); }
.auth-modal-box .modal-actions .modal-create {
  background: #2563eb;
  border: none;
  color: #fff;
}
.auth-modal-box .modal-actions .modal-create:hover { background: #1d4ed8; }
.modal-title { font-size: 18px; font-weight: 700; color: var(--od-modal-text); }
.modal-subtitle { font-size: 12px; color: var(--od-modal-muted); margin-bottom: 15px; }
.modal-field { margin-bottom: 12px; }
.modal-field label { display: block; font-size: 12px; color: var(--od-modal-muted); margin-bottom: 4px; }
.modal-field input, .modal-field select { width: 100%; padding: 8px; background: var(--od-modal-input-bg); border: 1px solid var(--od-modal-border); border-radius: 6px; color: var(--od-modal-text); }
.court-options { display: flex; gap: 8px; }
.court-option { flex: 1; padding: 12px; border: 1px solid var(--od-modal-border); border-radius: 8px; text-align: center; font-size: 11px; font-weight: 700; cursor: pointer; background: var(--od-surface-2); color: var(--od-text-muted); }
.court-option.active { border-color: var(--od-accent); color: var(--od-accent); background: #eff6ff; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* Line type picker modal */
.line-type-overlay { z-index: 1000; }
.line-type-box {
  width: min(400px, 94vw);
  padding: 22px 22px 18px;
}
.line-type-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}
.line-type-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--od-surface-2);
  border: 1px solid var(--od-modal-border);
  font-size: 22px;
  font-weight: 700;
  color: var(--od-text-muted);
}
.line-type-sub {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--od-modal-muted);
}
.line-type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.line-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 84px;
  padding: 12px 8px;
  border: 2px solid var(--od-modal-border);
  border-radius: 12px;
  background: var(--od-surface-2);
  color: var(--od-modal-text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.line-type-btn:hover {
  border-color: var(--line-accent, var(--od-accent));
  background: color-mix(in srgb, var(--line-accent, var(--od-accent)) 8%, var(--od-surface-2));
  transform: translateY(-1px);
}
.line-type-btn:focus-visible {
  outline: none;
  border-color: var(--line-accent, var(--od-accent));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--line-accent, var(--od-accent)) 25%, transparent);
}
.line-type-btn-icon {
  font-size: 26px;
  line-height: 1;
  color: var(--line-accent, var(--od-modal-text));
}
.line-type-btn-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.line-type-actions {
  margin-top: 16px;
  justify-content: center;
}
.line-type-actions .modal-cancel {
  min-width: 140px;
  padding: 10px 18px;
  font-weight: 600;
}
.touch-device .line-type-btn {
  min-height: 92px;
}
@media (max-width: 380px) {
  .line-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Contextual line action picker (FastDraw-style, near stroke end) */
.line-action-picker {
  position: absolute;
  z-index: 120;
  min-width: 168px;
  max-width: min(240px, 82vw);
  padding: 10px 10px 8px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(8px);
  pointer-events: auto;
  touch-action: manipulation;
}
.line-action-picker[hidden] { display: none !important; }
.line-action-picker-title {
  margin: 0 4px 8px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  letter-spacing: 0.01em;
}
.line-action-picker-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.line-action-picker-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #111111;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.line-action-picker-btn:hover,
.line-action-picker-btn:focus-visible {
  outline: none;
  border-color: rgba(15, 23, 42, 0.18);
  background: #f1f5f9;
}
.line-action-picker-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  flex-shrink: 0;
}
.line-action-picker-icon svg {
  display: block;
  width: 32px;
  height: auto;
}
.line-action-picker-label {
  font-size: 14px;
  font-weight: 600;
  color: #111111;
}
.touch-device .line-action-picker-btn {
  min-height: 46px;
  padding: 10px 12px;
}
.line-action-picker-btn.suggested {
  border-color: rgba(15, 23, 42, 0.35);
  background: #e2e8f0;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}
.line-action-picker-btn.suggested::after {
  content: none;
}

.modal-cancel { background: transparent; border: 1px solid var(--od-modal-border); color: var(--od-modal-text); padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.modal-create { background: var(--od-accent); border: none; color: white; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; }
.modal-create:hover { background: var(--od-accent-hover); }
.modal-box-wide { width: 560px; max-width: 94vw; }
.modal-box-wide.admin-panel-box {
  width: min(1700px, 99vw);
  max-width: 99vw;
  min-width: min(1700px, 99vw);
}
.modal-optional { font-weight: 400; color: var(--od-modal-muted); }
.modal-box-scroll {
  max-height: min(92vh, 940px);
  overflow-y: auto;
}
.playbook-cover-section {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--od-modal-border);
}
.playbook-cover-panel { margin-top: 4px; }
.playbook-cover-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}
.playbook-cover-checks { margin-top: 4px; }
.playbook-cover-image-preview {
  width: 200px;
  min-height: 120px;
}
.playbook-cover-image-preview img {
  width: 100%;
  height: auto;
  max-height: 140px;
  object-fit: contain;
}
.playbook-cover-rich-editor { margin-top: 4px; }
.playbook-cover-body-editor {
  min-height: 120px;
  max-height: 220px;
  overflow-y: auto;
}
.playbook-cover-advanced { margin-top: 12px; }
.playbook-cover-advanced summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--od-modal-muted);
  user-select: none;
}
.playbook-cover-advanced-body { margin-top: 10px; }
@media (max-width: 560px) {
  .playbook-cover-options-grid { grid-template-columns: 1fr; }
  .playbook-logos-grid { grid-template-columns: 1fr; }
}
.playbook-logo-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.playbook-logo-preview {
  width: 88px;
  height: 88px;
  border: 1px dashed var(--od-modal-border);
  border-radius: 10px;
  background: var(--od-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.playbook-logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.playbook-logo-placeholder {
  font-size: 11px;
  color: var(--od-modal-muted);
  text-align: center;
  padding: 8px;
}
.playbook-logo-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.org-playbook-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.org-playbook-add-btn {
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px dashed var(--od-accent);
  background: #eff6ff;
  color: var(--od-accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.org-playbook-add-btn:hover { background: #dbeafe; }
.org-playbook-preview-btn {
  background: var(--fd-red, #9e1b32);
  border-color: var(--fd-red-dark, #7a1528);
  color: #fff;
}
.org-playbook-preview-btn:hover { background: var(--fd-red-dark, #7a1528); }
.org-playbook-preview-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.org-playbook-present-btn {
  background: #111827;
  border-color: #374151;
  color: #fff;
}
.org-playbook-present-btn:hover { background: #1f2937; }
.org-playbook-present-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.org-preview-present-btn {
  font-size: 13px;
  font-weight: 800;
}
.org-playbook-add-btn[hidden] { display: none !important; }

.playbook-plays-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 8px;
}
.playbook-plays-tabs {
  display: flex;
  gap: 6px;
  margin: 10px 0 12px;
  padding: 4px;
  background: var(--od-surface-2);
  border-radius: 8px;
  border: 1px solid var(--od-border);
}
.playbook-plays-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--od-text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.playbook-plays-tab.active {
  background: var(--od-surface, #fff);
  color: var(--od-modal-text, #0f172a);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.playbook-plays-tab-panel { margin-bottom: 4px; }
.playbook-plays-hint {
  margin-top: 8px;
  font-size: 11px;
  color: var(--od-text-muted);
  line-height: 1.45;
}
.playbook-plays-remove-btn {
  margin-left: auto;
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.35);
}
.playbook-plays-remove-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.playbook-plays-remove-btn:not(:disabled):hover {
  background: rgba(185, 28, 28, 0.08);
}
.org-preview-playbook-item-remove {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 18px;
  line-height: 1;
  color: #94a3b8;
  margin-left: 4px;
}
.org-preview-playbook-item-remove:hover {
  background: rgba(185, 28, 28, 0.12);
  color: #b91c1c;
}
.playbook-plays-tool-btn {
  padding: 6px 12px;
  border: 1px solid var(--od-border);
  border-radius: 6px;
  background: var(--od-surface-2);
  color: var(--od-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.playbook-plays-tool-btn:hover { background: var(--od-designer-tool-hover); }
.playbook-plays-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--od-text-muted);
}
.playbook-plays-list {
  max-height: min(52vh, 420px);
  overflow: auto;
  border: 1px solid var(--od-border);
  border-radius: 8px;
  background: var(--od-surface-2);
  margin-bottom: 4px;
}
.playbook-plays-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--od-text-muted);
  font-size: 13px;
}
.playbook-plays-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--od-border);
  cursor: pointer;
  background: var(--od-surface);
}
.playbook-plays-row:last-child { border-bottom: none; }
.playbook-plays-row:hover { background: var(--od-surface-2); }
.playbook-plays-row.selected { background: var(--od-row-selected); }
.playbook-plays-check {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--od-accent);
}
.playbook-plays-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.playbook-plays-row-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--od-text);
}
.playbook-plays-row-meta {
  font-size: 11px;
  color: var(--od-text-muted);
  line-height: 1.4;
}
/* ==============================
   NEW FEATURES — v2
   ============================== */

/* Animation preset buttons */
.anim-preset-btn {
  flex: 1;
  padding: 5px 0;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
}
.anim-preset-btn:hover { background: #e0e7ff; color: #2563eb; border-color: #a5b4fc; }
.anim-preset-btn.active { background: #7c3aed; color: white; border-color: #6d28d9; }

/* Stats input rows */
.stat-row-input {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat-row-input label {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-row-input input,
.stat-row-input select {
  padding: 6px 8px;
  border: 1px solid #d1d9e0;
  border-radius: 5px;
  font-size: 12px;
  color: #1e293b;
  background: white;
  outline: none;
}
.stat-row-input input:focus,
.stat-row-input select:focus { border-color: #2563eb; }

/* Zone drawing overlay label */
.zone-type-bar {
  display: flex;
  gap: 5px;
  padding: 8px 12px;
  border-top: 1px solid #e5e9ee;
  flex-wrap: wrap;
}
.zone-type-btn {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  background: white;
  color: #475569;
  cursor: pointer;
}
.zone-type-btn:hover { background: #e0e7ff; color: #2563eb; border-color: #a5b4fc; }
.zone-type-btn.active { background: #2563eb; color: white; border-color: #1d4ed8; }

/* Player label input highlight */
#player-label-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.12);
}

/* Plays library templates modal */
#templates-modal .template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  max-height: 55vh;
  overflow-y: auto;
  padding: 4px;
}
.template-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 14px 12px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.template-card:hover { border-color: #3b82f6; background: #1d2f4a; transform: translateY(-2px); }
.template-card-icon { font-size: 26px; margin-bottom: 8px; }
.template-card-name { font-size: 13px; font-weight: 700; color: #f1f5f9; margin-bottom: 3px; }
.template-card-desc { font-size: 11px; color: #64748b; }

/* =========================
   PLAYBANK
========================= */
.playbank-overlay {
  position: fixed;
  inset: 0;
  z-index: 350;
  display: flex;
  flex-direction: column;
  background: #fff;
  padding: 0;
  box-sizing: border-box;
}
.playbank-overlay[hidden] { display: none !important; }
.playbank-shell {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: none;
  max-height: none;
  background: #fff;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.playbank-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(180deg, #fff 0%, #f9fafb 100%);
}
.playbank-header-actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-shrink: 0;
}
.playbank-admin-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 420px;
  justify-content: flex-end;
}
.playbank-admin-bar[hidden] { display: none !important; }
.playbank-admin-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.playbank-admin-btn:hover { background: #f8fafc; border-color: #94a3b8; }
.playbank-admin-btn-danger {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fef2f2;
}
.playbank-admin-btn-danger:hover { background: #fee2e2; }
.playbank-admin-btn-ghost { background: transparent; }
.playbank-source-link {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 13px;
  color: #2563eb;
  text-decoration: none;
}
.playbank-source-link:hover { text-decoration: underline; }
.playbank-source-link[hidden] { display: none !important; }
.playbank-court-img.playbank-preview-shot {
  object-fit: contain;
  max-width: 100%;
  max-height: 100%;
}
.playbank-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
}
.playbank-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: #64748b;
}
.playbank-close-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}
.playbank-close-btn:hover { background: #f1f5f9; color: #111827; }
.playbank-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}
.playbank-search-wrap {
  flex: 1 1 220px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 12px;
  min-height: 40px;
}
.playbank-search-icon { opacity: 0.55; font-size: 14px; }
.playbank-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
  color: #111827;
  min-width: 0;
}
.playbank-group-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 20px 0;
  border-bottom: 1px solid #e5e7eb;
}
.playbank-group-chip {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
}
.playbank-group-chip:hover { border-color: #94a3b8; background: #fff; }
.playbank-group-chip.active {
  background: #1e3a8a;
  border-color: #1e40af;
  color: #fff;
}
.playbank-tag-group { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.playbank-kind-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.playbank-kind-chip,
.playbank-cat-chip {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.playbank-kind-chip:hover,
.playbank-cat-chip:hover { border-color: #94a3b8; color: #1e293b; }
.playbank-kind-chip.active,
.playbank-cat-chip.active {
  background: #9e1b32;
  border-color: #7a1528;
  color: #fff;
}
.playbank-cat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 20px;
  border-bottom: 1px solid #e5e7eb;
  max-height: 88px;
  overflow-y: auto;
}
.playbank-body {
  display: grid;
  grid-template-columns: minmax(360px, 34%) 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.playbank-list-panel {
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
}
.playbank-admin-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.playbank-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
  font-size: 12px;
  color: #475569;
}
.playbank-list-toolbar[hidden] { display: none !important; }
.playbank-list-toolbar-count { font-weight: 600; }
.playbank-item-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
}
.playbank-item-check {
  flex: 0 0 auto;
  align-self: center;
  margin: 0 4px 0 8px;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #9e1b32;
}
.playbank-item-row .playbank-item {
  flex: 1;
  min-width: 0;
}
.playbank-item-row:has(.playbank-item-check:checked) .playbank-item {
  background: #fff7ed;
  border-color: #fed7aa;
}
.playbank-list {
  overflow-y: auto;
  flex: 1;
  padding: 8px;
}
.playbank-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.playbank-item:hover { background: #f8fafc; border-color: #e2e8f0; }
.playbank-item.active {
  background: #fef2f2;
  border-color: #fecaca;
}
.playbank-item-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.playbank-item-text { min-width: 0; }
.playbank-item-name {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 2px;
}
.playbank-item-desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.playbank-item-meta {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}
.playbank-empty {
  padding: 24px 16px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}
.playbank-detail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.playbank-preview-wrap {
  flex: 1;
  min-height: 375px;
  background: #eef2f7;
  border-bottom: 1px solid #e5e7eb;
  padding: 12px;
}
.playbank-court-area {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 405px;
}
.playbank-court-img {
  position: absolute;
  pointer-events: none;
  object-fit: contain;
}
.playbank-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.playbank-meta {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.playbank-meta-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.playbank-detail-icon { font-size: 28px; line-height: 1; }
.playbank-detail-name {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #111827;
}
.playbank-detail-desc {
  margin: 4px 0 0;
  font-size: 13px;
  color: #64748b;
}
.playbank-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.playbank-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.playbank-tag-kind-play { background: #dbeafe; color: #1d4ed8; }
.playbank-tag-kind-drill { background: #dcfce7; color: #15803d; }
.playbank-detail-notes {
  margin: 0;
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
}
.playbank-target-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.playbank-target-select {
  font-size: 14px;
  font-weight: 600;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-family: inherit;
}
.playbank-add-btn {
  margin-top: 4px;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background: #9e1b32;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.02em;
}
.playbank-add-btn:hover:not(:disabled) { background: #7a1528; }
.playbank-add-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.fd-playbank-btn {
  border-color: #9e1b32;
  color: #9e1b32;
}
.fd-playbank-btn:hover {
  background: #fef2f2;
  border-color: #7a1528;
  color: #7a1528;
}
@media (max-width: 860px) {
  .playbank-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(270px, 42vh) 1fr;
  }
  .playbank-list-panel { border-right: none; border-bottom: 1px solid #e5e7eb; }
}

/* =========================
   BUG FIXES & IMPROVEMENTS
========================= */

/* Fix: org-topnav center buttons overflow on small screens */
@media (max-width: 768px) {
  .org-topnav { flex-wrap: wrap; height: auto; min-height: 64px; padding: 10px 14px; gap: 10px; }
  .org-brand-logo { height: 44px; max-width: 140px; }
  .org-topnav-center { flex-wrap: wrap; justify-content: flex-start; }
  .org-topbtn { min-height: 46px; padding: 12px 18px; font-size: 15px; }
  .org-filter-bar { flex-direction: column; align-items: stretch; }
  .org-filter-bar-fields { flex-direction: column; align-items: stretch; }
  .org-filter-bar-label { width: 100%; }
  .org-filter-bar-search-wrap { max-width: none; }
  .org-library-split { flex-direction: column; }
  .org-library-split .org-library-main {
    flex: 0 0 auto;
    max-width: none;
    max-height: 45vh;
    border-right: none;
    border-bottom: 1px solid var(--od-border);
  }
  .org-library-preview { min-height: 40vh; }
  .org-preview-frames { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ds-body { grid-template-columns: 180px minmax(0, 1fr) 222px 0px; }
  .ds-right-panel { display: none; }
  .ds-frames-column { display: flex; }
  html:not(.tablet-device) .ds-canvas-wrap { width: 100%; max-width: 100%; height: min(520px, 55vh); min-height: 360px; }
  html:not(.tablet-device) #court-container { max-width: 100%; max-height: 520px; }
  .ds-editor-stack, .ds-frame-actions, .ds-court-chrome { width: 100%; max-width: 100%; }
  .ds-topbar-center { flex-wrap: wrap; gap: 4px; }
  .ds-nav-btn { padding: 6px 10px; font-size: 13px; }
  .org-settings-box {
    width: min(96vw, 100%);
    max-height: none;
    padding: 20px 18px;
  }
  .org-settings-body {
    overflow-y: auto;
    max-height: calc(100vh - 120px);
  }
  .org-settings-split {
    grid-template-columns: 1fr;
  }
}

/* Fix: dialog input focus style */
#dlg-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}


/* Fix: org-card PDF button style */
.org-card-btn[title="Export PDF Playbook"] { color: #7c3aed; }
.org-card-btn[title="Export PDF Playbook"]:hover { background: #f5f3ff; }

/* Improvement: smooth scroll for frames list */
.ds-thumb-list { scroll-behavior: smooth; }

/* Grid children must shrink inside fixed columns */
.ds-canvas-area { min-width: 0; min-height: 0; }

/* Touch / tablet — larger tap targets in designer */
.touch-device .ds-court-zoom-btn {
  width: 44px;
  height: 44px;
  font-size: 20px;
}

.touch-device .ds-court-zoom-label {
  min-width: 52px;
  font-size: 13px;
}

.touch-device .ds-tool-item {
  padding: 14px 16px;
  min-height: 48px;
}

.touch-device .ds-nav-btn {
  min-height: 42px;
  padding: 8px 14px;
}

.touch-device .notes-fmt-btn {
  min-width: 44px;
  min-height: 44px;
}

.touch-device .ds-frame-btn {
  min-height: 44px;
  padding: 10px 16px;
}

.touch-device .ds-frame-tab {
  min-height: 44px;
  padding: 10px 14px;
}

.touch-device .frame-item {
  min-width: 88px;
  min-height: 108px;
}

/* Tablet (iOS / Android) — full screen + court fills available height */
html.tablet-device,
html.tablet-device body {
  height: var(--app-height, 100dvh);
  min-height: var(--app-height, 100dvh);
  max-height: var(--app-height, 100dvh);
  width: 100%;
  overflow: hidden;
}

html.tablet-device #screen-organizer {
  flex: 1;
  min-height: 0;
  max-height: var(--app-height, 100dvh);
}

html.tablet-device #screen-designer.active,
html.tablet-device #screen-designer.fullscreen-active {
  inset: 0;
  width: 100%;
  height: var(--app-height, 100dvh);
  max-height: var(--app-height, 100dvh);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  box-sizing: border-box;
}

html.tablet-device #screen-designer .ds-body {
  flex: 1;
  min-height: 0;
  grid-template-columns: minmax(148px, 176px) minmax(0, 1fr) minmax(162px, 204px) 0px;
}

html.tablet-device #screen-designer .ds-right-panel {
  display: none;
}

html.tablet-device #screen-designer .ds-center-stack {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 8px 10px 6px;
}

html.tablet-device #screen-designer .ds-court-block {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
}

html.tablet-device #screen-designer .ds-canvas-wrap {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  width: 100%;
}

html.tablet-device #screen-designer #court-container {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
}

html.tablet-device #screen-designer .ds-court-chrome {
  flex-shrink: 0;
}

html.tablet-device #screen-designer .ds-editor-stack {
  max-height: min(24vh, 200px);
}

html.tablet-device #screen-designer .ds-topbar {
  flex-shrink: 0;
}

html.tablet-device #screen-designer .ds-topbar-right {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

html.tablet-device #screen-designer .ds-tool-shortcut {
  display: none;
}

html.tablet-device .welcome-screen {
  min-height: var(--app-height, 100dvh);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

html.tablet-device .org-library-split.library-tablet-mode .fd-preview-panel,
html.tablet-device .org-library-split.library-tablet-mode .fd-split-resizer,
html.tablet-device .org-library-split.library-tablet-mode #org-split-resizer {
  display: none !important;
}

html.tablet-device .org-library-split.library-tablet-mode .org-library-main {
  flex: 1 1 100% !important;
  max-width: 100% !important;
  max-height: none !important;
  border-right: none !important;
  border-bottom: none !important;
}

html.tablet-device .fd-play-table tbody tr {
  min-height: 48px;
}

html.tablet-device .fd-play-table tbody tr td {
  padding-top: 14px;
  padding-bottom: 14px;
  font-size: 15px;
}

html.tablet-device .org-filter-chip {
  min-height: 40px;
  padding: 8px 14px;
}

html.tablet-device .org-topbtn {
  min-height: 44px;
}

html.tablet-device,
html.tablet-device body {
  overscroll-behavior: none;
}

[data-theme="dark"] .ds-court-zoom {
  background: rgba(15, 23, 42, 0.88);
  border-color: #334155;
}

.ds-line-type-flash {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  z-index: 8;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}
.ds-line-type-flash.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 25000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: 10px;
  background: #1e293b;
  color: #f8fafc;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
  max-width: min(360px, 92vw);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #14532d; border: 1px solid #166534; }
.toast-error { background: #450a0a; border: 1px solid #7f1d1d; }

.org-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--od-text-muted);
}
.org-empty-icon { font-size: 36px; margin-bottom: 10px; opacity: 0.7; }
.org-empty-state p { margin: 0 0 16px; font-size: 15px; }
.org-empty-cta {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  background: #2563eb;
  color: white;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.org-empty-cta:hover { background: #1d4ed8; }
.org-empty-cta-ghost {
  background: transparent;
  border: 1px solid var(--od-border);
  color: var(--od-text);
}

.practice-duration-total { color: #2563eb; font-size: 15px; }
.practice-items-summary { font-size: 14px; color: var(--od-text-muted); }
.practice-item-drag {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  color: var(--od-text-muted);
  font-size: 16px;
  cursor: grab;
  flex-shrink: 0;
  user-select: none;
}
.practice-item-row.is-dragging { opacity: 0.55; }
.practice-item-row.is-drag-over { border-color: #2563eb; box-shadow: inset 0 0 0 1px #2563eb; }
.practice-save-template-btn {
  background: #f5f3ff;
  border: 1px solid #c4b5fd;
  color: #6d28d9;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.practice-save-template-btn:hover { background: #ede9fe; }
.practice-template-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(52vh, 480px);
  overflow: auto;
  margin: 12px 0 4px;
}
.practice-template-row-wrap {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.practice-template-row {
  flex: 1;
  text-align: left;
  padding: 14px 16px;
  border: 1px solid var(--od-border);
  border-radius: 10px;
  background: var(--od-surface);
  cursor: pointer;
}
.practice-template-row:hover { border-color: #93c5fd; background: #eff6ff; }
.practice-template-row-name { font-size: 15px; font-weight: 800; color: var(--od-text); }
.practice-template-row-meta { font-size: 12px; color: var(--od-text-muted); margin-top: 4px; }
.practice-template-row-notes { font-size: 12px; color: var(--od-text-muted); margin-top: 6px; line-height: 1.45; }
.practice-template-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  vertical-align: middle;
}
.practice-template-delete {
  flex-shrink: 0;
  width: 40px;
  border: 1px solid var(--od-border);
  border-radius: 10px;
  background: var(--od-surface);
  color: #dc2626;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}
.practice-template-delete:hover { background: #fef2f2; border-color: #fca5a5; }

.shortcuts-modal-box { width: min(420px, 94vw); }
.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-top: 8px;
}
.shortcut-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--od-modal-text);
}
.shortcut-row kbd {
  min-width: 28px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--od-modal-border);
  background: var(--od-surface-2);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 1024px) {
  .ds-body { grid-template-columns: 220px minmax(0, 1fr) 252px 0px; }
  .ds-right-panel { display: none; }
}

/* Print uses same topbar style as Share (ds-nav-btn) */

/* Dark mode — hardcoded light surfaces */
[data-theme="dark"] .org-bulk-bar {
  background: #1e3a5f;
  border-bottom-color: #334155;
}
[data-theme="dark"] .org-bulk-count { color: #93c5fd; }
[data-theme="dark"] .org-bulk-btn {
  background: #1e293b;
  color: #bfdbfe;
  border-color: #475569;
}
[data-theme="dark"] .org-bulk-btn-ghost:hover { background: #334155; }
[data-theme="dark"] .auth-error {
  background: #450a0a;
  border-color: #7f1d1d;
  color: #fca5a5;
}
[data-theme="dark"] .auth-trial-badge {
  color: #86efac;
  background: #14532d;
  border-color: #166534;
}
[data-theme="dark"] .court-option.active {
  background: #1e3a5f;
  color: #93c5fd;
}
[data-theme="dark"] .org-playbook-add-btn {
  background: #1e3a5f;
}
[data-theme="dark"] .org-playbook-add-btn:hover { background: #1e40af; }
[data-theme="dark"] .org-user-menu {
  background: #1e293b;
  border-color: #334155;
}
[data-theme="dark"] .org-user-menu-item:hover { background: #334155; }
[data-theme="dark"] .org-preview-duplicate-btn,
[data-theme="dark"] .org-bulk-btn-ghost {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #475569;
}
[data-theme="dark"] .org-preview-duplicate-btn:not(:disabled):hover {
  background: #334155;
  border-color: #64748b;
}
[data-theme="dark"] .org-preview-frame-card img,
[data-theme="dark"] .org-preview-frame-placeholder,
[data-theme="dark"] #frames-container .frame-thumb {
  background: transparent;
  border-color: #334155;
}
[data-theme="dark"] #frames-container .frame-item.active {
  background: #1e3a5f;
}
[data-theme="dark"] #frames-container .frame-item.drag-over {
  background: #312e81;
}
[data-theme="dark"] #frames-container .frame-label { color: #e2e8f0; }
[data-theme="dark"] .ds-notes-tab.active {
  background: #334155;
  color: #93c5fd;
}
[data-theme="dark"] .action-color-row:hover { background: #334155; }
[data-theme="dark"] .action-color-row.active {
  background: #1e3a5f;
  outline-color: #475569;
}
[data-theme="dark"] .ds-options-label { color: #94a3b8; }
[data-theme="dark"] .modal-box { box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45); }
[data-theme="dark"] .org-card {
  background: var(--od-surface);
  border-color: var(--od-border);
}
[data-theme="dark"] .org-card-btn {
  background: var(--od-surface-2);
  border-color: var(--od-border);
  color: var(--od-text);
}
[data-theme="dark"] .org-card-btn:hover { background: var(--od-designer-tool-hover); }
[data-theme="dark"] .org-card-btn[title="Export PDF Playbook"]:hover { background: #312e81; }
[data-theme="dark"] .org-card-tag.default { background: #334155; color: #cbd5e1; }
[data-theme="dark"] .org-filter-item:hover,
[data-theme="dark"] .org-tag-item:hover { background: #334155; }
[data-theme="dark"] .org-filter-item.active { background: #475569; color: #f1f5f9; }
[data-theme="dark"] .admin-library-type-play { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .admin-library-type-drill { background: #422006; color: #fcd34d; }
[data-theme="dark"] .org-settings-btn-admin:hover { background: #1e3a5f !important; }
[data-theme="dark"] .org-settings-btn-danger:hover { background: #450a0a !important; }

.org-settings-hint-muted {
  color: var(--od-text-muted);
  font-size: 12px;
  margin-top: -4px;
}

.admin-ui-layout-panel {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--od-modal-border);
}

.admin-ui-layout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.admin-ui-layout-card {
  cursor: pointer;
  margin: 0;
}

.admin-ui-layout-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.admin-ui-layout-card-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 2px solid var(--od-modal-border);
  border-radius: 10px;
  background: var(--od-surface-2);
  min-height: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.admin-ui-layout-card:hover .admin-ui-layout-card-inner {
  border-color: var(--od-accent);
}

.admin-ui-layout-card.is-selected .admin-ui-layout-card-inner,
.admin-ui-layout-card:has(input:checked) .admin-ui-layout-card-inner {
  border-color: var(--od-accent);
  box-shadow: 0 0 0 1px var(--od-accent);
}

.admin-ui-layout-swatch {
  height: 48px;
  border-radius: 6px;
  border: 1px solid var(--od-border);
}

.admin-ui-layout-swatch-classic {
  background: linear-gradient(180deg, #9e1b32 0 40%, #f3f4f6 40%);
}

.admin-ui-layout-swatch-pro-dark {
  background: linear-gradient(180deg, #141820 0 40%, #0a0d12 40%);
  border-color: #f97316;
}

.admin-ui-layout-swatch-sideline {
  background: linear-gradient(180deg, #e2e8f0 0 55%, #2563eb 55%);
}

.admin-ui-layout-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--od-modal-text);
}

.admin-ui-layout-desc {
  font-size: 12px;
  line-height: 1.4;
  color: var(--od-text-muted);
  font-weight: 500;
}

/* PRACTICE LIVE MODE */
#practice-live-overlay {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: #020617;
  display: flex;
  flex-direction: column;
  color: #f1f5f9;
  user-select: none;
}
#practice-live-overlay[hidden] { display: none !important; }
.practice-live-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
}
.practice-live-title { font-size: 20px; font-weight: 800; letter-spacing: 0.01em; }
.practice-live-meta { font-size: 13px; color: #64748b; margin-top: 4px; font-weight: 600; }
.practice-live-progress-text { font-size: 12px; color: #94a3b8; margin-top: 6px; font-weight: 700; }
.practice-live-progress-bar {
  margin-top: 8px;
  height: 4px;
  width: min(280px, 100%);
  border-radius: 999px;
  background: #1e293b;
  overflow: hidden;
}
.practice-live-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  transition: width 0.35s ease;
}
.practice-live-toggle-plan {
  display: none;
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.practice-live-header-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.practice-live-session-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 6px 12px;
  background: #1e293b;
  border-radius: 10px;
}
.practice-live-clock-label { font-size: 10px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.08em; }
#practice-live-session-time { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.practice-live-close-btn {
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.practice-live-close-btn:hover { background: #1e293b; color: white; }
.practice-live-session-notes-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 20px;
  background: #111827;
  border-bottom: 1px solid #1e293b;
}
.practice-live-session-notes-wrap[hidden] { display: none !important; }
.practice-live-session-notes-label {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  padding-top: 3px;
}
.practice-live-session-notes {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #cbd5e1;
  white-space: pre-wrap;
}
.practice-live-body { flex: 1; min-height: 0; display: flex; overflow: hidden; }
.practice-live-checklist-wrap {
  width: 300px;
  flex-shrink: 0;
  border-right: 1px solid #1e293b;
  background: #0b1220;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.practice-live-checklist-head {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 1px solid #1e293b;
}
.practice-live-checklist { flex: 1; overflow: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.practice-live-check-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  grid-template-rows: auto auto;
  gap: 2px 10px;
  align-items: start;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid #1e293b;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  cursor: pointer;
}
.practice-live-check-item:hover { border-color: #475569; background: #111827; }
.practice-live-check-item.is-current { border-color: #7c3aed; box-shadow: inset 0 0 0 1px #7c3aed; background: #1e1033; }
.practice-live-check-item.is-done { opacity: 0.72; }
.practice-live-check-item.is-done .practice-live-check-num { background: #16a34a; color: white; }
.practice-live-check-num {
  grid-row: 1 / span 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  background: #1e293b;
  color: #94a3b8;
}
.practice-live-check-name { font-size: 14px; font-weight: 800; line-height: 1.25; }
.practice-live-check-dur { grid-column: 2; font-size: 11px; color: #64748b; font-weight: 600; }
.practice-live-main {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: 24px 28px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.practice-live-block-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #7c3aed;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 16px;
}
.practice-live-thumb-wrap {
  width: min(420px, 90vw);
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid #1e293b;
  margin-bottom: 18px;
}
.practice-live-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.practice-live-thumb-fallback { font-size: 64px; line-height: 1; display: flex; align-items: center; justify-content: center; height: 100%; }
.practice-live-block-name { font-size: clamp(24px, 4vw, 34px); font-weight: 900; letter-spacing: -0.02em; margin-bottom: 8px; }
.practice-live-block-meta { font-size: 14px; color: #64748b; font-weight: 600; margin-bottom: 16px; }
.practice-live-cue {
  max-width: 640px;
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  background: #1e293b;
  border: 1px solid #334155;
  font-size: 16px;
  line-height: 1.5;
  color: #e2e8f0;
  margin-bottom: 22px;
  font-style: italic;
}
.practice-live-timer-panel { width: min(360px, 92vw); margin-bottom: 24px; }
.practice-live-timer-display {
  font-size: clamp(48px, 10vw, 72px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 10px;
}
.practice-live-timer-display.is-done { color: #f87171; }
.practice-live-timer-bar {
  height: 8px;
  border-radius: 999px;
  background: #1e293b;
  overflow: hidden;
  margin-bottom: 14px;
}
.practice-live-timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #7c3aed, #2563eb);
  transition: width 0.35s linear;
}
.practice-live-timer-fill.is-done { background: #ef4444; }
.practice-live-timer-actions { display: flex; gap: 10px; justify-content: center; }
.practice-live-timer-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  min-width: 110px;
}
.practice-live-timer-btn.is-running { background: #7c3aed; border-color: #6d28d9; }
.practice-live-timer-btn-muted { color: #94a3b8; }
.practice-live-auto-start {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
}
.practice-live-auto-start input { accent-color: #7c3aed; }
.practice-live-shortcuts {
  flex-shrink: 0;
  padding: 10px 16px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  border-top: 1px solid #1e293b;
  background: #0b1220;
}
#practice-live-overlay.plan-collapsed .practice-live-checklist-wrap { display: none; }
.practice-live-timer-btn:hover { background: #334155; }
.practice-live-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  width: 100%;
  max-width: 720px;
}
.practice-live-nav-btn,
.practice-live-diagram-btn,
.practice-live-done-btn {
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid #334155;
}
.practice-live-nav-btn { background: #1e293b; color: white; min-width: 120px; }
.practice-live-nav-btn:disabled { opacity: 0.35; cursor: default; }
.practice-live-diagram-btn { background: #0f172a; color: #cbd5e1; }
.practice-live-diagram-btn:disabled { opacity: 0.35; cursor: default; }
.practice-live-done-btn { background: #16a34a; border-color: #15803d; color: white; flex: 1; min-width: 180px; }
.practice-live-nav-btn:hover:not(:disabled),
.practice-live-diagram-btn:hover:not(:disabled) { background: #334155; }
.practice-live-done-btn:hover { background: #15803d; }

@media (max-width: 900px) {
  .practice-live-toggle-plan { display: inline-block; }
  .practice-live-body { flex-direction: column; }
  .practice-live-checklist-wrap {
    width: 100%;
    max-height: 34vh;
    border-right: none;
    border-bottom: 1px solid #1e293b;
  }
  .practice-live-checklist {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 12px;
  }
  .practice-live-check-item {
    min-width: 220px;
    flex-shrink: 0;
  }
}

/* v100 extras: formations, tour, analytics, high-contrast court */
#court-container.court-high-contrast canvas {
  filter: contrast(1.35) saturate(1.1) brightness(1.05);
}

.formation-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.formation-preset-btn {
  padding: 14px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  font-weight: 600;
  cursor: pointer;
}
.formation-preset-btn:hover { background: #e2e8f0; border-color: #94a3b8; }

.library-analytics-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.library-analytics-stat {
  text-align: center;
  padding: 12px 8px;
  border-radius: 10px;
  background: #f1f5f9;
}
.library-analytics-stat span { display: block; font-size: 1.5rem; font-weight: 700; color: #0f172a; }
.library-analytics-stat label { font-size: 0.75rem; color: #64748b; }
.library-analytics-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.library-analytics-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.library-analytics-table th, .library-analytics-table td { padding: 6px 8px; border-bottom: 1px solid #e2e8f0; text-align: left; }
@media (max-width: 640px) { .library-analytics-tables { grid-template-columns: 1fr; } }

.cloud-setup-steps { margin: 12px 0 16px; padding-left: 1.25rem; line-height: 1.7; color: #334155; }
.cloud-setup-steps code { font-size: 0.85em; background: #f1f5f9; padding: 2px 6px; border-radius: 4px; }

.app-tour-overlay {
  position: fixed; inset: 0; z-index: 12000;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 24px;
}
.app-tour-overlay[hidden] { display: none !important; }
.app-tour-card {
  background: #fff; border-radius: 14px; padding: 20px 22px;
  max-width: 420px; width: 100%; box-shadow: 0 20px 48px rgba(15,23,42,0.2);
}
.app-tour-progress { font-size: 0.75rem; color: #64748b; margin-bottom: 6px; }
.app-tour-title { font-size: 1.125rem; font-weight: 700; margin-bottom: 8px; }
.app-tour-body { font-size: 0.9rem; color: #475569; line-height: 1.55; margin-bottom: 16px; }
.app-tour-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.app-tour-nav { display: flex; gap: 8px; }
.app-tour-skip { background: none; border: none; color: #64748b; cursor: pointer; font-size: 0.875rem; }
.app-tour-highlight {
  outline: 3px solid #22c55e !important;
  outline-offset: 3px;
  border-radius: 8px;
  position: relative;
  z-index: 11999;
}

.practice-live-gym-notes-wrap {
  width: 100%; max-width: 520px; margin-top: 16px; text-align: left;
}
.practice-live-gym-notes-label {
  display: block; font-size: 0.75rem; color: #94a3b8; margin-bottom: 6px;
}
.practice-live-gym-notes {
  width: 100%; box-sizing: border-box; padding: 10px 12px;
  border-radius: 8px; border: 1px solid #334155; background: #0f172a; color: #e2e8f0;
  font-size: 0.9rem; resize: vertical; min-height: 72px;
}
