/* ============================================================================
   eabassets - kit/chrome.css
   The house chrome, shaped like Asset Panda and painted in EAB colours:
   row 1 navy bar with the reversed logo, row 2 white submenu of group tabs,
   page frame, cards, buttons, status pills, chips, form controls, tab rail,
   modal / drawer / toast, list header, record page, admin layouts, help panel,
   tour, login, skeletons, responsive.
   Every colour is a token from tokens.css.
   ==========================================================================*/

/* ------------------------------------------------- 1. the two chrome rows */
.appbar{position:sticky;top:0;z-index:50}

.topbar{
  display:flex;align-items:center;gap:10px;
  height:calc(var(--bar-h) + env(safe-area-inset-top, 0px));padding:env(safe-area-inset-top, 0px) var(--gutter) 0;
  box-sizing:border-box;
  background:var(--bar-grad);color:var(--bar-txt);
}
/* iOS standalone (black-translucent status bar): the page starts under the status bar and the
   notch, so the navy bar grows by the top inset and its content sits below the clock. */
.topbar .spacer{flex:1 1 auto;min-width:8px}

/* the reversed EAB logo, never redrawn */
.brand{display:inline-flex;align-items:center;flex:0 0 auto;padding:4px 2px;border-radius:var(--radius-ctl);text-decoration:none}
.brand img{height:34px;width:auto;display:block}
.brand:hover{text-decoration:none;opacity:.88}
.brand:focus-visible{box-shadow:0 0 0 3px var(--bar-hover)}
.brand .mark{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}
.brand .word{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

/* row 2: the group submenu, Asset Panda's second bar */
.subbar{
  display:flex;align-items:stretch;gap:0;
  height:var(--sub-h);padding:0 var(--gutter);
  background:var(--sub-bg);border-bottom:1px solid var(--sub-line);
  overflow-x:auto;overflow-y:hidden;scrollbar-width:none;
}
.subbar::-webkit-scrollbar{display:none}
.subbar .tab{
  display:inline-flex;align-items:center;gap:7px;flex:0 0 auto;
  padding:0 16px;border:0;border-bottom:2px solid transparent;margin-bottom:-1px;
  background:none;color:var(--sub-txt);text-decoration:none;white-space:nowrap;cursor:pointer;
  font-family:var(--font-head);font-size:12.5px;font-weight:600;letter-spacing:.01em;
  transition:color var(--t) var(--ease),border-color var(--t) var(--ease);
}
.subbar .tab:hover{color:var(--heading);text-decoration:none}
.subbar .tab.on{color:var(--sub-on);border-bottom-color:var(--sub-on);font-weight:700}
.subbar .tab .ic{opacity:.75}
.subbar .subend{margin-left:auto;display:flex;align-items:center;gap:6px;flex:0 0 auto;padding-left:12px}


/* ------------------------------------------------------------ 2. search   */
.search{position:relative;flex:0 1 300px;min-width:170px}
.search input[type=search]{
  width:100%;height:34px;padding:0 12px 0 32px;
  border:1px solid transparent;border-radius:var(--radius-ctl);
  background:var(--panel);color:var(--txt);font-size:12.5px;outline:none;
  -webkit-appearance:none;appearance:none;
  transition:box-shadow var(--t) var(--ease);
}
.search input[type=search]::-webkit-search-cancel-button{display:none}
.search input[type=search]:focus{box-shadow:0 0 0 3px var(--bar-hover)}
.search input[type=search]::placeholder{color:var(--faint)}
.search .sic{position:absolute;left:10px;top:50%;transform:translateY(-50%);color:var(--faint);pointer-events:none;display:flex}

/* icon button (34px) */
.iconbtn{
  position:relative;width:34px;height:34px;border-radius:var(--radius-ctl);
  border:1px solid var(--line);background:var(--panel);color:var(--muted);
  cursor:pointer;display:inline-flex;align-items:center;justify-content:center;
  transition:all var(--t) var(--ease);flex:0 0 auto;padding:0;
}
.iconbtn:hover{color:var(--accent);border-color:var(--accent);background:var(--accent-soft)}
.iconbtn:disabled{opacity:.45;cursor:default}
.iconbtn.quiet{border-color:transparent;background:transparent}
.iconbtn.quiet:hover{background:var(--bg2);border-color:var(--line);color:var(--accent)}
.iconbtn.sm{width:28px;height:28px}
.iconbtn.on{color:var(--accent);border-color:var(--accent);background:var(--accent-soft)}
.iconbtn.danger:hover{color:var(--red);border-color:var(--red);background:var(--red-soft)}
.topbar .iconbtn{border-color:transparent;background:transparent;color:var(--bar-txt)}
.topbar .iconbtn:hover{background:var(--bar-hover);border-color:transparent;color:var(--bar-txt)}
.topbar .iconbtn.on{background:var(--bar-hover);color:var(--bar-txt);border-color:transparent}
/* the hamburger and the search icon are phone only; this has to sit after
   the .iconbtn rules or the base display wins */
.topbar .menubtn{display:none}
.iconbtn .i-sun{display:none}
html[data-theme="dark"] .iconbtn .i-sun{display:block}
html[data-theme="dark"] .iconbtn .i-moon{display:none}
.iconbtn .cnt{
  position:absolute;top:-3px;right:-3px;min-width:17px;height:17px;padding:0 4px;
  border-radius:var(--pill);background:var(--red);color:#fff;
  font-family:var(--font-head);font-size:10px;font-weight:700;line-height:17px;text-align:center;
  box-shadow:0 0 0 2px var(--bar-bg);
}

.userbtn{
  display:inline-flex;align-items:center;gap:8px;height:34px;padding:0 8px 0 4px;
  border:1px solid transparent;border-radius:var(--radius-ctl);background:transparent;
  color:var(--bar-txt);font-size:12.5px;cursor:pointer;white-space:nowrap;
  transition:all var(--t) var(--ease);flex:0 1 auto;max-width:190px;
}
.userbtn:hover{background:var(--bar-hover)}
.userbtn .av{
  width:26px;height:26px;border-radius:50%;background:var(--sky);color:var(--brand-deep);
  display:flex;align-items:center;justify-content:center;
  font-family:var(--font-head);font-size:10.5px;font-weight:700;letter-spacing:.02em;
}
.userbtn .avwrap{display:flex}
.userbtn .pic.av{border:0;box-shadow:0 0 0 1px rgba(255,255,255,.35)}
.userbtn .uname{overflow:hidden;text-overflow:ellipsis;min-width:0;font-family:var(--font-head);font-weight:600}

/* ----------------------------------------------------------- 3. popovers  */
.pop{
  position:fixed;z-index:120;min-width:220px;
  background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-card);
  box-shadow:var(--shadow-lg);padding:6px;color:var(--txt);
  animation:popIn .12s var(--ease) both;
}
@keyframes popIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
.pop .pophead{padding:8px 10px 6px}
.pop .popname{font-family:var(--font-head);font-size:13px;font-weight:600;color:var(--heading)}
.pop .popsub{font-size:11.5px;color:var(--muted)}
.pop{overflow-y:auto}   /* kit/ui.js menu() caps the height so a long menu never runs off the bottom */
.pop hr{border:0;border-top:1px solid var(--line2);margin:6px 0}
.pop .item{
  display:flex;align-items:center;gap:9px;width:100%;
  padding:8px 10px;border:0;border-radius:var(--radius-ctl);
  background:transparent;color:var(--txt);font-family:var(--font);font-size:12.5px;text-align:left;cursor:pointer;
  transition:background var(--t) var(--ease),color var(--t) var(--ease);
}
.pop .item:hover,.pop .item.active{background:var(--bg2);color:var(--heading)}
.pop .item .ic{color:var(--muted);flex:0 0 auto;display:flex}
.pop .item:hover .ic{color:var(--accent)}
.pop .item.danger{color:var(--red)}
.pop .item.danger .ic{color:var(--red)}
.pop .item:disabled{opacity:.5;cursor:default}
.pop .item .nm{color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-left:auto;font-size:11.5px}
.pop .list{max-height:380px;overflow:auto;padding:2px}
.pop .popsearch{padding:5px}
.pop .popsearch input[type=search]{width:100%;height:32px;padding:0 10px;border:1px solid var(--line);border-radius:var(--radius-ctl);background:var(--bg2);color:var(--txt);font-size:13px;outline:none}
.pop .none{padding:16px 10px;color:var(--muted);font-size:12.5px;text-align:center}
.pop .sect{padding:8px 10px 3px;font-family:var(--font-head);font-size:10px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--faint)}

/* -------------------------------------------------------- 4. page frame   */
.page{display:block;width:100%;padding:20px var(--gutter) 56px}
.page.prose{max-width:780px;margin:0 auto}
.stack{display:flex;flex-direction:column;gap:16px}
.row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.rowend{display:flex;align-items:center;gap:8px;margin-left:auto}
.cols2{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.cols3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}

/* --------------------------------------------- 5. card + page title bar   */
.card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-card);box-shadow:var(--shadow);overflow:hidden}
.card > .cardhead{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid var(--line2)}
.card > .cardhead h3{font-size:11.5px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--muted)}
.card > .cardhead .rowend{margin-left:auto}
.card > .cardbody{padding:16px}
.card.flush > .cardbody{padding:0}
.scrollx{overflow-x:auto;max-width:100%;-webkit-overflow-scrolling:touch}

.page-title{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 16px}
.page-title h1{font-size:23px;font-weight:600;letter-spacing:-.005em;line-height:1.2;display:flex;align-items:center;gap:10px}
.page-title h1 .no{font-family:var(--font);font-weight:600;color:var(--muted);font-size:14px;letter-spacing:0}
.page-title .sub{color:var(--muted);font-size:12.5px}
.page-title .acts{display:flex;align-items:center;gap:8px;margin-left:auto;flex-wrap:wrap}
.crumbs{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted);margin-bottom:8px}
.crumbs a{color:var(--muted)}
.crumbs a:hover{color:var(--accent)}
.crumbs .ic{display:flex;color:var(--faint)}

/* ---------------------------------------------------------- 6. buttons    */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  height:34px;padding:0 14px;border-radius:var(--radius-ctl);
  border:1px solid var(--line);background:var(--panel);color:var(--txt);
  font-family:var(--font-head);font-size:12.5px;font-weight:600;white-space:nowrap;cursor:pointer;
  box-shadow:0 1px 1px rgba(18,40,76,.03);
  transition:all var(--t) var(--ease);
}
.btn:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-soft);text-decoration:none}
.btn:disabled{opacity:.45;cursor:default;box-shadow:none}
.btn:disabled:hover{border-color:var(--line);color:var(--txt);background:var(--panel)}
.btn .ic{opacity:.9;display:flex}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-txt);box-shadow:0 1px 2px rgba(0,85,184,.24)}
.btn.primary:hover{background:var(--accent-hover);border-color:var(--accent-hover);color:var(--accent-txt)}
.btn.primary .ic{opacity:1}
.btn.danger{color:var(--red);border-color:var(--line)}
.btn.danger:hover{border-color:var(--red);background:var(--red-soft);color:var(--red)}
.btn.danger.solid{background:var(--red);border-color:var(--red);color:#fff}
.btn.danger.solid:hover{background:var(--red);color:#fff;opacity:.9}
.btn.sm{height:28px;padding:0 10px;font-size:12px}
.btn.quiet{border-color:transparent;background:transparent;color:var(--muted);box-shadow:none}
.btn.quiet:hover{color:var(--accent);background:var(--bg2);border-color:transparent}
.btn.block{width:100%}
.btn.link{border:0;background:none;color:var(--accent);padding:0;height:auto;font-family:var(--font);font-weight:600;box-shadow:none}
.btn.link:hover{text-decoration:underline;background:none}
.btn.busy{opacity:.7}
.btngroup{display:inline-flex;gap:0}
.btngroup .btn{border-radius:0}
.btngroup .btn:first-child{border-radius:var(--radius-ctl) 0 0 var(--radius-ctl)}
.btngroup .btn:last-child{border-radius:0 var(--radius-ctl) var(--radius-ctl) 0}
.btngroup .btn + .btn{margin-left:-1px}

/* --------------------------------------------------- 7. badges + chips   */
.badge{
  display:inline-flex;align-items:center;gap:6px;
  font-family:var(--font-head);font-size:11px;font-weight:600;letter-spacing:.01em;
  padding:2px 10px;border-radius:var(--pill);border:1px solid var(--line);color:var(--muted);
  white-space:nowrap;line-height:1.6;
}
.badge .dot{width:7px;height:7px;border-radius:50%;background:var(--faint);flex:0 0 auto}
.badge.b-green{color:var(--green);border-color:transparent;background:var(--green-soft)} .badge.b-green .dot{background:var(--green)}
.badge.b-amber{color:var(--amber);border-color:transparent;background:var(--amber-soft)} .badge.b-amber .dot{background:var(--amber)}
.badge.b-red{color:var(--red);border-color:transparent;background:var(--red-soft)} .badge.b-red .dot{background:var(--red)}
.badge.b-acc{color:var(--accent);border-color:transparent;background:var(--accent-soft)} .badge.b-acc .dot{background:var(--accent)}
.badge.b-teal{color:var(--teal);border-color:transparent;background:var(--teal-soft)} .badge.b-teal .dot{background:var(--teal)}
.badge.b-purple{color:var(--purple);border-color:transparent;background:var(--purple-soft)} .badge.b-purple .dot{background:var(--purple)}
.badge.b-pink{color:var(--pink);border-color:transparent;background:var(--pink-soft)} .badge.b-pink .dot{background:var(--pink)}
.badge.b-orange{color:var(--orange);border-color:transparent;background:var(--orange-soft)} .badge.b-orange .dot{background:var(--orange)}
.badge.b-sky{color:var(--sky);border-color:transparent;background:var(--sky-soft)} .badge.b-sky .dot{background:var(--sky)}
.badge.b-grey{color:var(--grey);border-color:transparent;background:var(--grey-soft)} .badge.b-grey .dot{background:var(--grey)}
.badge.b-muted{color:var(--muted);border-color:var(--line);background:transparent}
.badge.lg{font-size:12.5px;padding:4px 13px}

.chip{
  display:inline-flex;align-items:center;gap:7px;
  height:28px;padding:0 11px;border-radius:var(--pill);border:1px solid var(--line);
  background:var(--panel);color:var(--muted);font-size:12px;cursor:pointer;
  white-space:nowrap;transition:all var(--t) var(--ease);
}
.chip:hover{color:var(--accent);border-color:var(--accent)}
.chip .box{width:13px;height:13px;border-radius:3px;border:1px solid var(--line);display:flex;align-items:center;justify-content:center;color:transparent;flex:0 0 auto}
.chip.on{color:var(--accent);border-color:var(--accent);background:var(--accent-soft);font-weight:600}
.chip.on .box{background:var(--accent);border-color:var(--accent);color:var(--accent-txt)}
.chip.static{cursor:default}
.chip.static:hover{color:var(--muted);border-color:var(--line)}
.chip .x{display:flex;color:var(--faint);margin-right:-4px;border-radius:50%;padding:2px}
.chip .x:hover{color:var(--red);background:var(--red-soft)}
.chip b{color:var(--txt);font-weight:600}
.chiprow{display:flex;align-items:center;gap:6px;flex-wrap:wrap}

/* --------------------------------------------------- 8. form controls    */
.field{display:flex;flex-direction:column;gap:5px;min-width:0}
.field > label,.lbl{font-family:var(--font-head);font-size:11px;font-weight:700;letter-spacing:.04em;color:var(--muted);text-transform:none}
.field > label .req{color:var(--red);margin-left:3px}
.field .help{font-size:11.5px;color:var(--faint);line-height:1.45}
.field.inline{flex-direction:row;align-items:center;gap:10px}
input[type=text],input[type=password],input[type=email],input[type=number],
input[type=date],input[type=datetime-local],input[type=time],input[type=tel],input[type=url],
input[type=search],select,textarea{
  height:34px;padding:0 10px;width:100%;
  border:1px solid var(--line);border-radius:var(--radius-ctl);
  background:var(--panel);color:var(--txt);font-size:13px;outline:none;font-family:var(--font);
  transition:border-color var(--t) var(--ease),box-shadow var(--t) var(--ease);
  max-width:100%;
}
textarea{height:auto;min-height:76px;padding:8px 10px;line-height:1.55;resize:vertical}
select{
  padding-right:28px;cursor:pointer;-webkit-appearance:none;appearance:none;
  background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);
  background-position:calc(100% - 14px) 14px,calc(100% - 10px) 14px;
  background-size:4px 4px,4px 4px;background-repeat:no-repeat;
}
input:focus,select:focus,textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
input:disabled,select:disabled,textarea:disabled,input[readonly]{background:var(--bg2);color:var(--muted);cursor:default}
input::placeholder,textarea::placeholder{color:var(--faint)}
input[type=search]::-webkit-search-cancel-button{display:none}
input[type=date]::-webkit-calendar-picker-indicator,input[type=datetime-local]::-webkit-calendar-picker-indicator,input[type=time]::-webkit-calendar-picker-indicator{opacity:.5;cursor:pointer}
html[data-theme="dark"] input[type=date]::-webkit-calendar-picker-indicator,html[data-theme="dark"] input[type=datetime-local]::-webkit-calendar-picker-indicator,html[data-theme="dark"] input[type=time]::-webkit-calendar-picker-indicator{filter:invert(1);opacity:.55}
input.invalid,select.invalid,textarea.invalid{border-color:var(--red)}
.err{color:var(--red);font-size:12px;min-height:16px}
.err:empty{min-height:0}
.hint{color:var(--muted);font-size:11.5px;line-height:1.5}
.formgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px}
.formgrid .span2{grid-column:1 / -1}

