:root {
  --cb-bg: #ffffff;
  --cb-text: #333333;
  --cb-primary: #091A2C;
  --cb-primary-hover: #9299a2;
  --cb-border: #e0e0e0;
  --cb-overlay: rgba(0, 0, 0, 0.5);
  --cb-radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --cb-bg: #222222;
    --cb-text: #f0f0f0;
    --cb-border: #444444;
  }
}

.hidden { display: none !important; }

/* Banner Styles */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--cb-bg);
  color: var(--cb-text);
  padding: 16px 20px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 9999;
  border-top: 1px solid var(--cb-border);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  box-sizing: border-box;
}

.cookie-content {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 768px) {
  .cookie-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cookie-content p { margin: 0; font-size: 1.28rem; line-height: 1.5; }
.cookie-content a { color: var(--cb-primary); text-decoration: underline; }

.cookie-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

/* Buttons */
.btn {
  padding: 10px 24px;
  border-radius: var(--cb-radius);
  border: none;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.2rem;
  transition: opacity 0.2s, background-color 0.2s;
  white-space: nowrap;
}

.btn-primary { background-color: var(--cb-primary); color: #fff; }
.btn-primary:hover { background-color: var(--cb-primary-hover); }
.btn-link { background: none; color: var(--cb-text); text-decoration: underline; padding: 5px; font-size: 1.2rem; font-weight: normal; }

/* Modal Styles */
.cookie-modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: var(--cb-overlay);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--cb-bg);
  color: var(--cb-text);
  padding: 24px;
  border-radius: var(--cb-radius);
  width: 90%;
  max-width: 450px;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
}

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h3 { margin: 0; font-size: 1.1rem; }
.close-icon { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--cb-text); }

.cookie-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--cb-border);
}

.option-title { display: block; font-weight: bold; margin-bottom: 4px; font-size: 0.95rem; }
.option-desc { display: block; font-size: 0.8rem; opacity: 0.8; line-height: 1.4; }

/* Toggle Switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; margin-left: 15px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc; transition: .4s; border-radius: 24px;
}
.slider:before {
  position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--cb-primary); }
input:checked + .slider:before { transform: translateX(20px); }
.slider.disabled { opacity: 0.5; cursor: not-allowed; }