/* ============================================================
   PnP Quest Log — Dark Theme
   Modern, minimal dark UI inspired by Discord/Notion
   ============================================================ */

/* ------------------------------------------------------------
   Reset & Base
   ------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: #0d0d0d;
  color: #e8e8e8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
  min-height: 100vh;
}

button {
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

a {
  color: #c9a84c;
  text-decoration: none;
}

a:hover {
  color: #d4af5c;
}

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
}

.hidden {
  display: none !important;
}

/* ------------------------------------------------------------
   Scrollbar
   ------------------------------------------------------------ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #444;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}

/* ------------------------------------------------------------
   Topbar
   ------------------------------------------------------------ */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: #151515;
  border-bottom: 1px solid #2a2a2a;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 110;
}

.topbar-toggle {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 1.2rem;
  color: #999;
  transition: background 0.15s, color 0.15s;
}
.topbar-toggle:hover { background: #222; color: #e8e8e8; }

.topbar-logo {
  font-size: 1rem;
  font-weight: 700;
  color: #c9a84c;
  white-space: nowrap;
}

.topbar-spacer { flex: 1; }

.topbar-campaign {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-campaign-name {
  color: #999;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.topbar-campaign-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #999;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.topbar-campaign-btn:hover { background: #222; color: #e8e8e8; }
.btn-danger-icon:hover { background: #3a1515; color: #ef4444; }

.topbar-actions {
  display: flex;
  gap: 4px;
}

.topbar-action {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 1.1rem;
  color: #999;
  transition: background 0.15s, color 0.15s;
}
.topbar-action:hover { background: #222; color: #e8e8e8; }

/* ------------------------------------------------------------
   Sidebar
   ------------------------------------------------------------ */

.sidebar {
  position: fixed;
  left: 0;
  top: 52px;
  bottom: 0;
  width: 220px;
  background: #131313;
  border-right: 1px solid #2a2a2a;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s;
}

.sidebar.collapsed {
  transform: translateX(-100%);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  width: 100%;
  text-align: left;
  color: #999;
  font-size: 0.9rem;
  border-radius: 0;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.nav-item:hover {
  background: #1e1e1e;
  color: #ccc;
}

.nav-item.active {
  background: #1e1e1e;
  color: #c9a84c;
  border-left-color: #c9a84c;
}

.nav-icon {
  font-size: 1.2rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.nav-label {
  font-size: 0.9rem;
}

/* Mobile header is removed - topbar handles everything */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ------------------------------------------------------------
   Mobile Responsive
   ------------------------------------------------------------ */

@media (max-width: 767px) {
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
    z-index: 120;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  /* On mobile, collapsed class should NOT hide sidebar (hamburger toggles .open instead) */
  .sidebar.collapsed {
    transform: translateX(-100%);
  }

  .main {
    margin-left: 0 !important;
    padding: 16px !important;
  }

  .main.expanded {
    margin-left: 0 !important;
  }

  .topbar-logo { display: none; }
  .topbar-campaign-name { max-width: 120px; }
}

/* ------------------------------------------------------------
   Main & Views
   ------------------------------------------------------------ */

.main {
  margin-left: 220px;
  margin-top: 52px;
  padding: 24px 32px;
  min-height: calc(100vh - 52px);
  transition: margin-left 0.25s;
}

.main.expanded {
  margin-left: 0;
}

.view {
  display: block;
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.view-header h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: #e8e8e8;
}

.view-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

/* ------------------------------------------------------------
   Cards
   ------------------------------------------------------------ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  background: #1a1a1a;
  border-radius: 10px;
  padding: 16px;
  border: 1px solid #2a2a2a;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: #3a3a3a;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.card-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 6px;
  color: #e8e8e8;
}

.card-subtitle {
  color: #999;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.card-desc {
  color: #999;
  font-size: 0.85rem;
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.card-footer {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.campaigns-hero {
  text-align: center;
  padding: 32px 16px 24px;
}

.campaigns-hero h2 {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.campaigns-hero .text-muted {
  font-size: 0.95rem;
}

.campaigns-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.card.campaign-card {
  padding: 20px;
  position: relative;
}

.campaign-card-actions {
  display: flex;
  gap: 4px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #222;
}

.campaign-card-action {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #999;
  background: #222;
  transition: all 0.15s;
}

.campaign-card-action:hover {
  color: #e8e8e8;
  background: #333;
}

.campaign-card-action.danger:hover {
  color: #ef4444;
  background: #2a1515;
}

.campaign-card-stats {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.campaign-card-stat {
  font-size: 0.8rem;
  color: #666;
  display: flex;
  align-items: center;
  gap: 4px;
}

.campaign-card-stat i {
  font-size: 0.85rem;
  color: #555;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
}

.card.campaign-card.selected {
  border-color: #c9a84c;
  box-shadow: 0 0 0 1px #c9a84c;
}

/* ------------------------------------------------------------
   Badges
   ------------------------------------------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.6;
}

/* Status badges — blue family */
.badge-met,
.badge-discovered,
.badge-active,
.badge-found,
.badge-encountered {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

/* Status badges — green family */
.badge-allied,
.badge-explored,
.badge-completed,
.badge-equipped,
.badge-defeated {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
}

/* Status badges — red family */
.badge-hostile,
.badge-failed,
.badge-lost {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* Status badges — amber family */
.badge-dead,
.badge-abandoned,
.badge-sold,
.badge-fled,
.badge-cleared {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

/* Status badges — neutral */
.badge-not-met,
.badge-unknown {
  background: rgba(85, 85, 85, 0.2);
  color: #888;
}

/* Priority badges */
.badge-priority-low {
  background: rgba(136, 136, 136, 0.15);
  color: #888;
}

.badge-priority-medium {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.badge-priority-high {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.badge-priority-critical {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* Rarity badges */
.badge-common {
  background: rgba(136, 136, 136, 0.15);
  color: #888;
}

.badge-uncommon {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}

.badge-rare {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.badge-epic {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.badge-legendary {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  min-height: 38px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s,
    opacity 0.15s, transform 0.1s;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: #c9a84c;
  color: #000;
}

.btn-primary:hover {
  background: #d4af5c;
}

.btn-secondary {
  background: #222;
  color: #ccc;
  border: 1px solid #333;
}

.btn-secondary:hover {
  background: #2a2a2a;
  border-color: #444;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-ghost {
  background: transparent;
  color: #999;
}

.btn-ghost:hover {
  color: #e8e8e8;
  background: rgba(255, 255, 255, 0.05);
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.8rem;
  min-height: 30px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ------------------------------------------------------------
   Inputs
   ------------------------------------------------------------ */

.text-input,
.search-input,
.select-input,
textarea {
  background: #222;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 10px 14px;
  color: #e8e8e8;
  width: 100%;
  font-size: 0.9rem;
  font-family: inherit;
  line-height: 1.4;
  transition: border-color 0.15s;
}

.text-input:focus,
.search-input:focus,
.select-input:focus,
textarea:focus {
  border-color: #c9a84c;
  outline: none;
}

.text-input::placeholder,
.search-input::placeholder,
textarea::placeholder {
  color: #555;
}

.select-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* ------------------------------------------------------------
   Forms
   ------------------------------------------------------------ */

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: #999;
  font-weight: 500;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ------------------------------------------------------------
   Modal
   ------------------------------------------------------------ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.15s ease;
}

.modal {
  background: #1a1a1a;
  border-radius: 12px;
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #2a2a2a;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  animation: popIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-small {
  max-width: 400px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #2a2a2a;
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #2a2a2a;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   Toast
   ------------------------------------------------------------ */

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 380px;
  pointer-events: auto;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.toast-success {
  background: #065f46;
  color: #4ade80;
  border-left: 3px solid #4ade80;
}

.toast-error {
  background: #7f1d1d;
  color: #f87171;
  border-left: 3px solid #ef4444;
}

.toast-info {
  background: #1e3a5f;
  color: #60a5fa;
  border-left: 3px solid #3b82f6;
}

/* ------------------------------------------------------------
   Stats
   ------------------------------------------------------------ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.stat-card {
  background: #1a1a1a;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  border: 1px solid #2a2a2a;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}

.stat-card:hover {
  border-color: #3a3a3a;
  transform: translateY(-1px);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #c9a84c;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  color: #999;
  margin-top: 4px;
}

/* ------------------------------------------------------------
   Dashboard
   ------------------------------------------------------------ */

.dashboard-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}

.dashboard-section {
  background: #1a1a1a;
  border-radius: 10px;
  padding: 16px;
  border: 1px solid #2a2a2a;
}

.dashboard-section h3 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: #ccc;
}

@media (max-width: 767px) {
  .dashboard-sections {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------
   Detail View
   ------------------------------------------------------------ */

#detail-content {
  max-width: 720px;
}

.detail-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.detail-field {
  padding: 8px 0;
  border-bottom: 1px solid #1a1a1a;
}

.detail-label {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.detail-value {
  font-size: 0.95rem;
  color: #e8e8e8;
}

.detail-notes {
  background: #151515;
  padding: 16px;
  border-radius: 8px;
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 0.9rem;
  color: #ccc;
}

.detail-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.detail-image img {
  max-width: 100%;
  border-radius: 8px;
}

.detail-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-link {
  background: #222;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  color: #c9a84c;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.detail-link:hover {
  background: #2a2a2a;
  color: #d4af5c;
}

/* ------------------------------------------------------------
   Dice Roller
   ------------------------------------------------------------ */

.dice-area {
  max-width: 480px;
}

.dice-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.dice-btn {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: #1a1a1a;
  border: 2px solid #2a2a2a;
  font-size: 1.1rem;
  font-weight: 700;
  color: #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s, transform 0.1s;
}

.dice-btn:hover {
  border-color: #c9a84c;
  color: #c9a84c;
}

.dice-btn:active {
  transform: scale(0.95);
}

.dice-custom {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  align-items: center;
}

.dice-result {
  text-align: center;
  padding: 20px;
}

.dice-total {
  font-size: 3.5rem;
  font-weight: 800;
  color: #c9a84c;
  line-height: 1.1;
}

.dice-rolls {
  color: #999;
  margin-top: 4px;
  font-size: 0.9rem;
}

.dice-history {
  border-top: 1px solid #2a2a2a;
  padding-top: 16px;
}

.dice-history-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #1a1a1a;
  font-size: 0.85rem;
  color: #999;
}

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

/* ------------------------------------------------------------
   Settings
   ------------------------------------------------------------ */

.settings-list {
  max-width: 600px;
}

.settings-group {
  background: #1a1a1a;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid #2a2a2a;
}

.settings-group h3 {
  margin-bottom: 16px;
  font-size: 1rem;
  color: #e8e8e8;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #222;
  gap: 16px;
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row.danger {
  border-bottom-color: #2a1515;
}

/* ------------------------------------------------------------
   Utilities
   ------------------------------------------------------------ */

.text-muted {
  color: #555;
}

.text-gold {
  color: #c9a84c;
}

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: #555;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 8px;
  opacity: 0.6;
}

.empty-state p {
  font-size: 0.95rem;
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ------------------------------------------------------------
   Animations
   ------------------------------------------------------------ */

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes popIn {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

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

/* ------------------------------------------------------------
   Print
   ------------------------------------------------------------ */

@media print {
  .sidebar,
  .mobile-header,
  .modal-overlay,
  .toast-container,
  .overlay,
  .btn {
    display: none !important;
  }

  .main {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .card,
  .dashboard-section,
  .settings-group,
  .stat-card {
    border-color: #ccc;
    background: #fff;
    box-shadow: none;
  }
}

/* ------------------------------------------------------------
   Canvas Overlay
   ------------------------------------------------------------ */

.canvas-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  flex-direction: column;
  background: #0d0d0d;
}

.canvas-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: #151515;
  border-bottom: 1px solid #2a2a2a;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 50px;
}

.canvas-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.canvas-input-mode {
  display: flex;
  background: #222;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #333;
}

.canvas-mode-btn {
  width: 36px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #666;
  transition: all 0.15s;
}
.canvas-mode-btn:hover { color: #999; }
.canvas-mode-btn.active { background: #c9a84c; color: #000; }

.canvas-eraser-cursor {
  position: absolute;
  pointer-events: none;
  border: 2px dashed rgba(255,255,255,0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: none;
}

.canvas-tool-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 1rem;
  color: #999;
  border: 2px solid transparent;
  transition: all 0.15s;
}
.canvas-tool-btn:hover { background: #222; color: #e8e8e8; }
.canvas-tool-btn.active { border-color: #c9a84c; color: #c9a84c; }

.canvas-color-input {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  background: none;
}

.canvas-range {
  width: 80px;
  accent-color: #c9a84c;
}

.canvas-actions {
  display: flex;
  gap: 8px;
}

#drawing-canvas {
  flex: 1;
  display: block;
  cursor: crosshair;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.canvas-overlay {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Unlink button in detail */
.btn-unlink {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 4px;
  margin-left: 4px;
  transition: color 0.15s;
}
.btn-unlink:hover { color: #ef4444; }

/* Backup reminder */
.backup-reminder {
  margin-top: 32px;
  padding: 16px 20px;
  background: #1a1a0d;
  border: 1px solid #3a3520;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.backup-reminder-icon {
  font-size: 1.5rem;
  color: #c9a84c;
  flex-shrink: 0;
}

.backup-reminder-text {
  font-size: 0.85rem;
  color: #ccc;
  line-height: 1.5;
}

/* Markdown styles */
.md-h { color: #c9a84c; margin: 12px 0 6px; }
h2.md-h { font-size: 1.1rem; }
h3.md-h { font-size: 1rem; }
h4.md-h { font-size: 0.9rem; }
.md-p { margin: 0 0 4px; }
.md-list { padding-left: 20px; margin: 4px 0 8px; }
.md-list li { list-style: disc; margin: 2px 0; color: #ccc; }
.md-hr { border: none; border-top: 1px solid #2a2a2a; margin: 12px 0; }
.md-code { background: #222; padding: 1px 6px; border-radius: 4px; font-size: 0.85em; color: #c9a84c; }
.md-checklist { margin: 6px 0; }
.md-check { display: flex; align-items: center; gap: 8px; padding: 4px 0; color: #ccc; cursor: default; }
.md-check input { accent-color: #c9a84c; pointer-events: none; }
.md-check-done { color: #666; text-decoration: line-through; }

/* Timeline */
.timeline-group { margin-bottom: 20px; }
.timeline-date { font-size: 0.85rem; font-weight: 600; color: #c9a84c; margin-bottom: 6px; padding-left: 16px; position: relative; }
.timeline-date::before { content: ''; position: absolute; left: 0; top: 50%; width: 8px; height: 8px; background: #c9a84c; border-radius: 50%; transform: translateY(-50%); }

/* Network legend */
.network-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
  color: #999;
}