.check{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:12.5px;user-select:none;font-family:var(--font)}
.check input[type=checkbox]{
  width:15px;height:15px;margin:0;border-radius:3px;border:1px solid var(--faint);
  background:var(--panel);cursor:pointer;-webkit-appearance:none;appearance:none;
  display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;
  transition:all var(--t) var(--ease);
}
.check input[type=checkbox]:checked{background:var(--accent);border-color:var(--accent)}
.check input[type=checkbox]:checked::after{content:"";width:4px;height:8px;margin-top:-2px;border:solid #fff;border-width:0 1.8px 1.8px 0;transform:rotate(45deg)}
.check input[type=checkbox]:indeterminate{background:var(--accent);border-color:var(--accent)}
.check input[type=checkbox]:indeterminate::after{content:"";width:7px;height:1.8px;background:#fff}
.check input[type=checkbox]:disabled{opacity:.5}

/* yes / no segmented toggle */
.seg{display:inline-flex;border:1px solid var(--line);border-radius:var(--radius-ctl);overflow:hidden}
.seg button{height:32px;padding:0 14px;border:0;background:var(--panel);color:var(--muted);cursor:pointer;font-family:var(--font-head);font-size:12px;font-weight:600}
.seg button + button{border-left:1px solid var(--line)}
.seg button.on{background:var(--accent);color:var(--accent-txt)}
.seg button:hover:not(.on){background:var(--bg2);color:var(--accent)}

/* switch */
.switch{position:relative;display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:12.5px;user-select:none}
.switch input{position:absolute;opacity:0;width:0;height:0}
.switch .trk{width:32px;height:18px;border-radius:var(--pill);background:var(--line);position:relative;transition:background var(--t) var(--ease);flex:0 0 auto}
.switch .trk::after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform var(--t) var(--ease);box-shadow:0 1px 2px rgba(18,40,76,.25)}
.switch input:checked + .trk{background:var(--accent)}
.switch input:checked + .trk::after{transform:translateX(14px)}
.switch input:focus-visible + .trk{box-shadow:0 0 0 3px var(--accent-soft)}

/* currency / prefix input */
.affix{display:flex;align-items:stretch;width:100%}
.affix .pre{display:flex;align-items:center;padding:0 10px;border:1px solid var(--line);border-right:0;border-radius:var(--radius-ctl) 0 0 var(--radius-ctl);background:var(--bg2);color:var(--muted);font-size:12.5px}
.affix input{border-radius:0 var(--radius-ctl) var(--radius-ctl) 0}

/* grouplist picker */
.picker{position:relative;width:100%}
.picker .pick-in{padding-right:28px}
.picker .pick-x{position:absolute;right:6px;top:50%;transform:translateY(-50%);display:flex;color:var(--faint);cursor:pointer;border:0;background:none;padding:2px}
.picker .pick-x:hover{color:var(--red)}
.picklist{
  position:fixed;z-index:260;max-height:270px;overflow:auto;
  background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-card);box-shadow:var(--shadow-lg);padding:4px;
}
.picklist .item{display:flex;flex-direction:column;gap:1px;width:100%;padding:7px 10px;border:0;background:transparent;color:var(--txt);text-align:left;cursor:pointer;border-radius:var(--radius-ctl);font-family:var(--font);font-size:12.5px}
.picklist .item:hover,.picklist .item.active{background:var(--bg2)}
.picklist .item .d2{font-size:11px;color:var(--muted)}
.picklist .item.withpic{flex-direction:row;align-items:center;gap:9px}
.picklist .item.withpic .tx{display:flex;flex-direction:column;gap:1px;min-width:0}
.picklist .item.withpic .pic .ini{font-size:10px}
.picklist .none{padding:10px;color:var(--muted);font-size:12px;text-align:center}
/* a link that may name a record in one of several groups shows a tab per group at the top of its list */
.picklist .ptabs{display:flex;gap:2px;padding:4px 4px 2px;border-bottom:1px solid var(--line2);margin-bottom:2px;position:sticky;top:-4px;background:var(--panel)}
.picklist .ptab{display:inline-flex;align-items:center;gap:5px;flex:1;justify-content:center;padding:5px 8px;border:0;border-radius:var(--radius-ctl);background:transparent;color:var(--muted);font-family:var(--font);font-size:12px;cursor:pointer}
.picklist .ptab:hover{background:var(--bg2);color:var(--txt)}
.picklist .ptab.on{background:var(--bg2);color:var(--txt);font-weight:600}
.picklist .ptab .ic{display:inline-flex;color:var(--faint)}
.withg{display:inline-flex;align-items:center;gap:5px}
.withg .lgrp{display:inline-flex;color:var(--faint)}
.chips-in{display:flex;flex-wrap:wrap;gap:5px;align-items:center;min-height:34px;padding:3px 6px;border:1px solid var(--line);border-radius:var(--radius-ctl);background:var(--panel)}
.chips-in:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.chips-in input{border:0;height:26px;flex:1 1 90px;min-width:70px;padding:0 4px;box-shadow:none!important;background:transparent}
.chips-in .chip{height:24px;padding:0 8px;font-size:11.5px;color:var(--txt)}

/* address block */
.addr{display:grid;grid-template-columns:2fr 1fr 1fr;gap:6px}
.addr .full{grid-column:1 / -1}

/* signature pad */
.sigpad{border:1px dashed var(--faint);border-radius:var(--radius-ctl);background:var(--panel);position:relative;touch-action:none}
.sigpad canvas{display:block;width:100%;height:120px;cursor:crosshair}
.sigpad .sigclear{position:absolute;right:6px;top:6px}
.sigpad .sighint{position:absolute;left:10px;bottom:6px;font-size:11px;color:var(--faint);pointer-events:none}

/* dropzone */
.drop{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
  padding:24px;border:1.5px dashed var(--line);border-radius:var(--radius-card);background:var(--panel2);
  color:var(--muted);text-align:center;cursor:pointer;transition:all var(--t) var(--ease);font-size:12.5px;
}
.drop:hover,.drop.over{border-color:var(--accent);background:var(--accent-soft);color:var(--accent)}
.drop .ic{display:flex;color:var(--faint)}
.drop:hover .ic,.drop.over .ic{color:var(--accent)}
.drop b{font-family:var(--font-head);font-weight:600;color:var(--heading)}
.filelist{display:flex;flex-direction:column;gap:4px}
.filelist .f{display:flex;align-items:center;gap:8px;padding:6px 8px;border:1px solid var(--line);border-radius:var(--radius-ctl);font-size:12px;background:var(--panel)}
.filelist .f .nm{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.filelist .f .sz{color:var(--faint);font-variant-numeric:tabular-nums}
.progress{height:6px;border-radius:var(--pill);background:var(--bg2);overflow:hidden;width:100%}
.progress .fill{display:block;height:100%;background:var(--accent);border-radius:var(--pill);transition:width .2s var(--ease)}
.progress.p-green .fill{background:var(--green)}
.progress.p-red .fill{background:var(--red)}

/* colour swatches */
.swatches{display:flex;flex-wrap:wrap;gap:6px}
.swatch{width:26px;height:26px;border-radius:50%;border:2px solid transparent;cursor:pointer;padding:0;position:relative;transition:transform var(--t) var(--ease)}
.swatch.on{border-color:var(--heading);box-shadow:0 0 0 2px var(--panel) inset}
.swatch:hover{transform:scale(1.08)}
.swdot{display:inline-block;width:12px;height:12px;border-radius:50%;vertical-align:middle;margin-right:6px}
.swbox{display:inline-block;width:16px;height:16px;border-radius:4px;border:1px solid var(--line);vertical-align:middle;flex:0 0 auto}
.swatch:focus-visible{outline:none;box-shadow:0 0 0 3px var(--accent-soft)}
.hexrow{display:flex;align-items:center;gap:8px;margin-top:8px}
.hexrow input{width:120px;font-family:var(--mono)}

/* ------------------------------------------------------------- 9. tabs  */
.tabs{display:inline-flex;align-items:center;gap:2px;padding:3px;background:var(--bg2);border-radius:var(--radius-ctl)}
.tabs button{
  display:inline-flex;align-items:center;gap:7px;border:0;background:transparent;color:var(--muted);
  padding:6px 14px;border-radius:var(--radius-ctl);cursor:pointer;font-family:var(--font-head);font-size:12px;font-weight:600;
  transition:all var(--t) var(--ease);white-space:nowrap;
}
.tabs button:hover{color:var(--heading)}
.tabs button.on{background:var(--panel);color:var(--accent);box-shadow:var(--shadow)}
.tabs button .cnt{font-size:10.5px;font-weight:700;font-variant-numeric:tabular-nums;padding:0 6px;border-radius:var(--pill);background:var(--panel);color:var(--muted)}
.tabs button.on .cnt{background:var(--accent-soft);color:var(--accent)}

/* the record page's left tab rail */
.rail{display:flex;flex-direction:column;gap:2px;min-width:180px}
.rail button{
  display:flex;align-items:center;gap:9px;width:100%;padding:9px 12px;border:0;border-left:3px solid transparent;
  background:transparent;color:var(--muted);text-align:left;cursor:pointer;
  font-family:var(--font-head);font-size:12.5px;font-weight:600;border-radius:0 var(--radius-ctl) var(--radius-ctl) 0;
  transition:all var(--t) var(--ease);
}
.rail button:hover{color:var(--heading);background:var(--bg2)}
/* the More button is built with button() and would otherwise centre its word like a toolbar button */
.rail button.btn{justify-content:flex-start;box-shadow:none;min-height:0;height:auto}
.rail button.on{color:var(--accent);border-left-color:var(--accent);background:var(--accent-soft)}
.rail button .ic{display:flex;opacity:.85}
.rail button .cnt{margin-left:auto;font-size:10.5px;font-weight:700;color:var(--muted);font-variant-numeric:tabular-nums;background:var(--bg2);border-radius:var(--pill);padding:0 7px;line-height:17px}
.rail button.on .cnt{background:var(--panel);color:var(--accent)}

/* ------------------------------------------------------------ 10. modal  */
.modal-back,.drawer-back{
  position:fixed;inset:0;z-index:200;background:var(--backdrop);
  display:flex;align-items:center;justify-content:center;padding:calc(24px + env(safe-area-inset-top, 0px)) 24px calc(24px + env(safe-area-inset-bottom, 0px));
  animation:fadeIn .14s var(--ease) both;
}
/* A drawer slides in beside the page, it does not take it over: a light scrim only, and the panel's own shadow does the separating.
   Dialogs keep the full backdrop. */
.drawer-back{background:var(--backdrop-light)}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
.modal{
  width:min(560px,100%);max-height:90vh;max-height:90dvh;display:flex;flex-direction:column;
  background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-card);
  box-shadow:var(--shadow-lg);overflow:hidden;animation:modalIn .18s var(--ease) both;
}
.modal.wide{width:min(900px,100%)}
.modal.xwide{width:min(1200px,100%)}
@keyframes modalIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.modal .mhead{display:flex;align-items:center;gap:10px;padding:14px 18px;border-bottom:1px solid var(--line2)}
.modal .mhead h2{font-size:15.5px;font-weight:600}
.modal .mhead .iconbtn{margin-left:auto}
.modal .mbody{padding:18px;overflow:auto;flex:1 1 auto}
.modal .mbody:empty{padding:0}
.modal .mfoot{display:flex;align-items:center;gap:8px;justify-content:flex-end;padding:12px 18px;border-top:1px solid var(--line2);background:var(--panel2)}
.modal .mfoot .left{margin-right:auto}

