/* ===========================================================================
   THE VAULT (step 7) - the mockup's vault and its Settings, on the app's own colours (app.css). Drawn by the browser
   (js/vault/vault.js); its dialogs use the app's .dlg shell (AppDialog) and .form-field inputs (crm.css). */

.vault-host { min-height: 120px; }
.vault-host .muted, .vdlg .muted { color: #667085; }
.vault-host .small, .vdlg .small { font-size: 12.5px; }
.vdlg .mono, .vault-host .mono { font-family: 'Cascadia Mono', Consolas, 'SFMono-Regular', Menlo, monospace; letter-spacing: .04em; }
.vault-host .link-btn, .vdlg .link-btn { background: none; border: 0; padding: 0; color: var(--app-primary); font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.vault-host .link-btn:hover, .vdlg .link-btn:hover { text-decoration: underline; }
.vault-host .tag { display: inline-flex; align-items: center; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    border-radius: 3px; padding: 2px 6px; background: #e7edf6; color: var(--app-black); margin-left: 6px; vertical-align: middle; }

/* ---------- the toolbar and the lock ---------- */
.vtoolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.vspacer { flex: 1; }
.vwaiting { font-size: 13px; font-weight: 600; color: #9a6a12; background: #fdf1dc; border-radius: 12px; padding: 3px 10px; text-decoration: none; }
.vwaiting:hover { text-decoration: underline; }
.lockchip { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; border-radius: 6px; padding: 4px 4px 4px 10px; }
.lockchip.locked { background: #eef1f6; color: #34405a; }
.lockchip.open { background: #fdf1dc; color: #9a6a12; }

/* ---------- the grid: 10 columns; a row shares a height ---------- */
.vgrid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 16px; align-items: stretch; position: relative; }
.vguides { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 16px; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 0; }
.vguides i { border: 1px dashed rgba(1, 101, 206, .45); background: rgba(1, 101, 206, .05); border-radius: 6px; }
.sizing > .vguides { opacity: 1; }
.vgrid.sizing, .vsection-b.sizing { user-select: none; cursor: ew-resize; }

.vpanel { grid-column: span var(--span, 5); position: relative; display: flex; flex-direction: column; min-width: 0;
    background: #fff; border: 1px solid #e5e5e5; border-radius: 6px; overflow: hidden; }
.vpanel.dragging { opacity: .4; }
.vpanel.drop-before { box-shadow: -6px 0 0 -2px var(--app-primary); }
.vpanel.drop-after { box-shadow: 6px 0 0 -2px var(--app-primary); }
.vpanel-h { background: #f6f7f9; padding: 9px 16px; font-size: 13px; font-weight: 600; color: var(--app-black); border-bottom: 1px solid #e5e5e5;
    display: flex; align-items: center; gap: 10px; cursor: grab; }
.vpanel-h .vt { min-width: 0; overflow-wrap: anywhere; }
.vpanel-h .right { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.vpanel-h .ico-btn { margin: -5px 0; }
.vpanel-h .grip { color: #9aa3b5; margin-left: -6px; flex: 0 0 auto; }
.vpanel-h.hc { color: #fff; border-bottom-color: transparent; }
.vpanel-h.hc .grip { color: rgba(255, 255, 255, .7); }
.vpanel-h.hc .ico-btn { color: #fff; background: transparent; border-color: rgba(255, 255, 255, .35); }
.vpanel-h.hc .ico-btn:hover { background: rgba(255, 255, 255, .2); }
.vpanel-b { padding: 14px 16px; flex: 1; }
.vpanel-b.vlocked { display: flex; align-items: center; justify-content: center; min-height: 70px; background: repeating-linear-gradient(135deg, #fafbfc, #fafbfc 8px, #f3f5f8 8px, #f3f5f8 16px); }
.vpanel-b .section-error { margin: 0; }
.vfoot { padding: 7px 16px; border-top: 1px solid #edf0f4; font-size: 12px; color: #667085; background: #fafbfc; }
.rsz { position: absolute; top: 0; right: 0; bottom: 0; width: 12px; cursor: ew-resize; display: flex; align-items: center; justify-content: center; z-index: 2; touch-action: none; }
.rsz::after { content: ""; width: 4px; height: 40px; border-radius: 2px; background: #b9c2d3; opacity: 0; transition: opacity .12s; }
.vpanel:hover > .rsz::after, .vpanel.sizing > .rsz::after { opacity: 1; }
.span-badge { position: absolute; right: 18px; bottom: 8px; background: var(--app-black); color: #fff; font-size: 11.5px; font-weight: 600; border-radius: 4px; padding: 1px 7px; display: none; }
.vpanel.sizing > .span-badge { display: block; }

/* ---------- inside a panel ---------- */
.rt { font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }
.rt > :first-child { margin-top: 0; }
.rt > :last-child { margin-bottom: 0; }
.rt p { margin: 0 0 8px; }
.rt ul, .rt ol { margin: 0 0 8px; padding-left: 20px; }
.rt h3 { font-size: 14px; margin: 10px 0 6px; color: var(--app-black); }
.keys { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.vpanel-b > .keys:first-child, .vpanel-b > .vlinks:first-child, .vpanel-b > .vfiles:first-child { margin-top: 0; }
.krow { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; align-items: center; }
.krow .kl { color: #555; font-size: 13px; overflow-wrap: anywhere; }
.kval { display: flex; align-items: center; gap: 4px; min-width: 0; }
.kval code { flex: 1; min-width: 0; font-family: 'Cascadia Mono', Consolas, 'SFMono-Regular', Menlo, monospace; font-size: 12.5px; color: #2b3142;
    background: #f3f5f8; border: 1px solid #e3e7ee; border-radius: 5px; padding: 4px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kval code.shown { background: #fffbe9; border-color: #f1dcae; }
.kval span.ico-btn { visibility: hidden; }
.vlinks { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; }
.vlinks li { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13.5px; min-width: 0; color: var(--app-primary); }
.vlinks a { color: var(--app-primary); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.vlinks a:hover { text-decoration: underline; }
.vlinks .lh { color: #667085; font-size: 12px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vfiles { margin-top: 12px; }

/* ---------- set-up, your password, waiting ---------- */
.vcard { max-width: 460px; margin: 24px auto; background: #fff; border: 1px solid #e5e5e5; border-radius: 8px; padding: 26px 24px 20px;
    display: flex; flex-direction: column; align-items: center; gap: 10px; }
.vcard .fp, .hello-b .fp { width: 64px; height: 64px; border-radius: 50%; background: #e6f0fb; color: var(--app-primary); display: flex; align-items: center; justify-content: center; }
.vcard h2, .hello-b h2 { margin: 4px 0 0; font-size: 18px; color: var(--app-black); }
.vcard-b { align-self: stretch; display: flex; flex-direction: column; gap: 10px; }
.vcard-b .form-field { margin: 0; }
.vcard-f { display: flex; justify-content: flex-end; gap: 8px; }
.vcard-links { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; }
.pw-row { display: flex; gap: 6px; align-items: center; }
.pw-row input { flex: 1; min-width: 0; }
.vault-host .pw-row input { border: 1px solid #c8c8c8; border-radius: 6px; padding: 8px 12px; font-size: 13.5px; }
.meter { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #667085; margin-top: 6px; }
.meter i { flex: 1; height: 6px; border-radius: 3px; background: #e4e7ee; overflow: hidden; position: relative; }
.meter i b { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 3px; }
.meter span { min-width: 60px; }
.vcode { font-family: 'Cascadia Mono', Consolas, monospace; font-size: 22px; letter-spacing: .12em; text-align: center; padding: 12px; border-radius: 8px;
    background: #f3f5f8; color: var(--app-black); font-weight: 600; }
.vcode-sm { font-family: 'Cascadia Mono', Consolas, monospace; letter-spacing: .06em; }
.reckey { font-family: 'Cascadia Mono', Consolas, monospace; font-size: 18px; letter-spacing: .06em; text-align: center; padding: 14px; border: 2px dashed #c8cfdb;
    border-radius: 8px; background: #f6f8fa; color: var(--app-black); overflow-wrap: anywhere; }
.vcenter { display: flex; justify-content: center; margin: 8px 0; }
.vok { color: #1c7a44; font-weight: 600; display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.vconfirm { margin: 0 0 6px; }

/* ---------- the dialogs ---------- */
.vdlg .dlg-body > .form-field { margin-bottom: 12px; }
.dlg.hello .hello-b { padding: 26px 22px 12px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.dlg.hello .dlg-body { padding-top: 6px; }
.hsw-row { display: flex; gap: 6px; flex-wrap: wrap; padding: 2px; }
.hsw { width: 28px; height: 28px; border-radius: 6px; border: 0; background: var(--sw); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.hsw.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--app-black); }
.trow { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 10px 12px; align-items: end; }
.rt-tools { display: flex; gap: 2px; border: 1px solid #c8c8c8; border-bottom: 0; border-radius: 6px 6px 0 0; padding: 3px; background: #f6f8fa; }
.rt-tools button { border: 0; background: none; min-width: 30px; height: 28px; border-radius: 4px; cursor: pointer; color: #222a37; font-size: 13.5px;
    display: inline-flex; align-items: center; justify-content: center; }
.rt-tools button:hover { background: #e3e7ee; }
.rt-edit { border: 1px solid #c8c8c8; border-radius: 0 0 6px 6px; padding: 9px 11px; min-height: 110px; outline: none; background: #fff; }
.rt-edit:focus { border-color: var(--app-primary); }
.kedit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.ledit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.kedit input[type=text], .kedit input[type=password], .ledit input { font-size: 13.5px; border: 1px solid #c8c8c8; border-radius: 6px; padding: 6px 8px; min-width: 0; font-family: inherit; }
.kedit .kv { font-family: 'Cascadia Mono', Consolas, monospace; font-size: 12.5px; }
.toggle, .vdlg .form-field label.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 400; cursor: pointer; white-space: nowrap; }
.vadd { align-self: flex-start; margin-top: 2px; }
.vdlg .drop { margin-top: 6px; flex-direction: column; gap: 4px; padding: 12px; }

/* ---------- Settings -> Vault ---------- */
.vsettings { display: flex; flex-direction: column; gap: 16px; max-width: 860px; }
.vset .info-panel-header .right .lockchip { margin: -4px 0; }
.srow { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid #edf0f4; flex-wrap: wrap; color: #4a5368; }
.info-panel-header + .srow { border-top: 0; }
.srow .sl { flex: 1; min-width: 180px; }
.srow .sl b { display: block; color: var(--app-black); font-weight: 600; font-size: 14px; }
.srow .sl > span { color: #667085; font-size: 12.5px; }
.srow .sa { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.srow select { border: 1px solid #c8c8c8; border-radius: 6px; padding: 5px 8px; font-size: 13.5px; }
.vav { width: 32px; height: 32px; border-radius: 50%; background: #e6f0fb; color: var(--app-primary); font-size: 12.5px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }

/* ---------- the note at the foot of the screen ---------- */
.vtoast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #14233f; color: #fff; padding: 9px 16px; border-radius: 8px;
    font-size: 13.5px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); z-index: 2000; max-width: calc(100% - 32px); }
.vtoast[hidden] { display: none; }

/* A phone: every panel full width, nothing to resize. */
@media (max-width: 760px) {
    .vgrid > .vpanel { grid-column: 1 / -1; }
    .rsz { display: none; }
    .krow { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .kedit { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .trow { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- (2) secrets masked by styling, not password boxes ---------- */
.vmask { -webkit-text-security: disc; }
.vdlg .form-field input.vlast { width: 120px; text-align: center; letter-spacing: .25em; font-size: 16px; }

/* ---------- (3) richer text: the allow-listed sizes, colours and highlights ---------- */
.rt .rt-small { font-size: 12px; }
.rt .rt-large { font-size: 16.5px; }
.rt .rt-huge { font-size: 20px; line-height: 1.35; }
.rt u { text-decoration: underline; }
.rt s { text-decoration: line-through; }
.rt blockquote { margin: 0 0 8px; padding: 2px 0 2px 12px; border-left: 3px solid #c8cfdb; color: #4a5368; }
.rt .rt-c-red { color: #b32121; } .rt .rt-c-orange { color: #c25100; } .rt .rt-c-amber { color: #a86a12; }
.rt .rt-c-green { color: #1f845a; } .rt .rt-c-teal { color: #137a85; } .rt .rt-c-blue { color: #1a6fd6; }
.rt .rt-c-purple { color: #6e5dc6; } .rt .rt-c-pink { color: #ae4787; } .rt .rt-c-grey { color: #667085; }
.rt .rt-h-yellow { background: #fff3a3; } .rt .rt-h-green { background: #d3f5df; } .rt .rt-h-blue { background: #d6e8ff; }
.rt .rt-h-pink { background: #fbdcea; } .rt .rt-h-orange { background: #ffe2c7; }
.rt-tools { position: relative; flex-wrap: wrap; align-items: center; }
.rt-tools .rt-sep { width: 1px; height: 20px; background: #d5dae3; margin: 0 4px; }
.rt-tools .rt-aa { font-size: 12.5px; font-weight: 600; padding: 0 4px; }
.rt-tools .rt-menu::after { content: ""; border: 4px solid transparent; border-top-color: #667085; margin: 4px 0 0 3px; }
.rt-tools .rt-hd { font-weight: 800; font-size: 14px; }
.rt-tools .rt-a { font-weight: 700; text-decoration: underline; text-decoration-color: #b32121; text-decoration-thickness: 3px; }
.rt-tools .rt-hl { font-weight: 600; background: #fff3a3; padding: 0 3px; border-radius: 2px; }
.rt-pop { position: absolute; top: 100%; z-index: 5; margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px; max-width: 220px; padding: 6px;
    background: #fff; border: 1px solid #e3e6ee; border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); }
.rt-pop .rt-item { display: block; width: 100%; text-align: left; padding: 5px 10px; border-radius: 5px; justify-content: flex-start; height: auto; }
.rt-pop .rt-item:hover { background: #eef1f6; }
.rt-pop .rt-item.rt-small { font-size: 12px; } .rt-pop .rt-item.rt-large { font-size: 16.5px; } .rt-pop .rt-item.rt-huge { font-size: 20px; }
.rt-pop .rt-sw { width: 24px; height: 24px; min-width: 24px; border-radius: 5px; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); color: #667085; }
.rt-pop .rt-sw:hover { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--app-black); }

/* ---------- (4) SECTIONS (Steven, 2026-10-17): a heading bar in the section's colour, its panels on a very light shade of
   it across the section's own width - none wider - and a panel inside takes the shade on its heading. ---------- */
.vsection { grid-column: span var(--span, 10); position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: 8px;
    background: color-mix(in srgb, var(--sc) 7%, #fff); border: 1px solid color-mix(in srgb, var(--sc) 28%, #fff); }
.vsection-h { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 7px 7px 0 0; cursor: grab;
    background: color-mix(in srgb, var(--sc) 22%, #fff); color: var(--app-black); font-weight: 700; font-size: 13.5px; }
.vsection.hc > .vsection-h { background: var(--sc); color: #fff; }
.vsection-h .vt { min-width: 0; overflow-wrap: anywhere; }
.vsection-h .cnt { font-size: 11px; font-weight: 600; border-radius: 8px; padding: 0 6px; line-height: 16px; background: rgba(255, 255, 255, .55); color: #34405a; }
.vsection-h .right { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.vsection-h .ico-btn { margin: -4px 0; }
.vsection.hc > .vsection-h .ico-btn { color: #fff; background: transparent; border-color: rgba(255, 255, 255, .4); }
.vsection.hc > .vsection-h .ico-btn:hover { background: rgba(255, 255, 255, .2); }
.vsection-h .vfold { border: 0; background: none; color: inherit; padding: 0; display: inline-flex; cursor: pointer; }
.vsection-h .grip { opacity: .7; flex: 0 0 auto; }
.vsection-b { display: grid; gap: 12px; padding: 12px; align-items: stretch; position: relative; flex: 1; }
.vsection-b[hidden] { display: none; }
.vsection-b > .vguides { inset: 12px; gap: 12px; }
.vsection-empty { grid-column: 1 / -1; margin: 0; padding: 14px; text-align: center; color: #667085; font-size: 13px; border-radius: 6px;
    border: 2px dashed color-mix(in srgb, var(--sc) 35%, #fff); }
.vpanel.insec { border-color: color-mix(in srgb, var(--sc) 30%, #fff); }
.vpanel.insec > .vpanel-h:not(.hc) { background: color-mix(in srgb, var(--sc) 14%, #fff); border-bottom-color: color-mix(in srgb, var(--sc) 22%, #fff); }
.vsection.dragging { opacity: .4; }
.vsection.drop-before { box-shadow: -6px 0 0 -2px var(--app-primary); }
.vsection.drop-after { box-shadow: 6px 0 0 -2px var(--app-primary); }
.vsection.drop-in { outline: 2px dashed var(--app-primary); outline-offset: 2px; }
.vsection:hover > .rsz::after, .vsection.sizing > .rsz::after { opacity: 1; }
.vsection.sizing > .span-badge { display: block; }
.trow.trow3 { grid-template-columns: minmax(0, 1fr) 110px 180px; }
.vav.vpc { background: #eef1f6; color: #34405a; }

@media (max-width: 760px) {
    .vgrid > .vsection { grid-column: 1 / -1; }
    .vsection-b { grid-template-columns: minmax(0, 1fr) !important; }
    .vsection-b > .vpanel { grid-column: 1 / -1; }
    .trow.trow3 { grid-template-columns: minmax(0, 1fr); }
}

/* A narrow panel (a half-width one in a section, say): each key's value under its name, not squeezed beside it. */
.vpanel { container-type: inline-size; }
@container (max-width: 380px) {
    .krow { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
