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

html, body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ck-bg {
  min-height: 100vh;
  background: #fafafa;
  transition: background 3s linear;
}

.ck-bg.dark { background: #111; }
.ck-bg.black { background: #000; }

.ck-help-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 25;
  padding: 8px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  color: #1a73e8;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: background 0.15s, border-color 0.15s;
}

.ck-help-btn:hover {
  background: #f8f9fa;
  border-color: #1a73e8;
}

.ck-help {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ck-help[hidden] { display: none; }

.ck-help-box {
  position: relative;
  background: #fff;
  max-width: 480px;
  width: 100%;
  max-height: min(90vh, 640px);
  overflow-y: auto;
  padding: 28px 24px 24px;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
  text-align: left;
}

.ck-help-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 18px;
  color: #666;
  cursor: pointer;
  padding: 4px 8px;
}

.ck-help-close:hover { color: #000; }

.ck-help-box h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
  padding-right: 28px;
}

.ck-help-intro {
  margin: 0 0 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #444;
}

.ck-help-list {
  margin: 0 0 16px;
  padding-left: 20px;
  font-size: 0.85rem;
  line-height: 1.65;
  color: #333;
}

.ck-help-list li { margin-bottom: 10px; }

.ck-help-tip {
  margin: 0 0 20px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #666;
  font-style: italic;
}

.ck-help-box .ck-btn--accept {
  display: block;
  width: 100%;
}

.ck-banner {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 20px;
}

.ck-banner-inner {
  background: #fff;
  max-width: 520px;
  width: 100%;
  padding: 32px;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
}

.ck-banner h2 { margin: 0 0 12px; font-size: 1.25rem; }

.ck-banner p { margin: 0 0 20px; line-height: 1.5; color: #444; font-size: 0.9rem; }

.ck-banner-btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ck-btn {
  padding: 12px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.ck-btn--accept {
  background: #1a73e8;
  color: #fff;
}

.ck-btn--ghost {
  background: #fff;
  color: #1a73e8;
  border: 1px solid #dadce0;
}

.ck-nudge {
  margin-top: 12px !important;
  font-size: 0.75rem !important;
  color: #c00 !important;
}

.ck-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 100%);
  height: 100%;
  background: #fff;
  z-index: 15;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.2);
}

.ck-panel[hidden] { display: none; }

.ck-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}

.ck-panel-head h3 { margin: 0; font-size: 1rem; }

.ck-panel-head button {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #666;
}

.ck-toggles {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 12px 20px;
}

.ck-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 12px;
}

.ck-toggle label {
  font-size: 0.82rem;
  color: #333;
  flex: 1;
  cursor: pointer;
}

.ck-toggle label.invasive { color: #800; }

.ck-toggle--snap {
  animation: ck-snap-row 0.35s ease-out;
}

@keyframes ck-snap-row {
  0%, 100% { transform: translateX(0); background: transparent; }
  25% { transform: translateX(-4px); background: rgba(200, 0, 0, 0.08); }
  75% { transform: translateX(4px); background: rgba(200, 0, 0, 0.08); }
}

.ck-switch input:disabled + .ck-slider {
  opacity: 0.55;
  cursor: not-allowed;
}

.ck-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.ck-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ck-slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}

.ck-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.ck-switch input:checked + .ck-slider { background: #1a73e8; }

.ck-switch input:checked + .ck-slider::before { transform: translateX(20px); }

.ck-switch.snap .ck-slider {
  animation: ck-snap 0.25s ease-out;
  background: #c00 !important;
}

@keyframes ck-snap {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.ck-panel-foot {
  padding: 16px 20px;
  border-top: 1px solid #eee;
}

.ck-track {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: #666;
}

.ck-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 30;
  text-align: center;
  padding: 20px;
}

.ck-overlay[hidden] { display: none; }
