/* Session Dashboard / GM Screen Styles */
/* Theme-aware styling using CSS variables */

.session-dashboard {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 60px);
  background: var(--color-bg);
}

/* No Campaign State */
.session-no-campaign {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  min-height: 60vh;
}

.no-campaign-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  animation: pulse 2s ease-in-out infinite;
}

.session-no-campaign h2 {
  font-family: var(--font-display);
  color: var(--color-primary);
  margin: 0 0 0.75rem;
  font-size: 1.75rem;
}

.session-no-campaign p {
  color: var(--color-text-muted);
  margin: 0.25rem 0;
  max-width: 400px;
}

.no-campaign-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.no-campaign-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Header */
.session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.session-header-left,
.session-header-center,
.session-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.session-campaign-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--color-primary);
  margin: 0;
  font-weight: 600;
}

.session-campaign-meta {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.meta-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.meta-badge.system {
  background: var(--color-primary-muted);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.meta-badge.theme {
  background: var(--color-secondary-muted);
  color: var(--color-secondary);
  border: 1px solid var(--color-secondary);
}

.session-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.session-label-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.current-session-badge {
  background: linear-gradient(135deg, var(--color-primary-muted), var(--color-secondary-muted));
  color: var(--color-text);
  padding: 0.4rem 0.75rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--color-primary);
}

.no-session-badge {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.session-buttons {
  display: flex;
  gap: 0.5rem;
}

.session-timer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--color-accent);
  background: var(--color-warning-bg);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--color-accent);
}

.timer-icon {
  font-size: 1rem;
}

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

.btn-icon {
  background: var(--color-surface-hover);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.5rem;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--color-text);
}

.btn-icon:hover {
  background: var(--color-surface-active);
  border-color: var(--color-primary);
}

/* Main Container */
.session-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebars */
.session-left,
.session-right {
  width: 280px;
  min-width: 240px;
  max-width: 320px;
  background: var(--color-bg-alt);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.session-right {
  border-right: none;
  border-left: 1px solid var(--color-border);
}

/* Center Panel */
.session-center {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Panel Headers */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.panel-header h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pinned-count,
.log-count {
  background: var(--color-primary);
  color: var(--color-bg);
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
}

/* Pinned Panel */
.pinned-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.pinned-content {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.pinned-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-text-muted);
}

.pinned-empty .hint {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  opacity: 0.7;
}

.pinned-group {
  margin-bottom: 0.75rem;
}

.pinned-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.group-count {
  font-size: 0.7rem;
  opacity: 0.7;
}

.pinned-group-items {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pinned-item {
  padding: 0.6rem 0.75rem;
  background: var(--color-surface-hover);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.pinned-item:hover {
  background: var(--color-surface-active);
  border-color: var(--color-primary-muted);
}

.pinned-item.selected {
  background: var(--color-primary-muted);
  border-color: var(--color-primary);
}

.pinned-item-label {
  font-size: 0.9rem;
  color: var(--color-text);
}

/* Quick Actions - Uses canonical card style */
.quick-actions-toolbar {
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: radial-gradient(circle at top left, rgba(80,140,255,0.16), rgba(5,6,10,0.98));
  box-shadow: 0 8px 20px rgba(0,0,0,0.55);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}
[data-theme="light"] .quick-actions-toolbar {
  background: radial-gradient(circle at top left, rgba(80,140,255,0.08), rgba(255,255,255,0.98));
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.quick-actions-header {
  margin-bottom: 0.75rem;
}

.quick-actions-header h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.75rem 0.5rem;
  background: var(--color-surface-hover);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text-muted);
  transition: all 0.2s;
}

.quick-action-btn:hover {
  background: var(--color-primary-muted);
  border-color: var(--color-primary);
  color: var(--color-text);
  transform: translateY(-2px);
}

.quick-action-btn.chaos-btn {
  background: linear-gradient(135deg, var(--color-error-bg), var(--color-secondary-muted));
  border-color: var(--color-error);
}

.quick-action-btn.chaos-btn:hover {
  background: linear-gradient(135deg, var(--color-error-bg), var(--color-secondary-muted));
  filter: brightness(1.1);
  border-color: var(--color-error);
}

.qa-icon {
  font-size: 1.5rem;
}

.qa-label {
  font-size: 0.75rem;
  font-weight: 500;
}

/* Detail Pane - Uses canonical card style */
.detail-pane {
  flex: 1;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: radial-gradient(circle at top left, rgba(80,140,255,0.16), rgba(5,6,10,0.98));
  box-shadow: 0 8px 20px rgba(0,0,0,0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
[data-theme="light"] .detail-pane {
  background: radial-gradient(circle at top left, rgba(80,140,255,0.08), rgba(255,255,255,0.98));
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  color: var(--color-text-muted);
  flex: 1;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.detail-empty h3 {
  margin: 0 0 0.5rem;
  color: var(--color-text);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.detail-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.detail-icon {
  font-size: 1.5rem;
}

.detail-title h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--color-primary);
}

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

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--color-surface-hover);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.detail-meta-item strong {
  color: var(--color-text);
}

.detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.entry-content-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.content-field {
  line-height: 1.6;
}

.content-field strong {
  color: var(--color-primary);
}

.content-field.description {
  font-size: 1rem;
  color: var(--color-text);
  line-height: 1.7;
}

.content-field ul {
  margin: 0.25rem 0 0 1.25rem;
  padding: 0;
}

.content-field li {
  margin-bottom: 0.25rem;
}

.content-field.stat-block pre {
  background: var(--color-bg);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-text);
}

.content-field.secrets {
  background: var(--color-warning-bg);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border-left: 3px solid var(--color-accent);
}

.no-content {
  color: var(--color-text-muted);
  font-style: italic;
}

/* GM Notes */
.detail-notes {
  padding: 1rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
}

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

.notes-header h4 {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-accent);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.notes-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.gm-notes-textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
}

.gm-notes-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-muted);
}