.drawer-back{align-items:stretch;justify-content:flex-end;padding:0}
.drawer{width:min(520px,100%);height:100%;display:flex;flex-direction:column;background:var(--panel);border-left:1px solid var(--line);box-shadow:var(--shadow-lg);animation:drawerIn .2s var(--ease) both}
@keyframes drawerIn{from{transform:translateX(100%)}to{transform:none}}
/* iOS home-screen install: the drawer runs under the status bar, so its head starts below the top inset */
.drawer .dhead{display:flex;align-items:center;gap:10px;padding:calc(14px + env(safe-area-inset-top, 0px)) 18px 14px;border-bottom:1px solid var(--line2)}
.drawer .dhead h2{font-size:15.5px;font-weight:600}
.drawer .dhead .iconbtn{margin-left:auto}
.drawer .dbody{padding:18px;overflow:auto;flex:1 1 auto}
.drawer .dfoot{display:flex;align-items:center;gap:8px;justify-content:flex-end;padding:12px 18px;border-top:1px solid var(--line2);background:var(--panel2)}

/* ------------------------------------------------------------ 11. toast  */
.toastwrap{position:fixed;right:20px;bottom:20px;z-index:300;display:flex;flex-direction:column;gap:8px;align-items:flex-end}
.toast{display:flex;align-items:center;gap:9px;max-width:420px;padding:11px 15px;border-radius:var(--radius-card);background:var(--panel);border:1px solid var(--line);box-shadow:var(--shadow-lg);color:var(--txt);font-size:12.5px;animation:toastIn .18s var(--ease) both;cursor:pointer}
.toast.leaving{animation:toastOut .18s var(--ease) both}
@keyframes toastIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes toastOut{to{opacity:0;transform:translateY(6px)}}
.toast .dot{width:8px;height:8px;border-radius:50%;background:var(--faint);flex:0 0 auto}
.toast.t-green .dot{background:var(--green)}
.toast.t-red .dot{background:var(--red)}
.toast.t-amber .dot{background:var(--amber)}
.toast.t-accent .dot{background:var(--accent)}

/* ------------------------------------- 12. kpi / empty / spinner / tiles */
.kpi{display:flex;flex-direction:column;gap:3px;padding:16px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-card);box-shadow:var(--shadow);min-width:0;color:inherit;text-decoration:none;transition:all var(--t) var(--ease)}
a.kpi:hover{border-color:var(--accent);text-decoration:none;box-shadow:var(--shadow-md)}
.kpi .k-label{font-family:var(--font-head);font-size:11px;font-weight:700;letter-spacing:.04em;color:var(--muted)}
.kpi .k-value{font-family:var(--font-head);font-size:28px;font-weight:600;color:var(--heading);font-variant-numeric:tabular-nums;line-height:1.15}
.kpi .k-sub{font-size:11.5px;color:var(--muted)}
.kpi.t-red .k-value{color:var(--red)}
.kpi.t-amber .k-value{color:var(--amber)}
.kpi.t-green .k-value{color:var(--green)}
.kpirow{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}

.empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:48px 24px;text-align:center;color:var(--muted)}
.empty .eic{width:46px;height:46px;border-radius:var(--pill);display:flex;align-items:center;justify-content:center;background:var(--accent-soft);color:var(--accent);border:1px solid transparent}
.empty h3{font-size:14.5px;font-weight:600}
.empty p{font-size:12.5px;color:var(--muted);max-width:52ch;margin:0}

.spinner{width:18px;height:18px;border-radius:50%;display:inline-block;flex:0 0 auto;border:2px solid var(--line);border-top-color:var(--accent);animation:spin .7s linear infinite}
.spinner.lg{width:28px;height:28px;border-width:2.5px}
@keyframes spin{to{transform:rotate(360deg)}}
.loading{display:flex;align-items:center;justify-content:center;gap:10px;padding:48px;color:var(--muted);font-size:12.5px}

/* skeletons: what a grid or a card shows while it loads */
.sk{display:block;border-radius:4px;background:var(--bg2);position:relative;overflow:hidden}
.sk::after{content:"";position:absolute;inset:0;transform:translateX(-100%);background:linear-gradient(90deg,transparent,var(--panel2),transparent);animation:skshine 1.2s infinite}
@keyframes skshine{100%{transform:translateX(100%)}}
.sk-line{height:11px;margin:5px 0}
.sk-block{height:120px}
.skstack{display:flex;flex-direction:column;gap:10px;padding:16px}

.cardgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px}
.tile{display:flex;flex-direction:column;gap:8px;padding:16px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-card);box-shadow:var(--shadow);color:inherit;text-decoration:none;transition:all var(--t) var(--ease);cursor:pointer;text-align:left}
a.tile:hover,button.tile:hover,.tile:hover{border-color:var(--accent);text-decoration:none;box-shadow:var(--shadow-md)}
.tic{width:34px;height:34px;border-radius:var(--radius-ctl);display:flex;align-items:center;justify-content:center;background:var(--accent-soft);color:var(--accent);flex:0 0 auto}
.card > .cardhead .tic{width:26px;height:26px}
.card > .cardhead .big{font-family:var(--font-head);font-size:19px;font-weight:600;color:var(--heading);font-variant-numeric:tabular-nums;text-decoration:none}
.card > .cardhead .big:hover{color:var(--accent)}
.tile h3{font-size:14px;font-weight:600}
.tile p{font-size:12px;color:var(--muted);margin:0;line-height:1.55}
.tile .foot{display:flex;align-items:center;gap:7px;margin-top:auto;padding-top:4px;color:var(--muted);font-size:11.5px}
.tile .big{font-family:var(--font-head);font-size:20px;font-weight:600;color:var(--heading);font-variant-numeric:tabular-nums}

/* mini table (record tabs, admin lists) */
.mt{width:100%;border-collapse:separate;border-spacing:0;font-size:12.5px}
.mt th{text-align:left;padding:9px 12px;font-family:var(--font-head);font-size:11px;font-weight:700;letter-spacing:.04em;color:var(--muted);border-bottom:1px solid var(--line);background:var(--panel2);white-space:nowrap}
.mt td{padding:9px 12px;border-bottom:1px solid var(--line2);vertical-align:middle}
.mt tr:last-child td{border-bottom:0}
.mt tbody tr:hover td{background:var(--bg2)}
.mt td.num,.mt th.num{text-align:right;font-variant-numeric:tabular-nums}
.mt td.a-center,.mt th.a-center{text-align:center}
.mt td.acts{text-align:right;white-space:nowrap;vertical-align:middle}
.mt td.acts>.btn,.mt td.acts>.iconbtn,.mt td.acts>a{display:inline-flex;vertical-align:middle;margin-left:2px}
.mt td.acts .acts{display:inline-flex;gap:2px;align-items:center;white-space:nowrap}
.mt td.wrapany{overflow-wrap:anywhere;min-width:160px}   /* long file names with underscores break so the other columns keep their width */   /* three buttons in a narrow table must not wrap onto a second line */
.mt th.acts,.mt th.links{text-align:right}
.mt tr.drag-over td{box-shadow:inset 0 2px 0 var(--accent)}
.mt tr.dragging{opacity:.4}
.mt .handle{color:var(--faint);cursor:grab;display:flex}
.mt .handle:active{cursor:grabbing}
.mt a{font-weight:600}
.mt .sect td{background:var(--bg2);font-family:var(--font-head);font-weight:600;color:var(--heading);font-size:12px}
/* the totals row a report def.sums adds: a subtotal under each section, then the grand total */
.mt tr.tot td{background:var(--bg2);font-weight:700;color:var(--heading);border-top:1px solid var(--line)}
/* Asset Panda's pipe separated row links */
.mt .links{display:flex;align-items:center;gap:0;flex-wrap:wrap;justify-content:flex-end}
.mt .links a,.mt .links button{font-size:12px;font-family:var(--font);font-weight:600;color:var(--accent);background:none;border:0;padding:0 9px;cursor:pointer;white-space:nowrap;border-right:1px solid var(--line)}
.mt .links a:last-child,.mt .links button:last-child{border-right:0;padding-right:0}
.mt .links a:hover,.mt .links button:hover{text-decoration:underline}
.mt .links .del{color:var(--red)}

/* ------------------------------------------------------- 13. record page */
.rec{display:grid;grid-template-columns:200px minmax(0,1fr);gap:20px;align-items:start}
.rec.wide-rail{grid-template-columns:220px minmax(0,1fr)}
.rec .rail{position:sticky;top:calc(var(--chrome-h) + 16px + env(safe-area-inset-top, 0px))}
.rechead{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.rechead h1{font-size:24px;font-weight:600;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.rechead h1 .d2{font-family:var(--font);font-weight:400;font-size:14px;color:var(--muted)}
.rechead .acts{display:flex;align-items:center;gap:8px;margin-left:auto;flex-wrap:wrap}
.rec-details{display:grid;grid-template-columns:280px minmax(0,1fr);gap:24px;align-items:start}
.imgcard{display:flex;flex-direction:column;gap:10px}
.imgcard .img{
  position:relative;aspect-ratio:1;border:1px solid var(--line);border-radius:var(--radius-card);background:var(--panel2);
  display:flex;align-items:center;justify-content:center;overflow:hidden;color:var(--faint);
}
.imgcard .img>img{width:100%;height:100%;object-fit:contain;display:block}
.imgcard .img .pic.main{border:0;border-radius:0;background:transparent}
.imgcard .img.people{border:0;background:transparent;padding:6px}
.imgcard .img.people .pic.main{border-radius:50%;box-shadow:0 0 0 1px var(--line)}
.imgcard .img.people .pic.main.empty{border-style:solid}
.imgcard .img.people .pic.main .ini{font-size:min(38%,64px);font-size:clamp(28px,7vw,64px)}
.imgcard .img.over{outline:2px dashed var(--accent);outline-offset:-4px}
.imgcard .thumbs{display:flex;gap:6px;flex-wrap:wrap}
.imgcard .thumbs img{width:44px;height:44px;object-fit:cover;border-radius:var(--radius-ctl);border:2px solid transparent;cursor:pointer}
.imgcard .thumbs img.on{border-color:var(--accent)}
.imgcard .thumbs .pic{cursor:pointer;border:2px solid transparent;box-shadow:0 0 0 1px var(--line)}
.imgcard .thumbs .pic.on{border-color:var(--accent)}
.imggrid .im .pic.att{width:100%;height:100%;border:0;border-radius:0;cursor:pointer}
.fgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 28px}
.fgrid .fsect{grid-column:1 / -1;padding:16px 0 6px;font-family:var(--font-head);font-size:10.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);border-bottom:1px solid var(--line);margin-bottom:4px}
.fgrid .fsect:first-child{padding-top:0}
.fv{display:flex;flex-direction:column;gap:2px;padding:10px 8px;border-bottom:1px solid var(--line2);min-width:0;border-radius:var(--radius-ctl);position:relative}
.fv.span2{grid-column:1 / -1}
.fv .fl{font-family:var(--font-head);font-size:11px;font-weight:700;letter-spacing:.03em;color:var(--muted);display:flex;align-items:center;gap:6px}
.fv .fl .req{color:var(--red)}
.fv .fval{font-size:13px;min-height:21px;display:flex;align-items:center;gap:8px;word-break:break-word;color:var(--txt)}
.fv .fval .none{color:var(--faint);font-style:italic}
.fv.editable{cursor:pointer}
.fv.editable:hover{background:var(--bg2)}
.fv.editable:hover .pen{opacity:1}
.fv .pen{position:absolute;right:8px;top:9px;opacity:0;color:var(--accent);display:flex;transition:opacity var(--t) var(--ease)}
.fv.editing{background:var(--accent-soft)}
.fv .fedit{display:flex;flex-direction:column;gap:8px;padding:4px 0}
.fv .fedit .row{gap:6px}
.fv .ro{font-size:10.5px;color:var(--faint);display:inline-flex;align-items:center;gap:3px}
.fv .fval a{font-weight:600}
.fv .fval .colordot{width:9px;height:9px;border-radius:50%;display:inline-block}
.fv.memo .fval{white-space:pre-wrap;align-items:flex-start}
/* a value that comes from the linked Model is greyed and labelled */
.fv.inherited .fval{color:var(--muted);font-style:italic}
.fv.inherited .fval a{font-weight:500}
.fv .fl .frommodel{font-weight:600;font-size:10px;letter-spacing:.02em;text-transform:none;color:var(--accent);background:var(--accent-soft);border-radius:999px;padding:1px 7px}
.fv .fval .btn.quiet{margin-left:auto;font-style:normal}
.frommodel-note{margin-top:2px}
.formgrid .help .frommodel{color:var(--accent);font-weight:600}
.yn{display:inline-flex;align-items:center;gap:6px}
.yn .ic{display:inline-flex}
.yn.yes .ic{color:var(--green)}
.yn.no .ic{color:var(--faint)}

