/* 37_sync_ui.css - KP Equipment slice D1: the save-state line in the footer and the unsaved list in the Changes menu.
 * Tokens only (01_tokens). Hooks set by 37_sync_ui.js: .foot.has-svs, #foot-save[data-svs][data-svs-tone][data-svs-act],
 * .changes-menu.svs-live, .changes-btn.svs-attn, #svs-chip (D2: the save state inside the phone edit bar). No animation. */

/* ---- one colour and one icon per state. The icon is a mask, so it takes the state colour in both themes; the
        words always say the state too, so colour is never the only signal. ---- */
[data-svs-tone] { --svs-c: var(--ink-soft); }
[data-svs-tone="saved"] { --svs-c: var(--success-fg); --svs-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M7.5 12.5l3 3 6-6.5'/%3E%3C/svg%3E"); }
[data-svs-tone="pending"] { --svs-c: var(--info); --svs-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 7v5.5l3.5 2'/%3E%3C/svg%3E"); }
[data-svs-tone="idle"] { --svs-c: var(--ink-muted); --svs-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M8 12h.01M12 12h.01M16 12h.01'/%3E%3C/svg%3E"); }
[data-svs-tone="offline"] { --svs-c: var(--warning-fg); --svs-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cmask id='g'%3E%3Crect width='24' height='24' fill='%23fff' stroke='none'/%3E%3Cpath d='M3 2.5l18 19' stroke-width='6.5'/%3E%3C/mask%3E%3Cpath mask='url(%23g)' d='M7.5 19h9.5a4 4 0 0 0 .7-7.94 6 6 0 0 0-11.6-.9A4.5 4.5 0 0 0 7.5 19z'/%3E%3Cpath d='M4 3.5l16 17.5'/%3E%3C/svg%3E"); }
[data-svs-tone="attn"] { --svs-c: var(--danger-fg); --svs-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5l9.5 17h-19z'/%3E%3Cpath d='M12 10v4.5M12 17.5h.01'/%3E%3C/svg%3E"); }
[data-svs-tone="auth"] { --svs-c: var(--warning-fg); --svs-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5.5' y='10.5' width='13' height='10' rx='2'/%3E%3Cpath d='M8.5 10.5V8a3.5 3.5 0 0 1 7 0v2.5'/%3E%3C/svg%3E"); }
[data-svs-tone="error"] { --svs-c: var(--danger-fg); --svs-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M8.5 8.5l7 7M15.5 8.5l-7 7'/%3E%3C/svg%3E"); }

.svs-ic { display: none; flex: none; width: 15px; height: 15px; margin-right: 5px; vertical-align: -2.5px; background-color: var(--svs-c, currentColor);
  -webkit-mask-image: var(--svs-ic); mask-image: var(--svs-ic); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
[data-svs-tone] .svs-ic { display: inline-block; }
[data-svs-tone="view"] .svs-ic { display: none; }

/* ---- footer: the save-state line ---- */
#foot-save[data-svs="live"] { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--sp-3); min-width: 0; }
.svs-ind { min-width: 0; }
.svs-hint { white-space: nowrap; } /* D2b: the words that say what to do next move to the next line whole, never split after "Press" */
.svs-hint:empty { display: none; }
#foot-save:is([data-svs-tone="offline"], [data-svs-tone="auth"], [data-svs-tone="attn"], [data-svs-tone="error"]) .svs-lead { color: var(--svs-c); }
.svs-act { flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 28px; margin: -5px 0; padding: 0 var(--sp-3);
  border: 1px solid currentColor; border-radius: var(--r-pill); background: transparent; color: var(--svs-c, var(--ink-soft));
  font: inherit; font-weight: 600; white-space: nowrap; cursor: pointer; }
.svs-act[hidden] { display: none; }
.svs-act:hover { background: var(--surface-alt); }
.svs-act:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.svs-act[aria-disabled="true"] { opacity: .6; cursor: default; }

/* ---- the Changes button and its menu ---- */
.changes .changes-btn.svs-attn, .changes .changes-btn.svs-attn:hover { border-color: var(--danger); background: var(--danger-bg); color: var(--danger-fg); }
.changes-btn #changes-n[hidden] { display: none; } /* D2: 60_changes.js shows no number once everything is saved */
@media screen and (min-width: 701px) and (min-height: 501px), screen and (min-width: 961px) {
  .changes-menu.svs-live { width: 340px; max-height: calc(100dvh - 140px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
}

.svs-panel { margin: 0 0 var(--sp-2); padding: var(--sp-1) var(--sp-2) var(--sp-2); border-bottom: 1px solid var(--line); }
.svs-panel[hidden] { display: none; }
.svs-head { margin: var(--sp-1) 0 0; color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.35; }
.svs-head:focus { outline: none; }
.svs-head:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: var(--r-sm); }
.svs-head .svs-ic { width: 17px; height: 17px; margin-right: 6px; vertical-align: -3px; }
.svs-sub { margin: 2px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.4; }
.svs-sub:empty, .svs-msg:empty, .svs-list:empty { display: none; }
.svs-msg { margin: var(--sp-2) 0 0; padding: 6px var(--sp-2); border-left: 3px solid var(--brand); border-radius: var(--r-sm); background: var(--surface-alt); color: var(--ink); font-size: 13px; line-height: 1.4; }
.svs-msg.visually-hidden { margin: -1px; padding: 0; border: 0; }
.svs-retry-all { margin-top: var(--sp-2); }
.svs-retry-all[hidden] { display: none; }

.svs-list { list-style: none; margin: var(--sp-2) 0 0; padding: 0; }
.svs-row { padding: 10px 0; border-top: 1px solid var(--line); }
.svs-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); }
.svs-row-label { min-width: 0; color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.svs-row[data-kind="pending"] .svs-row-label { font-weight: 500; }
.svs-tag { flex: none; padding: 1px var(--sp-2); border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface-alt); color: var(--ink-soft); font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.svs-row[data-kind="conflict"] .svs-tag { border-color: transparent; background: var(--danger-bg); color: var(--danger-fg); }
.svs-row[data-kind="unsupported"] .svs-tag { border-color: transparent; background: var(--warning-bg); color: var(--warning-fg); }
.svs-row[data-kind="early"] .svs-tag { border-color: transparent; background: var(--info-bg); color: var(--info); }
.svs-row-why, .svs-row-note { margin: var(--sp-1) 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.4; }
.svs-row-note { color: var(--danger-fg); font-weight: 600; }
.svs-row-acts { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }

.svs-btn { min-height: 44px; padding: 0 var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.svs-btn:hover { background: var(--surface-alt); }
.svs-btn-primary { border-color: var(--brand-solid); background: var(--brand-solid); color: var(--acc-ink, #ffffff); } /* FX-1 (A-01): white on the solid blue in both themes, 5.17:1 (hover 6.70:1). --on-brand is the ink for the lighter dark-theme brand blue; on this solid blue it gave 3.64:1 */
.svs-btn-primary:hover { border-color: var(--brand-solid-hover); background: var(--brand-solid-hover); }
.svs-btn-danger { border-color: var(--danger); background: var(--danger-bg); color: var(--danger-fg); }
.svs-btn-danger:hover { background: var(--danger-bg); box-shadow: inset 0 0 0 1px var(--danger); }
.svs-btn:focus-visible, .svs-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.svs-btn[aria-disabled="true"] { opacity: .6; cursor: default; }
.svs-confirm { margin-top: var(--sp-2); padding: var(--sp-2) var(--sp-3) var(--sp-3); border: 1px solid var(--danger); border-radius: var(--r-sm); background: var(--surface); }
.svs-confirm-q { margin: 0; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.4; }
.svs-row-more { padding: 0; }
.svs-link { display: block; width: 100%; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--brand); font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }

/* ---- FX-1: tablet, and any wider touch screen: the action is 32 px tall to the eye and 44 px to the finger (the unseen
        part reaches 10 px up over the plan edge and 2 px down). The footer keeps its height, so the plan above it never
        jumps when a save needs attention. ---- */
@media screen and (min-width: 701px) and (max-width: 1299px) and (min-height: 501px), screen and (min-width: 1300px) and (pointer: coarse) {
  .svs-act { position: relative; min-width: 44px; min-height: 32px; margin: -7px 0; }
  .svs-act::after { content: ""; position: absolute; left: 0; right: 0; top: -10px; bottom: -2px; }
}

/* ---- phone (the same breakpoint the plan uses): the line stays one short paragraph; an action gets its own 44 px row ---- */
@media screen and (max-width: 700px), screen and (max-height: 500px) and (max-width: 960px) {
  #foot-save[data-svs="live"] { display: inline; font-size: 13px; } /* FX-1: the save line reads at 13 px on a phone, the size it has on a tablet and a PC */
  #foot-save[data-svs="live"][data-svs-act] { display: flex; flex-wrap: nowrap; justify-content: space-between; gap: var(--sp-3); padding: 2px 0; }
  .svs-extra { display: none; }
  .foot .svs-ic { width: 13px; height: 13px; margin-right: 4px; vertical-align: -2px; }
  .svs-act { min-width: 44px; min-height: 44px; margin: 0; padding: 0 var(--sp-4); font-size: 13px; }
  .toolbar .changes-menu.svs-live { max-height: 84dvh; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .svs-row-acts .svs-btn { flex: 1 1 auto; }
}

@media print { .svs-act, .svs-panel { display: none !important; } }
