/* 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: center; }

/* 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); }
.kc-from { min-width: 0; overflow: hidden; text-overflow: ellipsis; 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: 64px 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; }

/* 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); }
}