/* files tab */
.imggrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}
.imggrid .im{position:relative;aspect-ratio:1;border:1px solid var(--line);border-radius:var(--radius-card);overflow:hidden;background:var(--panel2)}
.imggrid .im img{width:100%;height:100%;object-fit:cover;display:block;cursor:pointer}
.imggrid .im .ov{position:absolute;inset:auto 0 0 0;display:flex;gap:2px;justify-content:flex-end;padding:5px;background:linear-gradient(transparent,var(--backdrop));opacity:0;transition:opacity var(--t) var(--ease)}
.imggrid .im:hover .ov{opacity:1}
.imggrid .im .ov .iconbtn{width:26px;height:26px;background:var(--panel);color:var(--txt);border-color:transparent}
.imggrid .im .star{position:absolute;top:6px;left:6px;color:var(--amber);display:flex;background:var(--panel);border-radius:50%;padding:3px}
.imggrid .im .fold{position:absolute;top:6px;right:6px;display:inline-flex;align-items:center;gap:3px;max-width:calc(100% - 40px);padding:2px 7px;border-radius:999px;background:var(--panel);color:var(--muted);font-size:11px;line-height:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.imggrid .im .fold .ic{display:inline-flex;color:var(--faint)}

/* change log month bands */
.band{display:flex;align-items:center;gap:8px;padding:8px 10px;background:var(--bg2);border-bottom:1px solid var(--line);font-family:var(--font-head);font-size:12px;font-weight:600;color:var(--heading);cursor:pointer;user-select:none}
.band .cnt{color:var(--muted);font-weight:400;font-size:11.5px}
.band .ic{display:flex;color:var(--faint);transition:transform var(--t) var(--ease)}
.band.closed .ic{transform:rotate(-90deg)}

/* ------------------------------------------------------------ 14. admin  */
.adm{display:grid;grid-template-columns:minmax(0,1fr) 380px;gap:20px;align-items:start}
.adm .preview{position:sticky;top:calc(var(--chrome-h) + 16px + env(safe-area-inset-top, 0px))}
.preview .pvhead{display:flex;align-items:center;gap:8px;font-family:var(--font-head);font-size:10.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin-bottom:8px}
.preview .fgrid{grid-template-columns:1fr}
.helpbox{display:flex;gap:10px;padding:12px 14px;border-radius:var(--radius-card);background:var(--accent-soft);color:var(--txt);font-size:12.5px;line-height:1.55;border:1px solid transparent}
.helpbox .ic{display:flex;color:var(--accent);flex:0 0 auto;margin-top:1px}
.helpbox.warn{background:var(--amber-soft)} .helpbox.warn .ic{color:var(--amber)}
.helpbox.danger{background:var(--red-soft)} .helpbox.danger .ic{color:var(--red)}
.block{border:1px solid var(--line);border-radius:var(--radius-card);background:var(--panel);overflow:hidden;box-shadow:var(--shadow)}
.block > .bhead{display:flex;align-items:center;gap:10px;padding:12px 16px;background:var(--panel2);border-bottom:1px solid var(--line2)}
.block > .bhead h3{font-size:13.5px;font-weight:600}
.block > .bhead .sub{font-size:11.5px;color:var(--muted);font-family:var(--font)}
.block > .bhead .rowend{margin-left:auto}
.block > .bbody{padding:14px 16px}
.sentence{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:13px;padding:9px 0;border-bottom:1px solid var(--line2)}
.sentence:last-child{border-bottom:0}
.sentence select,.sentence input{width:auto;min-width:120px;height:30px}
.sentence .w{color:var(--muted)}
.sentence .iconbtn{margin-left:auto}
.dual{display:grid;grid-template-columns:1fr auto 1fr;gap:12px;align-items:start}
.dual .dl{border:1px solid var(--line);border-radius:var(--radius-card);background:var(--panel);min-height:240px;max-height:440px;overflow:auto}
.dual .dl h4{position:sticky;top:0;padding:9px 12px;background:var(--panel2);border-bottom:1px solid var(--line2);font-size:10.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);z-index:1}
.dual .dl .it{display:flex;align-items:center;gap:8px;padding:8px 12px;border-bottom:1px solid var(--line2);cursor:grab;font-size:12.5px;background:var(--panel)}
.dual .dl .it:hover{background:var(--bg2)}
.dual .dl .it.dragging{opacity:.4}
.dual .dl .it.over{box-shadow:inset 0 2px 0 var(--accent)}
.dual .dl .it .handle{color:var(--faint);display:flex}
.dual .dl .it .kind{margin-left:auto;font-size:10.5px;color:var(--faint);text-transform:uppercase;letter-spacing:.05em}
/* a heading inside the Available list: the columns of a linked group, or an action's own questions */
.dual .dl .it.sect{cursor:default;background:var(--panel2);font-family:var(--font-head);font-size:10.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.dual .dl .it.sect:hover{background:var(--panel2)}
.dual .dl .it .mv{display:flex;color:var(--faint);border:0;background:none;cursor:pointer;padding:2px}
.dual .dl .it .mv:hover{color:var(--accent)}
.dual .dl.over{border-color:var(--accent)}
.dual .mid{display:flex;flex-direction:column;gap:6px;justify-content:center;padding-top:40px}
.permgrid{width:100%;border-collapse:separate;border-spacing:0;font-size:12px}
.permgrid th{padding:8px 10px;font-family:var(--font-head);font-size:10.5px;font-weight:700;color:var(--muted);text-align:center;border-bottom:1px solid var(--line);background:var(--panel2);white-space:nowrap;position:sticky;top:0;z-index:2}
.permgrid th:first-child{text-align:left;left:0;z-index:3}
.permgrid td{padding:7px 10px;border-bottom:1px solid var(--line2);text-align:center}
.permgrid td:first-child{text-align:left;font-weight:600;white-space:nowrap;color:var(--heading);position:sticky;left:0;background:var(--panel)}
.permgrid tbody tr:hover td{background:var(--bg2)}
.permgrid tbody tr:hover td:first-child{background:var(--bg2)}
.permgrid input[type=checkbox]{width:15px;height:15px;accent-color:var(--accent);cursor:pointer;margin:0}
.iconpick{display:flex;flex-wrap:wrap;gap:4px}
.iconpick button{width:32px;height:32px;border:1px solid var(--line);border-radius:var(--radius-ctl);background:var(--panel);color:var(--muted);cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
.iconpick button:hover{color:var(--accent);border-color:var(--accent)}
.iconpick button.on{border-color:var(--accent);color:var(--accent);background:var(--accent-soft)}
.steps{display:flex;align-items:center;gap:4px;margin-bottom:16px;flex-wrap:wrap}
.steps .st{display:inline-flex;align-items:center;gap:7px;padding:5px 12px;border-radius:var(--pill);font-family:var(--font-head);font-size:12px;font-weight:600;color:var(--muted);background:var(--bg2)}
.steps .st .n{width:18px;height:18px;border-radius:50%;background:var(--panel);color:var(--muted);font-size:10.5px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--line)}
.steps .st.on{background:var(--accent);color:var(--accent-txt)} .steps .st.on .n{background:var(--panel);color:var(--accent);border-color:transparent}
.steps .st.done .n{background:var(--green);color:#fff;border-color:transparent}
.steps .sep{width:16px;height:1px;background:var(--line)}
.codebox{font-family:var(--mono);font-size:14px;padding:10px 12px;border:1px solid var(--line);border-radius:var(--radius-ctl);background:var(--bg2);display:flex;align-items:center;gap:10px;user-select:all}

/* ------------------------------------------------------- 15. help + tour */
/* the help button lives in the ribbon (.helptop); the floating corner button is gone */
.helppanel{display:flex;flex-direction:column;gap:12px;font-size:13px;line-height:1.6}
.helppanel h4{font-size:13px;font-weight:600;margin-top:6px}
.helppanel ul{margin:0;padding-left:18px}
.helppanel li{margin:3px 0}
.helppanel kbd{font-family:var(--mono);font-size:11px;padding:1px 5px;border:1px solid var(--line);border-radius:3px;background:var(--bg2)}
.tour-back{position:fixed;inset:0;z-index:400;pointer-events:auto}
.tour-hole{position:fixed;border-radius:6px;box-shadow:0 0 0 9999px var(--backdrop);transition:all .25s var(--ease);pointer-events:none}
.tour-card{position:fixed;z-index:401;width:min(340px,calc(100vw - 32px));background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-card);box-shadow:var(--shadow-lg);padding:16px}
.tour-card h3{font-size:14px;margin-bottom:6px}
.tour-card p{font-size:12.5px;color:var(--muted);margin:0 0 12px;line-height:1.55}
.tour-card .row{justify-content:space-between}
.tour-card .dots{display:flex;gap:4px}
.tour-card .dots span{width:6px;height:6px;border-radius:50%;background:var(--line)}
.tour-card .dots span.on{background:var(--accent)}

/* ------------------------------------------------------------- 16. login */
.login{min-height:100vh;min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:calc(40px + env(safe-area-inset-top, 0px)) 20px calc(40px + env(safe-area-inset-bottom, 0px));background:var(--login-grad)}
.login .lcard{width:100%;max-width:400px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-card);box-shadow:var(--shadow-lg);padding:32px 32px 26px}
.login .lmark{display:flex;justify-content:center;align-items:center;margin-bottom:22px}
.login .lmark img{height:52px;width:auto;display:block}
.login h1{font-size:18px;font-weight:600;text-align:center}
.login .lsub{text-align:center;color:var(--muted);font-size:12.5px;margin:6px 0 22px}
.login .lactions{margin-top:18px;display:flex;flex-direction:column;gap:10px}
.login .lerr{color:var(--red);font-size:12.5px;text-align:center;min-height:18px}
.login .lerr:empty{min-height:0}
.login .lfoot{margin-top:24px;padding-top:16px;border-top:1px solid var(--line2);text-align:center;color:var(--faint);font-size:11.5px;line-height:1.6}
.login .btn.primary{height:40px;font-size:13px;background:var(--accent);border-color:var(--accent);color:var(--accent-txt)}
.login .btn.primary:hover{background:var(--accent-hover);border-color:var(--accent-hover)}

/* the sign-in card over the landing page: same card, dimmed hero behind it */
.login.overlay{position:fixed;inset:0;z-index:420;min-height:0;background:rgba(2,16,44,.72);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);animation:fadein .18s var(--ease)}
.login.overlay .lcard{position:relative;animation:rise .22s var(--ease)}
.login.overlay .lclose{position:absolute;top:10px;right:10px;width:32px;height:32px;border:0;border-radius:50%;background:transparent;color:var(--muted);font-size:20px;line-height:1;cursor:pointer}
.login.overlay .lclose:hover{background:var(--accent-soft);color:var(--txt)}
@keyframes fadein{from{opacity:0}to{opacity:1}}
@keyframes rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

