/* =========================================================
   WitsDocVault — shared stylesheet
   Neutral + purple, modern SaaS theme
   ========================================================= */

:root{
  /* brand */
  --ink:            #241E52;   /* deep navy — sidebar, headings */
  --ink-soft:       #6E6A8C;
  --ink-faint:      #9995B3;
  --purple:         #8C7FE6;   /* primary accent */
  --purple-deep:    #6357CC;
  --purple-darker:  #4C41A8;
  --purple-tint:    #EFECFC;
  --teal:           #2B9C92;   /* secondary accent */
  --teal-deep:      #227D75;
  --teal-tint:      #E2F5F2;

  /* neutrals */
  --bg:             #F4F2EC;
  --surface:        #FFFFFF;
  --surface-sunken: #ECE9E1;
  --border:         #E1DDD1;
  --border-soft:    #ECE9E0;

  /* status */
  --green:          #3E8E5A;
  --green-tint:     #E7F4EC;
  --amber:          #C1861B;
  --amber-tint:     #FBF1DC;
  --red:            #C6483F;
  --red-tint:       #FBEAE8;

  /* geometry */
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 20px;
  --shadow-sm: 0 1px 2px rgba(36,30,82,.06), 0 4px 14px rgba(36,30,82,.05);
  --shadow-md: 0 4px 10px rgba(36,30,82,.08), 0 14px 34px rgba(36,30,82,.10);

  --sidebar-w: 252px;
  --topbar-h: 72px;
}

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; height:100%; }
body{
  font-family:'Inter',system-ui,-apple-system,sans-serif;
  background:var(--bg);
  color:var(--ink);
  font-size:14.5px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4,.brand,.font-display{ font-family:'Sora',system-ui,sans-serif; letter-spacing:-0.01em; }
h1{ font-size:22px; font-weight:700; margin:0; }
h2{ font-size:18px; font-weight:600; margin:0; }
h3{ font-size:15.5px; font-weight:600; margin:0; }
p{ margin:0 0 10px; color:var(--ink-soft); }
a{ color:var(--purple-deep); text-decoration:none; }
a:any-link:hover{ text-decoration:none; font-weight:700; }
button{ font-family:inherit; cursor:pointer; }
ul{ margin:0; padding:0; list-style:none; }
img{ max-width:35%; }
::selection{ background:var(--purple-tint); }

.scr-only{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }

/* =========================================================
   Layout shell
   ========================================================= */
.shell{
  display:grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr auto;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main"
    "sidebar footer";
  height:100vh;
  overflow:hidden;
}

/* ---- Sidebar ---- */
.sidebar{
  grid-area:sidebar;
  background:var(--ink);
  color:#DCD9EE;
  display:flex;
  flex-direction:column;
  position:relative;
  z-index:30;
}
.sidebar-brand{
  height:var(--topbar-h);
  flex-shrink:0;
  background:var(--bg);
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  gap:8px;
  padding:0 20px;
  overflow:hidden;
}
.sidebar-brand svg{ height:26px; width:auto; flex-shrink:0; }
.sidebar-brand .logo{ width:56px; height:46px; max-width:none; object-fit:contain; flex-shrink:0; }
.sidebar-brand .word{ font-family:'Sora',sans-serif; font-weight:200; font-size:16px; color:var(--purple-deep); white-space:nowrap; }
.sidebar-brand .word b{ color:var(--ink); font-weight:700; }

.sidebar-scroll{ flex:1; min-height:0; overflow-y:auto; padding:14px 12px 18px; }
.sidebar-scroll::-webkit-scrollbar{ width:6px; }
.sidebar-scroll::-webkit-scrollbar-thumb{ background:rgba(255,255,255,.14); border-radius:6px; }

.nav-label{ font-size:11px; font-weight:600; letter-spacing:.06em; color:#8A85AE; padding:16px 12px 6px; text-transform:uppercase; }
.nav-label:first-child{ padding-top:4px; }

nav.primary-nav{ display:flex; flex-direction:column; gap:2px; }
.nav-item{
  display:flex; align-items:center; gap:11px;
  padding:10px 12px; border-radius:10px;
  font-size:14px; color:#C6C2E2;
  border:none; background:none; width:100%; text-align:left;
  transition:background .15s ease, color .15s ease;
  position:relative;
}
.nav-item svg{ width:18px; height:18px; flex-shrink:0; opacity:.85; }
.nav-item:hover{ background:rgba(255,255,255,.07); color:#fff; text-decoration:none; }
.nav-item.active{ background:var(--purple); color:#fff; }
.nav-item.active svg{ opacity:1; }
.nav-item .count{
  margin-left:auto; font-size:11px; font-weight:600;
  background:rgba(255,255,255,.16); color:#fff;
  padding:1px 7px; border-radius:99px;
}
.nav-item.active .count{ background:rgba(255,255,255,.28); }

/* ---- Sidebar submenu / accordion ---- */
.nav-parent{ justify-content:flex-start; }
.nav-parent .chevron-ico{ margin-left:auto; width:14px; height:14px; flex-shrink:0; transition:transform .15s ease; opacity:.7; }
.nav-parent.open{ background:rgba(255,255,255,.07); color:#fff; }
.nav-parent.open .chevron-ico{ transform:rotate(90deg); opacity:1; }
.nav-submenu{
  display:flex; flex-direction:column; gap:1px;
  margin:2px 0 6px 33px; padding-left:12px;
  border-left:1px solid rgba(255,255,255,.14);
}
.nav-sub-item{
  display:flex; align-items:center; gap:9px; padding:8px 10px; border-radius:8px;
  font-size:13px; color:#ADA8CB; transition:background .15s ease, color .15s ease;
}
.nav-sub-item:hover{ background:rgba(255,255,255,.07); color:#fff; text-decoration:none; }
.nav-sub-item .subdot{ width:6px; height:6px; border-radius:50%; background:#6E6A8C; flex-shrink:0; }
.nav-sub-item.active{ background:var(--purple); color:#fff; font-weight:600; }
.nav-sub-item.active .subdot{ background:#fff; }

.sidebar-foot{
  padding:12px; border-top:1px solid rgba(255,255,255,.08); flex-shrink:0;
}
.sidebar-user{ display:flex; align-items:center; gap:10px; padding:8px; border-radius:10px; }
.sidebar-user:hover{ background:rgba(255,255,255,.06); cursor:pointer; }
.sidebar-user .avatar-sm{ background:var(--purple); color:#fff; }
.sidebar-user .who{ min-width:0; }
.sidebar-user .name{ font-size:13px; font-weight:600; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar-user .role{ font-size:11.5px; color:#9C97BE; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar-signout{ background:var(--teal-deep); color:#fff; }
.sidebar-signout:hover{ background:var(--teal); color:#fff; }
.sidebar-signout svg{ opacity:1; }
.menu-toggle:focus-visible,.nav-item:focus-visible{ outline:2px solid var(--teal); outline-offset:2px; }

@media (min-width:901px){
  .shell.sidebar-collapsed{ grid-template-columns:70px minmax(0, 1fr); }
  .sidebar-collapsed .sidebar-brand{ justify-content:center; padding:0 5px; }
  .sidebar-collapsed .sidebar-brand .word,
  .sidebar-collapsed .nav-label,
  .sidebar-collapsed .nav-item span,
  .sidebar-collapsed .nav-parent .chevron-ico,
  .sidebar-collapsed .sidebar-user .who{ display:none; }
  .sidebar-collapsed .nav-submenu{ display:none !important; }
  .sidebar-collapsed .sidebar-scroll{ padding:14px 12px 18px; }
  .sidebar-collapsed .nav-item{ justify-content:center; padding:12px 0; }
  .sidebar-collapsed .sidebar-user{ justify-content:center; padding:8px 0; }
}

/* ---- Topbar ---- */
header.topbar{
  grid-area:topbar;
  background:var(--surface);
  border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
  padding:0 26px; z-index:20; gap:16px;
}
.topbar-left{ display:flex; align-items:center; gap:14px; min-width:0; }
.menu-toggle{ display:flex; align-items:center; justify-content:center; background:none; border:none; padding:6px; color:var(--ink); }
.menu-toggle svg{ width:22px; height:22px; }
.crumbs{ font-size:12.5px; color:var(--ink-faint); margin-bottom:3px; }
.crumbs a{ color:var(--ink-faint); }
.crumbs a:hover{ color:var(--ink-soft); }
main > .crumbs{ margin-bottom:8px; }
.page-title{ font-size:19px; font-weight:700; margin:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.page-sub{ font-size:12.5px; color:var(--ink-soft); margin-top:1px; }

.topbar-right{ display:flex; align-items:center; gap:12px; flex-shrink:0; }
.search-box{
  display:flex; align-items:center; gap:8px;
  background:var(--surface-sunken); border-radius:9px; padding:8px 12px; width:230px;
}
.search-box svg{ width:16px; height:16px; color:var(--ink-faint); flex-shrink:0; }
.search-box input{ border:none; background:none; outline:none; font:inherit; font-size:13.5px; width:100%; color:var(--ink); }
.icon-btn{
  position:relative; width:38px; height:38px; border-radius:9px;
  background:var(--surface-sunken); border:none; color:var(--ink-soft);
  display:flex; align-items:center; justify-content:center;
}
.icon-btn:hover{ background:var(--border-soft); color:var(--ink); }
.icon-btn svg{ width:18px; height:18px; }
.icon-btn .dot{ position:absolute; top:7px; right:7px; width:7px; height:7px; border-radius:50%; background:var(--red); border:2px solid var(--surface); }
.avatar-sm{
  width:34px; height:34px; border-radius:50%; flex-shrink:0;
  background:var(--purple-tint); color:var(--purple-deep);
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px;
}
.avatar-md{ width:44px; height:44px; font-size:15px; }
.topbar-user{ display:flex; align-items:center; gap:9px; cursor:pointer; padding:4px 6px 4px 4px; border-radius:10px; }
.topbar-user:hover{ background:var(--surface-sunken); }
.topbar-user svg{ width:16px; height:16px; color:var(--ink-faint); }

/* ---- Main ---- */
main{ grid-area:main; padding:26px 28px 32px; overflow-y:auto; min-width:0; min-height:0; }
footer.app-footer{
  grid-area:footer; background:var(--surface); border-top:1px solid var(--border);
  padding:13px 28px; display:flex; align-items:center; justify-content:space-between;
  font-size:12px; color:var(--ink-faint); flex-wrap:wrap; gap:8px;
}
footer.app-footer .footer-links{ display:flex; gap:16px; }
footer.app-footer a{ color:var(--ink-faint); }
footer.app-footer a:hover{ color:var(--ink-soft); }

.overlay{ display:none; position:fixed; inset:0; background:rgba(36,30,82,.35); z-index:25; }

/* =========================================================
   Buttons
   ========================================================= */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  font-size:13.5px; font-weight:600; padding:9px 16px; border-radius:9px;
  border:1px solid transparent; white-space:nowrap; line-height:1.2;
  transition:background .15s ease, border-color .15s ease, color .15s ease;
}
.btn svg{ width:15px; height:15px; }
.btn-primary{ background:var(--purple); color:#fff; }
.btn-primary:hover{ background:var(--purple-deep); text-decoration:none; }
.btn-secondary{ background:var(--surface); border-color:var(--border); color:var(--ink); }
.btn-secondary:hover{ background:var(--surface-sunken); text-decoration:none; }
.btn-ghost{ background:none; color:var(--ink-soft); }
.btn-ghost:hover{ background:var(--surface-sunken); color:var(--ink); text-decoration:none; }
.btn-danger{ background:var(--red); color:#fff; }
.btn-danger:hover{ background:#A83A32; text-decoration:none; }
.btn-danger-ghost{ background:none; color:var(--red); }
.btn-danger-ghost:hover{ background:var(--red-tint); text-decoration:none; }
.btn-sm{ padding:6px 12px; font-size:12.5px; border-radius:8px; }
.btn-lg{ padding:12px 22px; font-size:14.5px; border-radius:10px; }
.btn-block{ width:100%; }
.btn[disabled]{ opacity:.5; pointer-events:none; }
.btn-icon-only{ padding:8px; }

/* =========================================================
   Cards / surfaces
   ========================================================= */
.card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-m);
  padding:20px 22px; box-shadow:var(--shadow-sm);
}
.card-flat{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-m); padding:20px 22px; }
.card-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:14px; }
.card-head h3{ margin:0 0 3px; }
.card-sub{ font-size:12.5px; color:var(--ink-soft); }
.card-icon{ width:36px; height:36px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.card-icon svg{ width:18px; height:18px; }
.card-icon.purple{ background:var(--purple-tint); color:var(--purple-deep); }
.card-icon.teal{ background:var(--teal-tint); color:var(--teal-deep); }
.card-icon.green{ background:var(--green-tint); color:var(--green); }
.card-icon.amber{ background:var(--amber-tint); color:var(--amber); }
.card-icon.red{ background:var(--red-tint); color:var(--red); }
.card-icon.blue{ background:#E8F1FC; color:#4778B7; }
.card-icon.rose{ background:#F9EAF1; color:#B45F88; }

/* Searchable audit event filter, using the standard table field theme. */
.report-event-filter{position:relative;flex:1 1 220px;min-width:0;}
.report-event-filter summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:42px;padding:10px 12px;border:1px solid var(--border);border-radius:9px;background:var(--surface);color:var(--ink);font-size:13px;cursor:pointer;list-style:none;}
.report-event-filter summary::-webkit-details-marker{display:none;}
.report-event-filter summary > span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.report-event-filter[open] summary,.report-event-filter summary:focus-visible{border-color:var(--purple);outline:2px solid var(--purple-tint);}
.report-event-menu{position:absolute;top:calc(100% + 4px);left:0;z-index:20;width:max(100%,280px);max-width:calc(100vw - 48px);padding:8px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-s);box-shadow:var(--shadow-sm);}
.report-event-menu input[type=text]{width:100%;min-width:0;margin-bottom:6px;}
.report-event-options{max-height:260px;overflow:auto;}
.report-event-options button{display:block;width:100%;padding:9px 10px;text-align:left;border:0;border-radius:6px;background:transparent;color:var(--ink);font:inherit;font-size:13px;overflow-wrap:anywhere;cursor:pointer;}
.report-event-options button:hover,.report-event-options button:focus-visible,.report-event-options button[aria-pressed=true]{background:var(--purple-tint);color:var(--purple-deep);}
.report-event-options button[hidden]{display:none;}
.report-export-trigger{gap:0;padding:0;overflow:hidden;}
.report-export-trigger > span:first-child{display:flex;align-items:center;gap:8px;padding:10px 16px;}
.report-export-download{display:flex;align-items:center;}
.report-export-download svg{width:16px;height:16px;}
.report-export-arrow{display:flex;align-items:center;justify-content:center;align-self:stretch;width:34px;border-left:1px solid rgba(255,255,255,.3);background:rgba(0,0,0,.08);}
.report-export-arrow svg{width:16px;height:16px;}
#reportExportMenu{min-width:140px;width:140px;}
#reportExportMenu a{gap:10px;padding:8px 10px;}
.report-export-format-icon{display:block;width:28px;height:32px;object-fit:contain;flex-shrink:0;}
.report-schedule{padding:20px;margin-bottom:20px;}
.report-schedule-button-icon{display:flex;align-items:center;}
.report-schedule-button-icon svg{width:16px;height:16px;}
.report-schedule[hidden]{display:none;}
.report-schedule-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:16px;}
.report-schedule-fields select{width:100%;min-width:0;}
.report-schedule-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:16px;}
.report-filters .table-toolbar > select[name=group_id]{flex:0 1 160px;width:160px;}
.report-filters .table-toolbar > .date-range-picker{flex:0 1 290px;min-width:290px;}
@media(max-width:768px){
  .report-filters .table-toolbar > select[name=group_id],.report-filters .table-toolbar > .date-range-picker{flex:0 0 auto;width:100%;min-width:0;}
}
@media(max-width:768px){.report-event-filter{flex:0 0 auto;width:100%;}}

.summary-row{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:22px; }
.summary-card{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-m); padding:17px 19px; }
.summary-card .label{ font-size:12.5px; color:var(--ink-soft); display:flex; align-items:center; gap:8px; }
.summary-card .label svg{ width:15px; height:15px; }
.summary-card .value{ font-family:'Sora',sans-serif; font-size:27px; font-weight:700; margin-top:8px; }
.summary-card .delta{ font-size:12px; margin-top:6px; display:flex; align-items:center; gap:4px; color:var(--ink-faint); }
.delta.up{ color:var(--green); } .delta.down{ color:var(--red); }

.section-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin:28px 0 14px; }
.section-head:first-child{ margin-top:0; }
.section-head h2{ margin-bottom:2px; }

/* =========================================================
   Forms
   ========================================================= */
.field{ margin-bottom:18px; }
.field label,.field-label{ display:block; font-size:13px; font-weight:600; color:var(--ink); margin-bottom:6px; }
.field .hint{ font-size:12px; color:var(--ink-faint); margin-top:5px; }
#newPolicy input[name=scope_value]{margin-top:8px;}
.field .error{ font-size:12px; color:var(--red); margin-top:5px; display:flex; align-items:center; gap:5px; }
.optional{ font-weight:400; color:var(--ink-faint); }

input[type=text],input[type=email],input[type=password],input[type=number],
input[type=search],input[type=tel],input[type=date],input[type=datetime-local],input[type=time],
select, textarea{
  width:100%; padding:10px 13px; font:inherit; font-size:13.5px; color:var(--ink);
  background:var(--surface); border:1px solid var(--border); border-radius:9px; outline:none;
  transition:border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder{ color:var(--ink-faint); }
input:focus,select:focus,textarea:focus{ border-color:var(--purple); box-shadow:0 0 0 3px var(--purple-tint); }
textarea{ resize:vertical; min-height:90px; }

/* range sliders — themed green, not browser-default blue */
input[type=range]{
  -webkit-appearance:none; appearance:none; width:100%; height:6px; border-radius:4px;
  background:var(--surface-sunken); outline:none; cursor:pointer; accent-color:var(--green);
}
input[type=range]::-webkit-slider-runnable-track{ height:6px; border-radius:4px; background:var(--surface-sunken); }
input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none; appearance:none; width:16px; height:16px; border-radius:50%;
  background:var(--green); border:2px solid #fff; box-shadow:0 1px 3px rgba(36,30,82,.3); margin-top:-5px; cursor:pointer;
}
input[type=range]::-moz-range-track{ height:6px; border-radius:4px; background:var(--surface-sunken); }
input[type=range]::-moz-range-thumb{
  width:16px; height:16px; border-radius:50%; background:var(--green); border:2px solid #fff;
  box-shadow:0 1px 3px rgba(36,30,82,.3); cursor:pointer;
}

.input-icon-wrap{ position:relative; }
.input-icon-wrap input{ padding-right:42px; }
.input-icon-wrap.has-leading-icon input{ padding-left:42px; }
.input-icon-wrap.has-leading-icon > svg{
  position:absolute; left:14px; top:50%; transform:translateY(-50%);
  width:18px; height:18px; color:var(--ink-faint); pointer-events:none;
}
.input-icon-wrap .icon-toggle{
  position:absolute; right:10px; top:50%; transform:translateY(-50%);
  background:none; border:none; color:var(--ink-faint); padding:4px;
}
.input-icon-wrap .icon-toggle svg{ display:block; width:18px; height:18px; }
.input-icon-wrap .icon-toggle:focus-visible{ outline:2px solid var(--purple); outline-offset:2px; border-radius:4px; }
.input-icon-wrap .icon-toggle[aria-pressed="false"] .eye-slash{ display:none; }
select{ appearance:none; -webkit-appearance:none; background:var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236E6A8C'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.17l3.71-3.94a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E") no-repeat right 12px center / 16px; padding-right:36px; }

.form-row{ display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.form-row-3{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:18px; }
.form-actions{ display:flex; gap:10px; margin-top:8px; }
.form-actions.end{ justify-content:flex-end; }
.backup-section-title{ display:flex; align-items:center; gap:14px; }
.field .backup-field-label{ display:flex; align-items:center; gap:8px; }
.backup-field-label svg,.backup-action-icon{ width:18px; height:18px; flex-shrink:0; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.notification-settings{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px; align-items:start; }
.notification-settings .card{ margin:0; }
.notification-settings .card-head{ justify-content:flex-start; gap:14px; padding-bottom:18px; margin-bottom:0; border-bottom:1px solid var(--border-soft); }
.notification-settings svg{ fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.notification-heading-icon{ display:flex; align-items:center; justify-content:center; flex:0 0 42px; height:42px; border-radius:10px; background:var(--purple-tint); color:var(--purple-deep); }
.notification-heading-icon svg{ width:24px; height:24px; }
.notification-channel-icon{ width:23px; height:23px; flex-shrink:0; color:var(--purple-deep); }
.notification-settings .switch-row{ padding:18px 0; }
.notification-settings .switch-row .txt{ flex:1; min-width:0; }
.notification-settings .switch-row .txt strong{ display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.notification-settings .switch-row .txt .badge{ font-size:10px; }
.notification-settings .switch{ flex-shrink:0; }
.notification-save{ padding-top:18px; margin-top:0; }
.notification-save svg{ width:18px; height:18px; }
.notification-options{ display:grid; gap:22px; min-width:0; }
.notification-info{ display:flex; align-items:center; gap:18px; padding:22px; border:1px solid #4778B7; border-radius:var(--radius-m); background:#E8F1FC; color:var(--ink); }
.notification-info > svg{ width:32px; height:32px; flex-shrink:0; color:#4778B7; }
.notification-info > div{ border-left:1px solid #4778B7; padding-left:18px; }
.notification-info strong{ display:block; font-size:14px; }
.notification-info p{ margin:6px 0 0; font-size:13px; }
.notification-digest{ display:grid; gap:18px; padding-top:20px; }
@media(max-width:1000px){ .notification-settings{ grid-template-columns:minmax(0,1fr); } }
.workspace-settings-actions{ flex-wrap:wrap; justify-content:space-between; align-items:center; }
.workspace-save-actions{ display:flex; flex-wrap:wrap; gap:10px; margin-left:auto; }

.email-editor-toolbar{ display:flex; align-items:center; gap:4px; padding:6px; border:1px solid var(--border); border-bottom:0; border-radius:9px 9px 0 0; background:var(--surface-sunken); }
.email-editor-toolbar button{ min-width:32px; padding:5px 8px; border:0; border-radius:5px; background:transparent; color:var(--ink); font:inherit; cursor:pointer; }
.email-editor-toolbar button:hover,.email-editor-toolbar button:focus-visible{ background:var(--purple-tint); color:var(--purple); }
.email-editor-divider{ width:1px; height:19px; margin:0 4px; background:var(--border); }
.email-editor{ min-height:170px; max-height:320px; overflow:auto; padding:12px; border:1px solid var(--border); border-radius:0 0 9px 9px; background:var(--surface); color:var(--ink); white-space:pre-wrap; outline:none; }
.email-editor:focus{ border-color:var(--purple); box-shadow:0 0 0 3px var(--purple-tint); }
.email-editor[aria-invalid="true"]{ border-color:var(--red); }
.email-editor p,.email-editor div{ margin:0 0 8px; }
.email-editor ul,.email-editor ol{ padding-left:24px; margin:6px 0; }

.checkbox-row,.radio-row{ display:flex; align-items:flex-start; gap:9px; }
.checkbox-row input,.radio-row input{ width:16px; height:16px; margin-top:2px; accent-color:var(--purple); flex-shrink:0; }

.switch{ position:relative; display:inline-block; width:38px; height:22px; flex-shrink:0; }
.switch input{ opacity:0; width:0; height:0; }
.switch .track{ position:absolute; inset:0; background:var(--border); border-radius:99px; transition:.15s; }
.switch .track::before{ content:""; position:absolute; width:16px; height:16px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.15s; box-shadow:0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .track{ background:var(--purple); }
.switch input:checked + .track::before{ transform:translateX(16px); }
.switch-row{ display:flex; align-items:center; justify-content:space-between; gap:14px; padding:13px 0; border-bottom:1px solid var(--border-soft); }
.switch-row:last-child{ border-bottom:none; }
.switch-row .txt strong{ display:block; font-size:13.5px; font-weight:600; }
.switch-row .txt span{ font-size:12.5px; color:var(--ink-soft); }

/* chip / tag input */
.chip-field{
  display:flex; flex-wrap:wrap; gap:7px; align-items:center;
  padding:7px 9px; border:1px solid var(--border); border-radius:9px; background:var(--surface);
}
.chip-field:focus-within{ border-color:var(--purple); box-shadow:0 0 0 3px var(--purple-tint); }
.chip{
  display:inline-flex; align-items:center; gap:6px; background:var(--surface-sunken);
  border-radius:7px; padding:4px 6px 4px 10px; font-size:12.5px; font-weight:500; color:var(--ink);
}
.chip button{ background:none; border:none; color:var(--ink-faint); display:flex; padding:2px; border-radius:5px; }
.chip button:hover{ background:var(--border); color:var(--ink); }
.chip-field input{ border:none; flex:1; min-width:80px; padding:4px; box-shadow:none !important; }

/* password strength */
.pw-strength{ display:flex; gap:4px; margin-top:8px; }
.pw-strength i{ height:4px; flex:1; border-radius:3px; background:var(--border); }
.pw-strength.weak i:nth-child(1){ background:var(--red); }
.pw-strength.fair i:nth-child(1),.pw-strength.fair i:nth-child(2){ background:var(--amber); }
.pw-strength.strong i{ background:var(--green); }

/* =========================================================
   Auth pages
   ========================================================= */
.auth-shell{
  min-height:100vh; display:grid; grid-template-columns:1fr 1fr;
  background:var(--surface);
}
.auth-shell--muted{ background:var(--bg); }
.auth-visual{
  background:var(--ink); color:#fff; position:relative; overflow:hidden;
  display:flex; flex-direction:column; justify-content:space-between; padding:44px;
}
.auth-visual::before{
  content:""; position:absolute; inset:0;
  background:
    radial-gradient(560px circle at 85% 15%, rgba(140,127,230,.35), transparent 60%),
    radial-gradient(480px circle at 10% 90%, rgba(43,156,146,.25), transparent 60%);
}
.auth-visual > *{ position:relative; z-index:1; }
.auth-visual .tagline{ max-width:400px; }
.auth-visual .tagline h2{ font-size:26px; line-height:1.35; margin-bottom:14px; }
.auth-visual .tagline p{ color:#C6C2E2; font-size:14px; }
.auth-visual .login-tagline{ max-width:none; }
.auth-visual .login-tagline h2{ white-space:nowrap; font-size:clamp(22px, 1.72vw, 26px); }
.auth-visual .login-tagline p{ max-width:400px; }
.auth-visual .brand-row{ display:flex; align-items:center; gap:10px; }
.auth-visual .brand-row .word{ font-family:'Sora',sans-serif; font-weight:700; font-size:19px; color:#fff; }
.auth-visual .brand-row .word b{ color:var(--purple); }
.auth-visual .login-brand{
  flex-direction:column; justify-content:center; gap:0;
  width:100%; max-width:600px; aspect-ratio:1; padding-bottom:32px;
  background:var(--ink); border-radius:25%;
}
.auth-visual .login-brand-illustration{ display:block; width:100%; max-width:450px; height:auto; }
.auth-visual .login-brand .word{ margin-top:-12px; font-size:clamp(28px, 3vw, 44px); line-height:1.2; }
.auth-visual .login-brand .word b{ font-weight:400; }
.auth-visual .foot-note{ font-size:12px; color:#8A85AE; }
.trust-strip{ display:flex; gap:22px; flex-wrap:wrap; }
.trust-strip .item{ display:flex; align-items:center; gap:8px; font-size:12.5px; color:#C6C2E2; }
.trust-strip svg{ width:15px; height:15px; color:var(--teal); flex-shrink:0; }

.auth-form-wrap{ display:flex; align-items:center; justify-content:center; padding:40px; }
.auth-form{ width:100%; max-width:380px; }
.auth-form .brand-row-mobile{ display:none; }
.auth-form h1{ font-size:24px; margin-bottom:6px; }
.auth-form .auth-heading{ text-align:center; }
.auth-form .lead{ color:var(--ink-soft); font-size:13.5px; margin-bottom:26px; }
.auth-divider{ display:flex; align-items:center; gap:12px; margin:20px 0; color:var(--ink-faint); font-size:12px; }
.auth-divider::before,.auth-divider::after{ content:""; flex:1; height:1px; background:var(--border); }
.auth-foot{ text-align:center; font-size:13px; color:var(--ink-soft); margin-top:22px; }

/* Authenticator form styling within the shared split authentication layout. */
.auth-shell--mfa{ min-height:100vh; min-height:100svh; background:var(--bg); }
.auth-shell--mfa .auth-form-wrap{ width:100%; padding:48px 24px; }
.auth-shell--mfa .auth-form{ max-width:410px; }
.mfa-brand{ text-align:center; font-family:'Sora',sans-serif; font-size:30px; font-weight:700; margin-bottom:32px; }
.mfa-brand span{ color:var(--purple-deep); font-weight:500; }
.auth-shell--mfa .auth-heading{ font-size:clamp(22px, 5vw, 27px); margin-bottom:14px; }
.auth-shell--mfa .mfa-intro{ text-align:center; font-size:14px; line-height:1.7; margin-bottom:28px; }
.mfa-code-label{ display:block; font-size:13px; font-weight:600; margin-bottom:12px; }
.mfa-code-boxes{ display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:10px; }
.mfa-code-boxes .mfa-code-box{ width:100%; min-width:0; height:56px; padding:0; text-align:center; font-size:24px; font-weight:600; border:1px solid var(--border); border-radius:6px; background:var(--surface); color:var(--ink); caret-color:var(--purple-deep); }
.mfa-code-box::placeholder{ color:var(--ink-faint); }
.mfa-code-boxes .mfa-code-box:focus{ outline:2px solid var(--purple); outline-offset:2px; border-color:var(--purple-deep); }
.mfa-code-boxes .mfa-code-box.filled{ border-color:var(--purple); background:var(--purple-tint); }
.auth-shell--mfa .btn-block{ justify-content:center; gap:10px; min-height:48px; }
.mfa-back{ margin:24px 0 32px; text-align:center; font-size:14px; }
.mfa-back a{ display:inline-flex; align-items:center; gap:10px; }
.mfa-back svg{ width:18px; height:18px; }
.mfa-copyright{ text-align:center; font-size:12px; color:var(--ink-soft); margin-top:32px; }
.mfa-copyright a{ font-weight:600; }
.mfa-enrollment{ text-align:center; margin-bottom:24px; }
.mfa-enrollment .mfa-qr{ display:block; width:200px; height:200px; max-width:100%; margin:0 auto 16px; }
.mfa-manual-label,.mfa-account{ font-size:12px; }
.mfa-secret{ display:block; overflow-wrap:anywhere; padding:10px; background:var(--surface); border:1px solid var(--border); border-radius:6px; color:var(--ink); margin-bottom:10px; }
@media(max-width:360px){ .mfa-code-boxes{ gap:6px; } .auth-shell--mfa .auth-form-wrap{ padding:32px 16px; } }
.sso-btn{
  width:100%; display:flex; align-items:center; justify-content:center; gap:10px;
  padding:10px 14px; border:1px solid var(--border); border-radius:9px; background:var(--surface);
  font-size:13.5px; font-weight:600; color:var(--ink); margin-bottom:10px;
}
.sso-btn:hover{ background:var(--surface-sunken); }
.sso-btn svg{ width:17px; height:17px; }

.alert{ display:flex; gap:11px; padding:13px 15px; border-radius:10px; font-size:13px; margin-bottom:18px; }
.alert svg{ width:17px; height:17px; flex-shrink:0; margin-top:1px; }
.alert-title{ font-weight:600; margin-bottom:2px; display:block;}
.alert.success{ background:var(--green-tint); color:#215B39; }
.alert.success svg{ color:var(--green); }
.alert.error{ background:var(--red-tint); color:#7D2C25; }
.alert.error svg{ color:var(--red); }
.alert.info{ background:var(--purple-tint); color:var(--purple-darker); }
.alert.info svg{ color:var(--purple-deep); }
.alert.warn{ background:var(--amber-tint); color:#7A5510; }
.alert.warn svg{ color:var(--amber); }
.alert .close{ margin-left:auto; background:none; border:none; color:inherit; opacity:.6; padding:2px; }
.alert .close:hover{ opacity:1; }

/* Stripped / no-sidebar layout, for external + auth-adjacent screens */
.bare-shell{ min-height:100vh; display:flex; flex-direction:column; background:var(--bg); }

.bare-topbar{
  height:64px; flex-shrink:0; background:var(--surface); border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between; padding:0 28px;
}
.bare-brand{ display:flex; align-items:center; gap:8px; min-width:0; }
.bare-brand img{ height:54px; width:auto; flex-shrink:0; }
.bare-brand .word{ font-family:'Sora',sans-serif; font-weight:200; font-size:18px; color:var(--purple-deep); white-space:nowrap; }
.bare-brand .word b{ color:var(--ink); font-weight:700; }
.bare-main{ flex:1; display:flex; align-items:flex-start; justify-content:center; padding:48px 20px; }
.bare-foot{ padding:16px 28px; text-align:center; font-size:12px; color:var(--ink-faint); border-top:1px solid var(--border); background:var(--surface); }

/* =========================================================
   Tables
   ========================================================= */
.notification-bulk-actions{display:flex;gap:10px;flex-wrap:wrap}
#notificationBulkForm[hidden]{display:none!important}
.notifications-table .select-all-th{width:40px;min-width:40px;padding-left:12px;padding-right:8px}
.notifications-table .notification-copy{min-width:180px;max-width:520px;overflow-wrap:anywhere}
.notifications-table .cell-sub{white-space:pre-line;line-height:1.5}
.notifications-table .notification-received{white-space:nowrap}
.notifications-table[hidden],#notificationPreferences[hidden]{display:none!important}
.table-card{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-m); box-shadow:var(--shadow-sm); overflow:hidden; }
.table-toolbar{ display:flex; align-items:center; gap:12px; padding:16px 20px; border-bottom:1px solid var(--border); flex-wrap:wrap; }
.table-toolbar .search-box{ width:280px; }
.table-toolbar .spacer{ flex:1; }
.table-scroll{ overflow-x:auto; }
table{ width:100%; border-collapse:collapse; font-size:13.5px; min-width:640px; }
thead th{ text-align:left; font-weight:600; color:var(--ink-soft); padding:11px 20px; font-size:12px; letter-spacing:.02em; border-bottom:1px solid var(--border); background:var(--surface-sunken); white-space:nowrap; }
tbody td{ padding:13px 20px; border-bottom:1px solid var(--border-soft); vertical-align:middle; }
tbody tr:last-child td{ border-bottom:none; }
tbody tr.clickable:hover{ background:var(--purple-tint); cursor:pointer; }
.cell-title{ font-weight:600; color:var(--ink); }
.cell-sub{ font-size:12px; color:var(--ink-faint); margin-top:2px; }
.cell-with-icon{ display:flex; align-items:center; gap:10px; }
.file-ico{ width:34px; height:34px; border-radius:8px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.file-ico svg{ width:16px; height:16px; }
.file-ico.pdf{ background:var(--red-tint); color:var(--red); }
.file-ico.doc{ background:var(--teal-tint); color:var(--teal-deep); }
.file-ico.xls{ background:var(--green-tint); color:var(--green); }
.file-ico.img{ background:var(--amber-tint); color:var(--amber); }
.file-ico.folder{ background:var(--purple-tint); color:var(--purple-deep); }
.table-foot{ display:flex; align-items:center; justify-content:space-between; padding:14px 20px; border-top:1px solid var(--border); font-size:12.5px; color:var(--ink-soft); flex-wrap:wrap; gap:10px; }
.pagination{ display:flex; gap:5px; }
.pagination button{ width:30px; height:30px; border-radius:8px; border:1px solid var(--border); background:var(--surface); color:var(--ink-soft); font-size:12.5px; }
.pagination button.active{ background:var(--purple); border-color:var(--purple); color:#fff; }
.pagination button:hover:not(.active){ background:var(--surface-sunken); }

.select-all-th{ width:36px; }
input[type=checkbox].tbl-check, input[type=radio].tbl-radio{ width:16px; height:16px; accent-color:var(--purple); }

/* =========================================================
   Badges / chips / status
   ========================================================= */
.badge{ display:inline-flex; align-items:center; gap:5px; padding:3px 10px; border-radius:99px; font-size:11.5px; font-weight:600; white-space:nowrap; }
.badge svg{ width:11px; height:11px; }
.badge.ok{ background:var(--green-tint); color:var(--green); }
.badge.warn{ background:var(--amber-tint); color:var(--amber); }
.badge.danger{ background:var(--red-tint); color:var(--red); }
.badge.info{ background:var(--purple-tint); color:var(--purple-deep); }
.badge.teal{ background:var(--teal-tint); color:var(--teal-deep); }
.badge.neutral{ background:var(--surface-sunken); color:var(--ink-soft); }
.dot-status{ width:8px; height:8px; border-radius:50%; display:inline-block; flex-shrink:0; }
.dot-status.ok{ background:var(--green); } .dot-status.warn{ background:var(--amber); }
.dot-status.danger{ background:var(--red); } .dot-status.neutral{ background:var(--ink-faint); }

/* =========================================================
   Tabs
   ========================================================= */
.tabs{ display:flex; gap:22px; border-bottom:1px solid var(--border); margin-bottom:22px; overflow-x:auto; }
.tab{
  padding:12px 2px; font-size:13.5px; font-weight:600; color:var(--ink-soft);
  border:none; background:none; border-bottom:2px solid transparent; white-space:nowrap;
}
.tab:hover{ color:var(--ink); text-decoration:none; }
.tab.active{ color:var(--purple-deep); border-bottom-color:var(--purple); }
.tabs.pill{ border-bottom:none; gap:8px; background:var(--surface-sunken); padding:4px; border-radius:11px; display:inline-flex; }
.tabs.pill .tab{ padding:8px 16px; border-radius:8px; border-bottom:none; }
.tabs.pill .tab.active{ background:var(--purple); color:var(--surface); box-shadow:var(--shadow-sm); }

/* =========================================================
   Breadcrumb / page header
   ========================================================= */
.page-header{ display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:22px; flex-wrap:wrap; }
.page-header .titles h1{ margin-bottom:4px; }
.settings-page-title{ display:flex; align-items:center; gap:14px; }
.settings-page-icon{ display:flex; align-items:center; justify-content:center; width:48px; height:48px; flex-shrink:0; border-radius:12px; background:var(--purple-tint); color:var(--purple-deep); }
.settings-page-icon svg{ width:26px; height:26px; }
.page-header .actions{ display:flex; gap:10px; flex-wrap:wrap; }
.breadcrumb{ display:flex; align-items:center; gap:6px; font-size:12.5px; color:var(--ink-faint); margin-bottom:8px; flex-wrap:wrap; }
.breadcrumb a{ color:var(--ink-faint); }
.breadcrumb a:hover{ color:var(--purple-deep); }
.breadcrumb svg{ width:12px; height:12px; }

/* =========================================================
   Timeline (activity / comments / email)
   ========================================================= */
.timeline{ display:flex; flex-direction:column; gap:0; }
.tl-item{ display:flex; gap:13px; padding:16px 0; border-bottom:1px solid var(--border-soft); }
.tl-item:last-child{ border-bottom:none; }
.tl-icon{ width:34px; height:34px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.tl-icon svg{ width:16px; height:16px; }
.tl-icon.comment{ background:var(--purple-tint); color:var(--purple-deep); }
.tl-icon.email-out{ background:var(--teal-tint); color:var(--teal-deep); }
.tl-icon.email-in{ background:var(--green-tint); color:var(--green); }
.tl-icon.system{ background:var(--surface-sunken); color:var(--ink-soft); }
.tl-icon.approve{ background:var(--green-tint); color:var(--green); }
.tl-body{ flex:1; min-width:0; }
.tl-head{ display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; }
.tl-who{ font-weight:600; font-size:13.5px; }
.tl-when{ font-size:12px; color:var(--ink-faint); }
.tl-type{ font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.03em; color:var(--ink-faint); }
.tl-text{ font-size:13.5px; color:var(--ink); margin-top:4px; }
.tl-meta-card{ margin-top:8px; border:1px solid var(--border); border-radius:10px; padding:10px 12px; background:var(--surface-sunken); font-size:12.5px; }
.tl-attach{ display:inline-flex; align-items:center; gap:7px; margin-top:8px; padding:6px 11px; border:1px solid var(--border); border-radius:8px; font-size:12.5px; background:var(--surface); }
.tl-attach svg{ width:14px; height:14px; color:var(--ink-faint); }

.composer{ display:flex; gap:12px; padding-top:16px; border-top:1px solid var(--border); margin-top:6px; }
.composer textarea{ min-height:64px; }
.composer-actions{ display:flex; justify-content:space-between; align-items:center; margin-top:8px; }
.composer-tools{ display:flex; gap:6px; }
.composer-tools button{ background:none; border:none; color:var(--ink-faint); padding:6px; border-radius:7px; }
.composer-tools button:hover{ background:var(--surface-sunken); color:var(--ink); }

/* =========================================================
   Progress / bars / steps
   ========================================================= */
.bar-track{ height:8px; border-radius:6px; background:var(--surface-sunken); overflow:hidden; }
.bar-fill{ height:100%; border-radius:6px; background:var(--purple); }
.bar-fill.teal{ background:var(--teal); } .bar-fill.green{ background:var(--green); } .bar-fill.amber{ background:var(--amber); } .bar-fill.red{ background:var(--red); }
.upload-queue-status{ max-width:180px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.upload-queue-failed{ color:var(--red); }
.upload-file-actions{ white-space:nowrap; min-width:76px; }
.upload-file-action{ width:30px; height:30px; display:inline-flex; align-items:center; justify-content:center; border:0; border-radius:7px; background:transparent; color:var(--ink-soft); cursor:pointer; vertical-align:middle; }
.upload-file-action:hover{ background:var(--surface-sunken); color:var(--purple); }
.upload-file-action:disabled{ opacity:.45; cursor:default; }
.upload-file-action:focus-visible{ outline:2px solid var(--purple); outline-offset:2px; }
.upload-file-action svg{ width:17px; height:17px; }
.upload-common-options > h3{display:flex;align-items:center;gap:12px;margin:0;padding-bottom:14px;border-bottom:1px solid var(--border-soft)}
.upload-common-options > .field,.upload-common-options #sectorMetadataFields > .field{margin:0;padding:14px 0;border-bottom:1px solid var(--border-soft)}
.upload-common-options > .field:has(> .upload-field-label){display:grid;grid-template-columns:36px minmax(0,1fr);column-gap:12px}
.upload-common-options .upload-field-label{display:contents}
.upload-common-options .upload-field-icon{grid-column:1;grid-row:1/span 2;align-self:start;width:36px;height:36px}
.upload-common-options .upload-field-label > span:last-child{grid-column:2;margin-bottom:6px}
.upload-common-options > .field:has(> .upload-field-label) > :not(label){grid-column:2}
.upload-field-icon svg{width:18px;height:18px}
.upload-expiry-panel .upload-expiry-date{max-width:280px;margin-bottom:14px}
.upload-expiry-option{padding:12px 0;border-top:1px solid var(--border)}
.upload-expiry-option .workflow-reminder-switch{align-items:center}
.upload-expiry-option:has(input:disabled){opacity:.5}
.upload-expiry-panel .reminder-delivery-note{margin-top:4px}
.upload-processing-options .switch-row{display:grid;grid-template-columns:36px minmax(0,1fr) auto;gap:12px;align-items:start}
.upload-processing-options .switch-row > .switch{align-self:center}
.upload-processing-options .txt{min-width:0}
.upload-processing-note{display:flex;align-items:flex-start;gap:12px;margin:0;padding:13px 0;font-size:12.5px;color:var(--ink-soft)}
.upload-processing-note-icon{display:flex;flex-shrink:0;margin-top:1px;color:var(--purple-deep)}
.upload-processing-note-icon svg{width:18px;height:18px}

.steps{ display:flex; align-items:flex-start; }
.step{ flex:1; text-align:center; position:relative; }
.step .circle{
  width:30px; height:30px; border-radius:50%; background:var(--surface-sunken); color:var(--ink-faint);
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px;
  margin:0 auto 8px; border:2px solid var(--surface-sunken);
}
.step.done .circle{ background:var(--green); border-color:var(--green); color:#fff; }
.step.current .circle{ background:var(--purple); border-color:var(--purple); color:#fff; }
.step .label{ font-size:12px; color:var(--ink-soft); font-weight:600; }
.step .line{ position:absolute; top:15px; left:calc(-50% + 15px); width:calc(100% - 30px); height:2px; background:var(--surface-sunken); z-index:0; }
.step:first-child .line{ display:none; }
.step.done .line, .step.current .line{ background:var(--green); }

/* =========================================================
   Modals
   ========================================================= */
.modal-backdrop{ position:fixed; inset:0; background:rgba(36,30,82,.4); display:flex; align-items:center; justify-content:center; padding:20px; z-index:50; }
.modal{ background:var(--surface); border-radius:var(--radius-m); box-shadow:var(--shadow-md); width:100%; max-width:900px; max-height:88vh; display:flex; flex-direction:column; overflow:hidden; }
/* Nested forms must shrink with the dialog so only the body scrolls. */
.modal > form{ display:flex; flex-direction:column; flex:1; min-height:0; overflow:hidden; }
.modal-head{ display:flex; align-items:center; justify-content:space-between; padding:18px 22px; border-bottom:1px solid var(--border); flex-shrink:0; }
.modal-head h3{ font-size:16.5px; }
.modal-close{
  display:inline-flex; align-items:center; justify-content:center; flex-shrink:0;
  width:36px; height:36px; padding:0; border-radius:7px;
  background:none; border:none; color:var(--ink-soft);
  font-size:28px; font-weight:700; line-height:1;
}
.modal-close:hover{ background:var(--surface-sunken); color:var(--ink); }
.modal-body{ flex:1; min-height:0; padding:20px 22px; overflow-y:auto; }
.modal-foot{ display:flex; justify-content:flex-end; flex-wrap:wrap; gap:10px; padding:16px 22px; border-top:1px solid var(--border); flex-shrink:0; }

/* Keep workspace permissions in distinct lists with room for three group rows. */
.workspace-access-list{
  margin-top:12px; border:1px solid var(--border); border-radius:10px;
  background:var(--surface); overflow-y:auto; scrollbar-gutter:stable;
  scrollbar-width:thin; scrollbar-color:var(--border) var(--surface-sunken);
}
.workspace-group-access{ --grant-row-height:90px; max-height:calc(3 * var(--grant-row-height) + 2px); }
.workspace-group-access .workspace-group-access-row{
  display:flex; flex-direction:column; justify-content:center; gap:6px;
  height:var(--grant-row-height); padding:10px 12px; margin:0; line-height:18px;
}
.workspace-group-access-row + .workspace-group-access-row{ border-top:1px solid var(--border-soft); }
.workspace-group-access-row > span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.workspace-group-access-row select{ flex-shrink:0; }
.workspace-user-access{ max-height:134px; }
.workspace-user-access .checkbox-row{ display:flex; align-items:center; min-height:44px; padding:10px 12px; margin:0; }
.workspace-user-access .checkbox-row + .checkbox-row{ border-top:1px solid var(--border-soft); }
.workspace-user-access .checkbox-row input{ margin-top:0; }
.workspace-access-list::-webkit-scrollbar{ width:8px; }
.workspace-access-list::-webkit-scrollbar-track{ background:var(--surface-sunken); border-radius:10px; }
.workspace-access-list::-webkit-scrollbar-thumb{ background:var(--border); border:2px solid var(--surface-sunken); border-radius:10px; }

/* Workspace collection icon choices use the same soft palette as collection cards. */
.icon-color-field{ border:0; padding:0; margin:0 0 18px; min-width:0; }
.icon-color-field legend{ color:var(--ink); font-size:13px; font-weight:600; margin-bottom:9px; padding:0; }
.icon-color-options{ display:flex; flex-wrap:wrap; gap:8px; }
.icon-color-option{ position:relative; display:inline-flex; cursor:pointer; }
.icon-color-option input{ position:absolute; width:1px; height:1px; opacity:0; }
.icon-color-swatch{ display:flex; align-items:center; justify-content:center; width:32px; height:32px; border-radius:50%; border:2px solid transparent; background:var(--purple-tint); color:var(--purple-deep); transition:box-shadow .15s ease, transform .15s ease; }
.icon-color-swatch svg{ width:16px; height:16px; }
.icon-color-swatch.teal{ background:var(--teal-tint); color:var(--teal-deep); }
.icon-color-swatch.amber{ background:var(--amber-tint); color:var(--amber); }
.icon-color-swatch.green{ background:var(--green-tint); color:var(--green); }
.icon-color-swatch.blue{ background:#E8F1FC; color:#4778B7; }
.icon-color-swatch.rose{ background:#F9EAF1; color:#B45F88; }
.icon-color-option input:checked + .icon-color-swatch{ box-shadow:0 0 0 2px var(--surface), 0 0 0 4px currentColor; }
.icon-color-option input:focus-visible + .icon-color-swatch{ outline:2px solid var(--ink); outline-offset:5px; }
.icon-color-option:hover .icon-color-swatch{ transform:translateY(-2px); }

/* =========================================================
   Empty / misc states
   ========================================================= */
.empty-state{ text-align:center; padding:60px 20px; color:var(--ink-soft); }
.empty-state .ico{ width:56px; height:56px; border-radius:16px; background:var(--purple-tint); color:var(--purple-deep); display:flex; align-items:center; justify-content:center; margin:0 auto 18px; }
.empty-state .ico svg{ width:26px; height:26px; }
.empty-state h3{ margin-bottom:6px; color:var(--ink); }
.empty-state p{ max-width:360px; margin:0 auto 18px; }

.upload-drop{
  border:2px dashed var(--border); border-radius:var(--radius-m); padding:40px 20px; text-align:center;
  background:var(--surface-sunken);
}
.upload-drop .ico{ width:50px; height:50px; border-radius:14px; background:var(--purple-tint); color:var(--purple-deep); display:flex; align-items:center; justify-content:center; margin:0 auto 14px; }
.upload-drop .ico svg{ width:24px; height:24px; }
.upload-drop strong{ display:block; margin-bottom:4px; }
.upload-drop p{ font-size:12.5px; margin-bottom:16px; }

.kv-list{ display:flex; flex-direction:column; gap:0; }
.kv-row{ display:flex; justify-content:space-between; gap:14px; padding:11px 0; border-bottom:1px solid var(--border-soft); font-size:13.5px; }
.kv-row:last-child{ border-bottom:none; }
.kv-row .k{ color:var(--ink-soft); flex-shrink:0; }
.kv-row .v{ font-weight:600; text-align:right; }

.tag-list{ display:flex; flex-wrap:wrap; gap:7px; }
.static-tag{ background:var(--surface-sunken); border-radius:7px; padding:4px 10px; font-size:12px; font-weight:500; color:var(--ink-soft); }

.divider{ height:1px; background:var(--border); border:none; margin:20px 0; }

/* helper layout */
.grid-2{ display:grid; grid-template-columns:2fr 1fr; gap:22px; align-items:start; }
.card-grid{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.stack{ display:flex; flex-direction:column; gap:18px; }
.flex-between{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.flex-center-gap{ display:flex; align-items:center; gap:10px; }
.muted{ color:var(--ink-soft); }
.faint{ color:var(--ink-faint); }
.text-sm{ font-size:12.5px; }
.mt-0{ margin-top:0; } .mb-0{ margin-bottom:0; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width:1180px){
  .summary-row{ grid-template-columns:repeat(2,1fr); }
  .grid-2{ grid-template-columns:1fr; }
  .auth-shell{ grid-template-columns:1fr; }
  .auth-visual{ display:none; }
}
@media (max-width:900px){
  .card-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .shell{ grid-template-columns:1fr; grid-template-areas:"topbar" "main" "footer"; }
  .sidebar{ position:fixed; top:0; left:0; bottom:0; width:var(--sidebar-w); transform:translateX(-100%); transition:transform .2s ease; z-index:40; }
  .sidebar.open{ transform:translateX(0); }
  .overlay.show{ display:block; }
  .menu-toggle{ display:flex; }
  .search-box{ display:none; }
  .form-row,.form-row-3{ grid-template-columns:1fr; }
}
@media (max-width:600px){
  .card-grid{ grid-template-columns:minmax(0,1fr); }
  header.topbar{ padding:0 16px; }
  main{ padding:18px 16px 22px; }
  footer.app-footer{ padding:12px 16px; }
  .summary-row{ grid-template-columns:1fr 1fr; }
  .page-header{ flex-direction:column; align-items:stretch; }
  .table-toolbar .search-box{ width:100%; }
}

/* =========================================================
   Error pages (bare layout, no tenant/session dependency)
   ========================================================= */
.err-main{ align-items:center; }
.err-card{ --tone:var(--purple-deep); --tone-bg:var(--purple-tint);
  width:100%; max-width:520px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-m);
  box-shadow:var(--shadow-sm); padding:40px 36px 28px; text-align:center; border-top:4px solid var(--tone); }
.err-card.tone-amber{ --tone:var(--amber); --tone-bg:var(--amber-tint); }
.err-card.tone-red{ --tone:var(--red); --tone-bg:#FBE9E7; }
.err-card.tone-teal{ --tone:var(--teal-deep); --tone-bg:var(--teal-tint); }
.err-ico{ width:60px; height:60px; border-radius:18px; background:var(--tone-bg); color:var(--tone); display:flex; align-items:center; justify-content:center; margin:0 auto 14px; }
.err-ico svg{ width:28px; height:28px; }
.err-code{ font-family:'Sora',sans-serif; font-weight:700; font-size:64px; line-height:1; letter-spacing:-1px; color:var(--tone); margin-bottom:10px; }
.err-title{ font-size:21px; margin:0 0 8px; color:var(--ink); }
.err-text{ color:var(--ink-soft); margin:0 auto 20px; max-width:400px; line-height:1.55; }
.err-actions{ display:flex; gap:10px; justify-content:center; flex-wrap:wrap; margin-top:6px; }
.err-actions .btn[disabled]{ opacity:.5; cursor:not-allowed; }
.err-search{ display:flex; align-items:center; gap:8px; border:1px solid var(--border); background:var(--bg); border-radius:10px; padding:0 12px; height:40px; margin:0 auto 18px; max-width:380px; }
.err-search svg{ width:16px; height:16px; color:var(--ink-faint); flex-shrink:0; }
.err-search input{ min-width:0; border:none; background:none; outline:none; flex:1; font:inherit; color:var(--ink); }
.err-note{ text-align:left; margin:0 auto 18px; max-width:400px; }
.err-ref{ display:flex; align-items:center; justify-content:space-between; gap:12px; text-align:left; background:var(--bg); border:1px solid var(--border-soft); border-radius:10px; padding:10px 14px; margin:0 auto 18px; max-width:400px; }
.err-ref .lbl{ font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--ink-faint); margin-bottom:2px; }
.err-ref code{ font-size:13px; color:var(--ink); }
.err-help{ font-size:13px; color:var(--ink-soft); margin:0 0 18px; }
.err-maint{ text-align:left; border:1px solid var(--border-soft); border-radius:10px; margin:0 auto 18px; max-width:400px; }
.err-maint .row{ display:flex; justify-content:space-between; align-items:center; padding:10px 14px; font-size:13px; color:var(--ink-soft); }
.err-maint .row + .row{ border-top:1px solid var(--border-soft); }
.err-maint b{ color:var(--ink); }
.err-meta{ margin-top:22px; padding-top:14px; border-top:1px solid var(--border-soft); font-size:12px; color:var(--ink-faint); }
@media (max-width:560px){ .err-card{ padding:30px 20px 22px; } .err-code{ font-size:52px; } }

/* Dashboard storage usage. */
.dashboard-storage-progress{display:block;width:100%;height:8px;margin:4px 0 7px;border:0;border-radius:999px;overflow:hidden;background:var(--surface-alt, #ece9e3);appearance:none;}
.dashboard-storage-progress::-webkit-progress-bar{background:#ece9e3;border-radius:999px;}
.dashboard-storage-progress::-webkit-progress-value{background:var(--primary, #8b7bea);border-radius:999px;}
.dashboard-storage-progress::-moz-progress-bar{background:var(--primary, #8b7bea);border-radius:999px;}
.dashboard-storage-labels{display:flex;justify-content:space-between;gap:12px;font-size:10px;color:var(--ink);}

/* Roles and permissions: role navigation and compact permission matrix. */
.roles-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:18px;align-items:start;}
.roles-layout .stack,.role-permissions-card{min-width:0;}
.role-directory{padding:16px;}
.role-directory-heading{display:flex;gap:12px;align-items:flex-start;margin:2px 2px 18px;}
.role-directory-heading p,.role-permissions-heading p{font-size:12px;margin:5px 0 0;color:var(--ink-soft);}
.role-directory-icon{display:flex;align-items:center;justify-content:center;width:34px;height:34px;flex:0 0 34px;border-radius:var(--radius-s);background:var(--purple-tint);color:var(--purple-deep);}
.role-directory-icon svg{width:23px;height:23px;}
.role-directory-list{border:1px solid var(--border-soft);border-radius:var(--radius-s);overflow:hidden;}
.role-directory-labels,.role-directory-row{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.3fr) 16px;gap:12px;align-items:center;padding:13px 14px;}
.role-directory-labels{background:var(--surface-sunken);font-size:12px;color:var(--ink-soft);}
.role-directory-row{position:relative;min-height:54px;border-top:1px solid var(--border-soft);color:var(--ink);font-size:12px;}
.role-directory-row:hover{background:var(--purple-tint);text-decoration:none;}
.role-directory-row:focus-visible{outline:2px solid var(--purple-deep);outline-offset:-3px;}
.role-directory-row.is-selected{background:var(--purple-tint);box-shadow:inset 3px 0 var(--purple);color:var(--purple-deep);}
.role-directory-name{font-weight:600;overflow-wrap:anywhere;}
.role-directory-description{color:var(--ink-soft);}
.role-directory-chevron svg{display:block;width:16px;height:16px;}
.role-permissions-card{padding:20px;}
.role-permissions-heading{margin-bottom:16px;}
.role-permissions-title{display:flex;align-items:center;gap:12px;flex-wrap:wrap;}
.role-scope-badge{display:inline-block;padding:3px 10px;border-radius:999px;font-size:11px;font-weight:500;background:var(--purple-tint);color:var(--purple-deep);}
.role-permission-matrix th,.role-permission-matrix td{padding:8px 10px;font-size:12px;}
.role-permission-matrix th:not(:first-child),.role-permission-matrix td:not(:first-child){text-align:center;}
.role-permission-matrix th:first-child{min-width:145px;}
.role-module{display:flex;align-items:center;gap:10px;white-space:nowrap;}
.role-module-icon{display:flex;color:var(--ink-soft);}
.role-module-icon svg{width:18px;height:18px;}
.role-permission-matrix .tbl-check{width:16px;height:16px;margin:0;vertical-align:middle;accent-color:var(--purple);}
.role-permissions-notice{display:flex;gap:10px;align-items:flex-start;background:var(--purple-tint);border-radius:var(--radius-s);padding:12px 14px;margin-top:14px;font-size:12px;}
.role-notice-icon{display:flex;color:var(--purple-deep);flex:0 0 21px;}
.role-notice-icon svg{width:21px;height:21px;}
.role-permissions-notice strong{display:block;margin-bottom:3px;}
.role-permissions-notice p{font-size:11px;color:var(--ink-soft);margin:0;}
.role-permissions-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap;margin-top:14px;}
.role-permissions-actions .btn{font-size:12px;}
@media(max-width:1100px){.roles-layout{grid-template-columns:minmax(0,1fr);}}
@media(max-width:560px){.role-directory,.role-permissions-card{padding:12px;}.role-directory-labels,.role-directory-row{padding:11px 10px;gap:8px;}.role-permissions-actions .btn{flex:1 1 auto;}}

/* Master processing switch preserves configuration while making inactive controls clear. */
.processing-dependent{border:0;padding:0;margin:0;min-width:0;}
.processing-dependent:disabled{opacity:.55;}
.processing-dependent:disabled .switch{cursor:not-allowed;}

/* Processing configuration forms have their own tabs and independently saved editors. */
.processing-feature-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 18px;margin:12px 0;}
.processing-feature-options label{display:flex;align-items:center;gap:8px;font-size:13px;}
.processing-feature-options input{flex:0 0 18px;width:18px;height:18px;accent-color:var(--purple);}
.processing-config-editor>summary{display:flex;align-items:center;justify-content:space-between;gap:16px;cursor:pointer;list-style:none;}
.processing-config-editor>summary::-webkit-details-marker{display:none;}
.processing-config-summary{display:flex;align-items:center;gap:16px;color:var(--ink-soft);font-size:12px;}
.processing-config-body{border-top:1px solid var(--border-soft);padding-top:18px;margin-top:18px;}
.processing-config-actions{display:flex;justify-content:flex-end;margin-top:18px;}
@media(max-width:600px){.processing-feature-options{grid-template-columns:1fr;}}

.processing-config-editor>summary .cell-sub{display:block;margin-top:3px;}

/* AI connector fields fit inside the existing integration dialog; actions remain visible. */
#integration-modal .modal > form{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;}
#integration-modal .modal-body{flex:1;min-height:0;}

/* Email template formatting toolbar, shared with WitsTechAdmin. */
.email-editor-toolbar{flex-wrap:wrap;padding:6px 8px;}
.email-editor-toolbar select{width:auto;min-width:128px;padding:7px 28px 7px 12px;font-size:12.5px;}
.email-editor-toolbar .email-editor-tool{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:7px;}
.email-editor-tool svg{width:18px;height:18px;flex-shrink:0;}
.email-editor-tool[aria-pressed=true]{background:var(--purple-tint);color:var(--purple);}
.email-editor-tool:focus-visible{outline:2px solid var(--purple);outline-offset:1px;}
.email-editor-tool:disabled{opacity:.4;cursor:default;}
.email-editor-divider{height:22px;flex-shrink:0;}
.email-editor[hidden]{display:none;}
.email-editor-source{width:100%;height:240px;font-family:monospace;white-space:pre;}
.email-editor h1,.email-editor h2,.email-editor h3{margin:8px 0;}
.email-editor blockquote{margin:8px 0;padding-left:16px;border-left:3px solid var(--border);}
#template-modal .modal > form{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;}
#template-modal .modal-body{flex:1;min-height:0;}

.email-editor-frame{display:block;width:100%;height:440px;max-height:none;padding:0;}

.storage-settings{display:grid;gap:22px;margin-top:22px;}.storage-card-body{padding:0 22px 22px;}.storage-settings .card-head{padding:22px;}.storage-settings .form-grid.two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;}.storage-settings [hidden]{display:none!important;}.storage-pending{margin-top:22px;padding-top:22px;border-top:1px solid var(--border);}.storage-settings input,.storage-settings select,.storage-settings textarea{width:100%;}.storage-settings input[type=checkbox]{width:auto;}@media(max-width:700px){.storage-settings .form-grid.two{grid-template-columns:1fr;}}

.storage-settings .notice{padding:12px;background:var(--purple-tint);border-radius:8px;}

/* Shared page images never expose an original PDF download. */
.share-preview-card{min-height:280px;display:flex;align-items:center;justify-content:center;margin-bottom:16px;text-align:center;}
.pdf-page-viewer{width:100%;min-width:0;}.pdf-page-controls{display:flex;align-items:center;justify-content:center;gap:16px;flex-wrap:wrap;margin-bottom:16px;}
.share-page-image{display:block;max-width:100%;height:auto;margin:0 auto;}.pdf-page-controls span{font-size:13px;color:var(--ink-soft);}

/* Row actions use the browser top layer so table scrolling cannot clip them. */
.row-actions-trigger{ display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; border:0; border-radius:6px; background:transparent; color:var(--ink-soft); cursor:pointer; }
.row-actions-trigger:hover,.row-actions-trigger:focus-visible{ background:var(--surface-sunken); color:var(--ink); }
.row-actions-trigger svg{ width:20px; height:20px; fill:currentColor; }
.row-actions-menu{ position:fixed; inset:auto; margin:0; padding:6px; min-width:200px; border:1px solid var(--border); border-radius:9px; background:var(--surface); color:var(--ink); box-shadow:var(--shadow-md); }
.row-actions-menu a,.row-actions-menu button{ display:flex; align-items:center; gap:10px; width:100%; padding:10px 12px; border:0; border-radius:5px; background:none; color:inherit; font:inherit; font-size:13px; text-align:left; text-decoration:none; cursor:pointer; white-space:nowrap; }
.row-actions-menu a:hover,.row-actions-menu button:hover,.row-actions-menu a:focus-visible,.row-actions-menu button:focus-visible{ background:var(--surface-sunken); }
.row-actions-menu .danger{ color:var(--red); }
.row-actions-menu svg{ width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; flex-shrink:0; }

/* Integration name fills spare space; metadata and right-aligned actions stay fixed. */
.integrations-table{table-layout:fixed;min-width:800px;}
.integrations-table .integration-type-col{width:180px;}
.integrations-table .integration-status-col{width:140px;}
.integrations-table .integration-test-col{width:150px;}
.integrations-table .integration-actions-col{width:90px;}
.integrations-table th:last-child,.integrations-table td:last-child{text-align:right;}
.integrations-table td:first-child{overflow-wrap:anywhere;}

/* Reusable table lists: filters, sort links, row actions and pagination.
   Add data-table to the table-card wrapper to opt into the shared toolbar layout. */
.data-table .table-toolbar .filter-search{ display:flex; flex:2 1 260px; width:auto; min-width:220px; padding:4px 4px 4px 12px; background:var(--surface); border:1px solid var(--border); border-radius:9px; }
.data-table .filter-search:focus-within{ border-color:var(--purple); box-shadow:0 0 0 3px var(--purple-tint); }
.data-table .filter-search input[type=search]{ flex:1; min-width:0; width:0; padding:8px 0; border:0; background:none; box-shadow:none; }
.data-table .filter-search-submit{ display:flex; align-items:center; justify-content:center; flex:0 0 36px; height:36px; padding:0; border:0; border-radius:6px; background:transparent; color:var(--ink-soft); cursor:pointer; }
.data-table .filter-search-submit:hover{ background:var(--purple); color:#fff; }
.data-table .filter-search-submit:focus-visible{ outline:2px solid var(--purple); outline-offset:1px; }
.data-table .filter-search-submit svg{ color:inherit; }
.data-table .table-toolbar > select{ flex:1 1 130px; width:auto; min-width:0; }
.data-table .table-toolbar > select[name=per_page]{ flex:0 0 74px; }
.data-table .table-toolbar > .tabs{ margin-bottom:0; flex-shrink:0; }
.data-table .filter-status,.sharing-document-dialog .filter-status{ display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 20px; background:var(--green-tint); border-bottom:1px solid var(--border); color:var(--ink-soft); font-size:11px; }
.data-table .filter-status a,.sharing-document-dialog .filter-status a{ margin-left:auto; color:var(--purple-deep); text-decoration:none; white-space:nowrap; }
.data-table .column-sort{ display:inline-flex; align-items:center; gap:7px; color:inherit; text-decoration:none; }
.data-table .column-sort:hover{ color:var(--purple-deep); }
.data-table .column-sort:focus-visible{ outline:2px solid var(--purple); outline-offset:4px; border-radius:2px; }
.data-table .sort-indicator{ color:var(--ink-faint); font-size:11px; }
.data-table .column-sort.is-sorted .sort-indicator{ color:var(--purple-deep); }
.data-table .table-actions{ text-align:right; }
.data-table .row-actions-trigger:disabled{ opacity:.4; cursor:default; }
.table-pagination{ align-items:center; flex-wrap:wrap; }
.table-pagination .page-link{ display:inline-flex; align-items:center; justify-content:center; min-width:30px; height:30px; padding:0 7px; border-radius:8px; border:1px solid var(--border); background:var(--surface); color:var(--ink-soft); font-size:12.5px; text-decoration:none; }
.table-pagination .page-link.active{ background:var(--purple); border-color:var(--purple); color:#fff; }
.table-pagination a.page-link:hover:not(.active){ background:var(--surface-sunken); }
.table-pagination a.page-link:focus-visible{ outline:2px solid var(--purple); outline-offset:2px; }
.table-pagination .page-link.disabled{ opacity:.5; }
.table-pagination .page-gap{ padding:0 3px; }
@media(max-width:900px){
  .data-table .table-toolbar{ flex-direction:column; align-items:stretch; }
  .data-table .table-toolbar > .tabs{ align-self:flex-start; }
  .data-table .table-toolbar .filter-search,.data-table .table-toolbar > select,.data-table .table-toolbar > select[name=per_page]{ flex:0 0 auto; width:100%; min-width:0; }
}

/* Extraction fields reuse the library table and notification information card. */
.extraction-fields-info{ margin-bottom:20px; }
.extraction-fields-heading{ align-items:center; gap:12px; flex-wrap:wrap; }
.extraction-field-code{ margin-top:0; overflow-wrap:anywhere; }
#extractionFieldsTable table{ min-width:850px; }
.extraction-field-drawer{ position:fixed; inset:0 0 0 auto; margin:0; padding:0; border:0; border-left:1px solid var(--border); width:min(540px, 100%); max-width:100%; height:100dvh; max-height:100dvh; background:var(--surface); color:var(--ink); box-shadow:var(--shadow-md); }
.extraction-field-drawer[open]{ display:flex; flex-direction:column; }
.extraction-field-drawer::backdrop{ background:rgba(36,30,82,.4); }
.extraction-field-drawer .form-row{ display:flex; flex-direction:column; }
.extraction-field-drawer .modal-close{ text-decoration:none; }
@media(max-width:600px){
  .extraction-fields-heading .btn{ width:100%; justify-content:center; }
  .extraction-fields-info{ padding:16px; gap:12px; }
  .extraction-fields-info > div{ padding-left:12px; }
}
#processingProfilesTable table{ min-width:950px; }
#processingProfilesTable .profile-features{ margin-top:0; max-width:280px; white-space:normal; }
#processingProfilesTable .profile-type-fallback{ display:block; }
#documentTypesTable table{ min-width:650px; }
#documentTypesTable .document-type-sector{ display:block; }
/* Keep document type metadata together; names and sources share the remaining width. */
#documentTypesTable table{ table-layout:fixed; }
#documentTypesTable .type-status-column{ width:110px; }
#documentTypesTable .type-updated-column{ width:210px; }
#documentTypesTable .type-actions-column{ width:80px; }
#documentTypesTable td:nth-child(-n+2){ overflow-wrap:anywhere; }
#documentTypesTable .document-type-updated > span{ display:block; }
#documentTypesTable .document-type-updated > span:first-child{ white-space:nowrap; font-size:12px; }
#processingRulesTable table{ table-layout:fixed; min-width:1050px; }
#processingRulesTable td:first-child,#processingRulesTable td:nth-child(3){ overflow-wrap:anywhere; }
#processingRulesTable .rule-type-fallback,#processingRulesTable .processing-rule-updated > span{ display:block; }
#processingRulesTable .processing-rule-updated > span:first-child{ white-space:nowrap; font-size:12px; }
nav[aria-label="Processing settings sections"]{ max-width:100%; }

/* Processing configuration tables reserve only the three trailing metadata columns. */
:is(#processingProfilesTable,#extractionFieldsTable,#processingRulesTable) table{ table-layout:fixed; }
:is(#processingProfilesTable,#extractionFieldsTable,#processingRulesTable) .processing-status-column{ width:110px; }
:is(#processingProfilesTable,#extractionFieldsTable,#processingRulesTable) .processing-updated-column{ width:210px; }
:is(#processingProfilesTable,#extractionFieldsTable,#processingRulesTable) .processing-actions-column{ width:80px; }
:is(#processingProfilesTable,#extractionFieldsTable,#processingRulesTable) td:nth-child(-n+4){ overflow-wrap:anywhere; }
.processing-config-updated > span{ display:block; }
.processing-config-updated > span:first-child{ white-space:nowrap; font-size:12px; }

.extraction-field-drawer .processing-config-actions{ gap:10px; flex-wrap:wrap; }
/* Current-revision processing review stays inside the document details tab. */
.document-processing-review section + section{ margin-top:22px; padding-top:18px; border-top:1px solid var(--border); }
.document-processing-review h3{ margin-bottom:10px; }
.document-processing-review .processing-status-line{ display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin:10px 0; }
.document-processing-review .processing-values table{ min-width:560px; }
.document-processing-review .processing-values td{ vertical-align:top; }
.processing-value-note{ display:block; }
.processing-value-text{ max-width:240px; overflow-wrap:anywhere; white-space:pre-wrap; }
.processing-value-form{ min-width:180px; }
.processing-value-actions{ display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.document-processing-review .processing-summary{ background:var(--purple-tint); border:1px solid var(--border); border-radius:8px; padding:14px; margin:10px 0; }
.document-processing-review .processing-output p{ overflow-wrap:anywhere; }

.processing-output{ padding:16px 0; border-top:1px solid var(--border); }

/* Document preview actions share a row and wrap as space becomes available. */
.document-preview-footer{ display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; margin-top:14px; }
.document-preview-links,.document-preview-processing{ display:flex; align-items:center; flex-wrap:wrap; gap:10px; min-width:0; }
.document-preview-processing{ margin-left:auto; }
.processing-evidence{ margin-top:6px; overflow-wrap:anywhere; }
.processing-evidence summary{ cursor:pointer; color:var(--purple); }

.summary-approved-text,.summary-comparison p{ white-space:pre-wrap; overflow-wrap:anywhere; }
.summary-approved-text{ max-height:18rem; overflow:auto; }
.summary-history{ margin-top:12px; }
.summary-history summary{ cursor:pointer; }
.summary-comparison{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
@media(max-width:640px){ .summary-comparison{ grid-template-columns:1fr; } }

/* Processing confirmation reuses the shared modal, notices and document checkbox. */
#requestDocumentProcessing{ backdrop-filter:blur(4px); }
#requestDocumentProcessing .modal{ max-width:1000px; }
#requestDocumentProcessing .modal-head,#requestDocumentProcessing .modal-foot{ padding:20px 26px; }
#requestDocumentProcessing .modal-head h3,#requestDocumentProcessing .processing-confirm-document{ font-size:22px; color:var(--ink); }
#requestDocumentProcessing .modal-body{ padding:22px 26px; }
#requestDocumentProcessing .modal-foot .btn{ font-size:15px; padding:10px 20px; }
.processing-confirm-meta{ display:flex; flex-wrap:wrap; align-items:center; gap:12px 24px; font-size:15px; }
.processing-confirm-meta>span{ display:inline-flex; align-items:center; flex-wrap:wrap; gap:8px; min-width:0; overflow-wrap:anywhere; }
.processing-confirm-meta>span+span{ border-left:1px solid var(--border); padding-left:24px; }
.processing-confirm-meta svg{ width:22px; height:22px; flex-shrink:0; }
.processing-confirm-meta strong{ color:var(--ink); }
#requestDocumentProcessing .alert{ margin-bottom:0; }
#requestDocumentProcessing .processing-confirm-preservation{ border-color:var(--purple); gap:18px; }
#requestDocumentProcessing .processing-confirm-preservation>svg{ width:28px; height:28px; }
#requestDocumentProcessing .processing-confirm-preservation>div{ border-color:var(--purple); }
#requestDocumentProcessing .processing-confirm-preservation p{ margin:0; font-size:15px; line-height:1.5; color:var(--ink); }
#requestDocumentProcessing .processing-confirm-cost{ align-items:center; gap:18px; font-size:14px; padding:14px 20px; }
#requestDocumentProcessing .processing-confirm-cost svg{ width:24px; height:24px; margin-top:0; }
#requestDocumentProcessing .processing-confirm-cost strong{ border-left:1px solid var(--amber); padding-left:18px; color:var(--ink); }
.processing-confirm-check{ align-items:center; font-size:16px; }
@media(max-width:600px){
    #requestDocumentProcessing .modal-head,#requestDocumentProcessing .modal-body,#requestDocumentProcessing .modal-foot{ padding:16px; }
    #requestDocumentProcessing .modal-head h3,#requestDocumentProcessing .processing-confirm-document{ font-size:18px; }
    .processing-confirm-meta{ flex-direction:column; align-items:flex-start; }
    .processing-confirm-meta>span+span{ border-left:0; padding-left:0; }
    #requestDocumentProcessing .notification-info{ gap:12px; padding:16px; }
    #requestDocumentProcessing .notification-info>div{ padding-left:12px; }
}

/* Collection cards reuse shared card, menu, modal and icon palette styles. */
.workspace-collection-new{ margin:16px 0; }
.workspace-collections-grid{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin-bottom:24px; }
.workspace-collection-card{ position:relative; }
.workspace-collection-link{ display:block; color:inherit; text-decoration:none; }
.workspace-collection-link:hover{ text-decoration:none; }
.workspace-collection-title{ margin-top:12px; padding-right:22px; overflow-wrap:anywhere; }
.workspace-collection-ancestors{ font-weight:400; }
.workspace-collection-actions{ position:absolute; top:14px; right:14px; }
@media(max-width:1100px){ .workspace-collections-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:520px){ .workspace-collections-grid{ grid-template-columns:1fr; } }

.workspace-archive-button,.search-advanced-toggle,.search-save-panel .btn-secondary,.search-delete-saved,#addWorkflowStep,.sd-viewer-footer [data-page-next]:enabled,.sd-viewer-footer [data-page-previous]:enabled,.document-preview-links > a:first-child{ background:var(--surface-sunken); }
.workspace-archive-button:hover,.search-advanced-toggle:hover,.search-save-panel .btn-secondary:hover,.search-delete-saved:hover,#addWorkflowStep:hover,.sd-viewer-footer [data-page-next]:enabled:hover,.sd-viewer-footer [data-page-previous]:enabled:hover,.document-preview-links > a:first-child:hover{ background:var(--surface); }

/* Collection deletion uses the shared modal and danger notice components. */
#deleteCollection .modal{ max-width:960px; }
#deleteCollection .modal-head{ justify-content:flex-start; gap:18px; padding:20px 26px; background:color-mix(in srgb,var(--red-tint) 55%,var(--surface)); }
#deleteCollection .modal-head h3{ margin-right:auto; font-size:21px; }
#deleteCollection .collection-delete-icon{ width:44px; height:44px; border-radius:50%; }
#deleteCollection .collection-delete-icon svg{ width:24px; height:24px; }
#deleteCollection .modal-close{ border:1px solid var(--border); background:var(--surface); }
#deleteCollection .modal-body{ padding:24px 26px; }
#deleteCollection .collection-delete-question{ font-size:23px; font-weight:400; }
.collection-delete-subtitle{ margin:8px 0 0; font-size:16px; }
#deleteCollection .collection-delete-notice{ margin:0; gap:22px; border-color:var(--red-tint); color:var(--ink); }
#deleteCollection .collection-delete-notice>svg{ width:30px; height:30px; margin:0; }
#deleteCollection .collection-delete-notice>div{ border-color:var(--border); }
.collection-delete-notice ul{ margin:0; padding-left:20px; font-size:15px; line-height:1.7; }
.collection-delete-notice li::marker{ color:var(--red); }
#deleteCollection .modal-foot{ padding:18px 26px; }
#deleteCollection .modal-foot .btn{ font-size:15px; padding:10px 18px; }
@media(max-width:600px){
    #deleteCollection .modal-head,#deleteCollection .modal-body,#deleteCollection .modal-foot{ padding:16px; }
    #deleteCollection .modal-head h3{ font-size:18px; }
    #deleteCollection .collection-delete-question{ font-size:20px; }
    #deleteCollection .collection-delete-notice{ padding:16px; gap:12px; }
    #deleteCollection .collection-delete-notice>div{ padding-left:12px; }
}

/* Search results: shared inputs and result typography retain their existing styles. */
.search-layout{ display:grid; grid-template-columns:minmax(0,1fr); gap:22px; align-items:start; }
.search-layout.search-filters-open{ grid-template-columns:minmax(0,1fr) 360px; }
.search-main{ min-width:0; display:grid; gap:24px; }
.search-query-card{ display:grid; gap:20px; }
.search-mode-buttons{ display:flex; flex-wrap:wrap; gap:0; }
.search-mode-buttons .btn{ padding:12px 20px; }
.search-mode-buttons svg,.search-query-input>svg,.search-panel-heading svg{ width:22px; height:22px; flex-shrink:0; }
.search-query-input{ display:flex; align-items:center; gap:12px; position:relative; }
.search-query-input>svg{ position:absolute; left:14px; color:var(--ink-faint); pointer-events:none; }
.search-query-input input{ padding-left:46px; padding-right:172px; }
.search-query-input .btn{ position:absolute; right:8px; color:var(--ink-soft); background:var(--bg); }
.search-natural-input>svg{ color:var(--purple-deep); }
.search-natural-input input{ border-color:var(--purple); background:var(--purple-tint); }
#naturalQuestion::selection{background:var(--teal-deep);color:var(--surface);}
.search-natural-status{display:flex;align-items:center;gap:9px;margin:0;color:var(--ink-soft);font-size:13px;}
.search-natural-status[hidden]{display:none;}
.search-natural-status::before{content:'';width:16px;height:16px;flex-shrink:0;border:2px solid var(--teal-tint);border-top-color:var(--teal-deep);border-radius:50%;animation:search-natural-spin .8s linear infinite;}
@keyframes search-natural-spin{to{transform:rotate(360deg);}}
@media(prefers-reduced-motion:reduce){.search-natural-status::before{animation:none;}}

.search-prompts{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.search-prompt{ border:1px solid var(--purple-tint); border-radius:24px; background:var(--purple-tint); color:var(--purple-deep); padding:6px 12px; font:inherit; font-size:12.5px; }
.search-prompt:disabled{ opacity:.5; cursor:not-allowed; }
.search-results-card{ padding:0 20px; }
.search-results-toolbar{ display:flex; gap:12px; align-items:center; flex-wrap:wrap; padding:18px 0; border-bottom:1px solid var(--border-soft); }
.search-results-toolbar select{ width:auto; flex:1 1 150px; min-width:0; }
.search-advanced-toggle{ margin-left:auto; }
.search-result-text{ min-width:0; flex:1; }
.search-result-snippet{ margin:8px 0 0; }
.search-empty{ padding:24px 0; }
.search-results-card .table-foot{ padding:16px 0; }
.search-advanced-panel{ min-width:0; animation:search-panel-enter .2s ease-out; }
.search-advanced-panel[hidden],.search-query-card form[hidden]{ display:none; }
.search-panel-heading{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
.search-panel-heading h3{ display:flex; align-items:center; gap:10px; }
.search-apply-filters{ width:100%; margin-top:14px; }
.search-facets{ border-top:1px solid var(--border-soft); margin-top:18px; padding-top:16px; }
.search-facet-row{ display:flex; justify-content:space-between; gap:12px; border-bottom:1px solid var(--border-soft); padding:10px 0; font-size:12.5px; }
.search-facet-row>span:last-child{ color:var(--purple-deep); text-align:right; }
.search-save-panel{ background:var(--purple-tint); border-radius:var(--radius-s); padding:14px; margin-top:18px; }
.search-save-panel form{ display:flex; flex-wrap:wrap; gap:8px; }
.search-save-panel input[type=text]{ flex:1 1 140px; min-width:0; }
@keyframes search-panel-enter{ from{ opacity:0; transform:translateX(20px); } to{ opacity:1; transform:translateX(0); } }
@media(max-width:1200px){ .search-layout.search-filters-open{ grid-template-columns:minmax(0,1fr) 320px; } }
@media(max-width:1000px){
    .search-layout.search-filters-open{ grid-template-columns:minmax(0,1fr); }
    .search-advanced-panel{ position:fixed; z-index:90; right:0; top:0; bottom:0; width:min(400px,100%); border-radius:0; overflow-y:auto; box-shadow:var(--shadow-md); }
}
@media(max-width:600px){
    .search-mode-buttons .btn{ flex:1; padding:10px; }
    .search-query-input input{ padding-right:14px; }
    .search-query-input .btn{ position:static; }
    .search-query-input{ flex-wrap:wrap; }
    .search-query-input>svg{ top:12px; }
    .search-query-card .notification-info{ padding:14px; gap:12px; }
    .search-query-card .notification-info>div{ padding-left:12px; }
    .search-results-toolbar .search-advanced-toggle{ margin-left:0; }
}
@media(prefers-reduced-motion:reduce){ .search-advanced-panel{ animation:none; } }

.search-filter-pair{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.search-mode-buttons .btn-secondary{ background:var(--bg); border-color:transparent; }
.search-mode-buttons .btn-secondary:hover{ background:var(--surface-sunken); }
.search-layout[data-natural-mode="0"] .search-prompts button:last-child{ display:none; }

/* =========================================================
   Dashboard — colours exclusively use the shared :root palette
   ========================================================= */
main:has(.dashboard-page){scrollbar-gutter:stable;}
.dashboard-page{font-size:14px;}
.dashboard-page svg{width:24px;height:24px;flex-shrink:0;vertical-align:middle;}
.dashboard-subtitle{color:var(--ink);margin:0 0 9px;}
.dashboard-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:20px;}
.dashboard-stat,.dashboard-panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-m);box-shadow:var(--shadow-sm);min-width:0;}
.dashboard-stat{display:flex;gap:18px;padding:11px 15px;min-height:115px;}
.dashboard-stat-icon{display:flex;align-items:center;justify-content:center;width:52px;height:50px;border-radius:var(--radius-m);flex-shrink:0;}
.dashboard-stat-icon svg{width:28px;height:28px;}
.dashboard-stat-body{min-width:0;}
.dashboard-page .tone-purple{color:var(--purple-deep);background:var(--purple-tint);}
.dashboard-page .tone-amber{color:var(--amber);background:var(--amber-tint);}
.dashboard-page .tone-green{color:var(--green);background:var(--green-tint);}
.dashboard-page .tone-red{color:var(--red);background:var(--red-tint);}
.dashboard-page .tone-neutral{color:var(--ink-soft);background:var(--surface-sunken);}
.dashboard-stat h2{font-family:'Sora',system-ui,sans-serif;font-size:14px;line-height:1.5;font-weight:650;letter-spacing:-.025em;}
.dashboard-stat-value{font-size:32px;font-weight:750;line-height:1.25;letter-spacing:-.04em;}
.dashboard-delta,.dashboard-stat-note{margin-top:6px;color:var(--ink-soft);}
.dashboard-delta{color:var(--green);font-weight:550;}
.dashboard-storage{flex-wrap:wrap;column-gap:18px;row-gap:0;}
.dashboard-storage-bottom{width:100%;padding-left:14px;}
.dashboard-page .dashboard-storage-progress{background:var(--surface-sunken);margin:2px 0 5px;}
.dashboard-page .dashboard-storage-progress::-webkit-progress-bar{background:var(--surface-sunken);}
.dashboard-page .dashboard-storage-progress::-webkit-progress-value{background:var(--purple);}
.dashboard-page .dashboard-storage-progress::-moz-progress-bar{background:var(--purple);}
.dashboard-page .dashboard-storage-labels{font-size:12px;font-weight:550;line-height:1.25;}
.dashboard-middle{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(0,.8fr) minmax(0,1fr);gap:16px;align-items:stretch;margin-bottom:20px;}
.dashboard-panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 18px;min-height:48px;}
.dashboard-panel-head h2{display:flex;align-items:center;gap:10px;font-family:'Sora',system-ui,sans-serif;font-size:17px;line-height:1.35;font-weight:700;letter-spacing:-.03em;}
.dashboard-panel-head>a{font-size:13px;white-space:nowrap;color:var(--purple-deep);}
.dashboard-panel-head>a span{margin-left:4px;font-size:19px;}
.dashboard-panel-head p{margin:3px 0 0 34px;font-size:12px;color:var(--ink-soft);}
.dashboard-actions-column{display:flex;flex-direction:column;gap:16px;min-width:0;}
.dashboard-quick{flex:1;}
.dashboard-quick-links{display:grid;gap:7px;padding:0 16px 13px;}
.dashboard-quick-links a{display:flex;align-items:center;gap:14px;border:1px solid var(--border);border-radius:10px;min-height:36px;padding:6px 16px;font-weight:600;line-height:1.25;color:var(--ink);}
.dashboard-quick-links a:nth-child(2){background:var(--bg);}
.dashboard-quick-links a:hover{background:var(--purple-tint);text-decoration:none;}
.dashboard-quick-links svg{width:20px;height:20px;}
.dashboard-quick-links p{font-size:13px;}
.dashboard-approvals{min-height:92px;}
.dashboard-approvals .dashboard-panel-head{padding-bottom:8px;}
.dashboard-approvals .dashboard-panel-head h2{font-size:16px;gap:10px;}
.dashboard-approval-count{background:var(--amber-tint);color:var(--amber);padding:3px 10px;border-radius:999px;}
.dashboard-approval-list{padding:0 18px 16px;font-size:13px;}
.dashboard-approval-list p{margin:0;}
.dashboard-approval-list>div{display:flex;justify-content:space-between;gap:10px;padding:4px 0;}
.dashboard-approval-list>div span{overflow-wrap:anywhere;}
.dashboard-page .dashboard-document-table{min-width:0;width:100%;border-collapse:collapse;table-layout:fixed;font-size:13px;}
.dashboard-page .dashboard-document-table th{background:var(--bg);font-size:12px;color:var(--ink);font-weight:500;padding:6px 12px;border:0;white-space:nowrap;}
.dashboard-document-table th:first-child{width:39%;padding-left:24px;}
.dashboard-document-table th:nth-child(2){width:19%;}
.dashboard-document-table th:nth-child(3){width:18%;}
.dashboard-document-table th:nth-child(4){width:16%;}
.dashboard-document-table th:last-child{width:8%;}
.dashboard-page .dashboard-document-table td{padding:7px 12px;border-bottom:1px solid var(--border-soft);vertical-align:middle;}
.dashboard-page .dashboard-document-table td:first-child{padding-left:24px;}
.dashboard-page .dashboard-document-table tr:last-child td{border:0;}
.dashboard-document-cell{display:flex;align-items:center;gap:18px;min-width:0;}
.dashboard-file-icon{display:flex;justify-content:center;align-items:center;flex-shrink:0;width:37px;height:37px;border-radius:12px;}
.dashboard-file-icon svg{width:23px;height:23px;}
.dashboard-document-cell>div:last-child{min-width:0;}
.dashboard-document-title{display:block;font-weight:650;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.dashboard-document-sub{font-size:12px;color:var(--ink-soft);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.dashboard-workspace-name{font-weight:600;overflow-wrap:anywhere;}
.dashboard-status{display:inline-block;border-radius:999px;font-size:12px;padding:2px 10px;white-space:nowrap;}
.dashboard-viewed-date{color:var(--ink-soft);font-size:12px;white-space:nowrap;}
.dashboard-row-link{display:inline-flex;align-items:center;font-size:14px;line-height:1;color:var(--purple-darker);}
.dashboard-page .dashboard-document-table td:last-child{padding-left:2px;padding-right:8px;}
.dashboard-page .dashboard-document-table tbody tr:hover,.dashboard-page .dashboard-document-table tbody tr:focus-within{background:var(--purple-tint);}
.dashboard-empty{padding:16px 18px;color:var(--ink-soft);font-size:13px;}
.dashboard-tags{position:relative;display:flex;flex-direction:column;overflow:clip;padding-bottom:12px;}
.dashboard-tags::after{content:'';position:absolute;width:80%;height:80px;border-radius:50%;background:var(--purple-tint);right:-16%;bottom:-48px;pointer-events:none;}
.dashboard-tags .dashboard-panel-head{padding-bottom:0;}
.dashboard-tag-cloud{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-around;align-content:space-around;gap:3px 8px;padding:5px 16px 0;position:relative;z-index:1;flex:none;min-height:203px;}
.dashboard-tag-cloud[hidden]{display:none;}
.dashboard-tag-size-12{font-size:12px;}
.dashboard-tag-size-13{font-size:13px;}
.dashboard-tag-size-14{font-size:14px;}
.dashboard-tag-size-15{font-size:15px;}
.dashboard-tag-size-16{font-size:16px;}
.dashboard-tag-size-17{font-size:17px;}
.dashboard-tag-size-18{font-size:18px;}
.dashboard-tag-size-19{font-size:19px;}
.dashboard-tag-size-20{font-size:20px;}
.dashboard-tag-size-21{font-size:21px;}
.dashboard-tag-size-22{font-size:22px;}
.dashboard-tag-size-23{font-size:23px;}
.dashboard-tag-size-24{font-size:24px;}
.dashboard-tag-size-25{font-size:25px;}
.dashboard-tag-size-26{font-size:26px;}
.dashboard-tag-size-27{font-size:27px;}
.dashboard-tag-size-28{font-size:28px;}
.dashboard-tag-size-29{font-size:29px;}
.dashboard-tag-size-30{font-size:30px;}
.dashboard-tag-size-31{font-size:31px;}
.dashboard-tag-size-32{font-size:32px;}
.dashboard-tag-size-33{font-size:33px;}
.dashboard-tag-size-34{font-size:34px;}
.dashboard-tag{font-weight:600;line-height:1.1;overflow-wrap:anywhere;max-width:100%;}
.dashboard-tag.tag-tone-0{color:var(--ink);}
.dashboard-tag.tag-tone-1{color:var(--purple-deep);}
.dashboard-tag.tag-tone-2{color:var(--purple-darker);}
.dashboard-tag.tag-tone-3{color:var(--purple);}
.dashboard-tag.tag-italic{font-style:italic;}
.dashboard-tag-extra{border-top:1px solid var(--border-soft);margin-top:14px;padding-top:14px;flex:none;min-height:0;}
.dashboard-tags-toggle{display:flex;align-items:center;justify-content:flex-end;align-self:flex-end;gap:5px;position:relative;z-index:1;margin:8px 22px 0;background:var(--surface);border:0;color:var(--purple-deep);font:inherit;font-size:13px;font-weight:550;border-radius:4px;padding:2px;}
.dashboard-toggle-chevron{display:inline-block;font-size:18px;line-height:1;}
.dashboard-tags-toggle[aria-expanded=true] .dashboard-toggle-chevron{transform:rotate(180deg);}
.dashboard-bottom{display:grid;grid-template-columns:minmax(0,1.54fr) minmax(0,1.07fr) minmax(0,1fr);gap:16px;align-items:stretch;}
.dashboard-bottom>.dashboard-panel{min-height:263px;}
.dashboard-page .dashboard-line-chart{display:block;width:100%;height:162px;padding:0 14px;}
.dashboard-chart-grid{stroke:var(--border-soft);stroke-width:1;}
.dashboard-chart-axis{stroke:var(--border);stroke-width:1;}
.dashboard-axis{fill:var(--ink);font-size:11px;}
.dashboard-revisions-line,.dashboard-shares-line{fill:none;stroke-width:2.2;stroke-linejoin:round;}
.dashboard-revisions-line{stroke:var(--purple);}
.dashboard-shares-line{stroke:var(--teal);}
.dashboard-chart-fill{fill:var(--purple-tint);}
.dashboard-chart-legend{display:flex;gap:30px;padding:2px 22px 12px;font-size:12px;}
.dashboard-chart-legend>span{display:flex;align-items:center;gap:6px;}
.dashboard-dot{width:11px;height:11px;border-radius:50%;display:inline-block;}
.revisions-dot{background:var(--purple);}
.shares-dot{background:var(--teal);}
.dashboard-types-body{display:flex;align-items:center;gap:12px;padding:0 18px 16px;min-height:194px;}
.dashboard-donut-wrap{flex:1;min-width:100px;max-width:200px;}
.dashboard-page .dashboard-donut{width:100%;height:auto;display:block;}
.dashboard-donut-track,.dashboard-donut-segment{fill:none;stroke-width:30;}
.dashboard-donut-track{stroke:var(--surface-sunken);}
.dashboard-donut-total{font-size:30px;font-weight:750;fill:var(--ink);letter-spacing:-1px;}
.dashboard-donut-label{font-size:14px;fill:var(--ink);}
.dashboard-type-legend{flex:1.1;min-width:0;font-size:12px;}
.dashboard-type-legend li{display:flex;align-items:center;gap:9px;margin:11px 0;}
.dashboard-type-legend li>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.dashboard-type-legend strong{margin-left:auto;white-space:nowrap;font-weight:550;}
.dashboard-type-swatch{display:inline-block;width:14px;height:14px;flex-shrink:0;border-radius:3px;}
.dashboard-page .type-colour-0{stroke:var(--purple-darker);background:var(--purple-darker);}
.dashboard-page .type-colour-1{stroke:var(--purple);background:var(--purple);}
.dashboard-page .type-colour-2{stroke:var(--teal);background:var(--teal);}
.dashboard-page .type-colour-3{stroke:var(--teal-tint);background:var(--teal-tint);}
.dashboard-page .type-colour-4{stroke:var(--surface-sunken);background:var(--surface-sunken);}
.dashboard-notifications .dashboard-panel-head{padding-bottom:6px;}
.dashboard-notification-list{padding:0 18px 14px;}
.dashboard-notification{display:flex;align-items:flex-start;gap:16px;padding:8px 0;border-bottom:1px solid var(--border-soft);font-size:12px;line-height:1.4;}
.dashboard-notification:last-child{border:0;}
.dashboard-notification-icon{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;border-radius:50%;background:var(--bg);color:var(--ink-soft);}
.dashboard-notification-icon svg{width:16px;height:16px;}
.dashboard-notification-content{min-width:0;flex:1;overflow-wrap:anywhere;}
.dashboard-notification-content>div{color:var(--ink-soft);}
.dashboard-notification strong{display:block;font-weight:650;}
.dashboard-notification time{font-size:11px;white-space:nowrap;}
.dashboard-page button:focus-visible,.dashboard-page a:focus-visible{outline:2px solid var(--purple-deep);outline-offset:3px;}
@media(min-width:901px){main:has(.dashboard-page){padding:12px 24px 32px;}main:has(.dashboard-page)>.crumbs{margin-bottom:3px;}}
@media(max-width:1250px){.dashboard-middle{grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);}.dashboard-tags{grid-column:1/-1;}.dashboard-tag-cloud{justify-content:center;min-height:130px;}.dashboard-bottom{grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);}.dashboard-notifications{grid-column:1/-1;}.dashboard-stat{gap:10px;padding:12px;}.dashboard-stat h2{font-size:12px;}.dashboard-stat-icon{width:40px;height:42px;}}
@media(max-width:700px){.dashboard-summary{grid-template-columns:repeat(2,minmax(0,1fr));}.dashboard-middle,.dashboard-bottom{grid-template-columns:minmax(0,1fr);}.dashboard-tags,.dashboard-notifications{grid-column:auto;}.dashboard-stat{min-height:110px;}.dashboard-stat-value{font-size:28px;}.dashboard-stat-note,.dashboard-delta{font-size:12px;}.dashboard-page .dashboard-document-table{min-width:580px;}.dashboard-panel-head h2{font-size:16px;}.dashboard-types-body{justify-content:center;}.dashboard-type-legend{max-width:240px;}.dashboard-donut-wrap{min-width:130px;}.dashboard-notification{gap:10px;}}
/* End of dashboard styles. */

/* Additional dashboard charts. Existing panels, axes, legends and palette are reused. */
.dashboard-analytics{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr) minmax(0,1fr);gap:16px;margin-top:20px;align-items:stretch;}
.dashboard-analytics>.dashboard-panel{min-height:300px;}
.dashboard-analytics-head{align-items:flex-start;padding-top:16px;}
.dashboard-analytics-head h2{font-size:16px;}
.dashboard-analytics-head h2 small{font:inherit;font-size:12px;white-space:nowrap;}
.dashboard-monthly-comparison{display:flex;flex-direction:column;align-items:flex-end;gap:5px;flex-shrink:0;font-size:10px;}
.dashboard-monthly-change{padding:5px 10px;border-radius:999px;font-size:13px;font-weight:700;white-space:nowrap;}
.dashboard-monthly-no-baseline{color:var(--ink-soft);font-size:10px;}
.dashboard-page .dashboard-monthly-chart,.dashboard-page .dashboard-workspace-chart{display:block;width:100%;height:232px;padding:0 16px 12px;}
.dashboard-monthly-bar{fill:var(--purple);}
.dashboard-workspace-label,.dashboard-workspace-count{fill:var(--ink);font-size:13px;}
.dashboard-workspace-count{font-weight:650;}
.dashboard-analytics .dashboard-analytics-colour-0{fill:var(--purple-darker);stroke:var(--purple-darker);background:var(--purple-darker);}
.dashboard-analytics .dashboard-analytics-colour-1{fill:var(--purple);stroke:var(--purple);background:var(--purple);}
.dashboard-analytics .dashboard-analytics-colour-2{fill:var(--teal);stroke:var(--teal);background:var(--teal);}
.dashboard-analytics .dashboard-analytics-colour-3{fill:var(--green-tint);stroke:var(--green-tint);background:var(--green-tint);}
.dashboard-analytics .dashboard-analytics-colour-4{fill:var(--amber);stroke:var(--amber);background:var(--amber);}
.dashboard-analytics .dashboard-donut-segment{fill:none;}
.dashboard-storage-chart .dashboard-types-body{min-height:232px;gap:10px;}
.dashboard-storage-chart .dashboard-donut-total{font-size:21px;letter-spacing:-.7px;}
.dashboard-storage-chart .dashboard-donut-label{font-size:12px;}
.dashboard-storage-chart .dashboard-type-legend{font-size:11px;flex:1.3;}
.dashboard-storage-chart .dashboard-type-legend li{gap:7px;margin:14px 0;}
@media(max-width:1250px){.dashboard-analytics{grid-template-columns:repeat(2,minmax(0,1fr));}.dashboard-storage-chart{grid-column:1/-1;}.dashboard-storage-chart .dashboard-types-body{justify-content:center;}.dashboard-storage-chart .dashboard-type-legend{max-width:300px;}}
@media(max-width:700px){.dashboard-analytics{grid-template-columns:minmax(0,1fr);}.dashboard-storage-chart{grid-column:auto;}.dashboard-analytics-head{padding-left:14px;padding-right:14px;}.dashboard-analytics-head h2{font-size:15px;}.dashboard-monthly-comparison{font-size:9px;}.dashboard-storage-chart .dashboard-donut-wrap{min-width:110px;}.dashboard-storage-chart .dashboard-type-legend{font-size:10px;}}
/* End of additional dashboard charts. */

/* Unified Sharing: existing cards, tabs, forms, chips and table components. */
.sharing-layout{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(260px,1fr);gap:20px;margin-top:20px;align-items:start;}
.sharing-stack{display:grid;gap:20px;min-width:0;}
.sharing-layout>.card{min-width:0;}
.sharing-stats{margin:20px 0;}
.sharing-distribution-stats{grid-template-columns:repeat(5,minmax(0,1fr));}
.sharing-stat{display:flex;gap:14px;align-items:center;padding:18px;}
.sharing-stat:first-child{background:var(--surface);}
.sharing-stat-label{font-weight:700;}
.sharing-stat-description{margin:4px 0 0;}
.sharing-stat strong{display:block;font-size:28px;line-height:1.25;}
.sharing-stat-icon{width:48px;height:48px;border-radius:12px;font-size:28px;}
.sharing-stat-icon svg{width:26px;height:26px;}
.sharing-type{display:flex;gap:16px;color:var(--ink);border:2px solid var(--border);}
.sharing-type.selected{border-color:var(--purple-deep);background:linear-gradient(120deg,var(--surface),var(--purple-tint));}
.sharing-type:hover{border-color:var(--purple);font-weight:inherit;}
.sharing-type[aria-disabled="true"]{opacity:.5;cursor:not-allowed;}
.sharing-type[aria-disabled="true"]:hover{border-color:var(--border);}
.sharing-type p{margin:6px 0 0;}
.sharing-steps{display:flex;align-items:center;gap:24px;max-width:1120px;padding:0;list-style:none;margin:28px auto;}
.sharing-steps li{display:flex;align-items:center;flex:1;gap:10px;color:var(--ink-soft);white-space:nowrap;}
.sharing-steps li:not(:last-child)::after{content:"";flex:1;height:2px;background:var(--ink-faint);opacity:.5;}
.sharing-steps li:last-child{flex:0 0 auto;}
.sharing-steps span{border:1px solid var(--border);background:var(--surface);border-radius:50%;width:34px;height:34px;flex-shrink:0;display:grid;place-items:center;}
.sharing-steps .is-complete{color:var(--ink);font-weight:600;}
.sharing-steps li.is-complete::after{background:var(--purple);opacity:1;}
.sharing-steps .is-complete span{background:var(--purple-tint);border-color:var(--purple-tint);color:var(--purple-deep);font-weight:700;}
.sharing-steps [aria-current=step]{color:var(--purple-deep);font-weight:700;}
.sharing-steps [aria-current=step] span{background:var(--purple-deep);color:var(--surface);}
.sharing-wizard-actions{display:flex;align-items:center;gap:12px;margin-top:20px;}
.sharing-wizard-actions .spacer{flex:1;}
#sharingWizard #wizardBack{background:var(--surface-sunken);}
#sharingWizard #wizardBack:hover{background:var(--surface);}
.sharing-fields{border:0;padding:0;margin:16px 0;min-width:0;}
.sharing-facts{margin:16px 0;}
.sharing-facts dt{font-size:12px;color:var(--ink-soft);margin-top:14px;}
.sharing-facts dd{margin:3px 0 0;overflow-wrap:anywhere;white-space:pre-wrap;}
.sharing-chips{display:flex;flex-wrap:wrap;gap:8px;}
.sharing-chips .chip{max-width:100%;overflow-wrap:anywhere;white-space:normal;}
.sharing-document-picker{max-height:250px;overflow:auto;border:1px solid var(--border);border-radius:var(--radius-s);margin-top:10px;}
.sharing-document-option{display:flex;gap:12px;align-items:center;padding:12px;border-bottom:1px solid var(--border-soft);cursor:pointer;}
.sharing-document-option:last-child{border-bottom:0;}
.sharing-document-option:has(input:checked){background:var(--purple-tint);}
.sharing-document-option input{width:auto;accent-color:var(--purple-deep);flex-shrink:0;}
.sharing-document-option .cell-sub{display:block;}
.sharing-empty{padding:40px;text-align:center;color:var(--ink-soft);}
.sharing-help{margin-top:20px;}
.sharing-help h3{margin-bottom:14px;}
.sharing-help-item{display:flex;align-items:flex-start;gap:16px;padding:16px;border:1px solid var(--border);border-radius:var(--radius-s);}
.sharing-help-item .card-icon{width:48px;height:48px;flex-shrink:0;}
.sharing-help-item .card-icon svg{width:28px;height:28px;}
.sharing-help-item h4{margin:0 0 4px;}
.sharing-help-item p{margin:0;}
.sharing-event,.sharing-document-line{padding:12px 0;border-bottom:1px solid var(--border-soft);}
.sharing-document-line{display:flex;align-items:center;flex-wrap:wrap;gap:12px;}
.sharing-issue-facts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:20px;margin:20px 0 0;}
.sharing-issue-facts dt{font-size:12px;color:var(--ink-soft);}
.sharing-issue-facts dd{margin:4px 0 0;overflow-wrap:anywhere;}
.sharing-distribution-layout{align-items:stretch;}
.sharing-settings{display:grid;grid-template-columns:minmax(0,1fr) minmax(80px,1fr);gap:14px;align-items:baseline;}
.sharing-settings dt,.sharing-settings dd{margin:0;}
.sharing-settings dd{text-align:right;}
.sharing-message{white-space:pre-wrap;margin-top:16px;}
#sharingWizard [hidden],.sharing-document-option[hidden],#secureSettings [hidden]{display:none;}
@media(max-width:1100px){.sharing-distribution-stats{grid-template-columns:repeat(2,minmax(0,1fr));}.sharing-type-grid{grid-template-columns:1fr;}.sharing-layout{grid-template-columns:minmax(0,1fr);}.sharing-issue-facts{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:600px){.sharing-stats{gap:10px;}.sharing-stat{padding:12px;gap:8px;}.sharing-stat-icon{width:32px;height:32px;font-size:20px;}.sharing-steps{gap:8px;font-size:12px;}.sharing-steps li{gap:5px;}.sharing-steps span{width:26px;height:26px;}.sharing-wizard-actions{flex-wrap:wrap;}.sharing-issue-facts{grid-template-columns:1fr;}.sharing-segments{max-width:100%;}}

/* Secure delivery setup rows reuse the existing fields, switches, cards and modal. */
.sharing-delivery-layout{grid-template-columns:minmax(0,2.5fr) minmax(260px,1fr);}
.sharing-setup-heading{justify-content:flex-start;align-items:center;gap:12px;padding-bottom:16px;border-bottom:1px solid var(--border-soft);margin-bottom:0;}
.sharing-setup-row{display:grid;grid-template-columns:minmax(150px,.85fr) minmax(0,1.65fr);gap:20px;padding:16px 0;border-bottom:1px solid var(--border-soft);}
.sharing-setup-row:last-child{padding-bottom:0;border-bottom:0;}
.sharing-row-label{display:flex;align-items:flex-start;gap:12px;}
.sharing-row-label>span{display:flex;flex-shrink:0;color:var(--purple-deep);}
.sharing-row-label svg{width:22px;height:22px;}
.sharing-row-label strong,.sharing-row-label label{display:block;font-weight:600;font-size:13px;}
.sharing-row-label p,.sharing-summary-item p,.reminder-legend-description{font-size:12px;margin:2px 0 0;color:var(--ink-soft);}
.sharing-row-controls{min-width:0;}
.sharing-row-controls>.hint{margin:6px 0 0;font-size:12px;color:var(--ink-soft);}
.sharing-row-controls .field{margin-bottom:0;}
.sharing-row-controls .form-row{gap:16px;}
.sharing-document-selection{display:flex;align-items:center;gap:12px;flex-wrap:wrap;}
.sharing-document-selection .sharing-chips{flex:1;}
.sharing-download-cap{margin-top:12px;}
.sharing-security-toggles{display:flex;align-items:center;gap:18px;}
.sharing-security-option{display:flex;align-items:center;gap:6px;white-space:nowrap;font-size:12px;font-weight:600;}
.sharing-pin-field{margin-top:14px;}
.sharing-expiry-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.sharing-expiry-controls input{flex:1;min-width:150px;}
.sharing-expiry-controls button{background:var(--purple-tint);color:var(--purple-deep);border-radius:99px;}
.sharing-secure-link-controls input{min-width:0;}
.sharing-secure-link-controls button{white-space:nowrap;}
.sharing-documents-heading{display:flex;align-items:center;gap:12px;}
.sharing-documents-heading>span{display:flex;color:var(--purple-deep);}
.sharing-documents-heading svg{width:24px;height:24px;}
.sharing-documents-heading h2{margin:0;}
.sharing-secure-actions{align-items:center;justify-content:space-between;flex-wrap:wrap;}
.sharing-secure-primary-actions{display:flex;gap:10px;margin-left:auto;}
.sharing-secure-actions .sharing-resend{background:var(--surface-sunken);}
.sharing-secure-actions .sharing-resend:hover{background:var(--surface);}
.sharing-resend-hint{font-size:12px;}
.sharing-history-pagination{display:flex;flex-direction:column;gap:12px;margin-top:14px;}
.sharing-conversation-entry{border-top:1px solid var(--border-soft);padding-top:16px;margin-top:16px;}
.sharing-conversation-meta{display:flex;align-items:center;gap:8px 14px;flex-wrap:wrap;font-size:12px;color:var(--ink-soft);overflow-wrap:anywhere;}
.sharing-conversation-entry .sharing-message{margin:8px 0 0;}
.sharing-conversation-reply{margin-top:10px;}
.sharing-conversation-reply summary{cursor:pointer;font-size:12px;color:var(--purple-deep);}
.sharing-conversation-reply form{margin-top:10px;}
.sharing-conversation-reply label{display:block;font-size:12px;font-weight:600;margin-bottom:6px;}
.sharing-guest-conversation{margin-bottom:16px;}
.sharing-message-count{text-align:right;}
.sharing-summary-item{display:flex;gap:12px;align-items:flex-start;padding:16px 0;border-bottom:1px solid var(--border-soft);}
.sharing-summary-item:last-child{border-bottom:0;padding-bottom:0;}
.sharing-summary-item>div{min-width:0;overflow-wrap:anywhere;}
.sharing-summary-item .card-icon{width:36px;height:36px;}
.sharing-summary-item strong{font-size:13px;}
.sharing-document-dialog{border:0;padding:0;width:calc(100% - 32px);color:var(--ink);}
.sharing-document-dialog:not([open]){display:none;}
.sharing-document-dialog::backdrop{background:rgba(36,30,82,.4);}
.sharing-document-dialog .modal-body{padding-top:12px;}
.sharing-document-dialog .modal-foot{align-items:center;}
.sharing-document-dialog .modal-foot .spacer{flex:1;}
.sharing-document-dialog .sharing-document-picker{max-height:45vh;}
.sharing-document-dialog .sharing-document-option>span{min-width:0;overflow-wrap:anywhere;}
.sharing-picker-filters{display:grid;grid-template-columns:minmax(0,2.2fr) repeat(3,minmax(0,1fr));gap:12px;margin:10px 0;}
.sharing-picker-filters .search-box{display:flex;width:auto;min-width:0;padding:0 12px;background:var(--surface);border:1px solid var(--border);}
.sharing-picker-filters .search-box input{border:0;background:transparent;box-shadow:none;}
.sharing-picker-filters input,.sharing-picker-filters select{min-width:0;width:100%;}
.sharing-picker-filters .search-box>span{display:flex;}
.sharing-picker-filters svg{width:16px;height:16px;}
.sharing-document-dialog [hidden]{display:none;}
.sharing-type.selected{position:relative;}
.sharing-type.selected::after{content:'✓';position:absolute;right:12px;top:12px;display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--purple-deep);color:var(--surface);font-size:13px;}
.sharing-type.selected h3{padding-right:18px;}
@media(max-width:1100px){.sharing-delivery-layout{grid-template-columns:minmax(0,1fr);}}
@media(max-width:700px){.sharing-setup-row{grid-template-columns:minmax(0,1fr);gap:12px;}.sharing-picker-filters{grid-template-columns:repeat(2,minmax(0,1fr));}.sharing-picker-filters .search-box{grid-column:1/-1;}}
@media(max-width:600px){.sharing-setup{padding:16px;}.sharing-security-toggles{gap:8px;}.sharing-security-option{gap:5px;}.sharing-row-controls .form-row{grid-template-columns:minmax(0,1fr);}.sharing-document-selection .sharing-chips{flex-basis:100%;}}

/* Internal recipient autocomplete shares the existing input and setup-row styles. */
.sharing-recipient-search{position:relative;}
.sharing-recipient-suggestions{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:10;max-height:240px;overflow:auto;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-s);box-shadow:var(--shadow-sm);}
.sharing-recipient-suggestions li{padding:10px 12px;font-size:12px;overflow-wrap:anywhere;}
.sharing-recipient-suggestions [role=option]{cursor:pointer;}
.sharing-recipient-suggestions [role=option]:hover,.sharing-recipient-suggestions .is-active{background:var(--purple-tint);color:var(--purple-deep);}
.sharing-distribution-info{display:flex;align-items:center;gap:10px;padding:12px;background:var(--purple-tint);color:var(--purple-deep);border-radius:var(--radius-s);font-size:12px;}
.sharing-distribution-info svg{width:20px;height:20px;}
.sharing-distribution-switch{display:flex;justify-content:flex-end;}

/* Existing Secure Delivery management and verified recipient conversations only. */
/* History anchors must scroll main, not the document or the clipped shell. */
.shell:has(#sharingActivityHistory){position:fixed;inset:0;overflow:clip;}
.sd-documents>p{margin:6px 0 14px;}
.sd-document-list{border:1px solid var(--border);border-radius:var(--radius-s);overflow:hidden;}
.sd-document-choice{display:flex;align-items:center;gap:12px;padding:12px;border-bottom:1px solid var(--border-soft);cursor:pointer;}
.sd-document-choice:last-child{border-bottom:0;}
.sd-document-choice.is-selected{background:var(--purple-tint);}
.sd-document-choice input{width:auto;flex-shrink:0;accent-color:var(--purple);}
.sd-document-choice>span:nth-last-child(2){flex:1;min-width:0;overflow-wrap:anywhere;}
.sd-document-choice strong,.sd-document-choice small{display:block;}
.sd-document-choice small{color:var(--ink-soft);font-size:12px;margin-top:3px;}
.sd-selection-status:empty{display:none;}
.sd-delivery-note{border:1px solid var(--purple);padding:12px 16px;background:var(--purple-tint);border-radius:var(--radius-s);white-space:pre-wrap;font-size:12px;color:var(--ink-soft);}
.sd-conversation{min-width:0;}
.sd-conversation-heading{display:flex;align-items:center;gap:12px;margin-bottom:18px;}
.sd-conversation-heading h3{margin:0 0 4px;}
.sd-conversation-heading p{margin:0;}
.sd-thread{margin-bottom:18px;}
.sd-message{display:flex;gap:14px;padding:14px 0;border-bottom:1px solid var(--border-soft);}
.sd-message:last-child{border-bottom:0;}
.sd-avatar{width:38px;height:38px;flex-shrink:0;display:flex;align-items:center;justify-content:center;background:var(--purple-tint);color:var(--purple-deep);border-radius:50%;font-weight:700;}
.sd-avatar svg{width:23px;height:23px;}
.sd-message-main{flex:1;min-width:0;}
.sd-message-meta{display:flex;align-items:center;gap:7px 14px;flex-wrap:wrap;font-size:12px;margin-bottom:6px;overflow-wrap:anywhere;}
.sd-message-meta time{color:var(--ink-soft);font-size:11px;}
.sd-visibility{display:inline-flex;align-items:center;gap:5px;border:1px solid var(--purple-soft,var(--border));background:var(--purple-tint);color:var(--purple-deep);padding:3px 9px;border-radius:99px;font-size:11px;font-weight:600;}
.sd-visibility svg{width:13px;height:13px;}
.sd-visibility.sd-public{background:var(--green-tint);color:var(--green);border-color:var(--green-tint);}
.sd-message-bubble{padding:10px 12px;background:var(--purple-tint);border:1px solid var(--border-soft);border-radius:9px;overflow-wrap:anywhere;}
.sd-message-bubble p{margin:0;white-space:pre-wrap;font-size:13px;}
.sd-attachment{display:flex;align-items:center;gap:10px;margin-top:8px;padding:9px 12px;max-width:480px;background:var(--surface);border:1px solid var(--border);border-radius:8px;color:var(--ink);}
.sd-attachment>span:nth-child(2){flex:1;min-width:0;overflow-wrap:anywhere;}
.sd-attachment strong,.sd-attachment small{display:block;}
.sd-attachment strong{font-size:12px;}
.sd-attachment small{font-size:11px;color:var(--ink-soft);}
.sd-attachment svg{width:20px;height:20px;}
.sd-composer{border:1px solid var(--purple);border-radius:10px;padding:16px;}
.sd-composer h4{margin:0 0 12px;}
.sd-compose-body{display:flex;gap:12px;}
.sd-compose-fields{flex:1;min-width:0;}
.sd-compose-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:10px;}
.sd-compose-actions>select{width:auto;max-width:100%;min-width:140px;margin-left:auto;}
.sd-compose-actions .btn svg{width:16px;height:16px;}
.sd-file-hint{font-size:11px;color:var(--ink-soft);overflow-wrap:anywhere;flex:1;min-width:120px;}
.sd-file-input,.sd-visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}
.sd-attach-button{cursor:pointer;background:var(--surface-sunken);}
.sd-attach-button:hover{background:var(--surface);}
.sd-compose-help,.sd-compose-status{font-size:12px;color:var(--ink-soft);margin:8px 0 0;}
.sd-compose-status:empty{display:none;}
.sd-private-recipient{margin:8px 0 0;max-width:380px;}
.sd-private-recipient label{font-size:12px;}
.sd-recipient-main{width:100%;max-width:1040px;margin:0 auto;padding:28px 24px 48px;flex:1;}
.sd-recipient-shell .bare-topbar{height:auto;min-height:64px;flex-wrap:wrap;gap:8px;padding-top:8px;padding-bottom:8px;}
.sd-recipient-shell .bare-topbar>.badge{max-width:100%;white-space:normal;overflow-wrap:anywhere;}
.sd-recipient-heading{display:flex;gap:14px;align-items:center;margin:0 0 20px;}
.sd-recipient-heading h1{font-size:25px;margin:0 0 4px;}
.sd-recipient-heading p{font-size:13px;color:var(--ink-soft);margin:0;}
.sd-security-notice{display:flex;gap:10px;align-items:center;padding:12px 16px;background:var(--purple-tint);color:var(--purple-deep);border-radius:var(--radius-s);font-size:13px;margin:16px 0;}
.sd-security-notice svg{width:20px;height:20px;flex-shrink:0;}
.sd-recipient-navigation{margin-bottom:20px;padding:14px;}
.sd-navigation-buttons{font-size:12px;flex-wrap:wrap;}
.sd-current-document{display:flex;align-items:center;gap:12px;margin-top:14px;padding:12px;border:1px solid var(--border);border-radius:var(--radius-s);}
.sd-current-document>div{flex:1;min-width:0;overflow-wrap:anywhere;}
.sd-current-document p{margin:3px 0 0;}
.sd-recipient-viewer{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-m);padding:16px;margin-bottom:20px;}
.sd-recipient-viewer .share-preview-card{box-shadow:none;margin:0;border:0;padding:0;overflow:hidden;}
.sd-viewer-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:16px;flex-wrap:wrap;}
.sd-viewer-footer>span{display:flex;align-items:center;gap:10px;font-size:13px;}
.sd-viewer-footer svg{width:22px;height:22px;color:var(--purple-deep);}
/* Secure-recipient document viewer; other preview cards retain their existing presentation. */
.sd-recipient-viewer:has(.sd-document-viewer){padding:4px;box-shadow:var(--shadow-sm)}
.sd-recipient-viewer .share-preview-card:has(.sd-document-viewer){display:block}
.sd-document-viewer{text-align:left}
.sd-viewer-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;padding:12px 14px;border-radius:10px;background:linear-gradient(110deg,var(--ink),var(--purple-deep));color:var(--surface)}
.sd-viewer-expiry{display:inline-flex;align-items:center;gap:8px;padding:7px 10px;border-radius:7px;background:rgba(255,255,255,.12);font-size:12px;font-weight:600}
.sd-viewer-expiry > span{display:flex}
.sd-viewer-expiry svg{width:20px;height:20px}
.sd-viewer-tools,.sd-viewer-page-controls{display:flex;align-items:center;gap:10px}
.sd-viewer-toolbar .sd-viewer-page-controls{border-left:1px solid rgba(255,255,255,.4);padding-left:16px}
.sd-viewer-toolbar .btn-secondary{background:var(--surface);border-color:var(--surface);color:var(--ink)}
.sd-viewer-toolbar .btn-secondary:hover{background:var(--purple-tint)}
.sd-viewer-toolbar .btn-secondary:disabled{background:transparent;color:var(--surface)}
.sd-viewer-tools button{padding:7px 9px}
.sd-viewer-tools button svg{width:19px;height:19px}
.sd-viewer-page-controls{font-size:12px;font-weight:600;white-space:nowrap}
.sd-viewer-page-scroll{height:78vh;min-height:320px;max-height:1000px;overflow:auto;overscroll-behavior:contain;padding:16px;background:var(--bg);border:1px solid var(--border-soft);margin:4px 4px 0}
.sd-viewer-page-surface{width:calc(100% * var(--share-preview-zoom,1));margin:0 auto;background:var(--surface);box-shadow:var(--shadow-sm)}
.sd-document-viewer .share-page-image{width:100%;max-width:none;height:auto;margin:0}
.sd-document-viewer .sd-viewer-footer{margin:0;padding:16px}
.sd-document-viewer [data-page-error]{margin:0;padding:12px 16px}
.sd-document-viewer [data-page-error][hidden]{display:none}
@media(max-width:700px){.sd-viewer-toolbar{gap:12px;padding:12px}.sd-viewer-toolbar .sd-viewer-page-controls{border-left:0;padding-left:0;flex:1 0 100%;justify-content:flex-end}.sd-viewer-page-scroll{padding:10px}.sd-document-viewer .sd-viewer-footer{padding:12px}}

.sd-activity-heading{display:flex;align-items:center;gap:12px;margin-bottom:12px;}
.sd-activity-heading>span,.sd-activity-icon{color:var(--purple-deep);display:flex;}
.sd-activity-heading svg,.sd-activity-icon svg{width:22px;height:22px;}
.sd-activity-heading h3{margin:0;}
#sharingActivityHistory .sharing-event{display:flex;gap:14px;}
#sharingActivityHistory .sharing-event>div{flex:1;min-width:0;}
@media(max-width:700px){.sd-recipient-shell .bare-topbar{padding-left:16px;padding-right:16px;}.sd-navigation-buttons{display:grid;grid-template-columns:1fr auto 1fr;gap:6px;}.sd-navigation-buttons .btn{white-space:normal;justify-content:center;}}
@media(max-width:700px){.sd-document-choice{flex-wrap:wrap;}.sd-document-choice .badge{margin-left:30px;}.sd-current-document{flex-wrap:wrap;}.sd-recipient-main{padding:22px 12px;}.sd-compose-actions>select{margin-left:0;flex:1;}.sd-conversation-heading{align-items:flex-start;}.sd-message{gap:9px;}.sd-avatar{width:32px;height:32px;}.sd-compose-body>.sd-avatar{display:none;}.sd-composer{padding:12px;}.sd-conversation{padding:16px;}.sd-navigation-buttons .btn{font-size:11px;padding:7px;}}

/* =========================================================
   Public homepage — every added selector is scoped to this page.
   ========================================================= */
html.wdv-home-page, .wdv-home-page body{ height:auto; }
.wdv-home-page main{ grid-area:auto; padding:0; overflow:visible; }
.wdv-home-page .section-head{ display:block; margin:0; }
.wdv-home-page a{ text-decoration:revert; }
.wdv-home-page a:any-link:hover{ font-weight:inherit; }
.wdv-home-page p{ color:inherit; }
.wdv-home-page .card{ box-shadow:none; }
.wdv-home-page .btn{ justify-content:flex-start; white-space:normal; }
.wdv-home-page .btn-ghost:hover{ background:transparent; color:var(--ink); }
.wdv-home-page .btn:any-link:hover, .wdv-home-page .nav-cta:any-link:hover{ font-weight:600; }

/* WitsDocVault home: shared tokens, layout, responsive states and component styles. */

html.wdv-home-page {
  /* ---- color ---- */
  --ink:        #201a4c;   /* primary text, dark surfaces   */
  --ink-deep:   #130f30;   /* footer — darker than --ink    */
  --ink-soft:   #423a72;   /* secondary text on light bg    */
  --violet:     #7d70d9;   /* primary accent                */
  --violet-deep:#5748b8;   /* hover / gradient partner       */
  --teal:       #2f9d94;   /* secondary accent               */
  --linen:      #f8f6f1;   /* page background                */
  --paper:      #ffffff;   /* card / surface background      */
  --line:       rgba(32,26,76,0.14);   /* hairline borders   */
  --line-soft:  rgba(32,26,76,0.08);

  /* ---- type ---- */
  --font-head: "Space Grotesk", "Tajawal", "Segoe UI", sans-serif;
  --font-body: "Inter", "Tajawal", "Segoe UI", sans-serif;

  /* ---- scale ---- */
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
  --step-2: clamp(1.5rem, 1.3rem + 0.8vw, 1.9rem);
  --step-3: clamp(2rem, 1.6rem + 1.6vw, 2.8rem);
  --step-4: clamp(2.6rem, 2rem + 2.6vw, 3.5rem);

  --maxw: 1280px;
  --radius: 3px;
}

html.wdv-home-page[dir="rtl"] {
  --font-head: "Tajawal", "Segoe UI", sans-serif;
  --font-body: "Tajawal", "Segoe UI", sans-serif;
}

.wdv-home-page *, .wdv-home-page *::before, .wdv-home-page *::after { box-sizing: border-box; }

html.wdv-home-page { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce){
  html.wdv-home-page { scroll-behavior: auto; }

  .wdv-home-page *, .wdv-home-page *::before, .wdv-home-page *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

.wdv-home-page body {
  margin: 0;
  background: var(--linen);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wdv-home-page h1, .wdv-home-page h2, .wdv-home-page h3 {
  font-family: var(--font-head);
  color: var(--ink);
  line-height: 1.12;
  margin: 0 0 0.5em;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.wdv-home-page h1 { font-size: var(--step-4); font-weight: 700; }

.wdv-home-page h2 { font-size: var(--step-3); }

.wdv-home-page h3 { font-size: var(--step-2); }

.wdv-home-page p { margin: 0 0 1em; max-width: 62ch; }

.wdv-home-page p.lede { color: var(--ink-soft); max-width: 54ch; }

.wdv-home-page a { color: inherit; }

.wdv-home-page img { max-width: 100%; display: block; }

.wdv-home-page .container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

.wdv-home-page section { padding-block: 40px; }

@media (max-width: 720px){
  .wdv-home-page section { padding-block: 56px; }
}

.wdv-home-page .bg-paper { background: var(--paper); }

.wdv-home-page .bg-linen { background: var(--linen); }

.wdv-home-page a:focus-visible, .wdv-home-page button:focus-visible {
  outline: 2px solid var(--violet-deep);
  outline-offset: 3px;
  border-radius: 2px;
}

.wdv-home-page .skip-link {
  position:absolute; inset-inline-start:12px; top:-48px;
  background: var(--ink); color:#fff; padding:10px 16px;
  border-radius: 2px; z-index: 200; transition: top .15s ease;
}

.wdv-home-page .skip-link:focus { top:12px; }

.wdv-home-page .site-header {
  position: sticky; top:0; z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid var(--line-soft);
}

.wdv-home-page .site-header.is-scrolled { box-shadow: 0 8px 24px rgba(32,26,76,0.08); }

.wdv-home-page .header-row {
  display:flex; align-items:center; gap:20px;
  padding-block: 12px;
}

.wdv-home-page .main-nav {
  margin-inline-start: auto;
  display:flex; align-items:center; gap: 28px;
}

.wdv-home-page .main-nav a {
  text-decoration:none; color: var(--ink); font-size: 0.96rem;
  padding-block: 6px; position:relative;
}

.wdv-home-page .main-nav a::after {
  content:""; position:absolute; inset-inline-start:0; bottom:0;
  width:0; height:2px; background: var(--violet); transition: width .18s ease;
}

.wdv-home-page .main-nav a:hover::after { width:100%; }

.wdv-home-page .header-actions { display:flex; align-items:center; gap:14px; }

.wdv-home-page .nav-cta {
  display:inline-flex; align-items:center; gap:9px;
  padding: 9px 18px;
  background: var(--ink);
  color:#fff;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 7px;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  transition: background .15s ease;
}

.wdv-home-page .nav-cta:hover { background: var(--violet-deep); }

.wdv-home-page .nav-cta .cta-arrow { display:inline-block; }

html.wdv-home-page[dir="rtl"] .nav-cta .cta-arrow { transform: scaleX(-1); }

.wdv-home-page .nav-toggle {
  display:none; border:0; background:transparent; cursor:pointer;
  width:40px; height:40px; padding:8px;
}

.wdv-home-page .nav-toggle span { display:block; width:100%; height:2px; background:var(--ink); margin:6px 0; }

.wdv-home-page .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform:translateY(8px) rotate(45deg); }

.wdv-home-page .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity:0; }

.wdv-home-page .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform:translateY(-8px) rotate(-45deg); }

@media (max-width: 1100px){
  .wdv-home-page .nav-toggle { display:block; }

  .wdv-home-page .main-nav {
      position:absolute; inset-inline: 0; top:100%; margin:0;
      background: var(--paper); border-top:1px solid var(--line);
      flex-direction:column; align-items:flex-start; gap:0;
      padding: 8px 24px 20px;
      max-height:calc(100dvh - var(--dv-header-height, 150px)); overflow-y:auto;
      transform: translateY(-8px); opacity:0; visibility:hidden; pointer-events:none;
      transition: opacity .16s ease, transform .16s ease;
    }

  .wdv-home-page .main-nav.is-open { opacity:1; visibility:visible; transform:none; pointer-events:auto; }

  .wdv-home-page .main-nav a { width:100%; padding-block:12px; border-bottom:1px solid var(--line-soft); }

  .wdv-home-page .header-row { flex-wrap:wrap; }

  .wdv-home-page .header-actions { flex-wrap:wrap; }

  .wdv-home-page .nav-toggle { flex-shrink:0; }
}

.wdv-home-page .btn {
  display:inline-flex; align-items:center; gap:10px;
  padding: 13px 26px; font-family: var(--font-body); font-weight:600;
  font-size: 0.95rem; text-decoration:none; border-radius: 2px;
  border: 1px solid transparent; cursor:pointer; line-height:1;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}

.wdv-home-page .btn:active { transform: translateY(1px); }

.wdv-home-page .btn-primary { background: var(--ink); color:#fff; }

.wdv-home-page .btn-primary:hover { background: var(--violet-deep); }

.wdv-home-page .btn-secondary { background:transparent; color: var(--ink); border-color: var(--ink); }

.wdv-home-page .btn-secondary:hover { background: var(--ink); color:#fff; }

.wdv-home-page .btn-row { display:flex; flex-wrap:wrap; gap:14px; margin-top: 8px; }

.wdv-home-page .hero {
  padding-block: 50px 25px;
  position: relative; overflow: hidden;
}

.wdv-home-page .hero-grid {
  display:grid; grid-template-columns: 1.05fr 0.95fr;
  column-gap: 40px;
}

@media (max-width: 900px){
  .wdv-home-page .hero-grid { grid-template-columns: 1fr; }

  .wdv-home-page .hero-art { order:-1; }
}

.wdv-home-page .hero h1 { margin-bottom: 0.4em; }

.wdv-home-page .hero .lede { margin-bottom: 1.6em; }

.wdv-home-page .hero-art { display:flex; justify-content:right; }

.wdv-home-page .hero-art svg, .wdv-home-page .hero-art img { width:100%; height:380px; max-width: 520px; }

.wdv-home-page .section-head { max-width: 62ch; margin-bottom: 44px; }

.wdv-home-page .section-head.center { margin-inline:auto; text-align:center; }

.wdv-home-page .card-grid {
  display:grid; gap: 22px;
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 980px){
  .wdv-home-page .card-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 640px){
  .wdv-home-page .card-grid { grid-template-columns: 1fr; }
}

.wdv-home-page .card {
  background: var(--paper); border: 1px solid var(--line);
  border-inline-start: 3px solid var(--violet);
  padding: 28px 26px; border-radius: var(--radius);
}

.wdv-home-page .card.accent-teal { border-inline-start-color: var(--teal); }

.wdv-home-page .card h3 { font-size: 1.18rem; margin-bottom: 10px; }

.wdv-home-page .card p { font-size: 0.95rem; color: var(--ink-soft); margin-bottom: 0; max-width: none; }

.wdv-home-page .cta-band {
  background: var(--violet-deep); color:#fff; padding-block: 40px;
  position: relative;
}

.wdv-home-page .cta-band h2 { color:#fff; margin-bottom: 0.35em; }

.wdv-home-page .cta-band p { color: rgba(255,255,255,0.85); }

.wdv-home-page .cta-inner { display:flex; justify-content:space-between; align-items:flex-end; gap: 32px; flex-wrap:wrap; }

.wdv-home-page .cta-band .btn-primary { background:#fff; color: var(--ink); }

.wdv-home-page .cta-band .btn-primary:hover { background: var(--linen); }

.wdv-home-page .cta-band .btn-secondary { color:#fff; border-color: rgba(255,255,255,0.6); }

.wdv-home-page .cta-band .btn-secondary:hover { background:#fff; color: var(--ink); }

.wdv-home-page .site-footer {
  background: var(--ink-deep); color: rgba(242,239,233,0.86);
  padding-block: 56px 28px;
  position: relative; overflow:hidden;
}

.wdv-home-page .site-footer::after {
  content:""; position:absolute; inset-inline:0; bottom:0; height: 230px;
  background-image: url("../img/footer-wave.svg");
  background-repeat:no-repeat; background-size:100% 100%; background-position:bottom;
  pointer-events:none;
}

.wdv-home-page .site-footer .container { position:relative; z-index:1; }

.wdv-home-page .footer-grid {
  display:grid; grid-template-columns: 1.3fr 1fr 1fr 190px; gap: 36px;
  padding-bottom: 36px; border-bottom: 1px solid rgba(255,255,255,0.14);
}

@media (max-width: 980px){
  .wdv-home-page .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 640px){
  .wdv-home-page .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 460px){
  .wdv-home-page .footer-grid { grid-template-columns: 1fr; }
}

.wdv-home-page .footer-col h5 { font-family: var(--font-head); font-size: 0.92rem; color:#fff; margin: 0 0 14px; }

.wdv-home-page .footer-col ul { list-style:none; margin:0; padding:0; }

.wdv-home-page .footer-col li { margin-bottom: 10px; }

.wdv-home-page .footer-col a { color: rgba(242,239,233,0.82); text-decoration:none; font-size: 0.92rem; }

.wdv-home-page .footer-col a:hover { color:#fff; text-decoration:underline; }

.wdv-home-page .footer-connect {
  border-inline-start: 1px solid rgba(255,255,255,0.16);
  padding-inline-start: 28px;
}

@media (max-width: 980px){
  .wdv-home-page .footer-connect { border-inline-start:0; border-top:1px solid rgba(255,255,255,0.16); padding-inline-start:0; padding-top:24px; grid-column: 1 / -1; }
}

.wdv-home-page .footer-social { display:flex; gap:10px; margin-bottom: 20px; }

.wdv-home-page .footer-social a {
  width:34px; height:34px; display:flex; align-items:center; justify-content:center;
  background: rgba(255,255,255,0.08); border-radius:7px; color:#fff;
  transition: background .15s ease;
}

.wdv-home-page .footer-social a:hover { background: rgba(255,255,255,0.2); }

.wdv-home-page .footer-social svg { width:16px; height:16px; }

.wdv-home-page .footer-bottom {
  display:flex; justify-content:space-between; align-items:center;
  padding-top: 22px; font-size: 0.82rem; color: rgba(242,239,233,0.6);
  flex-wrap:wrap; gap:14px;
}

.wdv-home-page .footer-legal { display:flex; gap:22px; list-style:none; margin:0; padding:0; }

.wdv-home-page .footer-legal a { color:inherit; text-decoration:none; }

.wdv-home-page .footer-legal a:hover { color:#fff; text-decoration:underline; }

.wdv-home-page .cta-description { max-width: 52ch; }

.wdv-home-page .footer-description { margin-top: 14px; max-width: 32ch; color: rgba(242,239,233,0.75); font-size: 0.92rem; }

.wdv-home-page .dv-brand { display:flex; align-items:center; gap:10px; text-decoration:none; flex:0 0 auto; }

.wdv-home-page .dv-brand img { height:55px; width:auto; }

.wdv-home-page .dv-brand-text { font-family: var(--font-head); font-size:1.7rem; font-weight:500; color: var(--ink); letter-spacing:-0.01em; }

.wdv-home-page .dv-brand-text b { font-weight:700; }

.wdv-home-page .dv-brand-text span { color: var(--violet); font-weight:400; }

.wdv-home-page .btn-ghost { background:transparent; color: var(--ink); border-color: var(--line); padding:9px 18px; font-size:0.85rem; border-radius:7px; }

.wdv-home-page .btn-ghost:hover { border-color: var(--ink); }

.wdv-home-page .dv-hero { padding-block: 56px 36px; }

.wdv-home-page .dv-hero h1 { margin-bottom:0.4em; }

.wdv-home-page .dv-hero .lede { max-width:46ch; color: var(--ink); margin-bottom:1.6em; }

.wdv-home-page .dv-checks { display:flex; flex-wrap:wrap; gap:20px; margin-top:26px; }

.wdv-home-page .dv-check { display:inline-flex; align-items:center; gap:8px; font-size:0.84rem; color: var(--ink-soft); }

.wdv-home-page .dv-check svg { width:14px; height:14px; padding:5px; box-sizing:content-box; border-radius:50%; background: rgba(125,112,217,0.14); color: var(--violet-deep); }

.wdv-home-page .dv-preview { background: var(--paper); border:1px solid var(--line); border-radius:14px; overflow:hidden; box-shadow:0 30px 60px -28px rgba(19,15,48,0.3); }

.wdv-home-page .dv-pv-grid { display:grid; grid-template-columns:150px 1fr; }

.wdv-home-page .dv-pv-rail { background: var(--ink); padding:14px 10px; color: rgba(242,239,233,0.78); font-size:0.66rem; }

.wdv-home-page .dv-pv-rail .dv-pv-logo { display:flex; align-items:center; gap:6px; color:#fff; font-family:var(--font-head); font-weight:700; font-size:0.74rem; padding:2px 6px 14px; }

.wdv-home-page .dv-pv-rail .dv-pv-logo img { height:22px; }

.wdv-home-page .dv-pv-rail h6 { margin:10px 6px 6px; font-size:0.54rem; letter-spacing:.08em; color: rgba(242,239,233,0.5); text-transform:uppercase; font-weight:600; }

.wdv-home-page .dv-pv-rail a { display:block; padding:7px 8px; border-radius:6px; text-decoration:none; color:inherit; }

.wdv-home-page .dv-pv-rail a.on { background: var(--violet); color:#fff; }

.wdv-home-page .dv-pv-main { padding:14px 16px 16px; min-width:0; background: var(--linen); }

.wdv-home-page .dv-pv-top { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; }

.wdv-home-page .dv-pv-top b { font-family:var(--font-head); font-size:0.95rem; }

.wdv-home-page .dv-pv-search { flex:0 1 230px; background:var(--paper); border:1px solid var(--line); border-radius:999px; padding:6px 12px; font-size:0.62rem; color: var(--ink-soft); }

.wdv-home-page .dv-pv-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:10px; }

.wdv-home-page .dv-pv-stat { display:flex; align-items:center; gap:8px; background:var(--paper); border:1px solid var(--line-soft); border-radius:10px; padding:10px; }

.wdv-home-page .dv-pv-stat .ico { width:30px; height:30px; border-radius:8px; background: rgba(125,112,217,0.12); color: var(--violet-deep); display:grid; place-items:center; flex:0 0 auto; }

.wdv-home-page .dv-pv-stat .ico svg { width:16px; height:16px; }

.wdv-home-page .dv-pv-stat b { display:block; font-family:var(--font-head); font-size:0.95rem; line-height:1.1; }

.wdv-home-page .dv-pv-stat span { font-size:0.58rem; color: var(--ink-soft); }

.wdv-home-page .dv-pv-panels { display:grid; grid-template-columns:1.1fr 1fr; gap:8px; }

.wdv-home-page .dv-pv-panel { background:var(--paper); border:1px solid var(--line-soft); border-radius:10px; padding:10px 12px; }

.wdv-home-page .dv-pv-panel h6 { display:flex; justify-content:space-between; margin:0 0 8px; font-family:var(--font-head); font-size:0.7rem; color: var(--ink); }

.wdv-home-page .dv-pv-panel h6 a { font-family:var(--font-body); font-weight:500; font-size:0.56rem; color: var(--violet-deep); text-decoration:none; }

.wdv-home-page .dv-pv-file { display:flex; align-items:center; gap:8px; padding:6px 0; font-size:0.6rem; line-height:1.3; }

.wdv-home-page .dv-pv-file b { display:block; font-size:0.64rem; }

.wdv-home-page .dv-pv-file span.sub { color: var(--ink-soft); font-size:0.54rem; }

.wdv-home-page .dv-ft { width:24px; height:28px; border-radius:4px; display:grid; place-items:center; font-size:0.46rem; font-weight:800; flex:0 0 auto; color:#ad263b; background:#fce8ec; }

.wdv-home-page .dv-ft.doc { color:#3264c8; background:#eaf0ff; }

.wdv-home-page .dv-ft.xls { color:#087d6b; background:#e4f5ee; }

.wdv-home-page .dv-pv-comp { display:flex; align-items:center; gap:10px; }

.wdv-home-page .dv-donut { width:62px; height:62px; border-radius:50%; flex:0 0 auto; display:grid; place-items:center;
  background: conic-gradient(#087d6b 0 94%, #986000 94% 98.2%, var(--line) 98.2% 100%); }

.wdv-home-page .dv-donut span { width:46px; height:46px; border-radius:50%; background:var(--paper); display:grid; place-items:center; text-align:center; font-family:var(--font-head); font-weight:700; font-size:0.8rem; line-height:1; }

.wdv-home-page .dv-donut small { display:block; font-family:var(--font-body); font-weight:400; font-size:0.44rem; color: var(--ink-soft); }

.wdv-home-page .dv-legend { list-style:none; margin:0; padding:0; font-size:0.54rem; color: var(--ink-soft); }

.wdv-home-page .dv-legend li { display:flex; align-items:center; gap:5px; margin:3px 0; }

.wdv-home-page .dv-legend i { width:6px; height:6px; border-radius:50%; background:#087d6b; }

.wdv-home-page .dv-legend li:nth-child(2) i { background:#986000; }

.wdv-home-page .dv-legend li:nth-child(3) i { background: var(--line); }

.wdv-home-page .dv-pv-activity { display:flex; align-items:flex-end; justify-content:space-between; gap:8px; margin-top:8px; }

.wdv-home-page .dv-bars { display:flex; align-items:flex-end; gap:4px; height:44px; }

.wdv-home-page .dv-bars i { width:7px; background: var(--violet); border-radius:2px 2px 0 0; opacity:.85; }

.wdv-home-page .dv-pv-activity b { font-family:var(--font-head); font-size:0.8rem; display:block; text-align:right; }

.wdv-home-page .dv-pv-activity span { font-size:0.48rem; color: var(--ink-soft); }

@media (max-width:560px){
  .wdv-home-page .dv-pv-grid { grid-template-columns:1fr; }

  .wdv-home-page .dv-pv-rail { display:none; }

  .wdv-home-page .dv-pv-panels { grid-template-columns:1fr; }
}

.wdv-home-page .dv-icon { display:inline-flex; align-items:center; justify-content:center; width:42px; height:42px; border-radius:10px; margin-bottom:14px; background: rgba(125,112,217,0.12); color: var(--violet-deep); }

.wdv-home-page .dv-icon svg { width:22px; height:22px; }

.wdv-home-page .dv-icon.teal { background: rgba(47,157,148,0.12); color: var(--teal); }

.wdv-home-page .dv-features .card-grid { grid-template-columns:repeat(3,1fr); }

@media (max-width:980px){
  .wdv-home-page .dv-features .card-grid { grid-template-columns:repeat(2,1fr); }
}

@media (max-width:640px){
  .wdv-home-page .dv-features .card-grid { grid-template-columns:1fr; }
}

.wdv-home-page .dv-plans { display:grid; grid-template-columns:repeat(3,1fr); gap:22px; align-items:stretch; max-width:1100px; margin-inline:auto; }

@media (max-width:860px){
  .wdv-home-page .dv-plans { grid-template-columns:1fr; }
}

.wdv-home-page .dv-plan { position:relative; background:var(--paper); border:1px solid var(--line); border-radius:var(--radius); padding:26px 28px; }

.wdv-home-page .dv-plan h3 { margin-bottom:4px; font-size:1.35rem; }

.wdv-home-page .dv-plan p { font-size:0.88rem; color: var(--ink-soft); max-width:none; }

.wdv-home-page .dv-plan ul { list-style:none; margin:16px 0 0; padding:0; }

.wdv-home-page .dv-plan li { display:flex; align-items:center; gap:10px; font-size:0.88rem; margin-bottom:10px; }

.wdv-home-page .dv-plan li svg { width:15px; height:15px; color: var(--violet-deep); flex:0 0 auto; }

.wdv-home-page .dv-plan.is-popular { border:2px solid var(--violet); background: rgba(125,112,217,0.06); }

.wdv-home-page .dv-badge { position:absolute; top:14px; inset-inline-end:14px; background:var(--violet-deep); color:#fff; font-size:0.7rem; font-weight:600; padding:3px 12px; border-radius:999px; }

.wdv-home-page .dv-footer-brand { display:flex; align-items:center; gap:10px; color:#fff; text-decoration:none; font-family:var(--font-head); font-weight:700; font-size:1.1rem; }

.wdv-home-page .dv-features .section-head, .wdv-home-page .dv-plans-head { max-width: 80ch; }

.wdv-home-page .dv-plan { background-clip: padding-box; }

.wdv-home-page .dv-plan.is-popular { background: linear-gradient(rgba(125,112,217,0.07), rgba(125,112,217,0.07)), var(--paper); }

.wdv-home-page .dv-cta-copy { max-width: 60ch; }

.wdv-home-page .dv-security { padding-bottom:0; }

.wdv-home-page #security-trust, .wdv-home-page #features, .wdv-home-page #plans { scroll-margin-top:calc(var(--dv-header-height, 110px) + 16px); }

.wdv-home-page .dv-security .section-head { max-width:1100px; margin-bottom:24px; }

.wdv-home-page .dv-security .lede { max-width:none; margin-inline:auto; }

.wdv-home-page .dv-security-copy { max-width:1050px; margin:0 auto; color:var(--ink-soft); }

.wdv-home-page .dv-security-strip { background:var(--paper); border-block:1px solid var(--line-soft); }

.wdv-home-page .dv-security-items { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); list-style:none; margin-block:0; padding-block:24px; }

.wdv-home-page .dv-security-items li { display:flex; align-items:center; justify-content:center; gap:16px; padding-inline:20px; font-family:var(--font-head); font-size:0.95rem; font-weight:600; line-height:1.4; }

.wdv-home-page .dv-security-items li + li { border-inline-start:1px solid var(--line); }

.wdv-home-page .dv-security-items svg { width:36px; height:36px; flex:0 0 36px; color:var(--ink); }

@media (max-width:980px){
  .wdv-home-page .dv-security-items { grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px 0; }

  .wdv-home-page .dv-security-items li { justify-content:flex-start; }

  .wdv-home-page .dv-security-items li:nth-child(3) { border-inline-start:0; }
}

@media (max-width:560px){
  .wdv-home-page .dv-security-items { grid-template-columns:1fr; }

  .wdv-home-page .dv-security-items li { padding-inline:0; }

  .wdv-home-page .dv-security-items li + li { border-inline-start:0; }
}

@media (min-width:861px){
  .wdv-home-page .dv-plans { grid-template-columns:repeat(5,minmax(0,1fr)); max-width:none; gap:16px; }

  .wdv-home-page .dv-plans .dv-plan { min-width:0; padding-inline:18px; }

  .wdv-home-page .dv-plans .dv-badge { top:-12px; }
}

.wdv-home-page .dv-storage-card { display:flex; align-items:flex-start; gap:20px; }

.wdv-home-page .dv-storage-card > .dv-icon { flex:0 0 48px; width:48px; height:48px; margin-top:3px; margin-bottom:0; background:transparent; }

.wdv-home-page .dv-storage-card > .dv-icon svg { width:48px; height:48px; }

.wdv-home-page .dv-storage-card h3 { font-size:1.28rem; }

.wdv-home-page .dv-storage-copy { min-width:0; }

.wdv-home-page .footer-col .dv-footer-brand { font-size:1.25rem; font-weight:400; }

.wdv-home-page .dv-footer-brand img { width:70px; height:70px; object-fit:contain; flex:0 0 70px; }

.wdv-home-page .dv-footer-brand b { font-weight:700; }

.wdv-home-page .dv-hero .hero-art.dv-hero-art-centered { align-items:center; }

.wdv-home-page .dv-hero .dv-preview.dv-preview-full { width:100%; }

.wdv-home-page .dv-pv-panel.dv-pv-panel-spaced { margin-bottom:8px; }

.wdv-home-page .dv-bars .dv-bar-30 { height:30%; }

.wdv-home-page .dv-bars .dv-bar-38 { height:38%; }

.wdv-home-page .dv-bars .dv-bar-34 { height:34%; }

.wdv-home-page .dv-bars .dv-bar-52 { height:52%; }

.wdv-home-page .dv-bars .dv-bar-45 { height:45%; }

.wdv-home-page .dv-bars .dv-bar-62 { height:62%; }

.wdv-home-page .dv-bars .dv-bar-58 { height:58%; }

.wdv-home-page .dv-bars .dv-bar-80 { height:80%; }

.wdv-home-page .dv-bars .dv-bar-100 { height:100%; }

.wdv-home-page .section-head p.dv-centered-lede { margin-inline:auto; }

.wdv-home-page .dv-plan h3.dv-plan-title { display:flex; align-items:center; gap:10px; }

.wdv-home-page .dv-plan-title svg.dv-plan-heading-icon { width:26px; height:26px; flex:0 0 26px; }

.wdv-home-page .dv-plan li svg.dv-plan-capacity-icon { width:18px; height:18px; color:var(--ink); }

.wdv-home-page .dv-plan-title svg.dv-plan-heading-icon-wide { width:30px; height:26px; flex:0 0 30px; }

.wdv-home-page .cta-inner .btn-row.dv-cta-actions { margin-top:0; }

.wdv-home-page .footer-connect .footer-product-by-label, .wdv-home-page .footer-connect .footer-product-by-tagline { margin:0; font-size:0.84rem; color:rgba(242,239,233,0.65); max-width:none; }

.wdv-home-page .footer-connect .footer-product-by-label { margin-bottom:10px; }

.wdv-home-page .footer-product-by-mark { display:flex; align-items:center; margin-bottom:10px; }

.wdv-home-page .footer-product-by-mark img { display:block; width:150px; max-width:100%; height:auto; }

/* Responsive refinements for narrower desktop, tablet and phone screens. */

.wdv-home-page .hero-grid > *, .wdv-home-page .footer-grid > *, .wdv-home-page .cta-inner > * { min-width:0; }

.wdv-home-page .dv-plan-title { overflow-wrap:anywhere; }

.wdv-home-page .nav-toggle { position:relative; }

.wdv-home-page .nav-toggle span { margin:0; position:absolute; inset-inline:8px; width:auto; top:19px; }

.wdv-home-page .nav-toggle span:nth-child(1) { top:11px; }

.wdv-home-page .nav-toggle span:nth-child(3) { top:27px; }

@media (min-width:981px) and (max-width:1199px){
  .wdv-home-page .dv-plans { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

@media (min-width:641px) and (max-width:980px){
  .wdv-home-page .dv-plans { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width:1199px){
  .wdv-home-page .footer-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }

  .wdv-home-page .footer-connect { border-inline-start:0; border-top:1px solid rgba(255,255,255,0.16); padding-inline-start:0; padding-top:24px; grid-column:1 / -1; }
}

@media (max-width:640px){
  .wdv-home-page .footer-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }

  .wdv-home-page .footer-grid > .footer-col:first-child { grid-column:1 / -1; }

  .wdv-home-page .dv-plans { grid-template-columns:minmax(0,1fr); }

  .wdv-home-page .dv-plans .dv-badge { top:-12px; }

  .wdv-home-page .footer-legal { flex-wrap:wrap; gap:10px 22px; }
}

@media (max-width:560px){
  .wdv-home-page .dv-hero h1 { font-size:clamp(2rem,7.5vw,2.6rem); }

  .wdv-home-page .dv-pv-stats { grid-template-columns:minmax(0,1fr); }

  .wdv-home-page .dv-pv-search { display:none; }
}

@media (max-width:460px){
  .wdv-home-page .footer-grid { grid-template-columns:minmax(0,1fr); }
}

/* Brand tagline, beneath the product name in the header and footer. */

.wdv-home-page .dv-brand { flex-shrink:1; min-width:0; max-width:100%; }

.wdv-home-page .dv-brand-copy { display:flex; flex-direction:column; min-width:0; }

.wdv-home-page .dv-brand-text { white-space:nowrap; }

.wdv-home-page .dv-brand-tagline { display:block; margin-top:3px; font-family:var(--font-body); font-size:0.6rem; font-weight:500; line-height:1.5; letter-spacing:0.08em; text-transform:uppercase; color:var(--ink-soft); }

.wdv-home-page .dv-footer-brand .dv-brand-tagline { color:rgba(242,239,233,0.6); }

/* Workflow template administration reuses the shared shell, table and form components. */
.workflow-template-layout{display:grid;grid-template-columns:minmax(0,1fr) 350px;gap:24px;align-items:start}
.workflow-template-form{min-width:0}
.workflow-template-form [hidden]{display:none}
.workflow-template-footer{margin:20px -22px -20px;padding:18px 22px;border-top:1px solid var(--border)}
.workflow-template-help-title{display:flex;align-items:center;gap:12px}
.workflow-template-help-title > span{display:inline-flex;flex:0 0 26px;color:var(--purple-deep)}
.workflow-template-help-title svg{width:26px;height:26px}
.workflow-template-help > p{margin-top:12px;line-height:1.55}
.workflow-template-key-details{margin-top:20px;padding-top:20px;border-top:1px solid var(--border)}
.workflow-template-help dl{display:grid;gap:20px;margin:18px 0 0;font-size:13px}
.workflow-template-help-detail{position:relative;min-height:42px;padding-left:56px}
.workflow-template-help dt{font-weight:600;margin:0}
.workflow-template-help dd{margin:4px 0 0;color:var(--ink-soft);line-height:1.45}
.workflow-template-help-icon{position:absolute;top:0;left:0;display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:10px;background:var(--purple-tint);color:var(--purple-deep)}
.workflow-template-help-icon svg{width:24px;height:24px}
.user-edit-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:24px;align-items:start}
.custom-reminder-layout{display:grid;grid-template-columns:minmax(0,1fr) 395px;gap:20px;align-items:start}
.custom-reminder-card,.custom-reminder-sidebar{min-width:0}
#customReminderForm [hidden]{display:none}
.custom-reminder-card .sharing-setup-row{grid-template-columns:minmax(150px,.65fr) minmax(0,1.65fr)}
.custom-reminder-card .sharing-setup-row:first-child{padding-top:0}
.custom-reminder-card .sharing-delivery-reminders + .sharing-setup-row{border-top:1px solid var(--border-soft)}
.custom-reminder-card .sharing-row-controls > .field:last-child{margin-bottom:0}
.custom-reminder-card .sharing-row-controls > .field:not(:last-child){margin-bottom:16px}
.custom-reminder-card .sharing-document-selection{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
.custom-reminder-metadata{margin-top:16px}
.custom-reminder-hold-metadata .field + .field{margin-top:16px}
.custom-reminder-metadata input:disabled,.custom-reminder-metadata textarea:disabled{background:var(--surface-sunken);color:var(--ink-soft);opacity:1;cursor:not-allowed}
.custom-reminder-card .required{color:var(--red)}
.custom-reminder-deadline{width:calc((100% - 16px)/2)}
.custom-reminder-card .workflow-reminder-controls > .field:first-child{margin-top:18px}
.custom-reminder-card fieldset:disabled{opacity:.55}
.custom-reminder-card fieldset:disabled fieldset:disabled{opacity:1}
.custom-reminder-card #customOverdueFields{margin-top:16px}
.custom-reminder-recurring{margin-top:18px}
.custom-reminder-channels{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.custom-reminder-sidebar .reminder-info-heading{padding-bottom:14px;border-bottom:1px solid var(--border);margin-bottom:0}
.custom-reminder-sidebar .reminder-info-heading + .hint{margin-top:14px}
.custom-reminder-guidance p{font-size:14px;color:var(--ink-soft);line-height:1.55;margin:14px 0 0}
.custom-reminder-guidance h3{padding-bottom:14px;border-bottom:1px solid var(--border);margin-bottom:0}
.custom-reminder-summary-row{display:grid;grid-template-columns:36px minmax(90px,.8fr) minmax(0,1fr);gap:10px;align-items:center;padding:12px 0;border-bottom:1px solid var(--border-soft);font-size:12px}
.custom-reminder-summary-row:last-child{border-bottom:0;padding-bottom:0}
.custom-reminder-summary-row strong{font-weight:600;overflow-wrap:anywhere}
.custom-reminder-summary-row .badge{justify-self:start}
.custom-reminder-summary-icon{display:flex;color:var(--purple-deep)}
.custom-reminder-timeline{list-style:none;margin:18px 0 0;padding:0 0 0 10px;font-size:12px}
.custom-reminder-timeline li{position:relative;border-left:1px solid var(--purple);padding:0 0 20px 18px}
.custom-reminder-timeline li:last-child{border-left:0;padding-bottom:0}
.custom-reminder-timeline li::before{content:'';position:absolute;width:9px;height:9px;left:-5px;top:3px;border-radius:50%;background:var(--purple)}
.custom-reminder-timeline strong,.custom-reminder-timeline span{display:block}
.custom-reminder-timeline span{margin-top:4px;color:var(--ink-soft)}
.custom-reminder-timeline .custom-reminder-date-row{display:grid;grid-template-columns:max-content minmax(0,1fr);column-gap:12px}
.custom-reminder-date-row > span{margin-top:0}
.custom-reminder-date-row > span::before{content:'—';margin-right:8px;color:var(--purple)}
.custom-reminder-timeline .custom-reminder-followup::before{box-sizing:border-box;background:var(--surface);border:1px solid var(--purple)}
.custom-reminder-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px;padding:16px 20px}
.custom-reminder-renewal{margin-right:auto}
.reminder-detail-layout > .stack,.reminder-detail-card{min-width:0}
.reminder-detail-card .sharing-setup-row{align-items:center}
.reminder-detail-card .sharing-row-label{align-items:center}
.reminder-detail-card .sharing-row-label > .card-icon svg{width:18px;height:18px}
.reminder-detail-card .sharing-setup-row.sharing-delivery-reminders{align-items:start}
.reminder-detail-card .sharing-delivery-reminders + .sharing-setup-row{border-top:1px solid var(--border-soft)}
.reminder-detail-value{font-size:14px;overflow-wrap:anywhere}
.reminder-detail-value .hint{margin:6px 0 0}
.reminder-detail-offset{padding:7px 14px;border-radius:999px;background:var(--ink);color:var(--surface);font-size:12px}
.reminder-detail-schedule-row{padding-top:14px;margin-top:14px;border-top:1px solid var(--surface)}
.reminder-detail-schedule-row p{margin:6px 0 0;font-size:13px}
.reminder-detail-history-row{display:flex;gap:12px;align-items:start;padding:14px 0;overflow-wrap:anywhere}
.reminder-detail-history-row + .reminder-detail-history-row{border-top:1px solid var(--border-soft)}
.reminder-detail-history-row:first-of-type{padding-top:0}
.reminder-detail-history-row .hint{margin:6px 0 0}
.reminder-detail-notes{white-space:normal;overflow-wrap:anywhere;font-size:14px;line-height:1.6}
.reminder-detail-actions{flex-wrap:wrap;align-items:center}
.reminder-detail-actions form{margin:0}
.reminder-detail-back{margin-right:auto}

@media(max-width:1150px){.custom-reminder-layout{grid-template-columns:minmax(0,1fr)}.custom-reminder-sidebar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.custom-reminder-guidance{grid-column:1/-1}}
@media(max-width:700px){.custom-reminder-card .sharing-setup-row,.custom-reminder-sidebar,.custom-reminder-channels{grid-template-columns:minmax(0,1fr)}.custom-reminder-deadline{width:100%}}
.user-edit-content{min-width:0}
.user-edit-actions{margin-top:20px}
.user-edit-tabs .tab{white-space:nowrap}
.user-access-reminders{display:grid;gap:18px}
.user-access-schedule-section{padding:14px 0;border-bottom:1px solid var(--border)}
.user-access-schedule-section:last-child{padding-bottom:0;border-bottom:0}
.user-access-schedule .workflow-reminder-switch{display:flex}
.user-access-schedule-section h5{margin:0 0 10px;font-size:13px;font-weight:600}
.user-access-schedule-section p{margin:0 0 12px;font-size:12px}
.user-access-schedule-section .field-label{margin-bottom:0;font-size:12px}
.user-access-schedule-section input[type=number]{margin-top:6px}
.user-access-schedule .user-access-recurring-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:650px){.user-access-schedule .user-access-recurring-grid{grid-template-columns:minmax(0,1fr)}}
@media(max-width:1000px){.user-edit-layout{grid-template-columns:minmax(0,1fr)}}
.workflow-step{margin-bottom:16px}
.workflow-step .add-assignment{margin-bottom:18px}
.workflow-step-reminders{margin:18px 0;border:1px solid var(--purple);border-radius:10px;background:var(--purple-tint);overflow:hidden}
.workflow-step-reminders-heading{padding:12px 16px}
.workflow-step-reminders-heading h4{display:flex;align-items:center;gap:10px;margin:0;font-size:14px;font-weight:600}
.workflow-step-reminders-heading p{margin:4px 0 0;font-size:12px}
.workflow-step-reminders-body{padding:12px 16px 16px;background:color-mix(in srgb,var(--purple-tint) 35%,var(--surface))}
.reminder-permissions-panel .reminder-permission-option{align-items:center;padding:10px 0;border-bottom:1px solid var(--border)}
.reminder-permission-option:has(input:disabled){opacity:.55;cursor:default}
.workflow-reminder-controls,.workflow-overdue-controls{min-width:0;margin:0;padding:0;border:0}
.workflow-reminder-switch{display:flex;align-items:flex-start;gap:12px;margin:0;font-size:13px;font-weight:600;cursor:pointer}
.workflow-reminder-switch .switch{flex-shrink:0}
.workflow-reminder-switch small{display:block;margin-top:4px;font-size:12px;font-weight:400;line-height:1.5;color:var(--ink-soft)}
.workflow-reminder-row{display:grid;grid-template-columns:150px minmax(0,1fr);align-items:center;gap:16px;padding:12px 0;border-bottom:1px solid var(--border);font-size:13px;font-weight:600}
.workflow-reminder-row > label{margin:0}
.workflow-reminder-first{display:flex;align-items:center;flex-wrap:wrap;gap:10px;font-weight:400}
.workflow-reminder-first select{width:120px;max-width:100%}
.workflow-reminder-row .reminder-chips{margin:0}
.workflow-step-reminders .reminder-chip input:checked + span{background:var(--ink);border-color:var(--ink);color:var(--surface)}
.workflow-reminder-overdue{padding-top:14px}
.workflow-overdue-controls .reminder-form-grid{margin:16px 0}
.workflow-overdue-controls .reminder-form-grid label{font-size:12px}
.workflow-step-reminders fieldset:disabled{opacity:.55}
.workflow-step-reminders fieldset:disabled fieldset:disabled{opacity:1}
.workflow-reminder-legacy{margin:0;padding:0 16px 16px}
.workflow-template-help .workflow-reminder-help-note{padding:10px;border-radius:8px;background:var(--purple-tint)}
@media(max-width:650px){.workflow-reminder-row{grid-template-columns:minmax(0,1fr);gap:8px}}
.workflow-step .assignment-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:12px;margin:8px 0}
.workflow-template-updated{white-space:nowrap}
.workflow-step-tags{display:flex;flex-wrap:wrap;gap:6px;min-width:180px;max-width:420px}
.workflow-step-trigger{font:inherit;font-size:12px;color:var(--ink-soft);background:var(--bg);border:1px solid var(--border);border-radius:5px;padding:4px 8px;cursor:pointer;text-align:left}
.workflow-step-trigger:focus-visible{outline:2px solid var(--purple-deep);outline-offset:2px}
.workflow-step-popover{position:fixed;inset:auto;margin:0;padding:12px;max-width:min(320px,calc(100vw - 16px));background:var(--surface);color:var(--ink);border:1px solid var(--border);border-radius:var(--radius-s);box-shadow:var(--shadow-md);font-size:13px;pointer-events:none}
.workflow-step-popover span,.workflow-step-popover strong{display:block;margin:3px 0}
@media(max-width:1100px){.workflow-template-layout{grid-template-columns:minmax(0,1fr)}.workflow-template-help{max-width:none}}
@media(max-width:600px){.workflow-step .assignment-row{grid-template-columns:minmax(0,1fr) auto}.workflow-step .assignment-type{grid-column:1/-1}}

/* Backend document viewer: the sidebar is measured without changing its cards. */
.document-detail-layout > .stack{min-width:0}
.document-details-heading{display:flex;align-items:center;gap:12px}
.document-reminders-header{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.document-reminders-header .hint{margin:10px 0 0}
.document-reminder-sources{padding:0 18px}
.document-reminder-source,.document-reminder-record{display:grid;grid-template-columns:36px minmax(0,1fr) auto;gap:14px;align-items:center;padding:18px 0}
.document-reminder-source + .document-reminder-source,.document-reminder-record + .document-reminder-record{border-top:1px solid var(--border)}
.document-reminder-copy{min-width:0;overflow-wrap:anywhere}
.document-reminder-copy h4{margin:0}
.document-reminder-copy .hint{margin:6px 0 0;line-height:1.5}
.document-reminder-copy .hint strong{font-weight:500}
.document-reminder-record{grid-template-columns:36px minmax(0,1fr) auto auto}
.document-reminder-record:first-child{padding-top:0}
.document-reminder-record:last-child{padding-bottom:0}
.document-reminder-title{font-weight:600}
.document-reminder-empty{display:flex;align-items:center;gap:12px}
.document-reminder-empty .hint{margin:0}
@media(max-width:700px){.document-reminder-source,.document-reminder-record{grid-template-columns:36px minmax(0,1fr)}.document-reminder-source > .btn,.document-reminder-record > .badge{grid-column:2}.document-reminder-record > .btn{grid-column:2;justify-self:start}.document-reminders-header > .btn{margin-left:50px}}

.document-preview-card{display:flex;flex-direction:column;gap:14px;min-height:0;padding:10px}
.document-preview-viewer{display:flex;flex-direction:column;min-height:0;flex:1}
.document-preview-viewer .sd-viewer-toolbar{flex-shrink:0}
.document-viewer-title{display:flex;align-items:center;gap:10px;min-width:0;flex:1 1 180px;font-size:12px;font-weight:600;overflow-wrap:anywhere}
.document-viewer-title > span{display:flex;flex-shrink:0}
.document-viewer-title svg{width:22px;height:22px}
.document-preview-viewer .sd-viewer-page-scroll{flex:1;height:calc(60vh + 200px);max-height:none;min-height:0;margin:0;padding:12px;background:var(--surface-sunken)}
.document-preview-card > .flex-between{flex-shrink:0;flex-wrap:wrap;margin:0 4px}
.document-preview-card .document-preview-footer{flex-shrink:0;margin:0 4px 4px}
.document-preview-placeholder{display:flex;flex:1;min-height:260px;align-items:center;justify-content:center;flex-direction:column;gap:12px;padding:24px;background:var(--surface-sunken);border-radius:10px;text-align:center}
.document-preview-placeholder svg{width:36px;height:36px;color:var(--ink-faint)}
@media(min-width:1181px){.document-preview-card{height:var(--document-viewer-height,640px)}.document-preview-viewer .sd-viewer-page-scroll{height:auto}}
@media(max-width:1180px){.document-preview-viewer{flex:none}.document-preview-viewer .sd-viewer-page-scroll{flex:none;min-height:280px}}

.document-delivery-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:28px;height:28px;margin:-5px 0;border-radius:8px;background:var(--purple-tint);color:var(--purple-deep)}
.document-delivery-icon svg{width:18px;height:18px}

.document-delivery-action:hover,.document-delivery-action:focus-visible{background:var(--purple);border-color:var(--purple);color:var(--surface)}

/* User document reports extend the shared cards, Documents filters and tables. */
.user-report-summary{grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;}
.user-report-summary .summary-card{display:flex;align-items:center;gap:14px;padding:18px 16px;box-shadow:var(--shadow-sm);}
.user-report-summary .label{font-size:11px;font-weight:700;text-transform:uppercase;}
.user-report-summary .value{margin-top:4px;font-size:25px;}
.user-report-stat-icon{display:flex;align-items:center;justify-content:center;flex:0 0 48px;height:48px;border-radius:12px;background:var(--purple-tint);color:var(--purple-deep);}
.user-report-stat-icon svg{width:28px;height:28px;}
.user-report-stat-icon.green{background:var(--green-tint);color:var(--green);}
.user-report-stat-icon.amber{background:var(--amber-tint);color:var(--amber);}
.user-report-filters{overflow:visible;}
.user-report-detail-filters{margin-bottom:18px;}
.user-report-filters .table-toolbar{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:12px;align-items:center;}
.user-report-filters .table-toolbar>label{grid-column:span 2;display:block;min-width:0;}
.user-report-filters input,.user-report-filters select{width:100%;min-width:0;}
.user-report-filters label:has(select[name=group_id]){grid-column:span 6;}
.user-report-filters label:has(select[name=owner_id]){grid-column:span 5;}
.user-report-filters label:has(select[name=per_page]){grid-column:span 1;}
.user-report-filters .table-toolbar .filter-search{flex:0 0 auto;min-width:0;width:100%;}
.user-report-filters .table-toolbar>.user-report-search,.user-report-activities{grid-column:span 6;min-width:0;}
.user-report-activity-select{position:relative;font-weight:400;}
.user-report-activity-select>summary{display:flex;align-items:center;gap:10px;min-height:42px;padding:7px 12px;border:1px solid var(--border);border-radius:9px;background:var(--surface);cursor:pointer;list-style:none;}
.user-report-activity-select>summary::-webkit-details-marker{display:none;}
.user-report-activity-select>summary:focus-visible,.user-report-activity-select[open]>summary{outline:none;border-color:var(--purple);box-shadow:0 0 0 3px var(--purple-tint);}
.user-report-activity-select>summary>svg{width:18px;height:18px;flex-shrink:0;margin-left:auto;color:var(--ink);}
.user-report-activity-chips{display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-width:0;}
.user-report-activity-chip{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border-radius:5px;background:var(--purple-tint);color:var(--purple-deep);font-size:12px;}
.user-report-activity-chip button{display:flex;align-items:center;justify-content:center;width:18px;height:18px;padding:0;border:0;border-radius:3px;background:none;color:inherit;font:inherit;font-size:18px;cursor:pointer;}
.user-report-activity-chip button:hover{background:var(--surface);}
.user-report-activity-chip button:focus-visible{outline:2px solid var(--purple);}
.user-report-activity-placeholder{color:var(--ink-faint);font-size:13px;}
.user-report-activity-panel{position:absolute;z-index:30;top:calc(100% + 5px);left:0;right:0;padding:10px;border:1px solid var(--border);border-radius:10px;background:var(--surface);box-shadow:var(--shadow-md);}
.user-report-activity-options{max-height:230px;overflow-y:auto;margin-top:8px;}
.user-report-filters label.user-report-activity-option{display:flex;flex-direction:row;align-items:center;gap:10px;padding:10px 8px;border-radius:5px;font-size:13px;font-weight:400;cursor:pointer;}
.user-report-activity-option:hover{background:var(--purple-tint);}
.user-report-activity-option input{width:17px;height:17px;margin:0;accent-color:var(--purple);}
.user-report-activities [hidden]{display:none!important;}
.user-report-table table{min-width:1100px;}
.user-report-table td.user-report-number{text-align:right;font-variant-numeric:tabular-nums;}
.user-report-table .avatar-sm{flex-shrink:0;}
.user-report-table .row-actions-menu button:disabled{opacity:.5;cursor:not-allowed;}
.user-report-breakdown{grid-template-columns:repeat(5,minmax(0,1fr));margin-top:18px;}
.user-report-breakdown meter{width:100%;margin-top:12px;accent-color:var(--purple);}
@media(max-width:1400px){.user-report-summary{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:1100px){.user-report-filters .table-toolbar{grid-template-columns:repeat(2,minmax(0,1fr));}.user-report-filters .table-toolbar>label{grid-column:auto;}.user-report-filters .table-toolbar>.user-report-search,.user-report-activities{grid-column:span 2;}.user-report-breakdown{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:600px){.user-report-summary{grid-template-columns:repeat(2,minmax(0,1fr));}.user-report-summary .summary-card{flex-direction:column;align-items:flex-start;}.user-report-filters .table-toolbar{grid-template-columns:1fr;}.user-report-filters .table-toolbar>label,.user-report-filters .table-toolbar>.user-report-search,.user-report-activities{grid-column:auto;}}

/* Dashboard user activity reuses the report scope and existing SVG chart components. */
.dashboard-user-activity{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:20px;align-items:stretch;}
.dashboard-user-activity>.dashboard-panel{min-width:0;min-height:300px;}
.dashboard-page .dashboard-user-chart{display:block;width:100%;height:auto;padding:0 18px 16px;}
.dashboard-user-bar{fill:var(--purple-darker);}
.dashboard-user-rank-1{fill:var(--purple-deep);}
.dashboard-user-rank-2{fill:var(--purple);}
.dashboard-user-rank-3{fill:var(--purple);opacity:.7;}
.dashboard-user-rank-4{fill:var(--purple);opacity:.45;}
.dashboard-user-types{gap:22px;min-height:230px;}
.dashboard-user-type-table{flex:1;min-width:0;overflow-x:auto;}
.dashboard-user-type-table table{width:100%;min-width:0;font-size:12px;}
.dashboard-user-type-table th,.dashboard-user-type-table td{padding:8px 5px;white-space:nowrap;}
.dashboard-user-type-table th{font-size:10px;background:transparent;}
.dashboard-user-type-table th:not(:first-child),.dashboard-user-type-table td:not(:first-child){text-align:right;font-variant-numeric:tabular-nums;}
.dashboard-user-type-table .dashboard-type-swatch{width:11px;height:11px;border-radius:50%;margin-right:8px;vertical-align:middle;}
.dashboard-user-activity .dashboard-activity-colour-viewed{stroke:var(--purple-darker);background:var(--purple-darker);}
.dashboard-user-activity .dashboard-activity-colour-downloaded{stroke:var(--teal);background:var(--teal);}
.dashboard-user-activity .dashboard-activity-colour-shared{stroke:var(--green);background:var(--green);}
.dashboard-user-activity .dashboard-activity-colour-uploaded{stroke:var(--amber);background:var(--amber);}
.dashboard-user-activity .dashboard-activity-colour-reviewed{stroke:var(--purple);background:var(--purple);}
.dashboard-user-types-empty{padding-top:0;}
@media(max-width:1100px){.dashboard-user-activity{grid-template-columns:minmax(0,1fr);}.dashboard-user-types{justify-content:center;}.dashboard-user-type-table{max-width:400px;}}
@media(max-width:500px){.dashboard-user-chart-scroll{overflow-x:auto;}.dashboard-page .dashboard-user-chart{min-width:540px;}.dashboard-user-types{flex-direction:column;gap:12px;}.dashboard-user-types .dashboard-donut-wrap{width:160px;flex:auto;}.dashboard-user-type-table{width:100%;flex:auto;}}

/* Reminders reuse shared cards, fields, tables, buttons and theme tokens. */
.reminder-stat-icon svg { width:24px; height:24px; }
.reminder-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:18px; margin-bottom:24px; }
.reminder-stat { display:flex; align-items:center; gap:16px; }
.reminder-stat b { display:block; font-size:28px; line-height:1.4; }
.reminder-stat-icon { width:48px; height:48px; padding:12px; background:var(--purple-tint); color:var(--purple-deep); border-radius:12px; }
.reminder-layout { display:grid; grid-template-columns:minmax(0,1fr) 285px; gap:20px; align-items:start; }
.reminder-info p { margin:14px 0; font-size:14px; }
.reminder-info h3 { margin:6px 0 14px; }
.reminder-heading { display:flex; justify-content:space-between; align-items:start; gap:16px; margin-bottom:16px; }
.reminder-filters { padding:16px 0; container-type:inline-size; }
.reminder-filter-primary { display:grid; grid-template-columns:minmax(0,1fr) 280px 140px; gap:12px; align-items:end; }
.reminder-filter-secondary { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:12px; align-items:end; margin-top:12px; }
.reminder-filters label { min-width:0; font-size:12px; font-weight:600; }
.reminder-filters input,.reminder-filters select { width:100%; min-width:0; max-width:100%; }
.reminder-list { min-width:0; }
.reminder-table-note { display:block; margin-top:4px; max-width:250px; }
.reminder-panel { border:1px solid var(--border); border-radius:10px; padding:16px; margin:18px 0; background:var(--purple-tint); }
.reminder-panel legend { font-weight:700; }
.reminder-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.reminder-form .field { margin-bottom:16px; }
.reminder-chips { display:flex; gap:8px; flex-wrap:wrap; margin:16px 0; }
.reminder-chip { position:relative; cursor:pointer; }
.reminder-chip input { position:absolute; opacity:0; width:1px; height:1px; }
.reminder-chip span { display:block; border:1px solid var(--border); padding:8px 14px; border-radius:24px; background:var(--surface); font-size:13px; }
.reminder-chip input:checked+span { background:var(--ink); color:white; border-color:var(--ink); }
.reminder-chip input:focus-visible+span { outline:3px solid var(--purple); outline-offset:2px; }
.reminder-details { display:grid; grid-template-columns:180px minmax(0,1fr); gap:12px; margin-bottom:24px; }
.reminder-details dt { font-weight:600; }
.reminder-details dd { margin:0; }
.reminder-settings-section { margin-bottom:18px; }
.reminder-bulk { margin-bottom:12px; }
@media(max-width:1100px) { .reminder-layout { grid-template-columns:minmax(0,1fr); } .reminder-info { order:2; } }
@media(max-width:650px) { .reminder-stats { grid-template-columns:repeat(2,minmax(0,1fr)); } .reminder-form-grid { grid-template-columns:1fr; } .reminder-heading { flex-direction:column; } .reminder-details { grid-template-columns:1fr; } }

.document-detail-tabs { margin-bottom:16px; }

.reminder-list table { min-width:850px; }
.reminder-list thead { background:var(--purple-tint); }
.reminder-list td:first-child:not(.select-all-th) { min-width:170px; }
.reminder-form label { display:block; }
.switch input:focus-visible + .track { outline:2px solid var(--purple-deep); outline-offset:3px; }
@media(max-width:650px) { .reminder-stat { flex-direction:column; align-items:flex-start; gap:8px; } .reminder-stat strong { overflow-wrap:anywhere; } }

/* Reminder lists reuse the app's underline tabs and document table controls. */
.reminder-list-tabs .tab { display:inline-flex; align-items:center; gap:8px; }
.reminder-list-tabs svg { width:18px; height:18px; }
.reminder-list .reminder-filters .filter-search { display:flex; width:100%; padding:4px 4px 4px 10px; background:var(--surface); border:1px solid var(--border); border-radius:9px; }
.reminder-list .reminder-filters .filter-search input[type=search] { padding:4px 0; font-weight:400; }
.reminder-list .filter-search > svg { flex-shrink:0; }
/* Respond to the filter card width, including when the wide legend sits beside it. */
@container(max-width:664px) {
  .reminder-filter-primary { grid-template-columns:minmax(0,2fr) minmax(0,1fr); }
  .reminder-filter-primary > label:first-child { grid-column:1 / -1; }
}
@container(max-width:340px) {
  .reminder-filter-primary,.reminder-filter-secondary { grid-template-columns:minmax(0,1fr); }
}

.nav-item .nav-reminders-icon { width:18px; height:18px; object-fit:contain; flex-shrink:0; opacity:.85; }
.nav-item.active .nav-reminders-icon { opacity:1; }

.badge.reminder-open { background:#dbeafe; color:#2563eb; }
.reminder-list > .reminder-filters { padding-top:0; }

.reminder-list .select-all-th { box-sizing:border-box; width:40px; min-width:40px; max-width:40px; padding-left:12px; padding-right:12px; }
.reminder-list .select-all-th .tbl-check { display:block; margin:0; }
.reminder-list .select-all-th + th,.reminder-list .select-all-th + td { padding-left:8px; }

.reminder-info-heading { display:flex; align-items:center; gap:10px; }
.reminder-info-heading > svg { width:22px; height:22px; flex-shrink:0; color:var(--purple-deep); }
.reminder-module-overview { list-style:none; margin:12px 0 0; padding:0; }
.reminder-module-overview li { display:grid; grid-template-columns:28px minmax(0,1fr) auto; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--border-soft); font-size:13px; }
.reminder-module-overview li:last-child { border-bottom:0; }
.reminder-module-overview strong { text-align:right; }
.reminder-module-overview-icon { display:flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:8px; color:var(--purple-deep); background:var(--purple-tint); }
.reminder-module-overview-icon svg { width:22px; height:22px; }

.reminder-legend-badge { margin-bottom:0; }
.reminder-legend-dot { width:7px; height:7px; border-radius:50%; background:currentColor; flex-shrink:0; }

/* Keep legend badges and explanations side by side in reminder lists. */
.reminder-list-layout { grid-template-columns:minmax(0,1fr) 390px; }
.reminder-list-layout.reminder-list-all { grid-template-columns:minmax(0,1fr) 390px; }
.reminder-list-all .reminder-legend-row { box-sizing:border-box; grid-template-columns:100px minmax(0,1fr); gap:8px; min-height:45px; padding:8px 0; }
.reminder-legend-row { display:grid; box-sizing:border-box; grid-template-columns:100px minmax(0,1fr); align-items:center; gap:8px; min-height:45px; padding:8px 0; border-bottom:1px solid var(--border-soft); font-size:14px; }
.reminder-legend-row .badge { justify-self:start; }
.reminder-legend-row:last-of-type { border-bottom:0; }
@media(max-width:1100px) { .reminder-list-layout,.reminder-list-layout.reminder-list-all { grid-template-columns:minmax(0,1fr); } }

/* Reminder date-range selector: presets and paired calendars in the shared theme. */
.date-range-picker { min-width:0; grid-column:span 2; }
.date-range-fallback { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.date-range-fallback[hidden],.date-range-trigger[hidden] { display:none; }
.date-range-trigger { width:100%; min-height:43px; justify-content:flex-start; }
.date-range-trigger > span { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:left; }
.date-range-trigger > svg { width:18px; height:18px; flex-shrink:0; }
.date-range-trigger > svg:last-child { width:14px; }
.date-range-popup { position:fixed; inset:auto; margin:0; padding:0; width:690px; max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); overflow:auto; border:1px solid var(--border); border-radius:var(--radius-s); background:var(--surface); color:var(--ink); box-shadow:var(--shadow-md); }
.date-range-heading { display:flex; align-items:center; justify-content:space-between; padding:10px 16px; border-bottom:1px solid var(--border-soft); }
.date-range-heading h3 { margin:0; font-size:14px; }
.date-range-body { display:grid; grid-template-columns:145px minmax(0,1fr); }
.date-range-presets { display:flex; flex-direction:column; gap:2px; padding:10px 8px; border-right:1px solid var(--border); }
.date-range-presets button { padding:8px 10px; border:0; border-radius:5px; background:none; color:var(--ink-soft); font:inherit; font-size:12px; text-align:left; cursor:pointer; }
.date-range-presets button:hover { background:var(--purple-tint); color:var(--purple-deep); }
.date-range-presets button.active { background:var(--purple); color:var(--surface); }
.date-range-main { padding:12px; min-width:0; }
.date-range-calendars { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.date-range-month-heading { display:grid; grid-template-columns:30px minmax(0,1fr) 30px; align-items:center; margin-bottom:8px; text-align:center; font-size:12px; }
.date-range-month-heading .row-actions-trigger { width:30px; height:28px; font-size:22px; }
.date-range-month:nth-child(2) .date-range-month-heading .row-actions-trigger { grid-column:3; grid-row:1; }
.date-range-month:nth-child(2) .date-range-month-heading strong { grid-column:2; grid-row:1; }
.date-range-days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); row-gap:3px; }
.date-range-weekday { font-size:11px; font-weight:600; text-align:center; padding:4px 0; }
.date-range-day { display:flex; align-items:center; justify-content:center; min-width:0; height:29px; padding:0; border:0; border-radius:3px; font:inherit; font-size:12px; background:none; color:var(--ink); text-align:center; }
button.date-range-day { cursor:pointer; }
button.date-range-day:hover { background:var(--purple-tint); color:var(--purple-deep); }
.date-range-day.outside { color:var(--ink-faint); opacity:.6; }
.date-range-day.in-range { background:var(--purple-tint); border-radius:0; }
.date-range-day.selected { background:var(--purple); color:var(--surface); }
.date-range-day[aria-current=date]:not(.selected) { box-shadow:inset 0 0 0 1px var(--purple); }
.date-range-popup button:focus-visible { outline:2px solid var(--purple-deep); outline-offset:1px; }
.date-range-inputs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:14px; }
.date-range-inputs label { font-size:12px; color:var(--ink-soft); }
.date-range-inputs input { display:block; margin-top:4px; width:100%; min-width:0; }
.date-range-help { margin:10px 0 0; min-height:18px; }
.date-range-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px; border-top:1px solid var(--border); }
.date-range-footer .actions { display:flex; gap:8px; }
@container(max-width:340px) { .date-range-picker { grid-column:1 / -1; } }
@media(max-width:600px) {
  .date-range-body { grid-template-columns:minmax(0,1fr); }
  .date-range-presets { flex-direction:row; flex-wrap:wrap; border-right:0; border-bottom:1px solid var(--border); }
  .date-range-presets button { padding:6px 8px; }
  .date-range-calendars { gap:8px; }
  .date-range-main { padding:10px; }
  .date-range-footer { flex-wrap:wrap; }
  .date-range-footer .actions { margin-left:auto; }
}
@media(max-width:360px) { .date-range-calendars { grid-template-columns:minmax(0,1fr); } }

.user-report-filters .table-toolbar > .date-range-picker { grid-column:span 4; }
@media(max-width:1100px) { .user-report-filters .table-toolbar > .date-range-picker { grid-column:span 2; } }
@media(max-width:600px) { .user-report-filters .table-toolbar > .date-range-picker { grid-column:1 / -1; } }

/* Secure-delivery reminders follow the existing setup-row and switch components. */
.sharing-delivery-reminders { padding:14px 12px; margin:12px 0; border-radius:10px; background:var(--purple-tint); }
.sharing-reminder-toggle { display:flex; align-items:flex-start; gap:8px; }
.sharing-reminder-toggle > label:not(.switch) { margin:2px 0 0; font-size:12px; font-weight:600; }
.sharing-reminder-enable { margin-bottom:12px; }
.sharing-row-controls .sharing-reminder-condition { margin-bottom:12px; }
.sharing-reminder-schedule { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.sharing-reminder-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-top:14px; }
.sharing-reminder-schedule .field,.sharing-reminder-condition { min-width:0; }
.sharing-reminder-schedule label { font-size:12px; }
@media(max-width:600px) { .sharing-reminder-schedule,.sharing-reminder-options { grid-template-columns:minmax(0,1fr); } }

.sharing-reminder-fields { min-width:0; margin:0; padding:0; border:0; }
.sharing-reminder-fields:disabled { opacity:.5; }
.sharing-reminder-fields:disabled input,.sharing-reminder-fields:disabled select,.sharing-reminder-fields:disabled label { cursor:not-allowed; }
.sharing-row-label > .sharing-reminders-icon,.workflow-step-reminders-heading .sharing-reminders-icon,.reminder-detail-card .card-icon > .sharing-reminders-icon { display:inline-block; flex-shrink:0; width:22px; height:22px; background:var(--purple-deep); -webkit-mask:url('../img/reminders.svg') center / contain no-repeat; mask:url('../img/reminders.svg') center / contain no-repeat; }

.sharing-reminder-toggle.is-disabled { opacity:.5; }
.sharing-reminder-toggle.is-disabled label { cursor:not-allowed; }

.sharing-reminder-offsets { min-width:0; margin:0; padding:0; border:0; }
.sharing-reminder-offsets legend { padding:0; font-size:12px; font-weight:600; }
.sharing-reminder-offsets .reminder-chips { margin:8px 0 14px; }
.sharing-reminder-audience label { font-size:12px; }
.sharing-reminder-owner { margin-top:14px; }

fieldset.sharing-reminder-audience { min-width:0; margin:0; padding:0; border:0; }
.sharing-reminder-audience legend { padding:0; margin-bottom:8px; font-size:12px; font-weight:600; }
.sharing-reminder-recipient-options { display:flex; align-items:center; flex-wrap:wrap; gap:12px 24px; }
.sharing-reminder-recipient-option { display:flex; align-items:center; gap:8px; font-weight:400; cursor:pointer; }
.sharing-reminder-recipient-option .tbl-radio { margin:0; flex-shrink:0; }

.sharing-delivery-reminders.sharing-setup-row:last-child { padding-bottom:20px; }

.sharing-reminder-summary { margin-top:14px; padding:0 10px; border-radius:8px; background:var(--purple-tint); }
.sharing-reminder-summary .sharing-summary-item { padding:12px 0; border-bottom-color:var(--surface); }
.sharing-reminder-summary .sharing-summary-item:last-child { padding-bottom:12px; }

/* Delivery & Scheduling settings use the app's cards, icons, inputs and type scale. */
.reminder-settings-tabs .tab { display:inline-flex; align-items:center; gap:8px; }
.reminder-settings-tabs .tab > span { display:flex; }
.reminder-settings-tabs svg { width:18px; height:18px; }
.reminder-delivery-presets { margin-bottom:16px; }
.reminder-delivery-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; align-items:stretch; }
.reminder-settings-card { min-width:0; }
.reminder-settings-card-heading { display:flex; align-items:flex-start; gap:12px; margin-bottom:18px; }
.reminder-settings-card-heading > .card-icon { width:40px; height:40px; }
.reminder-settings-card-heading > .card-icon svg { width:24px; height:24px; }
.reminder-settings-card-heading h2 { margin:0 0 4px; font-size:16px; }
.reminder-settings-card-heading p { margin:0; font-size:12px; }
.reminder-settings-card label,.reminder-delivery-field-label { font-size:12px; font-weight:600; }
.reminder-settings-card input,.reminder-settings-card select,.reminder-settings-card textarea { width:100%; min-width:0; }
.reminder-delivery-field-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(95px,.65fr); align-items:center; gap:12px; margin:12px 0 0; }
.reminder-delivery-toggle { display:flex; align-items:center; gap:10px; margin:12px 0; }
.reminder-delivery-toggle .switch input { width:0; }
.reminder-delivery-input-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:12px; }
.reminder-delivery-input-grid input { display:block; margin-top:6px; }
.reminder-delivery-defaults,.reminder-custom-presets { margin-top:16px; }
.reminder-delivery-defaults summary,.reminder-custom-presets summary { font-size:12px; font-weight:600; cursor:pointer; color:var(--purple-deep); }
.reminder-custom-presets label { display:block; margin-top:12px; }
.reminder-custom-presets textarea { display:block; margin-top:6px; }
.reminder-delivery-preset-row { display:grid; grid-template-columns:190px minmax(0,1fr); gap:16px; align-items:center; margin-top:18px; }
.reminder-delivery-presets > .reminder-delivery-field-row { grid-template-columns:190px minmax(0,1fr); gap:16px; }
.reminder-delivery-preset-options { display:flex; align-items:stretch; flex-wrap:wrap; gap:10px; }
.reminder-preset-tile { display:flex; align-items:center; gap:7px; min-width:100px; padding:8px 12px; border:1px solid var(--border); border-radius:8px; background:var(--surface); color:var(--ink); text-align:left; cursor:pointer; font:inherit; font-size:12px; }
.reminder-preset-tile.is-active { border-color:var(--purple); background:var(--purple-tint); color:var(--purple-deep); box-shadow:0 1px 2px rgba(99,87,204,.15); }
.reminder-preset-tile small { display:block; margin-top:2px; font-size:11px; color:var(--ink-soft); }
.reminder-preset-selected { display:none; }
.reminder-preset-tile.is-active .reminder-preset-selected { display:flex; }
.reminder-preset-selected svg { width:16px; height:16px; }
.reminder-preset-tile:focus-visible { outline:2px solid var(--purple-deep); outline-offset:2px; }
.reminder-delivery-note { display:flex; align-items:flex-start; gap:8px; padding:8px 10px; margin:12px 0 0; border-radius:8px; background:var(--purple-tint); font-size:12px; color:var(--ink-soft); }
.reminder-delivery-note svg { width:18px; height:18px; flex-shrink:0; color:var(--purple-deep); }
.reminder-completion-rule { display:flex; align-items:center; gap:10px; font-size:12px; }
.reminder-completion-rule .card-icon { width:28px; height:28px; }
.reminder-scheduling-guidance p { font-size:12px; }
.reminder-guidance-notes { list-style:none; padding:0; margin:12px 0 0; }
.reminder-guidance-notes li { position:relative; padding-left:16px; margin-bottom:10px; font-size:12px; }
.reminder-guidance-notes li::before { content:''; position:absolute; left:0; top:6px; width:6px; height:6px; border-radius:50%; background:var(--purple); box-shadow:0 0 0 3px var(--purple-tint); }
.reminder-guidance-checks { list-style:none; padding:0; margin:12px 0 0; }
.reminder-guidance-checks li { display:flex; align-items:flex-start; gap:8px; margin-bottom:12px; font-size:12px; }
.reminder-guidance-checks svg { width:18px; height:18px; color:var(--green); }
@media(max-width:1250px) { .reminder-delivery-preset-row,.reminder-delivery-presets > .reminder-delivery-field-row { grid-template-columns:minmax(0,1fr); gap:8px; } }
@media(max-width:800px) { .reminder-delivery-grid { grid-template-columns:minmax(0,1fr); } }
@media(max-width:450px) { .reminder-delivery-field-row,.reminder-delivery-input-grid { grid-template-columns:minmax(0,1fr); gap:6px; } }

.reminder-delivery-content { min-width:0; container-type:inline-size; }
@container(max-width:650px) { .reminder-delivery-grid { grid-template-columns:minmax(0,1fr); } }
@container(max-width:730px) { .reminder-delivery-preset-row,.reminder-delivery-presets > .reminder-delivery-field-row { grid-template-columns:minmax(0,1fr); gap:8px; } }

.reminder-add-preset { align-self:flex-start; min-height:54px; background:var(--surface-sunken); white-space:nowrap; }
.reminder-add-preset:hover { background:var(--surface); }

.reminder-settings-layout { grid-template-columns:minmax(0,1fr) 320px; }
@media(max-width:1100px) { .reminder-settings-layout { grid-template-columns:minmax(0,1fr); } }

/* General reminder settings share the delivery tab's card and icon treatment. */
.reminder-general-section { margin-bottom:16px; }
.reminder-general-section:last-child { margin-bottom:0; }
.reminder-general-enable { display:flex; align-items:center; gap:16px; }
.reminder-general-enable .reminder-settings-card-heading { flex:1; margin:0; }
.reminder-general-enable .switch input,.reminder-general-toggle-row .switch input { width:0; }
.reminder-general-section .field { min-width:0; margin-bottom:0; }
.reminder-general-section .field > label { display:block; }
.reminder-general-section .field input { margin-top:6px; }
.reminder-general-section .input-icon-wrap { margin-top:6px; }
.reminder-general-section .input-icon-wrap input { margin-top:0; }
.reminder-general-toggle-row { display:flex; align-items:center; gap:14px; padding:14px 0; border-bottom:1px solid var(--border-soft); cursor:pointer; }
.reminder-general-toggle-row:first-child { padding-top:0; }
.reminder-general-toggle-row:last-child { padding-bottom:0; border-bottom:0; }
.reminder-general-toggle-row strong { display:block; font-size:13px; }
.reminder-general-toggle-row small { display:block; margin-top:3px; font-size:12px; font-weight:400; color:var(--ink-soft); }
.reminder-general-retention { display:grid; grid-template-columns:220px minmax(0,1fr); gap:24px; align-items:end; }
.reminder-general-retention input { display:block; margin-top:6px; }
.reminder-general-retention p { display:flex; align-items:flex-start; gap:8px; margin:0 0 8px; font-size:12px; }
.reminder-general-retention svg { width:18px; height:18px; flex-shrink:0; color:var(--purple-deep); }
.reminder-general-guidance p { font-size:12px; }
.reminder-general-guidance .reminder-guidance-checks svg { color:var(--purple-deep); }
.reminder-general-guidance .reminder-guidance-checks li > span:first-child { display:flex; padding:2px; border-radius:50%; background:var(--purple-tint); }
.reminder-settings-layout.reminder-modules-layout { grid-template-columns:minmax(0,1fr); }
.reminder-module-notice { align-items:flex-start; padding:18px 20px; border:1px solid var(--purple-tint); }
.reminder-module-notice > span { display:flex; flex-shrink:0; }
.reminder-module-notice > span svg { width:28px; height:28px; }
.reminder-module-notice strong { font-size:14px; }
.reminder-module-notice p { margin:4px 0 0; font-size:12px; }
.reminder-modules-table { min-width:1040px; width:100%; }
.reminder-modules-table thead th { background:var(--purple-tint); border-bottom:0; vertical-align:middle; white-space:normal; }
.reminder-modules-table thead th:first-child { border-radius:8px 0 0 8px; }
.reminder-modules-table thead th:last-child { border-radius:0 8px 8px 0; }
.reminder-modules-table th:first-child { min-width:240px; }
.reminder-modules-table th:not(:first-child):not(:last-child),.reminder-modules-table td:not(:first-child):not(:last-child) { min-width:100px; text-align:center; }
.reminder-module-name { display:flex; align-items:center; gap:12px; font-size:13px; }
.reminder-module-name .card-icon svg { width:22px; height:22px; }
.reminder-module-hint { display:inline-flex; vertical-align:middle; margin-left:5px; color:var(--purple-deep); }
.reminder-module-hint svg { width:14px; height:14px; }
.reminder-module-templates { display:flex; flex-direction:column; gap:6px; min-width:290px; }
.reminder-module-template { display:flex; align-items:center; gap:8px; padding:6px 10px; border-radius:8px; background:var(--purple-tint); color:var(--purple-deep); font-size:11px; text-decoration:none; }
.reminder-module-template span { overflow-wrap:anywhere; }
.reminder-module-template > svg { width:16px; height:16px; flex-shrink:0; }
.reminder-module-template:hover { background:var(--surface-sunken); text-decoration:none; }
@media(max-width:1250px) { .reminder-general-retention { grid-template-columns:minmax(0,1fr); gap:12px; } }

.reminder-modules-layout > div,.reminder-module-card { min-width:0; }
