/* Daily Life Doc, round 18 (zone 18-C): a Custom app in the knowledge base (js/kb/kb-custom.js, kb-custom-up.js).
   The card's body (.kc-body) holds the client's phone (.kc-phone with the closed-off frame .kc-frame, or .kc-none:
   No app yet, Thank you; the page's head .kc-top over it), the saved values under it (.kc-saved), and beside it Reads, Saves, Resets (.kc-rows) with
   the actions (.kc-acts). The sheets Upload and Paste HTML: .kc-up, .kc-lab, the error line .kc-err, the question
   .kc-how and the specification sheet with Copy (.kc-spec, .kc-pre). One column at 880 px and narrower. */

.kbm .kc-body { padding: 16px 16px 24px; background: var(--app); }
.kc-grid { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 20px 28px; }
.kc-left { flex: none; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.kc-left .klk-eb { width: 100%; text-align: left; padding-left: 4px; box-sizing: border-box; } /* fixer F5: on the phone's edge */

/* The client's phone: the frame's edge, a white screen, the app filling it. */
.kc-phone { width: 300px; height: 580px; border-radius: 40px; padding: 9px; background: var(--frame); box-shadow: var(--lift); flex: none; box-sizing: border-box; }
.kc-in { width: 100%; height: 100%; border-radius: 32px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.kc-top { flex: none; display: flex; justify-content: space-between; gap: 8px; padding: 14px 18px 8px; font-size: var(--t-2xs); color: var(--ink3); border-bottom: 1px solid var(--cardline); }
/* The head's words wrap at a narrow phone and are never cut; the word on the right stays on one line (round 50, fixer H). */
.kc-from { min-width: 0; overflow-wrap: anywhere; }
.kc-rs { flex: none; white-space: nowrap; }
.kc-scr { flex: 1; min-height: 0; background: var(--surface); }
.kc-frame { display: block; width: 100%; height: 100%; border: 0; background: var(--surface); }
.kc-none { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; font-size: var(--t-m); }
.kc-none b { font-weight: 600; }
.kc-none p { margin: -6px 0 0; font-size: var(--t-sm); color: var(--ink3); }
.kc-thanks { animation: dd-rise .3s var(--ease-out) both; }
.kc-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--app); color: var(--sage-d); }
.kc-saved { max-width: 300px; font-size: var(--t-sm); font-weight: 500; color: var(--ink2); text-align: center; animation: dd-rise .25s var(--ease-out) both; }

/* Beside the phone: Reads, Saves, Resets, then the actions. */
.kc-side { flex: 1 1 220px; max-width: 320px; display: flex; flex-direction: column; gap: 16px; padding-top: 28px; }
.kc-rows { display: flex; flex-direction: column; border-radius: 14px; background: var(--surface); padding: 4px 14px; }
.kc-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; padding: 10px 0; font-size: var(--t-sm); }
.kc-row + .kc-row { border-top: 1px solid var(--cardline); }
.kc-row span { color: var(--ink3); }
.kc-row b { font-weight: 500; overflow-wrap: anywhere; }
.kc-acts { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
/* Round 51 (fixer F3): a Built-in app turned Off says so where Send me a test was. */
.kc-off { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--surface); color: var(--ink3); font-size: var(--t-sm); text-align: center; }

/* The sheets: Upload (Choose file, then the specification sheet) and Paste HTML (two boxes). */
.kc-up { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 2px 0 6px; }
.kc-lab { display: flex; flex-direction: column; gap: 6px; font-size: var(--t-xs); font-weight: 500; color: var(--ink3); margin-bottom: 12px; }
.kc-lab .kb-paste { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--t-xs); line-height: 1.45; }
.kc-err { margin: 4px 0 8px; padding: 8px 12px; border-radius: 10px; background: var(--soft); color: var(--ink); font-size: var(--t-sm); }
.kc-how { padding: 6px 0 10px; }
.kc-how .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.kc-spec { margin-top: 10px; border-radius: 14px; background: var(--app); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.kc-sh { display: flex; align-items: center; gap: 8px; }
.kc-sh b { font-size: var(--t-sm); font-weight: 600; margin-right: auto; }
.kc-pre { margin: 0; max-height: 300px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--t-xs); line-height: 1.5; color: var(--ink2); border-radius: 10px; background: var(--surface); padding: 10px 12px; }
.kc-pre:focus-visible { outline: 2px solid var(--sage); }

