/* WatchFlow AI Helper tab (2026-10-28). App tokens only, so it follows Day / Night like the rest of the Help panel.
   Rhythm (spacing guardrail): 16px between blocks, 12px inside a card, 8px for status lines. */
.wf-aih-pane { position: relative; }
.wf-help-tabs .inv-kind-tab { white-space: nowrap; }
.wf-aih-badge { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 4px 10px; border-radius: var(--radius-pill, 999px);
  background: color-mix(in srgb, var(--accent, var(--gold)) 14%, transparent); color: var(--accent, var(--gold)); font: 700 11.5px/1.2 var(--font-body); letter-spacing: .04em; text-transform: uppercase; }
.wf-aih-msg { display: block; }
.wf-aih-turn { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.wf-aih-reply { font-size: 14px; line-height: 1.5; font-weight: 600; color: var(--white); }
.wf-help-msg.is-canned .wf-aih-reply { font-weight: 500; color: var(--off-white, var(--muted)); }
.wf-aih-user-img { display: block; max-width: 180px; max-height: 160px; border-radius: 10px; margin-bottom: 8px; object-fit: cover; }

/* cards */
.wf-aih-card { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: var(--radius-lg, 14px); border: 1px solid var(--border); background: var(--bg-raised); }
.wf-aih-card.is-proposal { border-color: color-mix(in srgb, var(--accent, var(--gold)) 55%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, var(--gold)) 10%, transparent); }
.wf-aih-card.is-money.is-proposal { border-color: var(--accent, var(--gold)); }
.wf-aih-card.is-done { border-color: color-mix(in srgb, var(--success, #2e9e6b) 55%, var(--border)); }
.wf-aih-card.is-cancelled { opacity: .7; }
.wf-aih-card-top { display: flex; gap: 12px; align-items: center; }
.wf-aih-photo { width: 64px; height: 64px; flex: 0 0 64px; object-fit: contain; border-radius: 10px; background: var(--bg-base); border: 1px solid var(--border); }
.wf-aih-card-head { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wf-aih-card-type { font: 700 11px/1.2 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wf-aih-card.is-proposal .wf-aih-card-type { color: var(--accent, var(--gold)); }
.wf-aih-card-title { font: 700 15px/1.3 var(--font-body); color: var(--white); overflow-wrap: anywhere; }
.wf-aih-card-sub { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.wf-aih-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 0; }
.wf-aih-field { min-width: 0; }
.wf-aih-field.is-long { grid-column: 1 / -1; }
.wf-aih-field dt { font-size: 11px; color: var(--muted); margin: 0 0 2px; }
.wf-aih-field dd { margin: 0; font-size: 13px; font-weight: 600; color: var(--white); overflow-wrap: anywhere; white-space: pre-line; }
.wf-aih-lines { display: flex; flex-direction: column; gap: 8px; }
.wf-aih-line { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; background: var(--bg-base); border: 1px solid var(--border); }
.wf-aih-line .wf-aih-photo, .wf-aih-line-ph { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 8px; }
.wf-aih-line-ph { background: var(--bg-hover, var(--bg-raised)); }
.wf-aih-line-main { flex: 1 1 auto; min-width: 0; }
.wf-aih-line-title { font-size: 13px; font-weight: 700; color: var(--white); overflow-wrap: anywhere; }
.wf-aih-line-sub { font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.wf-aih-line-amt { font: 700 13px var(--font-body); color: var(--white); white-space: nowrap; font-variant-numeric: tabular-nums; }
.wf-aih-totals { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; border-top: 1px solid var(--border); }
.wf-aih-total { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wf-aih-total.is-strong { color: var(--white); font-weight: 700; font-size: 14px; }
.wf-aih-ba { display: flex; align-items: stretch; gap: 8px; }
.wf-aih-ba-box { flex: 1 1 0; min-width: 0; padding: 10px 12px; border-radius: 10px; background: var(--bg-base); border: 1px solid var(--border); }
.wf-aih-ba-box.is-after { border-color: color-mix(in srgb, var(--accent, var(--gold)) 50%, var(--border)); }
.wf-aih-ba-l { font-size: 11px; color: var(--muted); }
.wf-aih-ba-v { font: 700 15px/1.3 var(--font-body); color: var(--white); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wf-aih-ba-arrow { display: inline-flex; align-items: center; color: var(--muted); }
.wf-aih-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.wf-aih-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.wf-aih-table th, .wf-aih-table td { padding: 6px 8px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); }
.wf-aih-table th { color: var(--muted); font-weight: 600; background: var(--bg-base); }
.wf-aih-table tr:last-child td { border-bottom: 0; }
.wf-aih-warn { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wf-aih-warn li { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; line-height: 1.4; color: var(--off-white, var(--white)); }
.wf-aih-warn svg { flex: 0 0 14px; margin-top: 2px; color: var(--accent, var(--gold)); }
.wf-aih-acts { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.wf-aih-btn { min-height: 44px; padding: 0 16px; border-radius: var(--radius-pill, 999px); border: 1px solid var(--border); background: transparent; color: var(--white);
  font: 600 13.5px var(--font-body); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.wf-aih-btn:hover { border-color: var(--accent, var(--gold)); }
.wf-aih-btn.is-primary { background: var(--accent, var(--gold)); color: var(--on-accent, #0a0a0b); border-color: transparent; }
.wf-aih-btn.is-small { min-height: 36px; padding: 0 12px; font-size: 12.5px; }
.wf-aih-btn:disabled { opacity: .55; cursor: default; }
.wf-aih-status { font-size: 12.5px; color: var(--muted); min-height: 0; }
.wf-aih-status:empty { display: none; }
.wf-aih-card.is-done .wf-aih-status { color: var(--success, #2e9e6b); font-weight: 700; }
.wf-aih-fine { font-size: 11.5px; color: var(--muted); }

/* chips + page steps */
.wf-aih-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wf-aih-chip { min-height: 36px; padding: 6px 14px; border-radius: var(--radius-pill, 999px); border: 1px solid var(--accent, var(--gold)); background: transparent;
  color: var(--accent, var(--gold)); font: 600 13px/1.2 var(--font-body); cursor: pointer; text-align: left; }
.wf-aih-chip:hover { background: var(--accent, var(--gold)); color: var(--on-accent, #0a0a0b); }
.wf-aih-steps { display: flex; flex-direction: column; gap: 6px; }
.wf-aih-steps:empty { display: none; }
.wf-aih-step { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--border); font-size: 12.5px; }
.wf-aih-step-ic { display: inline-flex; color: var(--success, #2e9e6b); }
.wf-aih-step-txt { flex: 1 1 auto; color: var(--white); }
.wf-aih-step-txt.is-off { color: var(--muted); }
.wf-aih-step.is-failed { border-style: solid; border-color: var(--accent, var(--gold)); }
.wf-aih-step.is-failed .wf-aih-step-txt.is-off { color: var(--white); }
.wf-aih-step.is-undone .wf-aih-step-txt { text-decoration: line-through; color: var(--muted); }
.wf-aih-undo { min-height: 32px; padding: 0 12px; border-radius: var(--radius-pill, 999px); border: 1px solid var(--border); background: var(--bg-raised); color: var(--white); font: 600 12px var(--font-body); cursor: pointer; }
.wf-aih-learned { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--accent, var(--gold)); }

/* composer */
.wf-aih-compose { align-items: flex-end; }
.wf-aih-attach-btn { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-raised); color: var(--white); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.wf-aih-attach-btn:hover { border-color: var(--accent, var(--gold)); }
.wf-aih-file { display: none; }
.wf-aih-attach { padding: 8px 16px 0; }
.wf-aih-attach[hidden] { display: none !important; }
.wf-aih-attach-box { position: relative; display: inline-block; }
.wf-aih-attach-box img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); display: block; }
.wf-aih-attach-x { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; min-height: 24px; padding: 0; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-base); color: var(--white); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.wf-aih-attach-x::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; }
.wf-aih-foot-r { display: inline-flex; gap: 16px; }

/* confirm sheet + memory sheet (inside the panel) */
.wf-aih-sheet { position: absolute; inset: 0; z-index: 5; display: flex; align-items: flex-end; background: rgba(0, 0, 0, .38); }
.wf-aih-sheet-box { width: 100%; max-height: 92%; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 20px 16px 16px; background: var(--bg-base); border-top: 1px solid var(--border);
  border-radius: var(--radius-lg, 14px) var(--radius-lg, 14px) 0 0; box-shadow: 0 -12px 32px rgba(0, 0, 0, .22); }
.wf-aih-sheet-box.is-tall { height: 92%; }
.wf-aih-sheet-head { display: flex; align-items: center; gap: 12px; }
.wf-aih-sheet-title { font: 700 16px/1.3 var(--font-body); color: var(--white); flex: 1 1 auto; }
.wf-aih-sheet-sub { font-size: 13px; color: var(--muted); line-height: 1.45; }
.wf-aih-sheet-lines { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--bg-raised); border: 1px solid var(--border); font: 600 13.5px/1.4 var(--font-body); font-variant-numeric: tabular-nums; }
.wf-aih-sheet-acts { display: flex; gap: 8px; }
.wf-aih-sheet-acts .wf-aih-btn { flex: 1 1 0; }
.wf-aih-mem-list { display: flex; flex-direction: column; gap: 8px; }
.wf-aih-mem { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-raised); }
.wf-aih-mem-main { flex: 1 1 auto; min-width: 0; }
.wf-aih-mem-v { font-size: 13px; font-weight: 600; color: var(--white); overflow-wrap: anywhere; }
.wf-aih-mem-s { font-size: 11.5px; color: var(--muted); }

@media (max-width: 768px) {
  .wf-help-head .wf-help-title { display: none; }
  .wf-help-tabs .inv-kind-tab { padding: 8px 10px; }
  .wf-aih-fields { grid-template-columns: 1fr 1fr; }
}

/* Settings → Optional sections: the AI Helper daily store-credit limit row (2026-10-28 fix round, D9). */
#page-settings .wf-aih-limit-row { flex-wrap: wrap; padding: 8px 0; }
#page-settings .wf-aih-limit-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 0 0 auto; }
#page-settings .wf-aih-limit-box .currency-input { width: 160px; min-height: 44px; padding: 0 13px; font-size: 15px; color: var(--wfs-ink, var(--white)); background: var(--bg-raised); border: 1px solid var(--wfs-field, var(--border-light)); border-radius: 6px; box-sizing: border-box; }
#page-settings .wf-aih-limit-box .currency-input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); }
#page-settings .wf-aih-limit-box .wf-aih-limit-save { min-height: 44px; padding: 0 18px; border-radius: 6px; }
#page-settings .wf-aih-limit-msg { flex-basis: 100%; color: var(--muted); }
#page-settings .wf-aih-limit-ro { font-weight: 600; }
@media (max-width: 600px) { #page-settings .wf-aih-limit-box { flex: 1 1 100%; } #page-settings .wf-aih-limit-box .currency-input { flex: 1 1 auto; width: auto; } }
/* A watch photo whose file is missing: a plain tile the same size as the photo. */
.wf-aih-photo.is-missing { display: block; background: var(--bg-hover, var(--bg-raised)); }