.gm-notes-textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

/* Session Log */
.session-log-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.log-filter {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.filter-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.filter-toggle input[type="checkbox"] {
  accent-color: var(--color-primary);
}

.log-entries {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.log-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-text-muted);
}

.log-empty .hint {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  opacity: 0.7;
}

.log-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--color-surface-hover);
  border-radius: 6px;
  margin-bottom: 0.25rem;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.log-entry:hover {
  background: var(--color-surface-active);
  border-color: var(--color-primary-muted);
}

.log-entry.pinned {
  background: var(--color-primary-muted);
  border-color: var(--color-primary);
}

.log-entry-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
}

.log-entry-time {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-text-muted);
  opacity: 0.8;
}

.log-entry-icon {
  font-size: 0.9rem;
}

.log-entry-label {
  font-size: 0.85rem;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-entry-actions {
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.log-entry:hover .log-entry-actions {
  opacity: 1;
}

.btn-pin,
.btn-unpin {
  background: none;
  border: none;
  font-size: 0.9rem;
  padding: 0.25rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.btn-pin:hover,
.btn-unpin:hover {
  opacity: 1;
}

.log-more {
  text-align: center;
  padding: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.log-more a {
  color: var(--color-primary);
  font-size: 0.85rem;
  text-decoration: none;
}

.log-more a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 1024px) {
  .session-container {
    flex-direction: column;
  }
  
  .session-left,
  .session-right {
    width: 100%;
    max-width: none;
    min-width: auto;
    border: none;
    border-bottom: 1px solid var(--color-border);
    max-height: 300px;
  }
  
  .session-right {
    border-bottom: none;
    border-top: 1px solid var(--color-border);
  }
}

@media (max-width: 768px) {
  .session-header {
    flex-direction: column;
    text-align: center;
  }
  
  .session-header-left,
  .session-header-center,
  .session-header-right {
    width: 100%;
    justify-content: center;
  }
  
  .quick-actions-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  
  .detail-header {
    flex-direction: column;
  }
  
  .detail-actions {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .quick-actions-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .qa-icon {
    font-size: 1.25rem;
  }
  
  .qa-label {
    font-size: 0.65rem;
  }
}

/* Button styles consistent with site */
.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.btn-danger {
  background: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid var(--color-error);
}

.btn-danger:hover {
  background: var(--color-error-bg);
  filter: brightness(1.1);
  border-color: var(--color-error);
}

/* ===== NEW UX POLISH STYLES ===== */

/* Keyboard Help Overlay */
.keyboard-help-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.keyboard-help-modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 0;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.keyboard-help-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.keyboard-help-header h3 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--color-primary);
  font-size: 1.1rem;
}

.keyboard-help-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.keyboard-help-close:hover {
  background: rgba(139, 92, 246, 0.15);
  color: var(--color-primary);
}

.keyboard-help-close:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.keyboard-help-close:active {
  transform: scale(0.95);
}

.keyboard-help-content {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.keyboard-shortcut-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.keyboard-shortcut-row kbd {
  min-width: 2rem;
  text-align: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-primary);
  box-shadow: 0 2px 0 var(--color-border);
}

.keyboard-shortcut-row span {
  color: var(--color-text);
  font-size: 0.9rem;
}

.keyboard-help-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.keyboard-help-footer kbd {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 0.1rem 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* Help button in panel header */
.panel-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-help-kbd {
  background: var(--color-surface-hover);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  width: 1.5rem;
  height: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-help-kbd:hover {
  background: var(--color-primary-muted);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.pinned-empty kbd {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* Session Log Search */
.log-search {
  padding: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.log-search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text);
  font-size: 0.85rem;
}

.log-search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-muted);
}

.log-search-input::placeholder {
  color: var(--color-text-muted);
}

/* Log Filters */
.log-filters {
  padding: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.log-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.log-type-select {
  padding: 0.3rem 0.5rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text);
  font-size: 0.8rem;
  cursor: pointer;
}

.log-type-select:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* Log Entry Type Stripes */
.log-entry {
  position: relative;
  padding-left: 0.75rem;
}

.log-entry-type-stripe {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--type-color);
  border-radius: 4px 0 0 4px;
}

/* Pinned Item Actions */
.pinned-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pinned-item-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.pinned-item-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.pinned-item:hover .pinned-item-actions {
  opacity: 1;
}

.pinned-move-btn,
.pinned-unpin-btn {
  background: none;
  border: none;
  padding: 0.15rem 0.25rem;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s;
}

.pinned-move-btn:hover,
.pinned-unpin-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.pinned-unpin-btn:hover {
  color: var(--color-error);
}

.pinned-move-placeholder {
  width: 1.25rem;
}

/* Pinned Group Color Accent */
.pinned-group {
  border-left: 3px solid var(--type-color, var(--color-border));
  margin-left: 0.25rem;
  padding-left: 0.5rem;
}

/* Notes Header Layout */
.notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notes-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Notes Save Status */
.notes-save-status {
  font-size: 0.75rem;
  transition: all 0.2s;
}

.notes-save-status.saving {
  color: var(--color-accent);
}

.notes-save-status.saved {
  color: var(--color-success, #22c55e);
}

/* Auto-resize Textarea */
.gm-notes-textarea {
  overflow-y: hidden;
  resize: none;
  min-height: 80px;
}

/* AI Section Collapsible */
.entry-detail-ai-header.collapsible {
  padding: 0;
}

.ai-section-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem;
  background: var(--color-surface-hover);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--color-text);
  font-size: 0.9rem;
  text-align: left;
  transition: background 0.15s;
}

.ai-section-toggle:hover {
  background: var(--color-surface-active);
}

.toggle-icon {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  transition: transform 0.2s;
}

.ai-section-content {
  padding-top: 0.75rem;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  max-height: 2000px;
  opacity: 1;
}

.ai-section-content.collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
}