@media (max-width: 880px) {
  .kbm .kc-body { padding: 12px 10px 20px; }
  .kc-left { width: 100%; }
  .kc-phone { width: min(100%, 300px); height: 560px; }
  .kc-side { flex: 1 1 100%; max-width: 360px; padding-top: 0; }
  .kc-lab .kb-paste { font-size: var(--t-m); }
}
/* Round 53 (C56): at a phone width a Custom app's page is one page that scrolls, not a card with a scrollbar of its own. */
@media (max-width: 880px) {
  .page:has(> .tabview[data-tab="kb"] .kc-body) { display: block; overflow-y: auto; }
  .tabview:has(.kc-body), .kbp:has(.kc-body), .kbm:has(.kc-body), .kbm:has(.kc-body) .kbv, .kbm:has(.kc-body) .kc-body { flex: none; height: auto; min-height: 0; overflow: visible; }
}
/* Round 40 (zone H): the line of the Ask AI turn an upload woke ("Filling…", then the answer with Open). */
.kc-wake { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--card); font-size: var(--t-sm); color: var(--ink2); animation: dd-rise .25s var(--ease-out) both; }
.kc-wake span { flex: 1; min-width: 0; }
.kc-wake.work span { color: var(--ink3); }
/* Round 50 (zone P2a): a Built-in app's Settings beside the phone (js/kb/kb-builtin.js): a small heading, then the
   rows as Reads · Saves · Starts over, each with the tinted select of Settings (css/settings-team.css .kt-ncs) or,
   read only for a member, the value; the app's own section under it (.kc-extra, News's cards). */
.kc-bi { display: flex; flex-direction: column; gap: 16px; }
.kc-set { display: flex; flex-direction: column; gap: 8px; }
.kc-h { margin: 0; padding: 0 4px; font-size: var(--t-xs); font-weight: 600; color: var(--ink3); }
.kc-srow { align-items: center; padding: 6px 0; }
.kc-row.kc-srow { grid-template-columns: 84px minmax(0, 1fr); }
.kc-sel { width: 100%; min-width: 0; min-height: 40px; padding: 0 10px; border: 0; border-radius: 10px; background: var(--field); color: var(--ink);
  font: inherit; font-size: var(--t-sm); font-weight: 500; outline: none; cursor: pointer; }
.kc-sel:focus-visible { box-shadow: inset 0 0 0 1.5px var(--sage); }
.kc-extra:empty { display: none; }
/* Round 51 (zone P): the On switch above Settings, and a setting with several values as chips (tinted, no border). */
.kc-onrow { cursor: pointer; }
.kc-onrow:has(input:disabled) { cursor: default; }
.kc-sw { display: flex; justify-content: flex-end; }
.kc-sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.kc-sw i { width: 40px; height: 24px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 16%, var(--field)); position: relative; flex: none; transition: background var(--m-step); }
.kc-sw i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.18); transition: transform var(--m-step) var(--ease-out); }
.kc-sw input:checked + i { background: var(--sage); }
.kc-sw input:checked + i::after { transform: translateX(16px); }
.kc-sw input:focus-visible + i { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--sage); }
.kc-sw input:disabled + i { opacity: 0.55; }
.kc-row.kc-mrow { align-items: start; }
.kc-mrow > span { padding-top: 6px; }
.kc-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.kc-chip { min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--field); color: var(--ink);
  font: inherit; font-size: var(--t-sm); font-weight: 500; cursor: pointer; transition: background var(--m-step), color var(--m-step); }
.kc-chip.on { background: var(--ink); color: var(--surface); }
.kc-chip:focus-visible { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--sage); outline: none; }
@media (max-width: 880px) {
  .kc-sel { min-height: 44px; font-size: var(--t-m); }
  .kc-chip { min-height: 40px; }
  .kc-onrow { min-height: 44px; }
}
/* Round 52 (zone G, decision 41): the eyebrow's chips "Preview · as Sample · <client>" (js/kb/kb-builtin-as.js). */
.klk-eb .kc-as { display: inline-flex; flex-wrap: nowrap; margin-left: 8px; gap: 4px; vertical-align: middle; max-width: calc(100% - 90px); }
.klk-eb .kc-as .kc-chip { min-height: 30px; padding: 0 12px; font-size: var(--t-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
/* Fixer FX2 (round 52): the caption under the eyebrow, whose data the phone shows ("Dana's own app"). */
.kc-left .kc-as-note { width: 300px; max-width: 100%; margin: -4px 0 0; padding-left: 4px; box-sizing: border-box; font-size: var(--t-xs); color: var(--ink2); overflow-wrap: anywhere; }

/* Round 53: the On switch on a Built-in app's row of the list; .kbr-go is the row's own grid inside the wrapper. */
.kbr.kbr-on { grid-template-columns: minmax(0, 1fr) auto; }
.kbr-go { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; align-items: center; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.kbr-go:hover .nm { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.kbr-sw { position: relative; align-items: center; min-height: 32px; padding-left: 4px; cursor: pointer; }
@media (max-width: 700px) { .kbr-sw { min-height: 44px; } }
