/* myphonenumbers/page.css */

.view-panel          { display: none; flex-direction: column; flex: 1; }
.view-panel--active  { display: flex; }

.numbers-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 30px;
}

.pull-hint {
  text-align: center;
  font-size: 12px;
  color: var(--label-4);
  padding: 8px 0 0;
}

/* ── Toggle switch (iOS-style) ─────────────────────────────────────────────── */

.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle__track {
  width: 51px;
  height: 31px;
  background: var(--separator);
  border-radius: 16px;
  transition: background 0.2s;
  position: relative;
  display: block;
}

.toggle__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
  transition: transform 0.2s;
}

.toggle input:checked ~ .toggle__track {
  background: var(--accent, #34c759);
}

.toggle input:checked ~ .toggle__track::after {
  transform: translateX(20px);
}

.toggle input:disabled ~ .toggle__track {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Body flex containers ─────────────────────────────────────────────────── */

#list-body,
#detail-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* min-height:0 allows the textarea to fill remaining space in bounded containers */
#feature-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── Feature prompt editor nav ─────────────────────────────────────────────── */

/* NOTE: the element uses id="feature-nav", not class, so we target the ID here. */
#feature-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 20px;
  min-height: 44px;
  border-bottom: 0.5px solid var(--separator);
  flex-shrink: 0;
}

.feature-back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 0;
  font-family: inherit;
}

.feature-save {
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  background: transparent;
  border: 1.5px solid var(--accent);
  border-radius: 14px;
  padding: 5px 18px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s;
}
.feature-save:active  { opacity: .6; }
.feature-save:disabled { opacity: .4; cursor: not-allowed; }

/* ── Feature prompt editor content ─────────────────────────────────────────── */

.feature-phone {
  font-size: 14px;
  color: var(--label-3);
  margin-bottom: 4px;
}

.feature-display-text {
  font-size: 22px;
  font-weight: 600;
  color: var(--label);
  margin-bottom: 24px;
  text-wrap: balance;
}