/* Mobile Tabs (< 900px) */
@media (max-width: 900px) {
  .session-dashboard {
    position: relative;
  }

  .session-container {
    flex-direction: column;
    padding-bottom: 60px;
  }

  .session-left,
  .session-right {
    display: none;
    position: fixed;
    bottom: 60px;
    left: 0;
    right: 0;
    height: 50vh;
    max-height: 50vh;
    z-index: 50;
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
  }

  .session-left.mobile-active,
  .session-right.mobile-active {
    display: flex;
  }

  .session-center {
    min-height: calc(100vh - 180px);
  }

  .mobile-tab-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    z-index: 100;
    height: 60px;
  }

  .mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem;
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.15s;
  }

  .mobile-tab.active {
    color: var(--color-primary);
    background: var(--color-primary-muted);
  }

  .mobile-tab-icon {
    font-size: 1.25rem;
  }

  .mobile-tab-label {
    font-size: 0.7rem;
    font-weight: 500;
  }
}

/* Desktop: hide mobile tab bar */
@media (min-width: 901px) {
  .mobile-tab-bar {
    display: none;
  }
}

/* Type Color Variables */
:root {
  --color-type-npc: #3b82f6;
  --color-type-creature: #3b82f6;
  --color-type-quest: #f97316;
  --color-type-encounter: #ef4444;
  --color-type-location: #22c55e;
  --color-type-item: #a855f7;
  --color-type-loot: #eab308;
  --color-type-dungeon: #6b7280;
  --color-type-faction: #14b8a6;
  --color-type-shop: #ec4899;
  --color-type-tavern: #8b5cf6;
  --color-type-puzzle: #06b6d4;
}

/* ============================================================================
   Toast Notifications
   ============================================================================ */

.gmg-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 10000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  font-size: 0.9rem;
  max-width: 350px;
}