/* ------------------------------------------------------------- 16b. landing (signed-out front door) */
.land{min-height:100vh;min-height:100dvh;min-height:100svh;display:flex;flex-direction:column;background:#06101f;color:#fff;overflow-x:hidden}
/* a home-screen install starts under the status bar, so the white bar grows by the top inset and
   the hero, which is what a phone actually sees, starts below the clock */
.land{padding-top:env(safe-area-inset-top, 0px)}
.land-bar{height:64px;flex:0 0 64px;display:flex;align-items:center;justify-content:space-between;padding:0 max(20px,env(safe-area-inset-left)) 0 max(20px,env(safe-area-inset-right));background:#fff;border-bottom:1px solid #e5e1e6}
.land-logo{height:38px;width:auto;display:block}
.land-bar .land-signin{height:38px;padding:0 20px;font-size:12.5px;letter-spacing:.08em;text-transform:uppercase;background:#002F87;border-color:#002F87;color:#fff}
.land-bar .land-signin:hover{background:#0055B8;border-color:#0055B8;color:#fff}
.land-hero{position:relative;flex:1 1 auto;min-height:calc(100vh - 64px - 48px);min-height:calc(100svh - 64px - 48px);display:flex;align-items:center;justify-content:center;text-align:center;padding:64px 20px;overflow:hidden;isolation:isolate}
.land-bg,.land-bg img{position:absolute;inset:0;width:100%;height:100%;display:block}
.land-bg img{object-fit:cover;object-position:center 60%;z-index:-2}
.land-bg picture{position:absolute;inset:0}
.land-film{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center 60%;z-index:-2;opacity:0;transition:opacity .6s var(--ease)}
.land-film.on{opacity:1}
.land-film.portrait{object-position:center center}
@media (max-width:720px) and (orientation:portrait){.land-bg img{object-position:center center}}
.land-shade{position:absolute;inset:0;z-index:-1;background:radial-gradient(ellipse 70% 60% at 50% 55%,rgba(2,10,28,.55) 0%,rgba(2,10,28,.25) 55%,rgba(2,10,28,0) 100%),linear-gradient(180deg,rgba(2,10,28,.35) 0%,rgba(2,10,28,0) 30%,rgba(2,10,28,.15) 75%,rgba(6,16,31,.95) 100%)}
.land-copy{max-width:760px;display:flex;flex-direction:column;align-items:center;gap:14px}
.land-eyebrow{font-family:var(--font);font-size:13px;letter-spacing:.34em;text-transform:uppercase;color:#A9C6EF}
.land-mark{margin:6px 0 4px;line-height:0}
.land-mark img{width:min(520px,82vw);height:auto;display:block;filter:drop-shadow(0 4px 22px rgba(0,0,0,.55))}
.land-sub{margin:0;font-family:var(--font);font-size:14px;letter-spacing:.14em;text-transform:uppercase;color:rgba(255,255,255,.86)}
.land-cta{margin-top:22px;height:48px;padding:0 30px;border:1.5px solid rgba(255,255,255,.85);border-radius:var(--radius-ctl);background:rgba(6,16,31,.25);color:#fff;font-family:var(--font-head);font-size:13px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;cursor:pointer;backdrop-filter:blur(2px);transition:all var(--t) var(--ease)}
.land-cta:hover{background:#fff;color:#002F87;border-color:#fff}
.land-foot{height:48px;flex:0 0 48px;display:flex;align-items:center;justify-content:center;font-family:var(--font);font-size:11.5px;letter-spacing:.06em;color:rgba(255,255,255,.5);background:#06101f}
@media (max-width:720px){
  /* a narrow window on a desktop keeps the bar, just smaller */
  .land-bar{height:56px;flex-basis:56px}
  .land-logo{height:30px}
  .land-bar .land-signin{height:34px;padding:0 14px}
  .land-hero{min-height:calc(100vh - 56px - 48px);min-height:calc(100svh - 56px - 48px);padding:48px 20px}
  .land-eyebrow{font-size:11px;letter-spacing:.28em}
  .land-sub{font-size:12px;letter-spacing:.1em}
  .login.overlay{padding:20px 14px}
}
/* a real phone (touch, no hover) gets the hero alone: no white bar, no second Sign in
 */
@media (max-width:720px) and (hover:none) and (pointer:coarse){
  .land-bar{display:none}
  .land-hero{min-height:calc(100vh - 48px);min-height:calc(100svh - 48px)}
}

/* ------------------------------------------------------- 17. calendar    */
.cal{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));border:1px solid var(--line);border-radius:var(--radius-card);overflow:hidden;background:var(--line);gap:1px}
.cal .dh{padding:8px;background:var(--panel2);font-family:var(--font-head);font-size:10.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);text-align:center}
.cal .d{min-height:100px;background:var(--panel);padding:6px;display:flex;flex-direction:column;gap:3px;cursor:pointer}
.cal .d:hover{background:var(--bg2)}
.cal .d.out{background:var(--panel2);color:var(--faint)}
.cal .d.today .n{background:var(--accent);color:var(--accent-txt)}
.cal .d.on{outline:2px solid var(--accent);outline-offset:-2px}
.cal .d .n{font-size:11.5px;font-weight:600;width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;font-family:var(--font-head)}
.cal .ev{font-size:11px;padding:2px 6px;border-radius:3px;background:var(--accent-soft);color:var(--accent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-left:2px solid var(--accent)}
.cal .ev.t-teal{background:var(--teal-soft);color:var(--teal);border-left-color:var(--teal)}
.cal .ev.t-amber{background:var(--amber-soft);color:var(--amber);border-left-color:var(--amber)}
.cal .ev.t-purple{background:var(--purple-soft);color:var(--purple);border-left-color:var(--purple)}
.cal .more{font-size:10.5px;color:var(--muted)}

/* ------------------------------------------------------- 18. dashboard   */
.bars{display:flex;flex-direction:column;gap:7px}
.bars .b{display:grid;grid-template-columns:132px 1fr 44px;align-items:center;gap:8px;font-size:12px;padding:1px 0;border-radius:4px}
.bars a.b:hover{background:var(--bg2)}
.bars .b .lb{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted)}
.bars .b .n{text-align:right;font-variant-numeric:tabular-nums;font-weight:600;color:var(--heading)}
.bars svg{display:block;width:100%;height:14px}
.bars rect.trk{fill:var(--bg2)}

/* dashboards: chart cards, donut + legend, pixel-scale bars, the builder */
.dashgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:16px;align-items:start}
.dashcard.large{grid-column:span 2}
.dashcard > .cardhead h3{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.dashcard > .cardhead .tic{color:var(--muted);display:flex;width:auto;height:auto}
.piewrap{display:grid;grid-template-columns:auto minmax(0,1fr);gap:16px;align-items:center}
.piewrap svg.pie{display:block;max-width:100%;height:auto}
.pie .slice{cursor:pointer;stroke:var(--panel);stroke-width:1.5;transition:opacity var(--t) var(--ease)}
.pie .slice:hover,.pie .slice:focus{opacity:.78;outline:none}
.pie .mid{font-family:var(--font-head);font-size:22px;font-weight:600;fill:var(--heading)}
.legend{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px;min-width:0;max-height:260px;overflow:auto}
.legend li a{display:grid;grid-template-columns:10px minmax(0,1fr) auto 44px;gap:8px;align-items:center;padding:3px 6px;border-radius:4px;font-size:12px;color:inherit;text-decoration:none}
.legend li a:hover{background:var(--bg2);text-decoration:none}
.legend .dot,.dashtable .dot{width:10px;height:10px;border-radius:3px;display:inline-block;flex:0 0 auto;vertical-align:middle}
.legend .lb{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.legend .n{font-weight:600;color:var(--heading);font-variant-numeric:tabular-nums}
.legend .pc{color:var(--muted);text-align:right;font-variant-numeric:tabular-nums;font-size:11px}
.barwrap{width:100%;min-width:0}
.bars2{display:block;max-width:100%}
.bars2 .bar{cursor:pointer;outline:none}
.bars2 .hit{fill:transparent}
.bars2 .bar:hover .hit,.bars2 .bar:focus .hit{fill:var(--bg2)}
.bars2 .trk{fill:var(--bg2)}
.bars2 text{font-family:var(--font);font-size:12px;fill:var(--txt)}
.bars2 .num{font-weight:600;fill:var(--heading);font-variant-numeric:tabular-nums}
/* line chart: a value over a date bucket (Day / Week / Month / Quarter / Year) */
.linewrap{width:100%;min-width:0}
.lines{display:block;max-width:100%}
.lines text.ax{font-family:var(--font);font-size:11px;fill:var(--muted)}
.lines .grid{stroke:var(--line2);stroke-width:1}
.lines .ln{stroke:var(--accent);stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.lines .pt{cursor:pointer;outline:none}
.lines .pt .hit{fill:transparent}
.lines .pt .dot{fill:var(--accent)}
.lines .pt:hover .hit,.lines .pt:focus .hit{fill:var(--bg2)}
.bignum{display:flex;flex-direction:column;gap:4px;text-decoration:none;color:inherit;padding:6px 0}
.bignum:hover{text-decoration:none}
.bignum .v{font-family:var(--font-head);font-size:40px;font-weight:600;color:var(--heading);line-height:1.05;font-variant-numeric:tabular-nums}
.bignum .l{font-family:var(--font-head);font-size:12px;font-weight:700;letter-spacing:.04em;color:var(--muted)}
.bignum .s{font-size:11.5px;color:var(--muted)}
.tablewrap{max-height:300px;overflow:auto}
.dashtable td.num,.dashtable th.num{text-align:right;font-variant-numeric:tabular-nums}
.dashtable tr.clickable{cursor:pointer}
.dashtable tr.clickable:hover{background:var(--bg2)}
.dashtable tfoot td{font-weight:600;color:var(--heading);border-top:1px solid var(--line)}
.dashbuilder .sentence{margin:0;padding:10px 14px;border-left:3px solid var(--accent);background:var(--accent-soft);border-radius:0 var(--radius-ctl) var(--radius-ctl) 0;font-size:13.5px;line-height:1.5;color:var(--heading)}
.dashbuilder .phrase{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:13.5px}
.dashbuilder .phrase select{height:34px;max-width:240px}
.dashbuilder .phrase .w{display:inline-flex;align-items:center;gap:6px;color:var(--muted)}
.dashbuilder .preview{min-height:140px;padding:12px;border:1px dashed var(--line);border-radius:var(--radius-card);background:var(--panel2)}
@media (max-width:720px){.dashcard.large{grid-column:span 1}.piewrap{grid-template-columns:1fr;justify-items:center}}

/* -------------------------------------------------- 19. home dashboard   */
.greet{display:flex;align-items:flex-end;gap:14px;flex-wrap:wrap;margin:0 0 20px}
.greet h1{font-size:25px;font-weight:600;line-height:1.15}
.greet .gsub{color:var(--muted);font-size:12.5px;display:flex;align-items:center;gap:8px;padding-bottom:3px}
.greet .gsub .sep{width:3px;height:3px;border-radius:50%;background:var(--faint);display:inline-block}
.greet .acts{margin-left:auto;display:flex;gap:8px;align-items:center}
.homegrid{display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);gap:16px;align-items:start}
.sechead{display:flex;align-items:center;gap:8px;margin:0 0 8px}
.sechead h3{font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.sechead .n{font-size:11px;font-weight:700;color:var(--accent);background:var(--accent-soft);border-radius:var(--pill);padding:1px 8px;font-family:var(--font-head)}
.sechead .rowend{margin-left:auto}

/* Depreciation panel on a record: the numbers today, then the year by year schedule */
.deprpanel{margin-top:18px;border:1px solid var(--line);border-radius:var(--radius-card);background:var(--panel);overflow:hidden}
.deprpanel .dephead{display:flex;align-items:center;gap:8px;padding:10px 14px;border-bottom:1px solid var(--line);background:var(--bg2)}
.deprpanel .dephead h3{font-family:var(--font-head);font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.deprpanel .dephead .ic{display:flex;color:var(--accent)}
.deprpanel .depbody{padding:14px}
.depstats{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:14px}
.depstat .l{font-family:var(--font-head);font-size:10.5px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}
.depstat .v{font-family:var(--font-head);font-size:18px;font-weight:600;color:var(--heading);line-height:1.25;font-variant-numeric:tabular-nums}
.depstat .s{font-size:11.5px;color:var(--faint)}

/* --------------------------------------------------- 20. responsive/print */
/* Tools > Files: folder rail + file table */
.files-layout{display:grid;grid-template-columns:220px minmax(0,1fr);gap:20px;align-items:start}
.frail{display:flex;flex-direction:column;gap:2px;min-width:0;position:sticky;top:calc(var(--chrome-h) + 16px + env(safe-area-inset-top, 0px))}
.frail .sect{padding:12px 12px 4px;font-family:var(--font-head);font-size:10px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--faint)}
.frail .frow{display:flex;align-items:center;gap:2px;min-width:0;width:100%}
.frail .frow .fi{
  display:flex;align-items:center;gap:9px;flex:1;min-width:0;padding:8px 10px;border:0;border-left:3px solid transparent;
  background:transparent;color:var(--muted);text-align:left;cursor:pointer;
  font-family:var(--font-head);font-size:12.5px;font-weight:600;border-radius:0 var(--radius-ctl) var(--radius-ctl) 0;
  transition:all var(--t) var(--ease);
}
.frail .frow .fi .nm{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.frail .frow .fi .ic{display:flex;opacity:.85}
.frail .frow .fi .cnt{font-size:10.5px;font-weight:700;color:var(--muted);font-variant-numeric:tabular-nums;background:var(--bg2);border-radius:var(--pill);padding:0 7px;line-height:17px}
.frail .frow .fi:hover{color:var(--heading);background:var(--bg2)}
.frail .frow.on .fi{color:var(--accent);border-left-color:var(--accent);background:var(--accent-soft)}
.frail .frow.on .fi .cnt{background:var(--panel);color:var(--accent)}
.frail .frow .iconbtn{opacity:0;width:26px;height:26px;border-color:transparent;background:transparent}
.frail .frow:hover .iconbtn,.frail .frow.on .iconbtn,.frail .frow .iconbtn:focus-visible{opacity:1}
/* drag a folder up or down the rail to reorder it */
.frail .frow[draggable="true"] .grip{display:flex;align-items:center;opacity:0;cursor:grab;color:var(--faint);padding:0 2px}
.frail .frow:hover .grip,.frail .frow.on .grip{opacity:.7}
.frail .frow.dragging{opacity:.5}
.frail .frow.over{box-shadow:inset 0 2px 0 var(--accent)}

/* Admin > Email log: the message drawer */
.mailfacts{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 14px;align-items:baseline;font-size:12.5px}
.mailfacts .k{color:var(--faint);font-family:var(--font-head);font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap}
.mailfacts .v{color:var(--txt);word-break:break-word}
.mailsect{font-family:var(--font-head);font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.mailframe{width:100%;height:min(50vh,420px);border:1px solid var(--line);border-radius:var(--radius-card);background:var(--panel);color-scheme:light}
.mailtext{white-space:pre-wrap;word-break:break-word;font-size:12px;line-height:1.55;padding:12px;border:1px solid var(--line);border-radius:var(--radius-card);background:var(--panel2);max-height:min(50vh,420px);overflow:auto}

/* -------------------------------------------------- 24. predefined forms */
.tokrow{display:flex;flex-wrap:wrap;gap:5px;align-items:center}
.tokchip{display:inline-flex;align-items:center;gap:5px;padding:1px 9px;border:1px solid var(--line);border-radius:var(--pill);
  background:var(--bg2);color:var(--heading);font-family:var(--mono);font-size:11.5px;line-height:20px;white-space:nowrap}
.tokchip .faint{font-family:var(--font);color:var(--faint);font-size:11px}
.tokchip .ic{display:flex;color:var(--red)}
.tokchip.bad{border-color:var(--red);color:var(--red);background:var(--panel)}
.tokchip.pick{cursor:pointer;transition:all var(--t) var(--ease)}
.tokchip.pick:hover{border-color:var(--accent);background:var(--accent-soft);color:var(--accent)}
.warn{display:inline-flex;align-items:flex-start;gap:6px;color:var(--red);font-size:11.5px;line-height:1.5}
.warn .ic{display:flex;flex:0 0 auto;margin-top:2px}
.formdoc{display:inline-flex;align-items:center;gap:6px;font-size:12px}
.formdoc .ic{display:flex;color:var(--accent)}
/* --------------------------------------------- 21. scan and the barcode wizard */
/* the Scan button in the navy bar: icon and word, sitting next to search */
.scanbtn{
  position:relative;display:inline-flex;align-items:center;gap:7px;flex:0 0 auto;
  height:34px;padding:0 12px;border-radius:var(--radius-ctl);
  border:1px solid transparent;background:var(--bar-hover);color:var(--bar-txt);
  font-family:var(--font-head);font-size:13px;font-weight:600;cursor:pointer;
  transition:all var(--t) var(--ease);
}
.scanbtn:hover{background:var(--bar-txt);color:var(--brand)}
.scanbtn:focus-visible{outline:none;box-shadow:0 0 0 3px var(--bar-hover)}
.scanbtn .ic{display:flex}
/* the scan dialog */
.scanwrap .scanbox{position:relative;border-radius:var(--radius-ctl);overflow:hidden;background:var(--brand-deep);max-height:300px}
.scanwrap .scanvid{width:100%;max-height:300px;display:block;object-fit:cover;background:var(--brand-deep)}
.scanwrap .scanaim{
  position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  width:58%;aspect-ratio:1/1;border:2px solid var(--accent);border-radius:10px;
  box-shadow:0 0 0 2000px rgba(0,0,0,.18);pointer-events:none;
}
.scanwrap .scanlast{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
/* the wizard */
.wizard .block{margin:0}
.wizard .wizcount{font-size:13px;color:var(--txt);padding:8px 10px;background:var(--bg2);border-radius:var(--radius-ctl)}
.wizard .wizcount .hint{font-size:12px}
.wizard .wizline{display:flex;align-items:center;gap:8px;padding:4px 8px;border:1px solid var(--line);border-radius:var(--radius-ctl);background:var(--panel)}
.wizard .wizline .n{
  font-size:11px;font-weight:700;color:var(--accent);background:var(--accent-soft);
  border-radius:var(--pill);padding:1px 8px;font-family:var(--font-head);
}
.wizard .wizline .nm{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
.bcprev{font-size:12.5px;color:var(--muted)}
/* the EAB asset tag preview. The label stock is white in every theme, so the
   preview keeps a white card whatever the page is doing around it. */
.tagprevbox{display:flex;flex-direction:column;gap:6px;align-items:flex-start}
.tagprevbox .hint{font-size:12px}
.tagprev{display:block;width:100%;max-width:260px;height:auto;background:#fff;border:1px solid var(--line);border-radius:var(--radius-ctl);padding:6px;box-sizing:border-box}
@media (max-width:760px){.scanbtn .lb{display:none}.scanbtn{padding:0 9px}}
/* ---------------------------------------- assignee, dates, progress, templates */
.aprog{display:inline-flex;align-items:center;gap:8px;min-width:120px}
.aprog .n{font-size:11.5px;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.apbar{display:inline-block;width:56px;height:7px;border-radius:var(--pill);background:var(--bg2);border:1px solid var(--line);overflow:hidden;flex:0 0 auto}
.apbar>i{display:block;height:100%;background:var(--green);border-radius:var(--pill);transition:width var(--t) var(--ease)}
.auditnote{margin:0 0 12px;padding:12px 14px;border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:var(--radius-card);background:var(--panel)}
.auditnote .l{font-family:var(--font-head);font-size:10.5px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--accent);margin-bottom:4px}
.auditnote .b{font-size:13px;line-height:1.55;white-space:pre-wrap;color:var(--txt)}
.myaudits > .cardhead a{font-size:12px;color:var(--accent);text-decoration:none}
.myaudits > .cardhead a:hover{text-decoration:underline}
/* -------------------------------------------- the phone chrome */
/* The bottom tab bar, the "add to home screen" strip, the bottom sheet and the
   location pin on an action history row. Everything here is hidden above 760 px;
   the phone rules themselves live inside the media block further down. */
.tabbar{display:none}
.installhost{display:none}
.installbar{display:flex;align-items:center;gap:10px;padding:10px var(--gutter);border-bottom:1px solid var(--line);background:var(--accent-soft)}
.installbar .txt{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.35}
.installbar .txt b{font-family:var(--font-head);font-size:13.5px;font-weight:700;color:var(--heading)}
.installbar .txt span{font-size:12px;color:var(--muted)}
.installbar .pin{color:var(--accent);flex:0 0 auto}
.installbar .btn{flex:0 0 auto}
.sheetlist{display:flex;flex-direction:column}
.sheetsect{font-family:var(--font-head);font-size:10.5px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--muted);padding:10px 4px 4px}
.sheethr{height:1px;background:var(--line);margin:6px 0}
.sheetrow{display:flex;align-items:center;gap:12px;width:100%;min-height:44px;padding:8px 6px;border:0;border-radius:var(--radius-ctl);background:transparent;color:var(--txt);font:inherit;text-align:left;cursor:pointer}
.sheetrow:hover{background:var(--bg2)}
.sheetrow:focus-visible{outline:none;background:var(--bg2);box-shadow:0 0 0 3px var(--accent-soft)}
.sheetrow>.ic{width:22px;flex:0 0 auto;color:var(--accent)}
.sheetrow .l{flex:1;min-width:0;display:flex;flex-direction:column}
.sheetrow .l .n{font-size:15px;font-weight:600;color:var(--heading);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sheetrow .l .s{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sheetrow.on{background:var(--accent-soft)}
.sheetrow.danger .l .n,.sheetrow.danger>.ic{color:var(--red)}
.gpspin{display:inline-flex;align-items:center;gap:3px;font-size:11.5px;color:var(--accent);text-decoration:none;font-variant-numeric:tabular-nums}
.gpspin:hover{text-decoration:underline}
.gpspin .ic{color:var(--accent)}

/* screens/list.js: the line under the title while a cached first page is on screen. Quiet on
   purpose: the rows are already readable, this only says whether they are the latest. */
.cachenote{display:flex;align-items:center;gap:7px;margin:0 0 10px;font-size:11.5px;color:var(--muted)}
.cachenote .spinner{width:12px;height:12px;border-width:1.5px}
.cachenote.off{color:var(--amber)}

@media (max-width:1200px){
  .homegrid{grid-template-columns:minmax(0,1fr)}
  .homegrid>*{min-width:0}
}
@media (max-width:1100px){
  :root{--gutter:16px}
  .search{flex-basis:220px;min-width:140px}
  .userbtn .avwrap{display:flex}
.userbtn .pic.av{border:0;box-shadow:0 0 0 1px rgba(255,255,255,.35)}
.userbtn .uname{display:none}
  .userbtn{padding:0 4px}
  .adm{grid-template-columns:minmax(0,1fr)}
  .adm>.stack{min-width:0}
  .adm .bbody{overflow-x:auto}
  .adm .preview{position:static}
}
@media (max-width:900px){
  .rec,.rec.wide-rail{grid-template-columns:1fr}
  .rec .rail{position:static;flex-direction:row;overflow-x:auto;gap:0;padding-bottom:0;border-bottom:1px solid var(--line);min-width:0;scrollbar-width:none}
  .files-layout{grid-template-columns:1fr}
  .frail{position:static;flex-direction:row;flex-wrap:wrap;gap:4px;border-bottom:1px solid var(--line);padding-bottom:8px}
  .frail .sect{width:100%;padding:8px 4px 2px}
  .frail .frow .fi{border-left:0;border-radius:var(--pill);padding:6px 10px}
  .frail .frow .iconbtn{opacity:1}
  .rec .rail::-webkit-scrollbar{display:none}
  .rec .rail button{border-left:0;border-bottom:2px solid transparent;border-radius:0;white-space:nowrap;width:auto;flex:0 0 auto;padding:10px 14px}
  .rec .rail button.on{border-bottom-color:var(--accent);background:transparent}
  .rec-details{grid-template-columns:1fr}
  .imgcard{max-width:260px}
  .cols2,.cols3{grid-template-columns:1fr}
  .formgrid{grid-template-columns:1fr}
  .dual{grid-template-columns:1fr}
  .dual .mid{flex-direction:row;padding:0}
}
@media (max-width:760px){
  :root{--gutter:12px;--bar-h:52px;--sub-h:0px;--chrome-h:52px}
  /* the bottom tab bar replaces the white group tabs; the navy bar keeps
     the logo, search and the bell. 44 px is the smallest thing a thumb should have to hit. */
  .subbar{display:none}
  .installhost{display:block}
  .tabbar{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:120;background:var(--panel);border-top:1px solid var(--line);padding-bottom:max(0px, calc(env(safe-area-inset-bottom, 0px) - 12px));box-shadow:0 -2px 12px rgba(18,40,76,.10)}
  /* the buttons sit on the home-indicator line: the bar keeps 12 px less than the bottom inset, the indicator floats over the bar's foot */
  .tabbar .tbi{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:50px;padding:4px 2px;border:0;background:transparent;color:var(--muted);font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
  .tabbar .tbi .l{font-family:var(--font-head);font-size:10.5px;font-weight:600;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .tabbar .tbi.on{color:var(--accent)}
  .tabbar.nolabels .tbi .l{display:none}
  .tabbar.nolabels .tbi{min-height:46px;padding:6px 2px}
  .tabbar.nolabels .tbi .ic svg{width:24px;height:24px}
  .tabbar .tbi:active{background:var(--bg2)}
  .page{padding-bottom:calc(60px + env(safe-area-inset-bottom, 0px))}
  .toastwrap{bottom:calc(62px + env(safe-area-inset-bottom, 0px));right:14px;left:14px;align-items:stretch}
  .modal.sheet{max-height:80vh;max-height:80dvh}
  .modal.sheet .mbody{padding-bottom:calc(8px + env(safe-area-inset-bottom))}
  /* 44 px targets: list rows and cards, action forms, menu items, the record rail */
  .dg-card{padding:12px}
  .dg-card .top{min-height:44px}
  .dg-card .acts .btn{min-height:44px;flex:1 1 auto}
  .pop .item{min-height:44px}
  .rec .rail button{min-height:44px}
  .formgrid input,.formgrid select,.formgrid textarea,.fv input,.fv select{min-height:44px}
  .picker .pick-in{min-height:44px}
  .topbar .menubtn{display:inline-flex}
  .topbar .deskonly{display:none}
  .topbar .iconbtn{width:34px;height:34px}
  .brand{min-width:0;flex:0 1 auto}
  .brand img{height:28px;max-width:100%;object-fit:contain;object-position:left center}
  .topbar{gap:6px}
  .topbar .spacer{min-width:0;flex:1 1 0}
  .userbtn{padding:0 2px;gap:4px;flex:0 0 auto}
  /* the layout viewport must never grow past the phone: every screen clips at the page edge and
     anything wide scrolls inside its own .scrollx or rail, never the whole page */
  .page{overflow-x:clip;max-width:100vw}
  .tabs{display:flex;max-width:100%;overflow-x:auto;scrollbar-width:none}
  .tabs::-webkit-scrollbar{display:none}
  .tabs button{flex:0 0 auto}
  .scanbox{flex-wrap:wrap}
  .scanbox input{min-width:0;flex:1 1 140px}
  .aprog{min-width:0}
  .tokchip{max-width:100%;flex-wrap:wrap}
  /* phone tables scroll sideways inside their card instead of squeezing every column into a
     three-line stack; long cells clip with an ellipsis and the record page has the full value */
  .scrollx .mt th,.scrollx .mt td{white-space:nowrap}
  .scrollx .mt td{max-width:260px;overflow:hidden;text-overflow:ellipsis}
  .scrollx .mt td:has(.tokrow){max-width:none;white-space:normal}
  .scrollx .mt td .tokrow{min-width:380px;max-width:560px}
  .search{display:none}
  .topbar .search.open{display:block;position:absolute;left:8px;right:8px;top:calc(9px + env(safe-area-inset-top, 0px));z-index:2}
  .page-title h1{font-size:20px}
  .page-title .acts{width:100%;margin-left:0}
  .greet h1{font-size:21px}
  .fgrid{grid-template-columns:1fr;gap:0}
  .fv.span2{grid-column:auto}
  .rechead h1{font-size:20px}
  .rechead .acts{margin-left:0;width:100%}
  .btn{min-height:44px}
  .iconbtn{width:44px;height:44px}
  .modal-back{padding:env(safe-area-inset-top, 0px) 0 0;align-items:flex-end}
  /* dvh, not vh: with the iOS toolbar up a 94vh dialog is taller than the screen and its head goes under the status bar */
  .modal{max-height:calc(94vh - env(safe-area-inset-top, 0px));max-height:calc(94dvh - env(safe-area-inset-top, 0px));width:100%;border-radius:var(--radius-card) var(--radius-card) 0 0}
  .modal .mfoot{padding-bottom:calc(12px + env(safe-area-inset-bottom, 0px))}
  .modal .mbody:last-child{padding-bottom:calc(18px + env(safe-area-inset-bottom, 0px))}
  .cal .d{min-height:56px}
  .cal .ev{display:none}
  .cal .d .dots{display:flex;gap:2px}
  .cal .d .dots i{width:6px;height:6px;border-radius:50%;background:var(--accent);display:block}
  .mt th,.mt td{padding:12px 8px}
  .login .lcard{padding:24px 20px 20px}

  /* ---- the phone polish ---- */

  /* 1. iOS must never zoom the page when a field takes focus, and it does that to anything under
     16 px. Every control the app can put on a phone is listed, not just the bare element names,
     because the base rules are attribute-qualified and would otherwise win. */
  input[type=text],input[type=password],input[type=email],input[type=number],
  input[type=date],input[type=datetime-local],input[type=time],input[type=tel],input[type=url],
  input[type=search],select,textarea,
  .search input[type=search],.pop .popsearch input[type=search],.chips-in input,
  .sentence select,.sentence input,.hexrow input,
  .dashbuilder .phrase select{font-size:16px}
  /* the caret a select draws itself has to follow the taller box */
  select{background-position:calc(100% - 14px) calc(50% - 1px),calc(100% - 10px) calc(50% - 1px)}
  .sentence select,.sentence input{height:44px}
  .chips-in input{height:32px}      /* 16 px text needs the room */
  .chips-in{min-height:44px}

  /* 2. 44 px targets. The ribbon is the one place the buttons stay small on purpose: six controls
     and the wordmark do not fit across 360 px at 44 px each. They keep a 40 px face and gain a
     44 x 44 hit area through ::after, the way a native bar button does, so the ribbon still reads
     as a ribbon and nothing in it is hard to hit. */
  .topbar{gap:2px}
  .topbar .iconbtn{width:40px;height:40px}
  .topbar .iconbtn::after,.topbar .scanbtn::after,.userbtn::after{
    content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
    width:44px;height:44px;border-radius:var(--radius-ctl);
  }
  .userbtn{position:relative;min-height:44px}
  .scanbtn{min-height:40px}
  /* everything outside the ribbon gets a real 44 px box */
  .iconbtn.sm{width:44px;height:44px}          /* the small round buttons on a table row */
  .imggrid .im .ov .iconbtn,.frail .frow .iconbtn{width:34px;height:34px}   /* except the ones that sit on top of a picture or a folder name */
  .chip{min-height:44px;padding:0 14px}
  .tabs button{min-height:44px}
  .seg button{height:44px}
  .iconpick button{width:44px;height:44px}
  .mt .links a,.mt .links button{min-height:44px;display:inline-flex;align-items:center}
  .mt .links{gap:2px}
  .sheetrow{min-height:48px}
  /* a 15 px tick box is a hard thing to hit with a thumb. It grows rather than gaining an
     invisible 44 px halo, because these sit inches apart in a grid and in the permission matrix,
     and a halo there would swallow the tap meant for the row or the cell beside it. */
  .check input[type=checkbox],.permgrid input[type=checkbox]{width:20px;height:20px}
  .check input[type=checkbox]:checked::after{width:5px;height:10px;border-width:0 2px 2px 0}
  .mt td.chk,.mt th.chk{width:44px}

  /* 3. a title row that fits on one line at 360 px: the words come off the buttons and stay in
     the title attribute (screens/list.js passes iconOnlyOnPhone) */
  /* the word stays, small, under the symbol, so a first-time user knows what the pin, the box and the bolt do
     (user test 2026-09-12); a caret (Actions) sits beside the word */
  .btn.ph-icon{flex-direction:column;gap:2px;padding:5px 6px 4px;min-width:52px;min-height:46px;line-height:1}
  .btn.ph-icon .lb{display:block;font-size:10px;font-weight:600;max-width:64px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .btn.ph-icon > .ic:not(:first-child){display:none!important}
  .page-title .acts{gap:6px}
  .page-title .acts .btn,.page-title .acts .iconbtn{flex:0 0 auto}

  /* 4. the list toolbar lives in kit/grid.css, which loads after this file */

  /* 5. route transitions. Forward pushes in from the right, Back from the left, and a query-only
     change (a filter, a search) fades, because it is the same screen answering a new question.
     180 ms; prefers-reduced-motion turns every animation in the app off (kit/tokens.css). The page
     already clips sideways here, so nothing of this can widen the document. */
  .page.rt-fwd{animation:rtFwd .18s var(--ease) both}
  .page.rt-back{animation:rtBack .18s var(--ease) both}
  .page.rt-fade{animation:rtFade .18s var(--ease) both}
}
@keyframes rtFwd{from{opacity:.4;transform:translate3d(22px,0,0)}to{opacity:1;transform:none}}
@keyframes rtBack{from{opacity:.4;transform:translate3d(-22px,0,0)}to{opacity:1;transform:none}}
@keyframes rtFade{from{opacity:.35}to{opacity:1}}
@media print{
  .appbar,.toastwrap,.iconbtn,.tabbar,.crumbs,.dg-tools,.dg-bulk,.dg-pager,.dg-views,.page-title .acts,.rec .rail,.btn,button{display:none!important}
  body{background:var(--panel);color:var(--txt)}
  .page{padding:0}
  .card{box-shadow:none;break-inside:avoid;border:0;width:100%;max-width:none}
  .rec{display:block}
  a{color:var(--txt);text-decoration:none}
}

/* ------------------------------------------------------- the printed sheet
   kit/print.js builds .printview off screen; printing shows it and nothing else,
   so what comes out is the record itself, full width, with no chrome around it. */
.printview{display:none}
@media print{
  body.printing>*{display:none!important}
  body.printing .printview{display:block!important}
  .pr-page{break-after:page;padding:0 0 10px}
  .pr-page:last-child{break-after:auto}
  .pr-page.brk{break-before:page}
  .pr-run{display:flex;justify-content:space-between;font-size:9px;color:var(--muted);border-bottom:1px solid var(--line);padding-bottom:4px;margin-bottom:10px}
  .pr-head{display:flex;gap:14px;align-items:flex-start;margin-bottom:12px}
  .pr-img{width:120px;max-height:120px;object-fit:contain;border:1px solid var(--line)}
  .pr-title h2{font-family:var(--font-head);font-size:19px;margin:0 0 3px}
  .pr-sub{color:var(--muted);font-size:12px;margin-bottom:5px}
  .pr-sect{font-family:var(--font-head);font-size:11px;letter-spacing:.05em;text-transform:uppercase;color:var(--muted);margin:12px 0 5px;border-bottom:1px solid var(--line);padding-bottom:3px}
  .pr-grid{display:grid;grid-template-columns:1fr 1fr;gap:5px 22px}
  .pr-row{display:flex;gap:8px;font-size:11.5px;break-inside:avoid;border-bottom:1px solid var(--line2);padding-bottom:3px}
  .pr-row.wide{grid-column:1 / -1}
  .pr-l{flex:0 0 40%;color:var(--muted);font-weight:600}
  .pr-v{flex:1 1 auto;overflow-wrap:anywhere}
  .pr-none{color:var(--faint)}
}

/* ------------------------------------------------- audits, files, barcode */
.auditbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:12px 0}
.scanbox{display:flex;align-items:center;gap:10px;padding:12px 14px;border:1px solid var(--accent);border-radius:var(--radius-card);background:var(--accent-soft)}
.scanbox .ic{display:flex;color:var(--accent)}
.scanbox input{height:42px;font-size:16px;font-family:var(--mono);flex:1;min-width:160px}
.scanbox .lbl{font-family:var(--font-head);font-weight:700;font-size:11px;letter-spacing:.05em;text-transform:uppercase;color:var(--accent)}
.auditkpi{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.auditkpi .k{flex:1 1 140px;padding:10px 14px;border:1px solid var(--line);border-radius:var(--radius-card);background:var(--panel);box-shadow:var(--shadow)}
.auditkpi .k .l{font-family:var(--font-head);font-size:10.5px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}
.auditkpi .k .v{font-family:var(--font-head);font-size:20px;font-weight:600;color:var(--heading);font-variant-numeric:tabular-nums}
.mt td.chk,.mt th.chk{width:34px;padding-right:0}
.mt td.chk .check,.mt th.chk .check{gap:0}
.filegrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:12px}
.filegrid .fc{display:flex;flex-direction:column;gap:6px;padding:10px;border:1px solid var(--line);border-radius:var(--radius-card);background:var(--panel);box-shadow:var(--shadow);min-width:0}
.filegrid .fc .th{height:104px;border-radius:var(--radius-ctl);background:var(--bg2);display:flex;align-items:center;justify-content:center;overflow:hidden;color:var(--faint)}
.filegrid .fc .th img{width:100%;height:100%;object-fit:cover}
.filegrid .fc .nm{font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.filegrid .fc .sub{font-size:11.5px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.logoprev{display:flex;align-items:center;justify-content:center;height:56px;min-width:150px;padding:6px 12px;border:1px solid var(--line);border-radius:var(--radius-ctl);background:var(--panel2)}
.logoprev img{max-height:44px;width:auto}

/* ---------------------------------------------------- pictures */
/* kit/pic.js: a square box; the <img> inside is either cover-centred (no crop) or absolutely
   positioned by the crop. .round for people, rounded square for assets. */
.pic{position:relative;overflow:hidden;flex:0 0 auto;background:var(--panel2);border:1px solid var(--line);border-radius:var(--radius-ctl);display:flex;align-items:center;justify-content:center;color:var(--faint)}
.pic.round{border-radius:50%}
.pic>img{display:block;width:100%;height:100%;object-fit:cover;object-position:center}
.pic.cropped>img{position:absolute;width:auto;height:auto;object-fit:fill}
.pic.empty{border-style:dashed;background:var(--bg2);flex-direction:row;gap:0;padding:0;text-align:center}
.pic .ini{font-family:var(--font-head);font-weight:700;letter-spacing:.03em;color:#fff;width:100%;height:100%;display:flex;align-items:center;justify-content:center;border-radius:inherit}
.pic .ini.tone-accent{background:var(--accent)} .pic .ini.tone-sky{background:var(--sky)} .pic .ini.tone-teal{background:var(--teal)} .pic .ini.tone-purple{background:var(--purple)}
.pic .ini.tone-green{background:var(--green)} .pic .ini.tone-amber{background:var(--amber)} .pic .ini.tone-red{background:var(--red)} .pic .ini.tone-brand-deep{background:var(--brand-deep)}
.pic:has(.ini){border-color:transparent}
.pic .ph{display:flex}
.dg-thumb.pic{width:36px;height:36px;display:flex}
/* the crop editor (kit/crop.js) */
.cropview{position:relative;overflow:hidden;background:var(--bg2);border:1px solid var(--line);border-radius:var(--radius-card);cursor:grab;touch-action:none;outline:none;max-width:100%}
.cropview:active{cursor:grabbing}
.cropview:focus-visible{box-shadow:0 0 0 3px var(--accent-soft)}
.cropview .mask{position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 0 1px rgba(255,255,255,.35)}
.cropview.round .mask{border-radius:0;background:radial-gradient(circle closest-side, transparent 98.5%, rgba(18,40,76,.55) 99.5%)}
.cropzoom{flex:1;accent-color:var(--accent)}
/* Faces view (list.js, people groups) */
.faces{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px;padding:4px 0 12px}
.face{display:flex;flex-direction:column;align-items:center;text-align:center;gap:4px;padding:18px 12px 14px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-card);box-shadow:var(--shadow);cursor:pointer;position:relative;transition:transform var(--t) var(--ease),box-shadow var(--t) var(--ease),border-color var(--t) var(--ease);min-width:0}
.face:hover{transform:translateY(-2px);box-shadow:0 8px 22px rgba(18,40,76,.12);border-color:var(--accent)}
.face:focus-visible{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.face .pic{margin-bottom:6px;border-width:2px;border-color:var(--panel);box-shadow:0 0 0 1px var(--line)}
.face .nm{font-family:var(--font-head);font-weight:600;font-size:14px;color:var(--heading);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.face .of{font-size:12px;color:var(--muted);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.face .ct{display:flex;flex-direction:column;gap:2px;margin-top:6px;font-size:12px;max-width:100%}
.face .ct a{color:var(--accent);text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}
.face .ct a:hover{text-decoration:underline}
.face .ctx{margin-top:8px;max-width:100%}
.face .ctx .btn{width:100%;justify-content:center}
.face .st{position:absolute;top:10px;right:10px;width:10px;height:10px;border-radius:50%;box-shadow:0 0 0 2px var(--panel)}
.face .cb{position:absolute;top:8px;left:8px}
.face.dg-selected{border-color:var(--accent);background:var(--accent-soft)}
.face.arch{opacity:.6}
html[data-theme="dark"] .face:hover{box-shadow:0 8px 22px rgba(0,0,0,.45)}
/* My photo card (me.js) */
.mephoto{display:flex;align-items:center;gap:18px;flex-wrap:wrap}
.mephoto .pic{box-shadow:0 0 0 1px var(--line)}
/* search boxes built outside the grid tools still get room for the icon */
.dg-search>input[type=text],.dg-search>input[type=search]{padding-left:30px}

/* the client configuration snippet on My settings and the token shown once after it is created.
   A pre, not a codebox, because the JSON is several lines and must keep its indentation. */
.codeblock{font-family:var(--mono);font-size:13px;line-height:1.5;padding:10px 12px;margin:0;border:1px solid var(--line);border-radius:var(--radius-ctl);background:var(--bg2);color:var(--txt);overflow-x:auto;overscroll-behavior-x:contain;overscroll-behavior-y:auto;white-space:pre;user-select:all}

/* a link's "additional group fields" ride under it as small key: value lines (record page, list cells, phone cards) */
.withx{display:inline-flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0}
.xtra{display:flex;flex-direction:column;gap:1px;font-size:11.5px;line-height:1.35;color:var(--muted)}
.xtra .xl{display:inline-flex;gap:3px;flex-wrap:wrap;align-items:center}
.xtra .k{color:var(--faint)}
.dg td .xtra{white-space:normal}
/* the per-copy grid of Replicate multiple and the Values step of Reallocate */
.copygrid{display:grid;gap:8px 10px;align-items:start}
.copygrid .cg-h{font-family:var(--font-head);font-size:11px;font-weight:700;letter-spacing:.03em;color:var(--muted);padding-bottom:4px;border-bottom:1px solid var(--line2)}
.copygrid .cg-n{font-weight:600;font-size:13px;padding-top:8px;white-space:nowrap}
/* ---- rich text box (the welcome letter) ---- */
.rt{border:1px solid var(--line);border-radius:var(--radius-ctl);background:var(--bg);overflow:hidden}
.rt-bar{display:flex;gap:4px;align-items:center;flex-wrap:wrap;padding:4px 6px;border-bottom:1px solid var(--line);background:var(--bg2)}
.rt-bar select{max-width:220px}
.rt-area{min-height:180px;max-height:480px;overflow:auto;padding:10px 12px;font-size:14px;line-height:1.5;outline:none;color:var(--txt)}
.rt-area:focus{box-shadow:inset 0 0 0 2px var(--accent-soft)}
.rt-area:empty::before{content:attr(data-placeholder);color:var(--muted);pointer-events:none}
.rt-area p{margin:0 0 10px}
.rt-area ul,.rt-area ol{margin:0 0 10px;padding-left:22px}
.rt-area a{color:var(--accent);text-decoration:underline}
/* ---- the printed permissions summary (Templates > Print) ---- */
.pr-perm table{border-collapse:collapse;width:100%;font-size:12px;margin:6px 0 12px}
.pr-perm th,.pr-perm td{border:1px solid #bbb;padding:3px 6px;text-align:left;vertical-align:top}
.pr-perm th{background:#eee}
.pr-perm h3{margin:14px 0 4px;font-size:14px}

/* the yellow note a warn rule leaves on a save, and the clean-up queue */
.guardnote{align-items:flex-start;margin-bottom:12px}
.guardnote .rowend{flex:0 0 auto}
.guardlist{margin:4px 0 0;padding-left:16px}
.guardlist li{margin:2px 0}
.flagnote{display:flex;gap:8px;align-items:flex-start;padding:8px 10px;border-radius:var(--radius-card);background:var(--red-soft);font-size:12.5px;margin-bottom:6px}
.flagnote .ic{color:var(--red);flex:0 0 auto;margin-top:1px}
.qdiff{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.qdiff .was{color:var(--muted);text-decoration:line-through}
.qdiff .now{font-weight:600}
.qnote{color:var(--muted);font-size:12px;line-height:1.5}
.guardmode{display:inline-flex;gap:4px}
.guardrow .sub{color:var(--muted);font-size:12px;line-height:1.5;margin-top:2px}

/* ---- #/help as the manual: a contents column beside the pages ---- */
.shelf{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:12px}
.shelfbook{border:1px solid var(--line);border-radius:var(--radius-card);padding:12px 14px;background:var(--bg2);min-width:0}
.shelftitle{font-family:var(--font-head);font-weight:600;color:var(--heading);font-size:13px}
.shelfsub{font-size:12px;color:var(--muted);margin:2px 0 9px}
.manualwrap{display:grid;grid-template-columns:232px minmax(0,1fr);gap:20px;align-items:start}
.manualtoc{position:sticky;top:76px;max-height:calc(100vh - 120px);max-height:calc(100dvh - 120px);overflow:auto;border-right:1px solid var(--line);padding-right:12px}
.manualtoc .tocchap{font-family:var(--font-head);font-weight:600;font-size:11px;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);margin:14px 0 5px}
.manualtoc .tocchap:first-child{margin-top:0}
.manualtoc .toclink{display:block;padding:3px 0;font-size:13px;color:var(--txt);text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.manualtoc .toclink:hover{color:var(--accent);text-decoration:underline}
.manualchap{font-family:var(--font-head);font-size:19px;color:var(--heading);margin:26px 0 12px;padding-bottom:7px;border-bottom:2px solid var(--line)}
.manualbody > .manualchap:first-child{margin-top:0}
.manualchap .chapbook{display:block;font-family:var(--font);font-size:10px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--muted);margin-bottom:2px}
.manualtopic{margin-bottom:12px}
@media (max-width:900px){
  .manualwrap{grid-template-columns:minmax(0,1fr)}
  .manualtoc{position:static;max-height:none;border-right:0;border-bottom:1px solid var(--line);padding:0 0 10px;margin-bottom:14px;
             display:flex;flex-wrap:wrap;gap:4px 12px;align-items:baseline}
  .manualtoc .tocchap{width:100%;margin:8px 0 0}
  .manualtoc .toclink{white-space:normal}
}

/* Cleanup decisions remain readable and reachable on narrow screens. */
.review-filter{display:flex;flex:1 1 180px;flex-direction:column;gap:4px;min-width:0}
.review-filter input,.review-filter select{width:100%;min-width:0}
.review-bulk{flex-wrap:wrap;margin:10px 0;gap:8px!important}
.review-feedback{padding:14px;margin:12px 0;border:1px solid currentColor;border-radius:8px;overflow-wrap:anywhere}
.review-item{padding:16px;border-top:1px solid var(--line,#ddd);min-width:0}
.review-heading{display:flex;align-items:center;flex-wrap:wrap;gap:12px}
.review-values{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}
.review-value{display:flex;flex-direction:column;gap:4px;min-width:0;white-space:pre-wrap;overflow-wrap:anywhere}
.review-note{white-space:pre-wrap;overflow-wrap:anywhere;margin:12px 0}
.review-actions .row{flex-wrap:wrap}
@media(max-width:760px){.review-values{grid-template-columns:1fr}.review-queue button,.review-bulk button{min-height:44px}.review-heading .check{min-height:44px}.review-item{padding:12px}.review-filter{flex-basis:100%}}

/* Wide tables must shrink their container, not extend under the clipped page edge.
   Let vertical gestures continue to the page while horizontal movement stays in the table. */
.card,.block,.cardbody,.bbody,.stack,.dg,.cols2>*,.cols3>*{min-width:0}
.scrollx,.tablewrap,.dg-scroll{max-width:100%;min-width:0;touch-action:auto;overscroll-behavior-x:contain;overscroll-behavior-y:auto;-webkit-overflow-scrolling:touch}
@media(max-width:760px){
  /* Custom tables outside miniTable also need their own scroll box. */
  table.mt,table.permgrid{display:block;max-width:100%;overflow:auto;touch-action:auto;overscroll-behavior-x:contain;overscroll-behavior-y:auto;-webkit-overflow-scrolling:touch}
  .scrollx>table.mt,.tablewrap>table.mt{display:table;overflow:visible}
  .mt th,.mt td,.permgrid th{white-space:nowrap}
}

/* Mobile review: keep long-page actions reachable without pinning entire forms. */
.mobile-fold-toggle,.mobile-back-top{display:none}
.files-layout>.mobile-fold{position:sticky;top:calc(var(--chrome-h) + 16px + env(safe-area-inset-top,0px))}
.files-layout>.mobile-fold .frail{position:static}
.files-search{flex:1 1 240px;min-width:0}
.files-search input{width:100%}
.files-filters{display:flex;gap:12px;flex-wrap:wrap}
.files-filters>.field{flex:1 1 180px;min-width:0}
@media(max-width:760px){
  .btn.mobile-fold-toggle{display:flex;width:100%;justify-content:space-between;min-height:44px;border:1px solid var(--line);background:var(--panel);margin:4px 0}
  .mobile-fold-toggle::after{content:'+';margin-left:auto}
  .mobile-fold.expanded>.mobile-fold-toggle::after{content:'-'}
  .mobile-fold:not(.expanded)>.mobile-fold-body{display:none}
  .mobile-fold-body{padding:8px 0}
  .files-layout{gap:10px}
  .files-layout>.mobile-fold{position:static}
  .files-layout .frail{border:0;margin:0}
  .files-toolbar{position:sticky;top:calc(var(--bar-h) + env(safe-area-inset-top,0px));z-index:20;background:var(--bg);padding:8px 0;margin:0;border-bottom:1px solid var(--line);gap:6px}
  .files-search{flex-basis:100%}
  .files-actions{flex-wrap:nowrap;width:100%;overflow-x:auto;overscroll-behavior-y:auto;padding-bottom:2px}
  .files-actions .btn{flex:0 0 auto;min-height:44px}
  .files-filters{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}
  .files-results .card,.files-results .mtwrap{overflow:visible!important;border:0;background:transparent;box-shadow:none}
  .files-results .mt{display:block;width:100%}
  .files-results .mt thead{display:block;margin:8px 0}
  .files-results .mt thead tr{display:block}
  .files-results .mt thead th{display:none}
  .files-results .mt thead th.chk{display:flex;width:auto!important;align-items:center;gap:8px;background:transparent;border:0}
  .files-results .mt thead th.chk::after{content:'Select all shown';font-size:12px;text-transform:none;letter-spacing:0}
  .files-results .mt tbody{display:grid;gap:10px}
  .files-results .mt tbody tr{display:grid;grid-template-columns:36px minmax(0,1fr);padding:10px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-card)}
  .files-results .mt tbody td{display:block;text-align:left;grid-column:2;min-width:0;white-space:normal;border:0;padding:4px 0;font-size:12px}
  .files-results .mt tbody td.chk{grid-column:1;grid-row:1 / span 7;padding:0}
  .files-results .mt tbody td[data-label='File']{font-weight:600;font-size:14px}
  .files-results .mt tbody td[data-label='File'] a{white-space:normal!important;overflow-wrap:anywhere}
  .files-results .mt tbody td[data-label='Folder']::before,.files-results .mt tbody td[data-label='Size']::before,.files-results .mt tbody td[data-label='Uploaded']::before{content:attr(data-label) ': ';color:var(--muted)}
  .files-results .mt tbody td.acts>.row{justify-content:flex-start!important;flex-wrap:wrap!important}
  .files-results .mt tbody td.acts .btn{min-height:44px}
  .page-title:has(>.acts>.btn:only-child){position:sticky;top:calc(var(--bar-h) + env(safe-area-inset-top,0px));z-index:19;background:var(--bg);padding:8px 0;border-bottom:1px solid var(--line);gap:6px}
  .page-title:has(>.acts>.btn:only-child)>.sub{display:none}
  .page-title:has(>.acts>.btn:only-child)>.acts{width:auto;margin-left:auto}
  .btn.mobile-back-top{display:flex;position:fixed;right:14px;bottom:calc(66px + env(safe-area-inset-bottom,0px));z-index:45;min-height:44px;background:var(--panel);border:1px solid var(--line);box-shadow:var(--shadow-md);border-radius:var(--pill);padding:0 14px}
  .mt td.acts>.links{flex-wrap:nowrap}
  .auditbar{gap:8px}
  .auditbar>input,.auditbar>select{max-width:100%;min-width:0}
  .block .bhead{gap:8px;flex-wrap:wrap}
}
@media print{.mobile-back-top,.mobile-fold-toggle{display:none!important}.mobile-fold-body{display:block!important}}

/* Opaque status-bar inset, including browsers that sample the page behind native chrome. */
.appbar{background:var(--bar-bg)}
.topbar{background-color:var(--bar-bg)}
html::before{content:"";position:fixed;top:0;left:0;right:0;height:env(safe-area-inset-top,0px);background:var(--bar-bg);z-index:51;pointer-events:none}

.files-location{display:flex;align-items:center;gap:12px;width:100%}
.files-location h2{font-size:18px;margin:0;overflow-wrap:anywhere}
@media(max-width:760px){
  .files-folder-browser.files-at-root>.mobile-fold-toggle{display:none}
  .files-folder-browser.files-at-root>.mobile-fold-body{display:block}
  .files-folder-browser.files-at-root .frail{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .files-folder-browser.files-at-root .frail>.sect{display:none}
  .files-folder-browser.files-at-root .frow{border:1px solid var(--line);border-radius:var(--radius-ctl);background:var(--panel);min-height:56px}
  .files-folder-browser.files-at-root .frow .fi{min-height:56px;padding:8px;border-left:0;font-size:12px}
  .files-folder-browser.files-at-root .fi .nm{white-space:normal;overflow-wrap:anywhere}
  .files-folder-browser .frow .grip{display:none}
  .files-folder-browser .frow .iconbtn{opacity:1;min-width:32px;min-height:44px}
  .files-actions>.iconbtn{min-width:44px;min-height:44px}
}

/* The page search lives in the same header on every screen. */
.topbar .search{flex-basis:420px;min-width:220px}
.topbar .search input[type=search]{padding-right:118px}
.search-scope{position:absolute;right:4px;top:4px;max-width:170px;height:26px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:0;border-left:1px solid var(--line);background:var(--bg2);color:var(--txt);border-radius:4px;padding:0 8px;font-size:12px;cursor:pointer}
.search-scope[hidden]{display:none}
.topbar .search:has(.search-scope[hidden]) input{padding-right:12px}
.dg-search:has([data-page-search]){flex:0 1 auto;min-width:0}
.dg-search:has([data-page-search])>.sic{display:none}
.dg-search:has([data-page-search])>.dg-qf{max-width:180px}
@media(max-width:760px){
 .topbar .search.open{min-width:0}
 .topbar .search input[type=search]{height:44px;font-size:16px}
 .search-scope{top:0;height:44px;right:0}
}

.topbar .close-search{display:none}
@media(max-width:760px){
 .topbar .search.open{padding-right:44px;background:var(--bar-bg);border-radius:6px}
 .topbar .search.open .search-scope{right:44px}
 .topbar .search.open .close-search{display:inline-flex;position:absolute;right:0;top:0;width:44px;height:44px}
}

/* Record attachments stay compact and touch-scrollable on phones. */
.attachment-tabs{display:flex;gap:8px;overflow-x:auto;padding:4px 0 12px;touch-action:pan-x pan-y;max-width:100%}
.attachment-tabs .btn{flex:0 0 auto;min-height:44px}
.attachment-tab-settings{display:grid;gap:10px}
.attachment-tab-settings .category-row{display:grid;grid-template-columns:minmax(120px,1fr) minmax(140px,1fr) auto;gap:8px;align-items:center}
@media(max-width:600px){.attachment-tab-settings .category-row{grid-template-columns:minmax(0,1fr) auto}.attachment-tab-settings .category-row select{grid-column:1/-1;grid-row:2}.rec .rail{flex-wrap:wrap;overflow:visible}}

.imggrid .im:focus-within .ov{opacity:1}
@media(hover:none),(pointer:coarse){.imggrid .im{aspect-ratio:auto}.imggrid .im>.pic{aspect-ratio:1;height:auto!important}.imggrid .im .ov{position:relative;opacity:1;flex-wrap:wrap;justify-content:flex-start;background:var(--panel);border-top:1px solid var(--line)}.imggrid .im .ov .iconbtn{width:44px;height:44px}}

.attachment-doc-card{padding:14px 0;border-bottom:1px solid var(--line)}
.attachment-doc-card>a{font-weight:600;display:block;overflow-wrap:anywhere;line-height:1.5}
.attachment-doc-card .hint{margin:6px 0 10px}
@media(max-width:600px){.attachment-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible}.attachment-tabs .btn{min-width:0;padding:10px 6px;justify-content:center}.attachment-tabs .btn.primary .faint{color:inherit}.attachment-doc-card .btn,.attachment-doc-card .iconbtn{min-height:44px;min-width:44px}}

/* ---- Notifications page: one row per notification, read left to right ---- */
.notifs{display:flex;flex-direction:column}
.notif{display:flex;gap:12px;align-items:flex-start;padding:12px 14px;border-bottom:1px solid var(--line2);cursor:pointer;text-align:left}
.notif:last-child{border-bottom:0}
.notif:hover{background:var(--bg2)}
.notif .dot{flex:0 0 auto;width:8px;height:8px;border-radius:50%;margin-top:7px;background:var(--line)}
.notif.unread .dot{background:var(--accent)}
.notif .nb{flex:1 1 auto;min-width:0}
.notif .nt{display:flex;gap:10px;align-items:baseline;flex-wrap:wrap}
.notif .nt b{font-size:14px;color:var(--heading)}
.notif .nw{margin-left:auto;font-size:12px;color:var(--faint);white-space:nowrap}
.notif .nl{margin-top:4px;font-size:13px;color:var(--txt);line-height:1.45}
.notif .nl .k{color:var(--muted)}
.notif .nl .k::after{content:':'}
.notif:not(.unread) .nb{opacity:.75}
.notif .na{display:flex;gap:4px;align-items:center;flex:0 0 auto}
@media (max-width:760px){ .notif{padding:12px} .notif .na{flex-direction:column} }

.toast .toast-undo{margin-left:12px;padding:2px 10px;border:1px solid rgba(255,255,255,.45);border-radius:var(--pill);background:transparent;color:inherit;font:inherit;font-weight:700;cursor:pointer}
.toast .toast-undo:hover{background:rgba(255,255,255,.15)}
.search-scope.narrowed{background:var(--accent-soft);color:var(--accent)}
.search-scope::after{content:' \25BE';font-size:10px;opacity:.7}

/* ---- listPicker: chosen chips + a search box that offers the rest ---- */
.lpick{display:flex;flex-direction:column;gap:8px}
.lpick-box{position:relative;display:flex;align-items:center;max-width:360px}
.lpick-box .sic{position:absolute;left:10px;display:flex;color:var(--faint);pointer-events:none}
.lpick-in{width:100%;padding:7px 10px 7px 30px;border:1px solid var(--line);border-radius:var(--radius-ctl);background:var(--panel);color:var(--txt);font:inherit;font-size:13px}
.lpick-in:focus{outline:0;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.lpick-list{position:absolute;left:0;right:0;top:calc(100% + 4px);z-index:30;display:flex;flex-direction:column;max-height:260px;overflow:auto;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-ctl);box-shadow:var(--shadow-lg);padding:4px}
.lpick-row{display:flex;align-items:center;text-align:left;padding:7px 10px;border:0;background:transparent;color:var(--txt);font:inherit;font-size:13px;border-radius:6px;cursor:pointer}
.lpick-row:hover,.lpick-row.on{background:var(--bg2);color:var(--heading)}

/* Files > Tidy up: one line per clean-up, the count on the right */
.tidy{display:flex;flex-direction:column;gap:12px}
.tidy-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}

/* Keep mobile action rows reachable without widening the page or intercepting
   vertical gestures. Native focus scrolling reveals offscreen controls. */
@media(max-width:760px){
  .page-title .acts,.rechead .acts,.files-actions{
    flex-wrap:nowrap;min-width:0;max-width:100%;overflow-x:auto;
    overscroll-behavior-x:contain;touch-action:pan-x pan-y pinch-zoom;
    scrollbar-width:thin;scroll-padding-inline:4px;padding-block:4px;
  }
  .page-title .acts>*,.rechead .acts>*,.files-actions>*{flex:0 0 auto}
}
.tidy-row .field{margin:0;min-width:200px}
.tidy-row .hint{margin-left:auto;white-space:nowrap}
