/* ================================================================
   options-components.css — Setting cards, radio options, domain list, buttons
   Apple HIG: 色は機能のみ、グレーで階層、アクセントは選択状態だけ
   ================================================================ */

/* ── Setting card ── */
.sg-card {
  background: var(--bg-2);
  border: 1px solid var(--sep);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 8px;
}

.sg-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px 12px;
  border-bottom: 1px solid var(--sep);
}

/* アイコン — 装飾ボックスなし、シンプルに */
.sg-icon {
  color: var(--label-3);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.sg-info { flex: 1; min-width: 0; }

.sg-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--label-1);
  line-height: 1.3;
}

.sg-desc {
  font-size: var(--text-xs);
  color: var(--label-3);
  margin-top: 2px;
  line-height: 1.5;
}
.sg-desc .u { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--label-4); }

.sg-body { padding: 12px 16px; }

/* ── Radio grid ── */
.radio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
@media (max-width: 520px) { .radio-grid { grid-template-columns: 1fr; } }

/* ── Radio option ── */
.radio-opt {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.radio-opt input[type="radio"] {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}

.radio-card {
  padding: 10px 12px;
  background: var(--bg-3);
  border: 1px solid transparent;   /* border常時表示しない */
  border-radius: var(--r-md);
  transition: background var(--t-fast), border-color var(--t-fast);
  cursor: pointer;
}

.radio-opt:hover .radio-card {
  background: var(--bg-4);
}

/* 選択時のみアクセントカラー使用 */
.radio-opt input:checked ~ .radio-card {
  background: rgba(10, 132, 255, 0.12);
  border-color: var(--accent);
}

.radio-opt.disabled { opacity: 0.28; pointer-events: none; }

.radio-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

/* Custom radio dot */
.radio-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--fill-1);
  flex-shrink: 0;
  position: relative;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.radio-opt input:checked ~ .radio-card .radio-dot {
  border-color: var(--accent);
  background: var(--accent);
}
.radio-dot::after {
  content: '';
  position: absolute; inset: 0; margin: auto;
  width: 0; height: 0;
  border-radius: 50%;
  background: #fff;
  transition: width var(--t-fast), height var(--t-fast);
}
.radio-opt input:checked ~ .radio-card .radio-dot::after {
  width: 5px; height: 5px;
}

/* アイコン — 非選択時グレー、選択時だけアクセント */
.radio-ri {
  color: var(--label-3);
  flex-shrink: 0;
  transition: color var(--t-fast);
}
.radio-opt input:checked ~ .radio-card .radio-ri { color: var(--accent); }

.radio-lbl {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--label-1);
  flex: 1;
  line-height: 1;
}

.radio-sub {
  font-size: var(--text-xs);
  color: var(--label-3);
  padding-left: 22px;
  line-height: 1.4;
}

/* ── Domain list ── */
.domain-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.domain-item {
  display: flex;
  align-items: center;
  gap: 7px;
}

.domain-input {
  flex: 1;
  height: 34px;
  padding: 0 12px;
  background: var(--bg-3);
  border: 1px solid var(--sep);
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--label-1);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.domain-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-3);
}
.domain-input::placeholder { color: var(--label-4); }

.btn-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  color: var(--label-3);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--t-fast), color var(--t-fast);
}
.btn-remove:hover {
  background: var(--red-muted);
  color: var(--red);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  height: 36px;
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity var(--t-fast), transform var(--t-fast), background var(--t-fast);
  white-space: nowrap;
}
.btn:active { transform: scale(0.975); }

/* Add domain — subtle ghost */
.btn-ghost {
  width: 100%;
  height: 34px;
  background: transparent;
  border: 1px dashed var(--sep-opaque);
  color: var(--label-3);
  font-size: var(--text-sm);
  border-radius: var(--r-md);
}
.btn-ghost:hover {
  background: var(--fill-4);
  border-style: solid;
  border-color: var(--fill-1);
  color: var(--label-2);
}

/* Primary save button — accent only here */
.btn-primary {
  height: 44px;
  padding: 0 24px;
  background: var(--accent);
  color: #fff;
  font-size: var(--text-md);
  font-weight: 600;
  border-radius: var(--r-lg);
  width: 100%;
  letter-spacing: -0.01em;
}
.btn-primary:hover { opacity: 0.88; }

/* ── Accordion trigger on sg-head ── */
.sg-head[data-ac-trigger] {
  cursor: pointer;
  user-select: none;
}
.sg-head[data-ac-trigger]:hover { background: var(--fill-4); }

.sg-chevron {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--label-3);
  transition: transform var(--t-mid), color var(--t-fast);
}
.sg-card.is-open .sg-chevron {
  transform: rotate(180deg);
  color: var(--label-2);
}

/* Panel */
.sg-card [data-ac-panel] {
  height: 0;
  overflow: hidden;
  transition: height var(--t-slow);
}