.gmg-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.gmg-toast-success {
  border-left: 3px solid var(--color-success, #22c55e);
}

.gmg-toast-success .toast-icon {
  color: var(--color-success, #22c55e);
}

.gmg-toast-error {
  border-left: 3px solid var(--color-error, #ef4444);
}

.gmg-toast-error .toast-icon {
  color: var(--color-error, #ef4444);
}

.gmg-toast-warning {
  border-left: 3px solid var(--color-warning, #f59e0b);
}

.gmg-toast-warning .toast-icon {
  color: var(--color-warning, #f59e0b);
}

.gmg-toast-info {
  border-left: 3px solid var(--color-primary, #14b8a6);
}

.gmg-toast-info .toast-icon {
  color: var(--color-primary, #14b8a6);
}

.gmg-toast-generated {
  border-left: 3px solid var(--color-secondary, #8b5cf6);
}

.gmg-toast-generated .toast-icon {
  color: var(--color-secondary, #8b5cf6);
}

.toast-icon {
  font-weight: bold;
  font-size: 1rem;
}

.toast-message {
  color: var(--color-text);
}

/* Mobile positioning */
@media (max-width: 600px) {
  .gmg-toast {
    left: 10px;
    right: 10px;
    bottom: 70px;
    max-width: none;
  }
}

/* ===== SESSION GRID MODULE SYSTEM ===== */

.session-dashboard-grid {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
  overflow: hidden;
}

.session-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 80px;
  gap: 0.75rem;
  padding: 1rem;
  flex: 1;
  overflow: auto;
  background: var(--card-bg, #141620);
}

.session-module {
  position: relative;
  background: var(--card-bg-elevated, #1a1d2a);
  border: 1px solid var(--card-border, #2a2d3a);
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.session-module:hover {
  border-color: var(--arcane, #14b8a6);
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.1);
}

.session-module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--card-border, #2a2d3a);
  min-height: 36px;
  flex-shrink: 0;
}

.session-module-icon {
  margin-right: 0.375rem;
  font-size: 0.875rem;
}

.session-module-title {
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--rune, #e5e7eb);
  flex: 1;
}

.session-module-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.session-module:hover .session-module-controls {
  opacity: 1;
}

.session-module-controls button {
  background: transparent;
  border: none;
  color: var(--steel, #94a3b8);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 0.75rem;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.session-module-controls button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--rune, #e5e7eb);
}

.module-move-handle {
  cursor: grab;
}

.module-move-handle:active {
  cursor: grabbing;
}

.module-remove:hover {
  color: var(--color-error, #ef4444) !important;
}

.session-module-body {
  flex: 1;
  overflow: auto;
  padding: 0.5rem;
}

.module-resize-handle {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  cursor: se-resize;
  border-right: 2px solid rgba(255, 255, 255, 0.2);
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  opacity: 0;
  transition: opacity 0.2s;
}

.session-module:hover .module-resize-handle {
  opacity: 1;
}

/* Module Palette */
.session-header-modules {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--card-border, #2a2d3a);
}

.module-palette {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.module-palette-label {
  font-size: 0.75rem;
  color: var(--steel, #94a3b8);
  margin-right: 0.25rem;
}

.module-add {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border, #2a2d3a);
  border-radius: 999px;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  color: var(--steel, #94a3b8);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.module-add:hover {
  background: rgba(20, 184, 166, 0.1);
  border-color: var(--arcane, #14b8a6);
  color: var(--arcane, #14b8a6);
}

.toggle-grid-mode {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  margin-left: auto;
}

/* Drag and Resize States */
body.dragging-module,
body.resizing-module {
  user-select: none;
}

body.dragging-module .session-module {
  pointer-events: none;
}

body.dragging-module .session-module.dragging {
  pointer-events: auto;
  opacity: 0.8;
  z-index: 100;
}

body.resizing-module .session-module.resizing {
  z-index: 100;
}

/* Mobile: Show as vertical stack */
@media (max-width: 768px) {
  .session-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    grid-template-columns: none;
    grid-auto-rows: none;
  }

  .session-module {
    min-height: 200px;
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .session-header-modules {
    flex-wrap: wrap;
    justify-content: center;
  }

  .module-palette {
    width: 100%;
    justify-content: center;
  }

  .toggle-grid-mode {
    margin-left: 0;
    margin-top: 0.5rem;
    width: 100%;
    justify-content: center;
  }
}

/* Light mode adjustments */
.mode-light .session-grid {
  background: var(--card-bg, #f8fafc);
}

.mode-light .session-module {
  background: var(--card-bg-elevated, #ffffff);
  border-color: var(--card-border, #e2e8f0);
}

.mode-light .session-module-header {
  background: rgba(0, 0, 0, 0.02);
  border-bottom-color: var(--card-border, #e2e8f0);
}

.mode-light .session-header-modules {
  background: rgba(0, 0, 0, 0.02);
  border-top-color: var(--card-border, #e2e8f0);
}

.mode-light .module-add {
  background: rgba(0, 0, 0, 0.02);
  border-color: var(--card-border, #e2e8f0);
}

.mode-light .module-resize-handle {
  border-right-color: rgba(0, 0, 0, 0.2);
  border-bottom-color: rgba(0, 0, 0, 0.2);
}
