/* Settings > AI & Copilot wizard */
.aiw-steps { list-style: none; margin: 0 0 14px; padding: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.aiw-steps::-webkit-scrollbar { display: none; }
.aiw-steps li { flex: none; }
.aiw-steps button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px 0 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--grey-ink); font: inherit; font-size: var(--fs-14); cursor: pointer; white-space: nowrap; }
.aiw-steps .n { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 50%; background: var(--ground, #F2F4F2); font-weight: 600; font-size: 0.8125rem; }
.aiw-steps button.on { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.aiw-steps button.on .n { background: var(--ink); color: var(--surface); }
.aiw-steps button.done .n { background: var(--blue-bg, #E7EFF8); }
.aiw-card { display: flex; flex-direction: column; gap: 14px; max-width: 1100px; }
.aiw-card:focus { outline: none; }
.aiw-card .sechead { margin: 0; }
.aiw-lede { margin: 0; color: var(--muted); max-width: 70ch; line-height: 1.5; }
.aiw-h3 { margin: 6px 0 0; font-size: 1rem; }
.aiw-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.aiw-box legend, .aiw-box h3 { font-weight: 600; font-size: var(--fs-14); margin: 0; padding: 0 4px; }
.aiw-switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.aiw-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.aiw-switch .tg { flex: none; width: 46px; height: 26px; border-radius: 13px; background: var(--switch-off, #9AA8A1); position: relative; transition: background .15s; }
.aiw-switch .tg::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.aiw-switch input:checked + .tg { background: var(--good, #2F6B55); }
.aiw-switch input:checked + .tg::after { transform: translateX(20px); }
.aiw-switch input:focus-visible + .tg { outline: 2px solid var(--blue-btn, #4471B8); outline-offset: 2px; }
.aiw-switch > span:last-child { display: flex; flex-direction: column; }
.aiw-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0; }
.aiw-stats div { display: flex; flex-direction: column; gap: 2px; }
.aiw-stats dt { font-size: 0.8125rem; color: var(--muted); }
.aiw-stats dd { margin: 0; font-weight: 600; }
.aiw-feats, .aiw-tones { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.aiw-feat, .aiw-tone { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.aiw-feat input, .aiw-tone input { margin-top: 3px; flex: none; }
.aiw-feat > span, .aiw-tone > span { display: flex; flex-direction: column; gap: 2px; }
.aiw-feat.later { opacity: 0.7; cursor: default; }
.aiw-feat:has(input:checked), .aiw-tone:has(input:checked) { border-color: var(--ink); background: var(--ground, #F7F8F7); }
.aiw-words { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 18px; align-items: start; }
.aiw-phrases { display: flex; flex-direction: column; gap: 12px; }
.aiw-phrase { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.aiw-phrase legend { font-weight: 600; font-size: var(--fs-14); margin-bottom: 6px; }
.aiw-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.aiw-opt { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 10px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: var(--fs-14); }
.aiw-opt:has(input:checked) { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.aiw-opt input { margin: 0; }
.aiw-own { min-height: 40px; border: 1px solid var(--input-strong); border-radius: 8px; padding: 0 10px; font: inherit; max-width: 520px; }
.aiw-samples { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 10px; }
.aiw-sample { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; color: #212121; }
.aiw-st { margin: 0; padding: 6px 12px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; background: #212121; color: #fff; }
.aiw-mail { padding: 12px 14px; font: 14px/20px Arial, Helvetica, sans-serif; }
.aiw-fields { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 2px; max-width: 560px; }
.aiw-fields li { padding: 4px 0; }
.aiw-fields li { display: list-item; }
.aiw-fields li > span:first-child { display: inline-block; min-width: 220px; }
.aiw-facts { display: inline-flex; gap: 10px; }
.aiw-facts .link { min-height: 32px; font-size: var(--fs-14); }
.aiw-add { display: flex; gap: 8px; max-width: 560px; }
.aiw-add input { flex: 1; min-height: 40px; border: 1px solid var(--input-strong); border-radius: 8px; padding: 0 10px; font: inherit; }
.aiw-howto { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; max-width: 80ch; line-height: 1.5; }
.aiw-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; }
.aiw-copy code { padding: 4px 8px; border-radius: 6px; background: var(--ground, #F2F4F2); border: 1px solid var(--line); font-size: 0.8125rem; overflow-wrap: anywhere; }
.aiw-copy .link { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
.aiw-copy .ic, .aiw-card .btn .ic { width: 16px; height: 16px; }
.aiw-prompt { margin: 0; padding: 12px 14px; max-height: 420px; overflow: auto; white-space: pre-wrap; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--ground, #F7F8F7); border: 1px solid var(--line); border-radius: 10px; }
.aiw-card > .btn { align-self: flex-start; }
.aiw-bar { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 10px; margin-top: 12px; padding: 10px 0; background: var(--bg, #F5F7F5); max-width: 1100px; }
.aiw-state { margin-right: auto; }
@media (max-width: 860px) {
  .aiw-words { grid-template-columns: minmax(0, 1fr); }
  .aiw-samples { position: static; }
}
@media (max-width: 599px) {
  .aiw-fields li > span:first-child { min-width: 0; display: block; }
  .aiw-bar { padding-right: 64px; }
}

/* Budget and limits (aibudget.js) */
.aib { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.aib-top { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.aib-headline { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }
.aib-month { margin: 0; font-size: 1rem; }
.aib-fig { margin: 0; }
.aib-big { font-size: 1.75rem; line-height: 1.1; font-weight: 700; }
.aib-bar { height: 12px; border-radius: 6px; overflow: hidden; background: var(--line); }
.aib-bar svg { display: block; width: 100%; height: 100%; }
.aib-bar .bg { fill: var(--line); }
.aib-bar .fill.ok { fill: var(--good); }
.aib-bar .fill.warn { fill: var(--amber-bar); }
.aib-bar .fill.bad { fill: var(--red); }
.aib-scale { display: flex; justify-content: space-between; gap: 8px; }
.aib-facts { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; line-height: 1.45; max-width: 70ch; }
.aib-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.aib-tbl { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.aib-tbl th, .aib-tbl td { padding: 8px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--divider); }
.aib-tbl th:first-child, .aib-tbl td:first-child { text-align: left; }
.aib-tbl thead th { font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.aib-tbl tbody th { font-weight: 600; }
.aib-tbl tbody tr:last-child > * { border-bottom: 0; }
.aib-tbl .tot > * { font-weight: 700; border-top: 1px solid var(--line); }
.aib-limits dd { line-height: 1.4; }
.aib-form { display: flex; flex-direction: column; gap: 14px; }
.aib-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.aib-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.aib-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.aib-box legend { font-weight: 600; font-size: 0.875rem; padding: 0 4px; }
.aib-box p { margin: 0; }
.aib-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.aib-line { margin: 4px 0 0; }
@media (max-width: 599px) {
  .aib-grid, .aib-grid.three { grid-template-columns: minmax(0, 1fr); }
  .aib-big { font-size: 1.5rem; }
}