.feature-prompt-label {
  font-size: 12px;
  font-weight: 400;
  color: var(--label-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 2px 8px;
}

.feature-prompt-textarea {
  flex: 1;
  min-height: 280px; /* fallback: page-main is scrollable so flex:1 alone gives 0px */
  padding: 14px;
  border: 1px solid var(--separator);
  border-radius: 12px;
  background: var(--bg-surface, var(--surface));
  color: var(--label);
  font-size: 15px;
  font-family: inherit;
  line-height: 1.5;
  resize: none;
  outline: none;
}
.feature-prompt-textarea:focus {
  border-color: var(--accent);
}

.feature-msg {
  font-size: 13px;
  min-height: 20px;
  color: var(--label-3);
  padding-top: 8px;
  flex-shrink: 0;
}
.feature-msg--ok  { color: var(--success, #34c759); }
.feature-msg--err { color: var(--destructive, #ff3b30); }

/* ── AI feature rows ────────────────────────────────────────────────────────── */

.ai-feature-row {
  cursor: pointer;
}
.ai-feature-row .row__label {
  color: var(--label);
}

/* ── Direction-based AI setup ─────────────────────────────────────────────── */

.ai-direction-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-top: .5px solid var(--separator);
  padding: 14px 16px;
  background: transparent;
  color: var(--label);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.ai-direction-row:focus-visible,
.ai-capability-card:focus-within,
.ai-remove-direction:focus-visible,
.ai-restore:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.ai-direction-copy,
.ai-capability-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ai-direction-label,
.ai-direction__eyebrow {
  color: var(--label-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ai-direction-name {
  font-size: 16px;
  font-weight: 550;
}
.ai-direction-description,
.ai-capability-description {
  color: var(--label-3);
  font-size: 13px;
  line-height: 1.35;
}
.ai-chevron { color: var(--label-4); font-size: 25px; }
.ai-inline-state { padding: 16px; color: var(--label-3); font-size: 14px; }
.ai-inline-state--error { color: var(--destructive); }
.ai-setup-progress {
  color: var(--label-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
}
.ai-capability-list { display: flex; flex-direction: column; gap: 10px; }
.ai-capability-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 70px;
  padding: 15px;
  border: 1px solid var(--separator);
  border-radius: 14px;
  background: var(--bg-surface, var(--surface));
  cursor: pointer;
}
.ai-capability-card--selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.ai-capability-card input { position: absolute; opacity: 0; }
.ai-radio {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--separator);
  border-radius: 50%;
  color: white;
  background: transparent;
}
.ai-capability-card--selected .ai-radio {
  border-color: var(--accent);
  background: var(--accent);
}
.ai-capability-title { font-weight: 600; font-size: 16px; }
.ai-capability-title + .capsule { align-self: flex-start; margin-top: 2px; }
.ai-none-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--label-2);
  cursor: pointer;
}
.ai-primary-action { margin-top: 22px; align-self: flex-end; width: auto; }
.ai-help { color: var(--label-3); font-size: 14px; line-height: 1.45; }
.ai-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.ai-draft-customize { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-wide-button { margin-top: 18px; }
.ai-remove-direction,
.ai-restore {
  min-height: 44px;
  border: 0;
  padding: 10px 0;
  background: transparent;
  color: var(--destructive);
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.ai-restore { color: var(--accent); }
.ai-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  color: var(--label-3);
  font-size: 13px;
}

.ai-setup-block {
  border: 0;
  border-top: .5px solid var(--separator);
  margin: 0;
  padding: 16px;
}
.ai-setup-block legend { padding-top: 16px; }
.ai-choice, .ai-tool-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  cursor: pointer;
}
.ai-choice input { margin-top: 3px; accent-color: var(--accent); }
.ai-choice span, .ai-tool-text { display: flex; flex: 1; flex-direction: column; gap: 3px; }
.ai-choice small { color: var(--label-3); font-size: 13px; line-height: 1.35; }
.ai-tool-row { align-items: center; border-bottom: .5px solid var(--separator); }
.ai-tool-row:last-child { border-bottom: 0; }
.ai-tool-row--disabled { cursor: default; opacity: .55; }
.ai-edit-link { border: 0; background: none; color: var(--accent); padding: 8px 0; font: inherit; cursor: pointer; }
.ai-save-row { display: flex; align-items: center; gap: 12px; justify-content: flex-end; padding: 16px; }
.ai-save-row .feature-msg { flex: 1; }

@media (max-width: 700px) {
  .ai-confirm-actions {
    position: sticky;
    bottom: 0;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    background: var(--bg, #f2f2f7);
  }
  .ai-confirm-actions .btn { flex: 1; }
  .ai-editor-footer {
    position: sticky;
    bottom: 0;
    background: var(--bg, #f2f2f7);
    padding-bottom: env(safe-area-inset-bottom);
  }
}
.capsule--ai { color: #176b3a; background: #e5f7eb; }
.capsule--warning { color: #8a5700; background: #fff3d6; }

/* ── Redesign (2026-10) ───────────────────────────────────────────────────── */

#detail-nav,
#feature-nav { padding-left: 40px; padding-right: 40px; }
#detail-nav:empty { display: none; }
#feature-nav { border-bottom: 0; }
@media (max-width: 899px) {
  #detail-nav,
  #feature-nav { padding-left: 16px; padding-right: 16px; }
}

/* Detail: subscription on the left, AI assistant on the right when there is room */
@media (min-width: 1180px) {
  #detail-body .section-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 24px;
    align-items: start;
  }
  #detail-body .section-list > .section,
  #detail-body .section-list > .num-hero { grid-column: 1; }
  #detail-body .section-list > #ai-section { grid-column: 2; grid-row: 1 / span 6; }
}

.toggle__track { background: var(--border); }
.toggle input:checked ~ .toggle__track { background: var(--accent); }
.toggle input:focus-visible ~ .toggle__track { box-shadow: 0 0 0 4px var(--accent-ring); }

.feature-save {
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 12px;
  padding: 9px 20px;
  font-weight: 700;
  box-shadow: var(--shadow-blue);
}
.feature-display-text { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.feature-prompt-textarea {
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  font-size: 15px;
  background: var(--bg-surface);
}
.feature-prompt-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-bg); }
.feature-msg--ok  { color: var(--green-text); }

/* AI setup card */
#ai-section .card { border-radius: 22px; }
.ai-setup-block { border-top: 1px solid var(--separator); padding: 18px 20px; }
.ai-direction-label { font-size: 12px; font-weight: 750; letter-spacing: .09em; color: var(--label-3); margin-bottom: 4px; }
.ai-choice {
  padding: 14px;
  margin-top: 10px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  align-items: flex-start;
}
.ai-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-bg); }
.ai-choice strong { font-size: 15.5px; }
.ai-choice input { width: 18px; height: 18px; }
.ai-tool-row { padding: 14px 0; border-bottom: 1px solid var(--separator); }
.ai-tool-row .row__label { font-weight: 650; }
.ai-edit-link { font-weight: 700; color: var(--accent-strong); margin-top: 6px; }
.ai-help { font-size: 14px; }
.ai-help strong { font-family: var(--font-mono); font-weight: 650; color: var(--label); }
.ai-save-row { padding: 18px 20px 20px; border-top: 1px solid var(--separator); }
.ai-save-row .btn { width: auto; }
.ai-inline-state { padding: 18px 20px; }
.ai-restore { color: var(--accent-strong); font-weight: 700; }

/* ── AI assistant summary + AI setup screen (as in the mock) ─────────────── */

.ai-card { padding: 22px 24px; border-radius: 22px; }
.ai-card__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ai-card__title { font-size: 18px; font-weight: 800; color: var(--label); }
.ai-card__title--lg { font-family: var(--font-display); font-size: 22px; letter-spacing: -0.01em; }
.ai-card__sub { font-size: 14px; color: var(--label-3); margin-top: 3px; }
.ai-card__eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--label-3);
  margin: 22px 0 4px;
}
.ai-card > .ai-card__eyebrow:first-child { margin-top: 0; margin-bottom: 12px; }

.ai-callout {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(29, 185, 127, .12), rgba(43, 136, 235, .10));
  font-size: 14px;
  line-height: 1.5;
  color: var(--label-2);
}
.ai-callout b { color: var(--label); }
.ai-callout--muted { background: var(--bg-sunken); }
.ai-mono { font-family: var(--font-mono); font-weight: 650; color: var(--label); white-space: nowrap; }
.ai-wave { display: inline-flex; align-items: flex-end; gap: 3px; height: 26px; flex-shrink: 0; }
.ai-wave i { width: 4px; border-radius: 2px; background: var(--green); }
.ai-wave i:nth-child(1) { height: 10px; }
.ai-wave i:nth-child(2) { height: 22px; }
.ai-wave i:nth-child(3) { height: 14px; }
.ai-wave i:nth-child(4) { height: 26px; }
.ai-wave i:nth-child(5) { height: 12px; }

.ai-sum-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--separator);
}
.ai-sum-row__title { font-weight: 700; font-size: 15.5px; }
.ai-sum-row__sub { font-size: 13.5px; color: var(--label-3); margin-top: 2px; }
.ai-state {
  flex-shrink: 0;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: var(--label-3);
  background: var(--bg-sunken);
}
.ai-state--on { color: var(--green-text); background: var(--green-bg); }
.ai-link { color: var(--accent-strong); font-weight: 750; font-size: 14.5px; flex-shrink: 0; }
.ai-open {
  margin-top: 20px;
  background: var(--ink);
  color: #fff;
}
.ai-open:hover { background: var(--ink-2); color: #fff; }

.toggle--live input:checked ~ .toggle__track { background: var(--green); }

/* Setup screen: settings left, instructions right */
.ai-setup { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
@media (min-width: 1100px) {
  .ai-setup:not(.ai-setup--off) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.ai-setup__col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

.ai-choices { display: flex; flex-direction: column; gap: 10px; }
.ai-choice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0;
  padding: 16px;
  border-radius: 16px;
  border: 2px solid var(--border);
  background: var(--bg-surface);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ai-choice:hover { border-color: var(--accent-ring); }
.ai-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ai-choice__dot {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  margin-top: 1px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ai-choice__text { display: flex; flex-direction: column; gap: 3px; }
.ai-choice__text strong { font-size: 16px; font-weight: 800; color: var(--label); }
.ai-choice__text small { font-size: 13.5px; line-height: 1.45; color: var(--label-3); }
.ai-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-bg); }
.ai-choice:has(input:checked) .ai-choice__dot { border-color: var(--accent); }
.ai-choice:has(input:checked) .ai-choice__dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.ai-choice:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--accent-ring); }
.ai-choice--disabled { opacity: .5; cursor: not-allowed; }

