/* Client Settings (/settings.html) — a quiet, white, single-accent page that
   sits under the Hub's own top bar. System font stack on purpose (the rest of
   the Hub loads Montserrat); no gradients, glow or card clutter here. */

body.aic {
  --aic-ink: #1D1D1F;
  --aic-sub: #6E6E73;
  --aic-faint: #86868B;
  --aic-surface: #F5F5F7;
  --aic-hair: #D2D2D7;
  --aic-accent: #1c7cb8; /* the Hub's blue, darkened for AA contrast on white */
  background: #fff;
  color: var(--aic-ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}
body.aic .hub-top { border-bottom-color: var(--aic-hair); }

.aic-wrap { width: min(820px, 100% - 32px); margin: 0 auto; padding: 56px 0 72px; }

.aic-hero h1 {
  margin: 0 0 14px; font-size: clamp(34px, 5vw, 52px); font-weight: 700;
  letter-spacing: -.035em; line-height: 1.05;
}
:lang(zh-Hans) .aic-hero h1 { font-size: clamp(30px, 4.2vw, 44px); letter-spacing: -.03em; line-height: 1.15; }
.aic-hero .lead { margin: 0; font-size: 19px; line-height: 1.5; color: var(--aic-sub); max-width: 640px; }
:lang(zh-Hans) .aic-hero .lead { font-size: 17px; line-height: 1.75; }

.aic-section { margin-top: 56px; }
.aic-hero + .aic-section, .aic-hero + .aic-note { margin-top: 40px; }
.aic-section h2 { margin: 0 0 8px; font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
:lang(zh-Hans) .aic-section h2 { font-size: 21px; letter-spacing: -.01em; }
.aic .muted { margin: 0 0 16px; font-size: 15px; line-height: 1.6; color: var(--aic-sub); }
:lang(zh-Hans) .aic .muted { line-height: 1.75; }

.aic-note {
  margin-top: 28px; padding: 16px 18px; border-radius: 12px;
  background: var(--aic-surface); font-size: 15px; line-height: 1.6; color: var(--aic-ink);
}

/* Language switch — segmented, quiet, top right */
.lang-switch { display: inline-flex; padding: 3px; border-radius: 9px; background: #E8E8ED; }
.lang-switch button {
  border: 0; background: transparent; color: var(--aic-sub); cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 7px;
  min-height: 30px;
}
.lang-switch button[aria-pressed="true"] { background: #fff; color: var(--aic-ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.lang-switch button:focus-visible, .aic-btn:focus-visible, .aic-tabs button:focus-visible { outline: 2px solid var(--aic-accent); outline-offset: 2px; }

/* URL row */
.url-row { display: flex; gap: 10px; align-items: stretch; }
.url-row code {
  flex: 1; min-width: 0; padding: 14px 16px; border-radius: 10px; background: var(--aic-surface);
  font: 15px/1.4 "SF Mono", ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere;
  display: flex; align-items: center;
}

.aic-btn {
  border: 0; border-radius: 10px; padding: 0 18px; min-height: 44px; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap;
  background: var(--aic-accent); color: #fff;
}
.aic-btn:hover { opacity: .9; }
.aic-btn.secondary { background: #E8E8ED; color: var(--aic-ink); }
.aic-btn.small { min-height: 34px; padding: 0 14px; font-size: 13px; }
.aic-btn:disabled { opacity: .5; cursor: default; }

/* Tabs */
.aic-tabs { display: inline-flex; gap: 4px; padding: 3px; border-radius: 10px; background: #E8E8ED; margin: 14px 0 22px; flex-wrap: wrap; }
.aic-tabs button {
  border: 0; background: transparent; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600;
  color: var(--aic-sub); padding: 8px 18px; border-radius: 8px; min-height: 38px;
}
.aic-tabs button[aria-selected="true"] { background: #fff; color: var(--aic-ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

/* Numbered steps — one action per step */
ol.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
ol.steps li {
  counter-increment: s; position: relative; padding: 14px 0 14px 46px;
  border-top: 1px solid var(--aic-hair); font-size: 16px; line-height: 1.55;
}
ol.steps li:last-child { border-bottom: 1px solid var(--aic-hair); }
ol.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 14px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--aic-surface); color: var(--aic-ink); font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
:lang(zh-Hans) ol.steps li { line-height: 1.75; }
ol.steps b { font-weight: 650; }
ol.steps code, .prompts code {
  font: 14px "SF Mono", ui-monospace, Menlo, Consolas, monospace; background: var(--aic-surface);
  padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere;
}
ol.steps .cmd { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
ol.steps .cmd code { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 8px; display: block; }
.step-note { margin: 14px 0 0; font-size: 14px; line-height: 1.6; color: var(--aic-faint); }

/* Connections */
.conn-list { list-style: none; margin: 0; padding: 0; }
.conn-list li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--aic-hair); }
.conn-list li:last-child { border-bottom: 1px solid var(--aic-hair); }
.conn-list .name { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.conn-list .when { color: var(--aic-faint); font-size: 14px; }

/* Example prompts */
ul.prompts { list-style: none; margin: 0; padding: 0; }
ul.prompts li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--aic-hair); font-size: 16px; line-height: 1.55; }
ul.prompts li:last-child { border-bottom: 1px solid var(--aic-hair); }
ul.prompts li span { flex: 1; min-width: 0; }
:lang(zh-Hans) ul.prompts li { line-height: 1.75; }

.aic-foot { margin-top: 56px; font-size: 13px; line-height: 1.6; color: var(--aic-faint); }

@media (max-width: 560px) {
  .aic-wrap { padding-top: 36px; }
  .biz-row { gap: 12px; }
  .switch .sw-label { display: none; }
  .url-row { flex-direction: column; }
  .aic-hero .lead { font-size: 17px; }
  body.aic .hub-user { gap: 8px; }
  body.aic .btn-admin { padding: 8px 10px; }
  ol.steps .cmd { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: no-preference) {
  .aic-wrap { animation: aic-in .3s ease both; }
  @keyframes aic-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* What is shared — a quiet list, no bullets-in-boxes */
ul.explain { list-style: none; margin: 0 0 24px; padding: 0; }
ul.explain li { padding: 10px 0; border-top: 1px solid var(--aic-hair); font-size: 16px; line-height: 1.55; }
ul.explain li:last-child { border-bottom: 1px solid var(--aic-hair); }
:lang(zh-Hans) ul.explain li { line-height: 1.75; }
ul.explain b { font-weight: 650; }

/* One block per business: name + state on the left, switch on the right */
.biz { padding: 18px 0; border-bottom: 1px solid var(--aic-hair); }
.biz:first-child { padding-top: 4px; }
.biz-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.biz-info { min-width: 0; }
.biz-name { font-size: 18px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.biz-state { margin-top: 4px; font-size: 15px; line-height: 1.5; color: var(--aic-sub); }
.biz-state .when { color: var(--aic-faint); }
.biz-hint { margin: 10px 0 0; font-size: 14px; line-height: 1.6; color: var(--aic-faint); }
.biz.is-blocked .biz-name { color: var(--aic-sub); }

/* On/Off switch (button role=switch) */
.switch {
  flex: none; display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  border: 0; background: transparent; padding: 4px 0 4px 4px; min-height: 44px; font: inherit;
  color: var(--aic-ink);
}
.switch .knob {
  position: relative; width: 51px; height: 31px; border-radius: 16px; background: #D2D2D7;
  transition: background .2s ease; flex: none;
}
.switch .knob::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s ease;
}
.switch[aria-checked="true"] .knob { background: var(--aic-accent); }
.switch[aria-checked="true"] .knob::after { transform: translateX(20px); }
.switch .sw-label { min-width: 26px; font-size: 14px; font-weight: 600; text-align: left; }
.switch:disabled { cursor: not-allowed; opacity: .5; }
.switch:focus-visible { outline: 2px solid var(--aic-accent); outline-offset: 2px; border-radius: 10px; }
@media (prefers-reduced-motion: reduce) { .switch .knob, .switch .knob::after { transition: none; } }