.ai-tools .ai-tool-row { padding: 15px 0; margin: 0; }
.ai-tools .ai-tool-row:last-child { border-bottom: 0; padding-bottom: 4px; }

.ai-instructions__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.ai-count { font-size: 12.5px; font-weight: 650; color: var(--label-3); white-space: nowrap; }
.ai-instructions-card .ai-help { margin: 0 0 14px; }
.ai-textarea {
  display: block;
  width: 100%;
  min-height: 260px;
  resize: vertical;
  padding: 16px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--bg-primary);
  color: var(--label);
  font: 500 15px/1.55 var(--font);
}
.ai-textarea:focus { outline: none; border-color: var(--accent); background: var(--bg-surface); box-shadow: 0 0 0 4px var(--accent-bg); }
.ai-instructions__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.ai-save { width: auto; padding-left: 28px; padding-right: 28px; }
.ai-instructions-card--off .ai-textarea,
.ai-instructions-card--off .ai-restore { opacity: .5; }
.ai-instructions-card .feature-msg:empty { display: none; }
@media (max-width: 899px) {
  .ai-card { padding: 18px; }
  .ai-instructions__foot { flex-direction: column-reverse; align-items: stretch; }
  .ai-save { width: 100%; }
  .ai-restore { text-align: center; }
}
.ai-choice .ai-choice__dot { flex: 0 0 22px; flex-direction: row; gap: 0; }
.ai-choice .ai-choice__text { flex: 1; display: flex; flex-direction: column; gap: 3px; text-align: left; }
