/* ==========================================================================
   DLT custom theme: overrides for Bootstrap 3.3.7 + AdminLTE 2
   Loaded LAST in head_standard.php / head_standard_shared.php.
   Core framework files are untouched; remove the <link> to revert.

   Not overridden on purpose:
   - .ratingpoor/.ratingfair/.ratinggood/.ratingexcellent (+ .textrating*):
     coloured per user from their theme (themecss.php / dltlib/usercss.php).
   - Membership logo / tagline content (white-label).
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  /* Brand */
  --dlt-primary: #0064a2;          /* DLT blue */
  --dlt-primary-600: #00578d;
  --dlt-primary-700: #004a78;
  --dlt-primary-50: #e8f2f9;
  --dlt-primary-100: #cfe4f2;
  --dlt-accent: #f29a1f;           /* DLT orange, slightly deepened for contrast */
  --dlt-accent-50: #fef3e2;

  /* Status */
  --dlt-success: #1f9d6b;
  --dlt-success-50: #e6f6ef;
  --dlt-warning: #d98a06;
  --dlt-warning-50: #fdf4e1;
  --dlt-danger: #d64545;
  --dlt-danger-50: #fbeaea;
  --dlt-info: #2b8cc4;
  --dlt-info-50: #e7f3fa;

  /* Neutrals (no pure black) */
  --dlt-ink: #142130;              /* headings, sidebar */
  --dlt-ink-2: #1c2c3d;
  --dlt-text: #2f3d4c;
  --dlt-muted: #6b7a8a;
  --dlt-subtle: #95a2b0;
  --dlt-border: #e3e8ee;
  --dlt-border-strong: #cfd7e0;
  --dlt-surface: #ffffff;
  --dlt-surface-2: #f7f9fb;
  --dlt-canvas: #f1f4f7;

  /* Shape & depth */
  --dlt-radius-sm: 6px;
  --dlt-radius: 10px;
  --dlt-radius-lg: 14px;
  --dlt-shadow-sm: 0 1px 2px rgba(20, 33, 48, .06);
  --dlt-shadow: 0 1px 3px rgba(20, 33, 48, .06), 0 4px 14px rgba(20, 33, 48, .05);
  --dlt-shadow-lg: 0 10px 30px rgba(20, 33, 48, .12);
  --dlt-ring: 0 0 0 3px rgba(0, 100, 162, .18);

  /* Spacing scale */
  --dlt-space-1: 4px;
  --dlt-space-2: 8px;
  --dlt-space-3: 12px;
  --dlt-space-4: 16px;
  --dlt-space-5: 24px;
  --dlt-space-6: 32px;

  --dlt-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --dlt-ease: all .2s ease-in-out;
}

/* ---------- 2. Base & typography ---------- */
html, body {
  font-family: var(--dlt-font);
  color: var(--dlt-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { background: var(--dlt-canvas); font-size: 14px; line-height: 1.55; }

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--dlt-font);
  color: var(--dlt-ink);
  font-weight: 600;
  letter-spacing: -.01em;
}

a { color: var(--dlt-primary); transition: var(--dlt-ease); }
a:hover, a:focus { color: var(--dlt-primary-700); text-decoration: none; }

hr { border-top-color: var(--dlt-border); }
.text-muted { color: var(--dlt-muted); }
.text-primary { color: var(--dlt-primary); }
::selection { background: var(--dlt-primary-100); color: var(--dlt-ink); }

/* Legacy dlt.css headings used ProximaNova; bring them onto the same stack */
[style*="ProximaNova"], .catbtngo, .btnyellow { font-family: var(--dlt-font) !important; }

/* ---------- 3. Layout shell (AdminLTE) ---------- */
.content-wrapper, .right-side { background: var(--dlt-canvas); }
.content { padding: var(--dlt-space-5); }
/* Many legacy pages put rows straight into .content-wrapper with no
   section.content; give them the same gutter so .row margins line up */
.content-wrapper:not(:has(> .content, > section.content, > .content-header)) { padding: var(--dlt-space-5); }
@media (max-width: 767px) {
  .content-wrapper:not(:has(> .content, > section.content, > .content-header)) { padding: var(--dlt-space-4); }
}
.content-header { padding: var(--dlt-space-5) var(--dlt-space-5) 0; }
.content-header > h1 { font-size: 26px; font-weight: 700; color: var(--dlt-ink); }
.content-header > h1 > small { color: var(--dlt-subtle); font-weight: 500; font-size: 14px; }
.content-header > .breadcrumb { top: 22px; right: var(--dlt-space-5); font-size: 13px; background: transparent; }
.content-header > .breadcrumb > li > a { color: var(--dlt-muted); }

/* Header: logo block in ink, navbar bar white */
.skin-blue .main-header .logo {
  background: var(--dlt-ink);
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  transition: var(--dlt-ease);
}
.skin-blue .main-header .logo:hover { background: var(--dlt-ink-2); }
.skin-blue .main-header .navbar {
  background: var(--dlt-surface);
  border-bottom: 1px solid var(--dlt-border);
  box-shadow: var(--dlt-shadow-sm);
}
.skin-blue .main-header .navbar .nav > li > a,
.skin-blue .main-header .navbar .sidebar-toggle { color: var(--dlt-muted); transition: var(--dlt-ease); }
.skin-blue .main-header .navbar .nav > li > a:hover,
.skin-blue .main-header .navbar .nav > li > a:focus,
.skin-blue .main-header .navbar .nav .open > a,
.skin-blue .main-header .navbar .sidebar-toggle:hover {
  background: var(--dlt-surface-2);
  color: var(--dlt-primary);
}
/* Tagline strip ("Powered by Daily Life Tracker") */
.dlt-tagline {
  float: left;
  display: block;
  padding: 0 var(--dlt-space-4);
  line-height: 50px;
  font-size: 14px;
  font-weight: 600;
  color: var(--dlt-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50vw;
}
@media (max-width: 767px) { .dlt-tagline { display: none; } }

.main-header .navbar .label { font-weight: 600; border-radius: 999px; }
.main-header .navbar-custom-menu .user-menu > a,
.main-header .navbar-custom-menu > .navbar-nav > li > a { font-weight: 500; }

/* Sidebar */
.skin-blue .wrapper,
.skin-blue .main-sidebar,
.skin-blue .left-side { background: var(--dlt-ink); }
.skin-blue .sidebar-menu > li.header {
  background: transparent;
  color: rgba(255, 255, 255, .38);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: var(--dlt-space-5) var(--dlt-space-5) var(--dlt-space-2);
}
.skin-blue .sidebar-menu > li > a {
  margin: 2px var(--dlt-space-3);
  padding: 10px var(--dlt-space-3);
  border-left: 0;
  border-radius: var(--dlt-radius-sm);
  color: rgba(255, 255, 255, .72);
  font-weight: 500;
  transition: var(--dlt-ease);
}
.skin-blue .sidebar-menu > li > a > .fa,
.skin-blue .sidebar-menu > li > a > .ion,
.skin-blue .sidebar-menu > li > a > .glyphicon { width: 22px; opacity: .85; }
.skin-blue .sidebar-menu > li:hover > a {
  background: rgba(255, 255, 255, .06);
  color: #fff;
  border-left-color: transparent;
}
.skin-blue .sidebar-menu > li.active > a,
.skin-blue .sidebar-menu > li.menu-open > a {
  background: var(--dlt-primary);
  color: #fff;
  border-left-color: transparent;
  box-shadow: 0 4px 12px rgba(0, 100, 162, .35);
}
.skin-blue .sidebar-menu > li > .treeview-menu {
  background: transparent;
  margin: 0 var(--dlt-space-3);
  padding-left: var(--dlt-space-4);
}
.skin-blue .sidebar-menu .treeview-menu > li > a { color: rgba(255, 255, 255, .6); padding: 7px 10px; }
.skin-blue .sidebar-menu .treeview-menu > li.active > a,
.skin-blue .sidebar-menu .treeview-menu > li > a:hover { color: #fff; }
/* Collapsed (sidebar-mini) flyouts keep a rounded panel */
.sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > a > span:not(.pull-right),
.sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > .treeview-menu {
  background: var(--dlt-ink-2);
  border-radius: 0 var(--dlt-radius-sm) var(--dlt-radius-sm) 0;
}
.sidebar-mini.sidebar-collapse .sidebar-menu > li > a { margin: 2px 6px; }
@media (min-width: 768px) {
  /* collapsed: icon-only rail, labels pop out on hover (AdminLTE shows the <span>) */
  .sidebar-mini.sidebar-collapse .sidebar-menu > li > a { padding: 10px 0; text-align: center; }
  .sidebar-mini.sidebar-collapse .sidebar-menu > li > a > .fa { width: 38px; margin: 0; opacity: .9; }
  .sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > a > span:not(.pull-right) {
    top: 0; margin-left: -6px; padding: 10px 14px 10px 18px; line-height: 20px; color: #fff; font-weight: 500;
    box-shadow: 4px 4px 14px rgba(0, 0, 0, .25);
  }
  .sidebar-mini.sidebar-collapse .sidebar-menu > li.active:hover > a > span:not(.pull-right) { background: var(--dlt-primary); }
  /* collapsed logo: show just the coloured bars (the left ~70px of the 300x50 logo) scaled to fit the 50px strip */
  .sidebar-mini.sidebar-collapse .main-header .logo { padding: 0; }
  .sidebar-mini.sidebar-collapse .main-header .logo > .logo-mini { display: flex; align-items: center; justify-content: center; height: 100%; overflow: hidden; }
  .sidebar-mini.sidebar-collapse .main-header .logo > .logo-mini img { width: 42px !important; height: 30px; max-width: none !important; max-height: none !important; object-fit: cover; object-position: left center; }
}

.main-footer {
  background: var(--dlt-surface);
  border-top: 1px solid var(--dlt-border);
  color: var(--dlt-muted);
  padding: var(--dlt-space-4) var(--dlt-space-5);
}

/* ---------- 4. Cards (AdminLTE .box, Bootstrap .panel / .well) ---------- */
.box,
.panel {
  background: var(--dlt-surface);
  border: 1px solid var(--dlt-border);
  border-top: 1px solid var(--dlt-border);
  border-radius: var(--dlt-radius-lg);
  box-shadow: var(--dlt-shadow);
  margin-bottom: var(--dlt-space-5);
  transition: box-shadow .2s ease-in-out;
}
/* Colour variants become a slim accent instead of a heavy top border */
.box.box-primary, .box.box-info, .box.box-success,
.box.box-warning, .box.box-danger, .box.box-default { border-top-color: var(--dlt-border); }
.box.box-primary  > .box-header .box-title::before,
.box.box-info     > .box-header .box-title::before,
.box.box-success  > .box-header .box-title::before,
.box.box-warning  > .box-header .box-title::before,
.box.box-danger   > .box-header .box-title::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  vertical-align: 2px;
  background: var(--dlt-primary);
}
.box.box-info    > .box-header .box-title::before { background: var(--dlt-info); }
.box.box-success > .box-header .box-title::before { background: var(--dlt-success); }
.box.box-warning > .box-header .box-title::before { background: var(--dlt-accent); }
.box.box-danger  > .box-header .box-title::before { background: var(--dlt-danger); }
.box.box-solid > .box-header .box-title::before { display: none; }
/* Title already leads with an icon: the icon is the cue, skip the dot */
.box-header:has(.box-title > .fa:first-child, .box-title > .ion:first-child, .box-title > .glyphicon:first-child) .box-title::before { display: none; }

.box-header,
.panel-heading { padding: var(--dlt-space-4) var(--dlt-space-5); }
.box-header.with-border,
.panel-default > .panel-heading { border-bottom: 1px solid var(--dlt-border); background: transparent; }
.box-header .box-title,
.panel-title { font-size: 16px; font-weight: 600; color: var(--dlt-ink); }
.box-header > .box-tools { top: 12px; right: var(--dlt-space-4); }
.box-body,
.panel-body { padding: var(--dlt-space-5); }
.box-footer,
.panel-footer {
  background: var(--dlt-surface-2);
  border-top: 1px solid var(--dlt-border);
  border-radius: 0 0 var(--dlt-radius-lg) var(--dlt-radius-lg);
  padding: var(--dlt-space-3) var(--dlt-space-5);
}
.box .btn-box-tool { color: var(--dlt-subtle); border-radius: var(--dlt-radius-sm); transition: var(--dlt-ease); }
.box .btn-box-tool:hover { color: var(--dlt-primary); background: var(--dlt-primary-50); }

.well {
  background: var(--dlt-surface-2);
  border: 1px solid var(--dlt-border);
  border-radius: var(--dlt-radius);
  box-shadow: none;
}

/* Small stat boxes */
.small-box, .info-box {
  border-radius: var(--dlt-radius-lg);
  box-shadow: var(--dlt-shadow);
  overflow: hidden;
}
.info-box-icon { border-radius: var(--dlt-radius) 0 0 var(--dlt-radius); }

/* ---------- 5. Buttons ---------- */
.btn {
  font-family: var(--dlt-font);
  font-weight: 600;
  border-radius: var(--dlt-radius-sm);
  padding: 8px 16px;
  border-width: 1px;
  box-shadow: var(--dlt-shadow-sm);
  transition: var(--dlt-ease);
}
.btn:focus, .btn.focus, .btn:active:focus { outline: none; box-shadow: var(--dlt-ring); }
.btn:active, .btn.active { box-shadow: inset 0 1px 2px rgba(20, 33, 48, .12); transform: translateY(1px); }
.btn-lg { padding: 12px 22px; border-radius: var(--dlt-radius); }
.btn-sm { padding: 6px 12px; }
.btn-xs { padding: 3px 9px; font-size: 12px; border-radius: 5px; }

.btn-default {
  background: var(--dlt-surface);
  border-color: var(--dlt-border-strong);
  color: var(--dlt-text);
}
.btn-default:hover, .btn-default:focus { background: var(--dlt-surface-2); border-color: var(--dlt-subtle); color: var(--dlt-ink); }

.btn-primary { background: var(--dlt-primary); border-color: var(--dlt-primary); color: #fff; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active,
.open > .dropdown-toggle.btn-primary { background: var(--dlt-primary-600); border-color: var(--dlt-primary-600); color: #fff; }

.btn-info { background: var(--dlt-info); border-color: var(--dlt-info); color: #fff; }
.btn-info:hover, .btn-info:focus, .btn-info:active { background: #237aab; border-color: #237aab; color: #fff; }

.btn-success { background: var(--dlt-success); border-color: var(--dlt-success); color: #fff; }
.btn-success:hover, .btn-success:focus, .btn-success:active { background: #198559; border-color: #198559; color: #fff; }

.btn-warning { background: var(--dlt-accent); border-color: var(--dlt-accent); color: #fff; }
.btn-warning:hover, .btn-warning:focus, .btn-warning:active { background: var(--dlt-warning); border-color: var(--dlt-warning); color: #fff; }

.btn-danger { background: var(--dlt-danger); border-color: var(--dlt-danger); color: #fff; }
.btn-danger:hover, .btn-danger:focus, .btn-danger:active { background: #bf3a3a; border-color: #bf3a3a; color: #fff; }

.btn-link { color: var(--dlt-primary); box-shadow: none; font-weight: 500; }
.btn-link:hover { color: var(--dlt-primary-700); text-decoration: none; }

/* Soft / tonal variant for secondary actions */
.btn-soft { background: var(--dlt-primary-50); border-color: transparent; color: var(--dlt-primary); box-shadow: none; }
.btn-soft:hover, .btn-soft:focus { background: var(--dlt-primary-100); color: var(--dlt-primary-700); }

.btn-group > .btn:not(:first-child):not(:last-child) { border-radius: 0; }

/* Legacy pages give buttons fixed inline widths (e.g. width:120px) sized for the
   old font/padding; let the label decide, keeping the old width as a minimum. */
.content-wrapper .btn[style*="width:1"]:not(.btn-block),
.content-wrapper .btn[style*="width: 1"]:not(.btn-block) { width: auto !important; min-width: 120px; white-space: nowrap; }

/* ---------- 6. Forms ---------- */
.form-control,
input[type="text"]:not(.btn), input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="search"], select, textarea {
  font-family: var(--dlt-font);
}
.form-control {
  height: 38px;
  padding: 8px 12px;
  color: var(--dlt-text);
  background: var(--dlt-surface);
  border: 1px solid var(--dlt-border-strong);
  border-radius: var(--dlt-radius-sm);
  box-shadow: none;
  transition: var(--dlt-ease);
}
textarea.form-control { height: auto; }
.form-control:hover { border-color: var(--dlt-subtle); }
.form-control:focus { border-color: var(--dlt-primary); box-shadow: var(--dlt-ring); }
.form-control::placeholder { color: var(--dlt-subtle); }
.form-control[disabled], .form-control[readonly] { background: var(--dlt-surface-2); }
.input-sm { height: 32px; padding: 5px 10px; }
.input-group-addon {
  background: var(--dlt-surface-2);
  border-color: var(--dlt-border-strong);
  color: var(--dlt-muted);
  border-radius: var(--dlt-radius-sm);
}
label, .control-label { font-weight: 600; color: var(--dlt-ink); font-size: 13px; margin-bottom: 6px; }
.form-group { margin-bottom: var(--dlt-space-4); }
.help-block { color: var(--dlt-muted); font-size: 12.5px; }
.has-error .form-control { border-color: var(--dlt-danger); }
.has-error .form-control:focus { box-shadow: 0 0 0 3px rgba(214, 69, 69, .18); }
.has-success .form-control { border-color: var(--dlt-success); }

/* ---------- 7. Tables ---------- */
.table {
  margin-bottom: 0;
  color: var(--dlt-text);
  border-collapse: separate;
  border-spacing: 0;
}
.table > thead > tr > th,
.table > tbody > tr > th,
.table > tfoot > tr > th,
.table > thead > tr > td,
.table > tbody > tr > td,
.table > tfoot > tr > td {
  padding: 12px 16px;
  vertical-align: middle;
  border-top: 1px solid var(--dlt-border);
  border-left: 0;
  border-right: 0;
}
.table > thead > tr > th {
  background: var(--dlt-surface-2);
  color: var(--dlt-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-top: 0;
  border-bottom: 1px solid var(--dlt-border);
}
.table > thead:first-child > tr:first-child > th:first-child { border-top-left-radius: var(--dlt-radius-sm); }
.table > thead:first-child > tr:first-child > th:last-child { border-top-right-radius: var(--dlt-radius-sm); }
.table-bordered { border: 1px solid var(--dlt-border); border-radius: var(--dlt-radius); overflow: hidden; }
.table-bordered > thead > tr > th, .table-bordered > tbody > tr > td,
.table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > td,
.table-bordered > thead > tr > td, .table-bordered > tfoot > tr > th {
  border-left: 0;
  border-right: 0;
}
.table-striped > tbody > tr:nth-of-type(odd) { background: transparent; }
.table-striped > tbody > tr:nth-of-type(even) { background: var(--dlt-surface-2); }
.table > tbody > tr { transition: background-color .15s ease-in-out; }
.table-hover > tbody > tr:hover,
.box .table > tbody > tr:hover { background: var(--dlt-primary-50); }
.table-condensed > thead > tr > th, .table-condensed > tbody > tr > td { padding: 8px 12px; }
.box-body.no-padding .table > thead > tr > th:first-child,
.box-body.no-padding .table > tbody > tr > td:first-child { padding-left: var(--dlt-space-5); }
.table-responsive { border: 0; }

/* ---------- 8. Navigation components ---------- */
.nav-tabs { border-bottom: 1px solid var(--dlt-border); }
.nav-tabs > li > a {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--dlt-muted);
  font-weight: 500;
  margin-right: var(--dlt-space-2);
  padding: 10px 14px;
  transition: var(--dlt-ease);
}
.nav-tabs > li > a:hover { background: transparent; color: var(--dlt-ink); border-bottom-color: var(--dlt-border-strong); }
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
  border: 0;
  border-bottom: 2px solid var(--dlt-primary);
  color: var(--dlt-primary);
  background: transparent;
}
.nav-tabs-custom { border-radius: var(--dlt-radius-lg); box-shadow: var(--dlt-shadow); }
.nav-tabs-custom > .nav-tabs > li.active { border-top-color: var(--dlt-primary); }
.nav-pills > li > a { border-radius: var(--dlt-radius-sm); color: var(--dlt-muted); transition: var(--dlt-ease); }
.nav-pills > li.active > a, .nav-pills > li.active > a:hover { background: var(--dlt-primary); }

.dropdown-menu {
  border: 1px solid var(--dlt-border);
  border-radius: var(--dlt-radius);
  box-shadow: var(--dlt-shadow-lg);
  padding: 6px;
}
.dropdown-menu > li > a { border-radius: var(--dlt-radius-sm); padding: 8px 12px; color: var(--dlt-text); transition: var(--dlt-ease); }
.dropdown-menu > li > a:hover { background: var(--dlt-primary-50); color: var(--dlt-primary); }
.navbar-nav > .notifications-menu > .dropdown-menu,
.navbar-nav > .messages-menu > .dropdown-menu,
.navbar-nav > .tasks-menu > .dropdown-menu { border-radius: var(--dlt-radius); overflow: hidden; }

.pagination > li > a, .pagination > li > span {
  color: var(--dlt-text);
  border-color: var(--dlt-border);
  margin: 0 2px;
  border-radius: var(--dlt-radius-sm) !important;
  transition: var(--dlt-ease);
}
.pagination > .active > a, .pagination > .active > span { background: var(--dlt-primary); border-color: var(--dlt-primary); }

.breadcrumb { background: transparent; }

/* ---------- 9. Feedback ---------- */
.label, .badge { font-weight: 600; border-radius: 999px; padding: .3em .7em; }
.label-primary { background: var(--dlt-primary); }
.label-success { background: var(--dlt-success); }
.label-warning { background: var(--dlt-accent); }
.label-danger  { background: var(--dlt-danger); }
.label-info    { background: var(--dlt-info); }
.label-default { background: var(--dlt-border); color: var(--dlt-text); }

.alert { border: 0; border-left: 4px solid; border-radius: var(--dlt-radius); padding: 14px 18px; }
.alert-success { background: var(--dlt-success-50); border-left-color: var(--dlt-success); color: #145f43; }
.alert-info    { background: var(--dlt-info-50);    border-left-color: var(--dlt-info);    color: #1b5a80; }
.alert-warning { background: var(--dlt-warning-50); border-left-color: var(--dlt-accent);  color: #7a4d04; }
.alert-danger  { background: var(--dlt-danger-50);  border-left-color: var(--dlt-danger);  color: #8c2b2b; }

.progress, .progress-sm, .progress-xs, .progress-xxs {
  background: var(--dlt-border);
  border-radius: 999px;
  box-shadow: none;
  overflow: hidden;
}
.progress .progress-bar { border-radius: 999px; transition: width .4s ease-in-out; }
.progress-bar-primary, .progress-bar { background-color: var(--dlt-primary); }

.modal-content {
  border: 0;
  border-radius: var(--dlt-radius-lg);
  box-shadow: var(--dlt-shadow-lg);
}
.modal-header { padding: var(--dlt-space-4) var(--dlt-space-5); border-bottom: 1px solid var(--dlt-border); }
.modal-body { padding: var(--dlt-space-5); }
.modal-footer { padding: var(--dlt-space-3) var(--dlt-space-5); border-top: 1px solid var(--dlt-border); background: var(--dlt-surface-2); border-radius: 0 0 var(--dlt-radius-lg) var(--dlt-radius-lg); }
.modal-backdrop.in { opacity: .45; background: var(--dlt-ink); }

.tooltip-inner { background: var(--dlt-ink); border-radius: var(--dlt-radius-sm); padding: 6px 10px; }
.popover { border-color: var(--dlt-border); border-radius: var(--dlt-radius); box-shadow: var(--dlt-shadow-lg); }

/* jQuery UI datepicker / dialogs used on legacy pages */
.ui-widget { font-family: var(--dlt-font); }
.ui-widget-content { border-color: var(--dlt-border); }
.ui-datepicker { border-radius: var(--dlt-radius); box-shadow: var(--dlt-shadow-lg); padding: 6px; }
.ui-dialog { border-radius: var(--dlt-radius-lg); box-shadow: var(--dlt-shadow-lg); border: 0; }

/* ---------- 10. Legacy DLT components (css/dlt.css) ---------- */
/* PNG image buttons → real buttons (labels are already text) */
.btnblue, .btnbluesml, .btngreen, .btngreensml, .btnyellow {
  display: inline-block;
  width: auto;
  min-width: 140px;
  height: auto;
  padding: 9px 18px;
  border-radius: var(--dlt-radius-sm);
  background-image: none;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: var(--dlt-shadow-sm);
  transition: var(--dlt-ease);
}
.btnblue, .btnbluesml { background-color: var(--dlt-primary); color: #fff; }
/* Thin blue / back image buttons → soft and outline buttons (labels were hidden by text-indent) */
.thinbluebtn, .btnback {
  display: inline-block;
  width: auto;
  height: auto;
  padding: 7px 14px;
  margin: 0 6px 6px 0;
  border-radius: var(--dlt-radius-sm);
  background-image: none;
  text-indent: 0;
  overflow: visible;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
  transition: var(--dlt-ease);
}
.thinbluebtn { background-color: var(--dlt-primary-50); color: var(--dlt-primary); }
.thinbluebtn:hover { background-color: var(--dlt-primary-100); }
.btnback { background-color: var(--dlt-surface); color: var(--dlt-text); border: 1px solid var(--dlt-border-strong); }
.btnback:hover { background-color: var(--dlt-surface-2); }
.btngreen, .btngreensml { background-color: var(--dlt-success); color: #fff; }
.btnyellow { background-color: var(--dlt-accent); color: #fff; }
.btnbluesml, .btngreensml { padding: 6px 14px; font-size: 13px; min-width: 0; }
.btnblue:hover, .btnbluesml:hover, .btngreen:hover, .btngreensml:hover, .btnyellow:hover {
  filter: brightness(.94);
  text-decoration: none;
  transform: translateY(-1px);
}

/* Diet tracker tables (static + rows rendered by JS/.lyt templates) */
table.dietentry, .diettable {
  width: 100%;
  max-width: 720px;
  margin: 0 0 var(--dlt-space-4);
  border: 1px solid var(--dlt-border);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--dlt-radius);
  overflow: hidden;
  background: var(--dlt-surface);
  font-size: 13.5px;
}
table.dietentry th, table.dietentry td,
.diettable th, .diettable td {
  border: 0;
  border-top: 1px solid var(--dlt-border);
  padding: 10px 16px;
  background-image: none;
}
table.dietentry th, .diettable th,
.dietreview table.dietentry th {
  background: var(--dlt-surface-2);
  color: var(--dlt-muted);
  font-family: var(--dlt-font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-top: 0;
}
table.dietentry tbody tr, .diettable tbody tr { transition: background-color .15s ease-in-out; }
table.dietentry tbody tr:hover, .diettable tbody tr:hover { background: var(--dlt-primary-50); }
table.dietentry td:first-child, .diettable td:first-child { color: var(--dlt-muted); font-weight: 500; }
table.dietentry input { border-bottom-color: var(--dlt-border-strong); border-radius: 0; }

/* Journal save/update buttons sit on the right of the editor */
.journalbtn.btn { float: right; margin-top: var(--dlt-space-3); }
/* beats dlt.css ".spjournali .journalbtn { background: none; border: 1px solid #000 }" */
.journalbtn.btn.btn-primary { background: var(--dlt-primary); border: 1px solid var(--dlt-primary); color: #fff; font-family: var(--dlt-font); }
.journalbtn.btn.btn-primary:hover { background: var(--dlt-primary-600); border-color: var(--dlt-primary-600); }

/* Tracker tab bars (bodytracker, sleeptracker, journal + shared views).
   Legacy markup: title floated over the tab row with margin-bottom:-40px, and
   a full-width inline-flex <ul> with padding-left:20%/65% and 120px fixed tabs.
   That collides / overflows below ~1500px, so: title on its own line, tabs
   share the row and scroll sideways inside the card when space runs out. */
.titletabs:has(+ .nav-tabs-custom) { float: none; width: auto; }
.titletabs:has(+ .nav-tabs-custom) > h2 {
  float: none;
  max-width: none;
  width: auto;
  margin: 0 0 var(--dlt-space-3);
  font-family: var(--dlt-font);
  font-size: 20px;
  font-weight: 700;
  color: var(--dlt-primary);
}
.nav-tabs-custom > .nav-tabs[style*="inline-flex"] {
  float: none !important;
  display: flex !important;
  flex-wrap: nowrap;
  width: 100% !important;
  padding-left: 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.nav-tabs-custom > .nav-tabs[style*="inline-flex"] > li {
  float: none;
  flex: 1 1 0;
  min-width: 104px;
  margin-bottom: 0;
}
.nav-tabs-custom > .nav-tabs[style*="inline-flex"] > li > a {
  width: auto !important;
  height: 100%;
  margin-right: 0;
  padding: 10px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.3;
}

/* Body tracker field grid (body_measurements_*.php): fields were sized for
   the old 2px-padded inputs */
.content-wrapper .bodyfield input:not([type="hidden"]):not([type="submit"]):not(.btn) { padding-left: 8px; padding-right: 8px; }
.content-wrapper .bodyfield input[type="text"]:not([style*="width"]),
.content-wrapper .bodyfield input[type="number"]:not([style*="width"]) { width: calc(100% - 56px); min-width: 72px; max-width: 200px; } /* leave room for the unit label ("in.", "years") */
.content-wrapper .bodyfield.bloodpressure input[type="number"] { width: 64px !important; padding-right: 4px; }

/* Overview / reports page (css/dlt.overview.css loads after this file, hence .content-wrapper scope) */
.content-wrapper .overviewcontainer {
  float: none;
  width: auto;
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: var(--dlt-space-5);
}
.content-wrapper .overviewcontrolspanel,
.content-wrapper .overviewresultspanel {
  float: none;
  margin: 0;
  background: var(--dlt-surface);
  border: 1px solid var(--dlt-border);
  border-radius: var(--dlt-radius-lg);
  box-shadow: var(--dlt-shadow);
  overflow: hidden;
}
.content-wrapper .overviewcontrolspanel { flex: 0 0 300px; width: 300px; padding-bottom: var(--dlt-space-4); }
.content-wrapper .overviewresultspanel { flex: 1 1 auto; width: auto; min-height: 320px; }
.content-wrapper .overviewheader { float: none; background: var(--dlt-primary); padding: var(--dlt-space-3) var(--dlt-space-4); }
.content-wrapper .overviewheader h2 { margin: 0; font-size: 17px; font-weight: 600; color: #fff; line-height: 26px; }
.content-wrapper .overviewresults { width: auto; float: none; }
.content-wrapper .overviewcontrolspanel h3 { float: none; font-family: var(--dlt-font); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--dlt-subtle); margin: var(--dlt-space-4) var(--dlt-space-4) var(--dlt-space-2); }
.content-wrapper .overviewchoices,
.content-wrapper .overviewchoices .blockoptions { float: none; width: auto; padding: 0 var(--dlt-space-3); }
.content-wrapper .overviewchoices h4 {
  font-family: var(--dlt-font);
  font-size: 14px;
  font-weight: 600;
  margin: 6px 0;
  padding: 11px 12px 11px 40px;
  border-radius: var(--dlt-radius-sm);
  background-color: var(--dlt-accent);
  transition: var(--dlt-ease);
}
.content-wrapper .overviewchoices h4:hover { filter: brightness(.95); transform: translateX(2px); }
.content-wrapper .formbox {
  float: none;
  width: auto;
  margin: 0 0 var(--dlt-space-2);
  padding: var(--dlt-space-3);
  background: var(--dlt-surface-2);
  border: 1px solid var(--dlt-border);
  border-radius: var(--dlt-radius-sm);
}
.content-wrapper .overviewpanel {
  float: none;
  width: auto;
  margin: var(--dlt-space-4);
  border: 1px solid var(--dlt-border);
  border-radius: var(--dlt-radius);
  box-shadow: var(--dlt-shadow-sm);
}
.content-wrapper .overviewpanelcontent { float: none; width: auto; }
@media (max-width: 991px) {
  .content-wrapper .overviewcontainer { flex-direction: column; }
  .content-wrapper .overviewcontrolspanel { flex-basis: auto; width: 100%; }
  .content-wrapper .overviewresultspanel { width: 100%; }
}

/* Legacy ".con" page wrapper (dlt.css: hard black drop shadow) → standard card */
.content-wrapper .con {
  float: none;
  display: flow-root;
  background: var(--dlt-surface);
  background-image: none;
  border: 1px solid var(--dlt-border);
  border-radius: var(--dlt-radius-lg);
  box-shadow: var(--dlt-shadow);
  padding: var(--dlt-space-5);
}

/* Legacy fixed-width page containers → fluid */
.content-wrapper .centralarea { width: auto; max-width: 100%; float: none; padding: 0; min-height: 0; }
.content-wrapper .pagetitle { float: none; width: auto; margin: 0 0 var(--dlt-space-4); padding: 0; }
.content-wrapper .pagetitle h1,
.content-wrapper .pagetitle h2 {
  float: none;
  font-family: var(--dlt-font);
  font-size: 22px;
  font-weight: 700;
  color: var(--dlt-ink);
  text-transform: none;
  text-align: left;
}

/* SCEditor (journal etc.) sets a fixed pixel width on load; keep it inside its card */
.box-body .sceditor-container,
.content-wrapper .sceditor-container {
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
  border-color: var(--dlt-border-strong);
  border-radius: var(--dlt-radius-sm);
  overflow: hidden;
}
.content-wrapper .sceditor-container iframe,
.content-wrapper .sceditor-container textarea { width: 100% !important; box-sizing: border-box; }
.content-wrapper .sceditor-toolbar { background: var(--dlt-surface-2); border-bottom: 1px solid var(--dlt-border); }
.content-wrapper .journalentrybox { display: flow-root; }

/* Journal / diet panels */
.journalentrybox, .contentbox, .entrytextbox {
  border-radius: var(--dlt-radius);
  border-color: var(--dlt-border);
}

/* Bare inputs (no .form-control) used across legacy pages.
   Look only: width/display/margins stay as each page set them, so inline
   table-cell inputs keep their layout. */
.content-wrapper input[type="text"]:not(.form-control):not(.btn),
.content-wrapper input[type="textbox"]:not(.form-control),
.content-wrapper input[type="email"]:not(.form-control),
.content-wrapper input[type="password"]:not(.form-control),
.content-wrapper input[type="number"]:not(.form-control),
.content-wrapper input[type="date"]:not(.form-control),
.content-wrapper input[type="time"]:not(.form-control),
.content-wrapper input[type="search"]:not(.form-control),
.content-wrapper input:not([type]):not(.form-control),
.content-wrapper select:not(.form-control),
.content-wrapper textarea:not(.form-control) {
  font-family: var(--dlt-font);
  font-size: 13.5px;
  color: var(--dlt-text);
  background-color: var(--dlt-surface);
  border: 1px solid var(--dlt-border-strong);
  border-radius: var(--dlt-radius-sm);
  padding: 6px 10px;
  min-height: 34px;
  box-shadow: none;
  transition: var(--dlt-ease);
}
.content-wrapper select:not(.form-control) { padding-right: 6px; }
.content-wrapper input:not(.form-control):not([type="checkbox"]):not([type="radio"]):not([type="image"]):not([type="submit"]):not([type="button"]):hover,
.content-wrapper select:not(.form-control):hover,
.content-wrapper textarea:not(.form-control):hover { border-color: var(--dlt-subtle); }
.content-wrapper input:not(.form-control):focus,
.content-wrapper select:not(.form-control):focus,
.content-wrapper textarea:not(.form-control):focus {
  outline: none;
  border-color: var(--dlt-primary);
  box-shadow: var(--dlt-ring);
}
/* Inputs embedded in data tables stay compact and borderless-looking */
.content-wrapper table input[type="text"]:not(.form-control),
.content-wrapper table input:not([type]):not(.form-control) {
  min-height: 0;
  padding: 3px 6px;
}
table.dietentry input[type="text"]:not(.form-control) { border: 0; border-bottom: 1px dashed var(--dlt-border-strong); border-radius: 0; background: transparent; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--dlt-primary); }

/* Legacy submit inputs without Bootstrap classes */
.content-wrapper input[type="submit"]:not(.btn),
.content-wrapper input[type="button"]:not(.btn),
.content-wrapper button:not(.btn):not([class*="ui-"]):not(.close):not(.navbar-toggle):not([class*="dlt-"]) {
  font-family: var(--dlt-font);
  font-weight: 600;
  font-size: 13px;
  color: var(--dlt-primary);
  background: var(--dlt-primary-50);
  border: 1px solid transparent;
  border-radius: var(--dlt-radius-sm);
  padding: 6px 14px;
  cursor: pointer;
  transition: var(--dlt-ease);
}
.content-wrapper input[type="submit"]:not(.btn):hover,
.content-wrapper input[type="button"]:not(.btn):hover,
.content-wrapper button:not(.btn):not([class*="ui-"]):not(.close):not(.navbar-toggle):not([class*="dlt-"]):hover { background: var(--dlt-primary-100); }

/* ---------- 10b. Auth pages (login / forgotten password) ---------- */
body.dlt-auth,
body.dlt-auth .wrapper { background: var(--dlt-canvas); }
body.dlt-auth .wrapper {
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(0, 100, 162, .14), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(242, 154, 31, .12), transparent 60%),
    var(--dlt-canvas);
  min-height: 100vh;
}
body.dlt-auth .main-header { display: none; }
.dlt-auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--dlt-space-6) var(--dlt-space-4);
}
.dlt-auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--dlt-surface);
  border: 1px solid var(--dlt-border);
  border-radius: 18px;
  box-shadow: var(--dlt-shadow-lg);
  padding: 40px 36px 32px;
}
.dlt-auth-brand {
  display: flex;
  justify-content: center;
  margin: -4px 0 var(--dlt-space-5);
}
.dlt-auth-brand img { max-width: 240px; height: auto; }
.dlt-auth-title { font-size: 24px; font-weight: 700; text-align: center; margin: 0 0 6px; }
.dlt-auth-subtitle { text-align: center; color: var(--dlt-muted); margin: 0 0 var(--dlt-space-5); }
.dlt-auth-card form { float: none; text-align: left; }
.dlt-auth-card .form-control.input-lg { height: 46px; font-size: 15px; border-radius: var(--dlt-radius); }
.dlt-auth-card .btn-lg { height: 48px; margin-top: var(--dlt-space-2); }
.dlt-auth-labelrow { display: flex; justify-content: space-between; align-items: baseline; }
.dlt-auth-link { font-size: 13px; font-weight: 500; }
.dlt-auth-footnote {
  margin: var(--dlt-space-5) 0 0;
  padding-top: var(--dlt-space-4);
  border-top: 1px solid var(--dlt-border);
  text-align: center;
  font-size: 13px;
  color: var(--dlt-muted);
}
.dlt-auth-credit { margin-top: var(--dlt-space-4); opacity: .7; transition: var(--dlt-ease); }
.dlt-auth-credit:hover { opacity: 1; }
@media (max-width: 480px) { .dlt-auth-card { padding: 28px 22px 24px; border-radius: var(--dlt-radius-lg); } }

/* ---------- 10c. New-dataset wizard (wizard.php, js/dlt_wizard.js) ---------- */
.con:has(.dlt-wiz) { background: transparent; border: 0; box-shadow: none; padding: 0; }
.dlt-wiz { max-width: 820px; }
.dlt-wiz [hidden] { display: none !important; }
.dlt-wiz-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--dlt-space-4); padding: 0; list-style: none; }
.dlt-wiz-steps li { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 6px; border: 1px solid var(--dlt-border); border-radius: 999px; background: var(--dlt-surface); font-size: 13px; color: var(--dlt-muted); }
.dlt-wiz-steps li span { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--dlt-surface-2); font-size: 12px; font-weight: 700; }
.dlt-wiz-steps li.is-on { border-color: var(--dlt-primary); background: var(--dlt-primary-50); color: var(--dlt-primary); font-weight: 600; }
.dlt-wiz-steps li.is-on span { background: var(--dlt-primary); color: #fff; }
.dlt-wiz-steps li.is-done { cursor: pointer; color: var(--dlt-text); }
.dlt-wiz-steps li.is-done span { background: var(--dlt-success); color: #fff; font-size: 0; }
.dlt-wiz-steps li.is-done span::before { content: "\f00c"; font-family: FontAwesome; font-size: 11px; }
.dlt-wiz-card { padding: 22px 26px; }
.dlt-wiz-card h2 { margin: 0 0 4px; font-size: 19px; font-weight: 700; color: var(--dlt-ink); }
.dlt-wiz-intro { margin: 0 0 var(--dlt-space-4); color: var(--dlt-muted); font-size: 13.5px; }
.dlt-wiz-loading { padding: 30px 0; text-align: center; color: var(--dlt-muted); }
.dlt-wiz-label { display: block; margin: var(--dlt-space-4) 0 6px; font-size: 12.5px; font-weight: 600; color: var(--dlt-muted); }
.dlt-wiz-name { max-width: 420px; font-size: 15px; }
/* templates */
.dlt-wiz-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); align-items: stretch; gap: 8px; }
.dlt-wiz-tpl { display: flex; flex-wrap: wrap; align-content: flex-start; align-items: baseline; gap: 0 6px; text-align: left; padding: 10px 12px; border: 1px solid var(--dlt-border); border-radius: var(--dlt-radius); background: var(--dlt-surface); color: var(--dlt-text); font-size: 13.5px; line-height: 1.35; transition: var(--dlt-ease); }
.dlt-wiz-tpl:hover { border-color: var(--dlt-border-strong); background: var(--dlt-surface-2); }
.dlt-wiz-tpl:focus-visible { outline: none; box-shadow: var(--dlt-ring); }
.dlt-wiz-tpl.is-on { border-color: var(--dlt-primary); background: var(--dlt-primary-50); box-shadow: inset 0 0 0 1px var(--dlt-primary); }
.dlt-wiz-tpl b { color: var(--dlt-ink); }
.dlt-wiz-tpl small { display: block; flex-basis: 100%; margin-top: 3px; color: var(--dlt-muted); font-size: 12px; }
.dlt-wiz-tag { display: inline-block; padding: 0 6px; border-radius: 999px; background: var(--dlt-accent-50); color: #9a5a00; font-size: 11px; font-weight: 600; vertical-align: 1px; }
.dlt-wiz-tag.is-mine { background: var(--dlt-info-50); color: var(--dlt-primary-700); }
/* categories */
.dlt-wiz-cats { margin: 0 0 var(--dlt-space-3); padding: 0; list-style: none; }
.dlt-wiz-cat { display: grid; grid-template-columns: minmax(0, 1fr) 190px 72px 32px; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--dlt-border); }
.dlt-wiz-imp { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; }
.dlt-wiz-imp input { flex: 1; min-width: 0; accent-color: var(--dlt-primary); }
.dlt-wiz-imp output { width: 38px; text-align: right; font-size: 12.5px; color: var(--dlt-text); font-variant-numeric: tabular-nums; }
.dlt-wiz-acts { font-size: 12px; color: var(--dlt-muted); white-space: nowrap; }
.dlt-wiz-empty { padding: 14px 0; color: var(--dlt-muted); }
.dlt-wiz-ideas { margin-top: var(--dlt-space-3); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; }
.dlt-wiz-idea { padding: 3px 10px; border: 1px dashed var(--dlt-border-strong); border-radius: 999px; background: transparent; color: var(--dlt-primary); font-size: 12.5px; }
.dlt-wiz-idea:hover { border-style: solid; background: var(--dlt-primary-50); }
/* theme */
.dlt-wiz-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dlt-wiz-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border: 1px solid var(--dlt-border); border-radius: 999px; background: var(--dlt-surface); color: var(--dlt-text); font-size: 13px; }
.dlt-wiz-chip:hover { background: var(--dlt-surface-2); }
.dlt-wiz-chip.is-on { border-color: var(--dlt-primary); background: var(--dlt-primary-50); color: var(--dlt-primary); font-weight: 600; }
.dlt-wiz-chipdots { display: inline-flex; vertical-align: -1px; }
.dlt-wiz-chipdots i { width: 9px; height: 12px; }
.dlt-wiz-chipdots i:first-child { border-radius: 3px 0 0 3px; }
.dlt-wiz-chipdots i:last-child { border-radius: 0 3px 3px 0; }
.dlt-wiz-mine { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; font-size: 12.5px; }
.dlt-wiz-band { display: flex; height: 18px; margin: var(--dlt-space-4) 0 var(--dlt-space-3); border-radius: 5px; overflow: hidden; }
.dlt-wiz-levels { display: grid; gap: 6px; max-width: 420px; }
.dlt-wiz-level { display: grid; grid-template-columns: 26px 90px 1fr; align-items: center; gap: 8px; font-size: 13.5px; }
.dlt-wiz-level b { color: var(--dlt-ink); font-weight: 600; }
.dlt-wiz-level span { color: var(--dlt-text); font-variant-numeric: tabular-nums; }
.dlt-wiz-level .form-control { display: inline-block; width: 64px; height: 30px; padding: 3px 6px; }
.dlt-wiz-level input[type=color] { width: 26px; height: 26px; padding: 0; border: 1px solid var(--dlt-border-strong); border-radius: 5px; background: none; cursor: pointer; }
.dlt-wiz-sw { width: 18px; height: 18px; border-radius: 4px; justify-self: center; }
.dlt-wiz-tname { display: block; margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--dlt-muted); }
.dlt-wiz-tname .form-control { margin-top: 5px; font-weight: 400; }
/* review + done */
.dlt-wiz-sum { display: grid; grid-template-columns: 110px 1fr; gap: 8px 14px; margin: 0 0 var(--dlt-space-4); font-size: 13.5px; }
.dlt-wiz-sum dt { color: var(--dlt-muted); font-weight: 600; }
.dlt-wiz-sum dd { margin: 0; color: var(--dlt-text); }
.dlt-wiz-check { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; cursor: pointer; }
.dlt-wiz-done { padding: 12px 0 4px; text-align: center; }
.dlt-wiz-done-icon { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin-bottom: 10px; border-radius: 50%; background: var(--dlt-success-50); color: var(--dlt-success); font-size: 24px; }
.dlt-wiz-done-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.dlt-wiz-error { margin: var(--dlt-space-4) 0 0; padding: 8px 12px; border-radius: var(--dlt-radius-sm); background: var(--dlt-danger-50); color: var(--dlt-danger); font-size: 13px; }
.dlt-wiz-foot { display: flex; align-items: center; gap: 8px; margin-top: var(--dlt-space-5); padding-top: var(--dlt-space-4); border-top: 1px solid var(--dlt-border); }
.dlt-wiz-cancel { padding-left: 0; color: var(--dlt-muted); }
@media (max-width: 600px) {
  .dlt-wiz-card { padding: 18px 16px; }
  .dlt-wiz-steps li { padding-right: 9px; font-size: 12px; }
  .dlt-wiz-cat { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; }
  .dlt-wiz-cat [data-remove] { justify-self: end; }
  .dlt-wiz-cat .form-control { grid-column: 1; }
  .dlt-wiz-imp { grid-column: 1; grid-row: 2; }
  .dlt-wiz-acts { grid-column: 2; grid-row: 2; text-align: right; font-size: 11px; }
  .dlt-wiz-cat [data-remove] { grid-column: 2; grid-row: 1; }
  .dlt-wiz-sum { grid-template-columns: 1fr; gap: 2px; }
  .dlt-wiz-sum dd { margin-bottom: 8px; }
}

/* ---------- 10d. All Actions / day view (category-classic-day.php) ----------
   Markup: dltlib/action_functions.php (dltRenderCategorySection, drawActionRowEmail).
   Rating colours come from the user's theme (.ratingpoor/fair/good/excellent in
   themecss.php); they are shown as the card stripe, badge and bar, never as a
   full-card fill. */
.con:has(.dlt-actions-page) { background: transparent; border: 0; box-shadow: none; padding: 0; }
.dlt-actions-row { margin: 0; }
.dlt-actions-row > .dlt-actions-page { padding: 0; }

.dlt-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--dlt-space-4); margin-bottom: var(--dlt-space-4); }
.dlt-page-sub { font-size: 13px; color: var(--dlt-muted); }
.dlt-page-title { margin: 2px 0 0; font-size: 26px; font-weight: 700; color: var(--dlt-ink); }
.dlt-date-nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--dlt-space-2); }
.dlt-date-nav .dlt-square { width: 38px; padding-left: 0; padding-right: 0; text-align: center; }
.dlt-date-nav .btndietnext { display: inline-flex; align-items: center; gap: 8px; width: auto; height: auto; text-indent: 0; overflow: visible; background-image: none; z-index: auto; }

.dlt-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  padding: 6px;
  margin-bottom: var(--dlt-space-4);
  background: var(--dlt-surface);
  border: 1px solid var(--dlt-border);
  border-radius: var(--dlt-radius-lg);
  box-shadow: var(--dlt-shadow-sm);
}
.dlt-week-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; border-radius: var(--dlt-radius); color: var(--dlt-text); position: relative; transition: var(--dlt-ease); }
.dlt-week-day span { font-size: 12px; color: var(--dlt-muted); }
.dlt-week-day strong { font-size: 16px; font-weight: 600; }
.dlt-week-day:hover, .dlt-week-day:focus { background: var(--dlt-surface-2); color: var(--dlt-ink); }
.dlt-week-day.is-selected { background: var(--dlt-primary-50); color: var(--dlt-primary); }
.dlt-week-day.is-selected span { color: var(--dlt-primary); }
.dlt-week-day.is-today::after { content: ""; position: absolute; bottom: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--dlt-accent); }

.dlt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--dlt-space-4); margin-bottom: var(--dlt-space-5); }
.dlt-kpi { background: var(--dlt-surface); border: 1px solid var(--dlt-border); border-radius: var(--dlt-radius-lg); box-shadow: var(--dlt-shadow-sm); padding: 16px 20px; }
.dlt-kpi-label { font-size: 12.5px; font-weight: 600; color: var(--dlt-muted); }
.dlt-kpi-value { font-size: 26px; font-weight: 700; color: var(--dlt-ink); line-height: 1.25; margin-top: 4px; }
.dlt-kpi-sub { font-size: 14px; font-weight: 500; color: var(--dlt-muted); }
.dlt-kpi .dlt-progress { margin-top: 10px; }
.dlt-kpi #progbar.progress-bar { float: none; height: 100%; background: var(--dlt-primary); box-shadow: none; border-radius: 999px; overflow: hidden; }
.dlt-kpi #progbox.info-box { display: block; min-height: 0; height: 100%; margin: 0; padding: 0; box-shadow: none; border-radius: 0; }
.dlt-quicklog { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-top: 8px; }
.dlt-quicklog .bodyfield, .dlt-quicklog .dlt-sleep { display: flex; align-items: center; gap: 6px; float: none; margin: 0; color: var(--dlt-text); }
.dlt-quicklog .fa { color: var(--dlt-subtle); }
.dlt-quicklog .units { color: var(--dlt-muted); font-size: 13px; }

.dlt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--dlt-space-2); margin-bottom: var(--dlt-space-4); }
.dlt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dlt-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px;
  font-size: 13px; font-weight: 500; line-height: 1.3;
  color: var(--dlt-text);
  background: var(--dlt-surface);
  border: 1px solid var(--dlt-border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: var(--dlt-ease);
}
.dlt-chip:hover, .dlt-chip:focus { border-color: var(--dlt-subtle); color: var(--dlt-ink); background: var(--dlt-surface); text-decoration: none; }
.dlt-chip.is-active { background: var(--dlt-primary-50); border-color: var(--dlt-primary-100); color: var(--dlt-primary); }
.dlt-chip-warn .fa { color: var(--dlt-danger); }
.dlt-chip-warn.is-active { background: var(--dlt-danger-50); border-color: #f2c4c4; color: #8c2b2b; }
.dlt-inline-label { margin: 0 2px 0 6px; font-size: 13px; font-weight: 500; color: var(--dlt-muted); }
.dlt-spacer { flex: 1 1 auto; }

.dlt-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  padding: 0; margin: 0;
  float: none;
  border: 0; border-radius: var(--dlt-radius-sm);
  background: transparent; background-image: none;
  color: var(--dlt-subtle);
  cursor: pointer;
  transition: var(--dlt-ease);
}
.dlt-icon-btn:hover, .dlt-icon-btn:focus { background: var(--dlt-surface-2); color: var(--dlt-primary); }
.dlt-cat-menu { display: inline-block; }
.dlt-cat-menu .dropdown-menu { min-width: 190px; }
.dlt-cat-menu .dropdown-menu > li > a {
  display: flex; align-items: center; gap: 10px;
  width: auto; height: auto; float: none; margin: 0;
  background-image: none; text-indent: 0;
  font-weight: 500;
}
.dlt-cat-menu .dropdown-menu > li > a .fa { width: 14px; color: var(--dlt-subtle); }

/* "Complete all today": checkbox drives a button-styled label */
/* "Complete all today" (js/dlt_actions_ui.js): green once everything is done */
.dlt-done-all { display: inline-flex; align-items: center; gap: 6px; }
.dlt-done-all.is-all { background: var(--dlt-success-50); border-color: var(--dlt-success); color: #145f43; }

.dlt-filters { background: var(--dlt-surface); border: 1px solid var(--dlt-border); border-radius: var(--dlt-radius-lg); padding: var(--dlt-space-4) var(--dlt-space-5); margin-bottom: var(--dlt-space-4); }
.dlt-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 0; }
.dlt-filter-label { width: 110px; font-size: 13px; font-weight: 600; color: var(--dlt-ink); margin: 0; }
.dlt-filters div.btnfilter { float: none; margin: 0; padding: 5px 12px; border: 1px solid var(--dlt-border-strong); border-radius: 999px; background: var(--dlt-surface); color: var(--dlt-text); font-size: 13px; font-weight: 500; cursor: pointer; transition: var(--dlt-ease); }
.dlt-filters div.btnfilter.on { background: var(--dlt-primary-50); border-color: var(--dlt-primary-100); color: var(--dlt-primary); }
.dlt-filters #compfiltdone { display: inline-flex; gap: 6px; margin-left: var(--dlt-space-3); }
.dlt-filters #compfiltdone[style*="none"] { display: none !important; }

/* Category cards */
.dlt-cat {
  background: var(--dlt-surface);
  border: 1px solid var(--dlt-border);
  border-radius: var(--dlt-radius-lg);
  box-shadow: var(--dlt-shadow);
  margin-bottom: var(--dlt-space-4);
}
.dlt-cat-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 14px 12px 10px; }
.dlt-cat-toggle .fa { transition: transform .2s ease-in-out; }
.dlt-cat.is-collapsed .dlt-cat-toggle .fa { transform: rotate(-90deg); }
.dlt-cat-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dlt-primary); flex: 0 0 auto; }
.dlt-cat-title { margin: 0; font-size: 16px; font-weight: 600; color: var(--dlt-ink); }
.dlt-cat-count { font-size: 12.5px; color: var(--dlt-muted); }
.dlt-cat-week { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--dlt-muted); white-space: nowrap; }
.dlt-cat-week .dlt-progress { width: 120px; margin: 0; }
.dlt-cat-body { padding: 0 18px 18px; }
.dlt-cat.is-collapsed .dlt-cat-body { display: none; }
.dlt-subcat { margin-top: var(--dlt-space-3); }
.dlt-subcat + .dlt-subcat { border-top: 1px solid var(--dlt-border); padding-top: var(--dlt-space-2); }
.dlt-grid + .dlt-subcat { border-top: 1px solid var(--dlt-border); padding-top: var(--dlt-space-2); margin-top: var(--dlt-space-4); }
.dlt-subcat-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-height: 36px; margin-bottom: 6px; }
.dlt-subcat-title { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--dlt-muted); }
.dlt-empty { margin: 4px 0 0; font-size: 13px; color: var(--dlt-muted); }

/* "Done today" button on category / sub-category headers (js/dlt_actions_ui.js): 0 of 3 / 2 of 3 / All done */
.dlt-done-pill { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 3px 10px; border: 1px solid var(--dlt-border-strong); border-radius: 999px; background: var(--dlt-surface); color: var(--dlt-text); font-size: 12.5px; font-weight: 600; line-height: 1.4; font-variant-numeric: tabular-nums; cursor: pointer; transition: var(--dlt-ease); }
.dlt-done-pill[hidden] { display: none; }
.dlt-done-pill:hover { border-color: var(--dlt-primary); color: var(--dlt-primary); }
.dlt-done-pill:focus-visible { outline: none; box-shadow: var(--dlt-ring); }
.dlt-done-pill .fa { color: var(--dlt-subtle); }
.dlt-done-pill.is-some { border-color: var(--dlt-primary-100); background: var(--dlt-primary-50); color: var(--dlt-primary); }
.dlt-done-pill.is-some .fa { color: var(--dlt-primary); }
.dlt-done-pill.is-all { border-color: transparent; background: var(--dlt-success-50); color: #145f43; }
.dlt-done-pill.is-all .fa { color: var(--dlt-success); }
/* the button already says "2 of 3", so the plain count beside the title is hidden */
.dlt-cat-head:has(.dlt-done-pill:not([hidden])) > .dlt-cat-count, .dlt-subcat-head:has(.dlt-done-pill:not([hidden])) > .dlt-cat-count { display: none; }
/* "3 actions marked done · Undo" */
.dlt-done-toast { position: fixed; left: 50%; bottom: 20px; z-index: 1500; display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px); padding: 10px 14px 10px 16px; transform: translateX(-50%); border-radius: var(--dlt-radius); background: var(--dlt-ink); color: #fff; font-size: 14px; box-shadow: var(--dlt-shadow-lg); }
.dlt-done-toast[hidden] { display: none; }
.dlt-done-toast button { padding: 4px 8px; border: 0; border-radius: var(--dlt-radius-sm); background: transparent; color: #8fd0ff; font-weight: 700; cursor: pointer; }
.dlt-done-toast button:hover { background: rgba(255, 255, 255, .1); }

/* Action cards */
.dlt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.dlt-action {
  background: var(--dlt-surface);
  border: 1px solid var(--dlt-border);
  border-radius: var(--dlt-radius);
  box-shadow: var(--dlt-shadow-sm);
  overflow: hidden;
  transition: box-shadow .2s ease-in-out, opacity .2s ease-in-out;
}
.dlt-action:hover { box-shadow: var(--dlt-shadow); }
.dlt-action.is-unscheduled { opacity: .72; }
.dlt-action.is-unscheduled:hover, .dlt-action.is-unscheduled:focus-within { opacity: 1; }
/* Outer rating div: the theme's background colour shows only under the 5px
   transparent left border. Two layers: a white image clipped to the padding
   box over an empty layer clipped to the border box (the background colour
   follows the last layer, so it fills the border area). */
.dlt-action > div {
  display: flex; flex-direction: column; gap: 10px;
  height: 100%;
  padding: 14px 14px 12px;
  border-left: 5px solid transparent;
  background-image: linear-gradient(var(--dlt-surface), var(--dlt-surface)), none;
  background-clip: padding-box, border-box;
  background-origin: padding-box, border-box;
  color: var(--dlt-text);
}
.dlt-action > div:not([class*="rating"]) { background-color: var(--dlt-border-strong); }
/* "happyweek" = week target already met (dlt.css paints it grey with !important) */
.dlt-action > div.happyweek {
  background-color: var(--dlt-success) !important;
  background-image: linear-gradient(var(--dlt-surface), var(--dlt-surface)), none !important;
  background-clip: padding-box, border-box !important;
  background-origin: padding-box, border-box !important;
  color: var(--dlt-text) !important;
}
.dlt-action > div > div.happyweek { background: transparent !important; color: var(--dlt-text) !important; }
/* Not scheduled today and nothing logged: "poor" for today isn't a problem, so keep the stripe neutral.
   (dlt_actions.js switches the class to fair/good/excellent as soon as a value is logged.) */
.dlt-action.is-unscheduled > div.ratingpoor:not(.happyweek) { background-color: var(--dlt-border-strong); }
.dlt-action-top { display: flex; align-items: flex-start; gap: 10px; }
.dlt-action-icon { width: 36px; height: 36px; object-fit: contain; flex: 0 0 auto; }
.dlt-action-titles { flex: 1 1 auto; min-width: 0; }
.dlt-action-title { font-size: 15px; font-weight: 600; color: var(--dlt-ink); line-height: 1.3; }
.dlt-action-meta { font-size: 12.5px; color: var(--dlt-muted); margin-top: 2px; }
.dlt-badge { flex: 0 0 auto; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.dlt-action .editcataction.dlt-icon-btn { width: 28px; height: 28px; margin: -2px -4px 0 0; }
.dlt-progress { height: 6px; border-radius: 999px; background: var(--dlt-border); overflow: hidden; }
.dlt-progress-bar { height: 100%; border-radius: 999px; transition: width .4s ease-in-out; }
.dlt-progress-bar:not([class*="rating"]) { background: var(--dlt-primary); }
.dlt-action-week { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--dlt-muted); }
.dlt-dots { display: inline-flex; gap: 4px; }
.dlt-dot { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--dlt-border-strong); background: transparent; }
.dlt-dot.is-part { background: var(--dlt-primary-100); border-color: var(--dlt-primary); }
.dlt-dot.is-full { background: var(--dlt-success); border-color: var(--dlt-success); }
.dlt-dot.is-off { border-style: dashed; opacity: .6; }
.dlt-dot.is-today { box-shadow: 0 0 0 2px var(--dlt-surface), 0 0 0 3.5px var(--dlt-primary); }

/* Log row: inner rating div (class replaced by dlt_actions.js on change) */
.dlt-action > div > div:last-child {
  display: flex; align-items: center; gap: 6px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--dlt-border);
  background: transparent;
  color: var(--dlt-text);
  line-height: normal;
}
.dlt-step {
  width: 32px; height: 34px;
  border: 1px solid var(--dlt-border-strong);
  border-radius: var(--dlt-radius-sm);
  background: var(--dlt-surface);
  color: var(--dlt-muted);
  font-size: 18px; line-height: 1;
  cursor: pointer;
  transition: var(--dlt-ease);
}
.dlt-step:hover, .dlt-step:focus { background: var(--dlt-primary-50); border-color: var(--dlt-primary-100); color: var(--dlt-primary); }
.content-wrapper .dlt-action input.dayinp2 { width: 64px; height: 34px; min-height: 0; padding: 4px; text-align: center; font-size: 15px; font-weight: 600; }
.content-wrapper .dlt-action input.dayinp2.hasnote { border-color: var(--dlt-accent); background: var(--dlt-accent-50); }
.dlt-unit { flex: 1 1 auto; font-size: 12.5px; color: var(--dlt-muted); }
/* Done tick (was the on/off switch) */
.dlt-action .onoffswitch { width: 32px; height: 32px; flex: 0 0 auto; }
.dlt-action .onoffswitch-label {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  border: 2px solid var(--dlt-border-strong);
  border-radius: 50%;
  background: var(--dlt-surface);
  line-height: 1;
  transition: var(--dlt-ease);
}
.dlt-action .onoffswitch-label::before {
  content: "\f00c";
  font-family: FontAwesome;
  position: static;
  width: auto; margin: 0;
  border: 0; background: none;
  font-size: 14px;
  color: var(--dlt-border-strong);
  transition: color .2s ease-in-out;
}
.dlt-action .onoffswitch-label:hover { border-color: var(--dlt-success); }
.dlt-action .onoffswitch-checkbox:checked + .onoffswitch-label { background: var(--dlt-success); border-color: var(--dlt-success); }
.dlt-action .onoffswitch-checkbox:checked + .onoffswitch-label::before { color: #fff; }

@media (max-width: 767px) {
  .dlt-page-title { font-size: 22px; }
  .dlt-week-day strong { font-size: 14px; }
  .dlt-cat-week { order: 10; flex-basis: 100%; padding-left: 42px; }
  .dlt-cat-week .dlt-progress { flex: 1 1 auto; width: auto; }
  /* category header on phones: title and menu on the first line; done button and week bar on the second */
  .dlt-cat-head .dlt-cat-title { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
  .dlt-cat-head > .dlt-spacer { display: none; }
  .dlt-cat-head::after { content: ""; order: 8; flex-basis: 100%; height: 0; }
  .dlt-cat-head .dlt-done-pill { order: 9; margin-left: 42px; }
  .dlt-cat-head .dlt-cat-week { order: 10; flex: 1 1 140px; padding-left: 0; }
  .dlt-cat-head:not(:has(.dlt-done-pill:not([hidden]))) .dlt-cat-week { padding-left: 42px; }
  .dlt-subcat-head .dlt-subcat-title { flex: 1 1 110px; min-width: 0; overflow-wrap: anywhere; }
  .dlt-cat-body { padding: 0 12px 14px; }
  .dlt-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 10e. To-do (todo.php, js/dlt_todo_list.js) ---------- */
.con:has(.dlt-todo-page) { background: transparent; border: 0; box-shadow: none; padding: 0; }
.dlt-todo-headtools { display: flex; align-items: center; gap: var(--dlt-space-2); }
.dlt-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--dlt-surface); border: 1px solid var(--dlt-border-strong); border-radius: var(--dlt-radius); }
.dlt-seg-btn { padding: 6px 14px; border: 0; border-radius: 7px; background: transparent; color: var(--dlt-muted); font-size: 13px; font-weight: 600; cursor: pointer; transition: var(--dlt-ease); }
.dlt-seg-btn:hover { color: var(--dlt-ink); background: var(--dlt-surface-2); }
.dlt-seg-btn.is-active { background: var(--dlt-primary-50); color: var(--dlt-primary); }

.dlt-todo-toolbar { display: flex; flex-wrap: wrap; align-items: stretch; gap: var(--dlt-space-2); margin-bottom: var(--dlt-space-4); }
.dlt-quickadd {
  flex: 1 1 320px;
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 14px;
  background: var(--dlt-surface);
  border: 1px solid var(--dlt-border-strong);
  border-radius: var(--dlt-radius);
  box-shadow: var(--dlt-shadow-sm);
  transition: var(--dlt-ease);
}
.dlt-quickadd:focus-within { border-color: var(--dlt-primary); box-shadow: var(--dlt-ring); }
.dlt-quickadd > .fa { color: var(--dlt-primary); }
#dltTodoAdd { flex: 1 1 auto; min-width: 0; height: 42px; min-height: 0; padding: 0; border: 0; background: transparent; box-shadow: none; font-size: 14.5px; }
#dltTodoAdd:focus { box-shadow: none; }
.dlt-quickadd-where { font-size: 12px; color: var(--dlt-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.dlt-lists .btn { height: 100%; }
.dlt-lists-menu { max-height: 380px; overflow-y: auto; min-width: 240px; }
.dlt-lists-menu > li > a { display: flex; align-items: center; gap: 8px; }
.dlt-lists-menu > li > a .fa { color: var(--dlt-subtle); }
.dlt-lists-menu > li > a.is-active { background: var(--dlt-primary-50); color: var(--dlt-primary); font-weight: 600; }
.dlt-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--dlt-surface); border: 1px solid var(--dlt-border-strong); border-radius: var(--dlt-radius); }
.dlt-search:focus-within { border-color: var(--dlt-primary); box-shadow: var(--dlt-ring); }
.dlt-search .fa { color: var(--dlt-subtle); }
#dltTodoSearch { width: 160px; height: 40px; min-height: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }

.dlt-todo-grid { display: grid; grid-template-columns: minmax(0, 1fr) 22px var(--dlt-detail-w, minmax(380px, 44%)); gap: 0; align-items: start; }
.dlt-todo-grid > .dlt-detail-resizer::before { left: 10px; }
@media (max-width: 991px) { .dlt-todo-grid { grid-template-columns: minmax(0, 1fr); gap: var(--dlt-space-5); } .dlt-detail-resizer { display: none !important; } }

/* Task list */
.dlt-todo-list { background: var(--dlt-surface); border: 1px solid var(--dlt-border); border-radius: var(--dlt-radius-lg); box-shadow: var(--dlt-shadow); overflow: hidden; }
.dlt-todo-list > .dlt-empty { padding: var(--dlt-space-5); margin: 0; }
.dlt-todo-group + .dlt-todo-group { border-top: 1px solid var(--dlt-border); }
.dlt-todo-group-head {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 14px 18px 8px;
  border: 0; background: transparent;
  font-size: 13px; font-weight: 700; color: var(--dlt-ink);
  text-align: left; cursor: pointer;
}
.dlt-todo-group-head .fa-angle-down { width: 12px; color: var(--dlt-subtle); transition: transform .2s ease-in-out; }
.dlt-todo-group.is-collapsed .fa-angle-down { transform: rotate(-90deg); }
.dlt-todo-group.is-collapsed .dlt-todo-group-head { padding-bottom: 14px; }
.dlt-todo-group.is-collapsed .dlt-todo-rows { display: none; }
.dlt-todo-count { padding: 1px 8px; border-radius: 999px; background: var(--dlt-surface-2); color: var(--dlt-muted); font-size: 11.5px; font-weight: 600; }
.dlt-todo-group.is-danger .dlt-todo-group-head { color: var(--dlt-danger); }
.dlt-todo-group.is-danger .dlt-todo-count { background: var(--dlt-danger-50); color: var(--dlt-danger); }
.dlt-todo-group.is-warn .dlt-todo-group-head { color: var(--dlt-warning); }
.dlt-todo-group.is-muted .dlt-todo-group-head { color: var(--dlt-muted); }
.dlt-todo-rows { list-style: none; margin: 0; padding: 0 0 6px; }
.dlt-todo-row {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  padding: 10px 18px;
  border-top: 1px solid var(--dlt-border);
  transition: background-color .15s ease-in-out, opacity .3s ease-in-out;
}
.dlt-todo-rows > .dlt-todo-row:first-child { border-top: 0; }
.dlt-todo-row:hover { background: var(--dlt-surface-2); }
.dlt-todo-row.is-selected { background: var(--dlt-primary-50); box-shadow: inset 3px 0 0 var(--dlt-primary); }
.dlt-todo-row.is-leaving { opacity: .45; }
.dlt-todo-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; margin-top: 1px; padding: 0;
  border: 2px solid var(--dlt-border-strong); border-radius: 6px;
  background: var(--dlt-surface); color: transparent;
  font-size: 11px; cursor: pointer; transition: var(--dlt-ease);
}
.dlt-todo-check:hover, .dlt-todo-check:focus { border-color: var(--dlt-success); color: var(--dlt-success); }
.dlt-todo-row.is-done .dlt-todo-check { background: var(--dlt-success); border-color: var(--dlt-success); color: #fff; }
.dlt-todo-open { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; color: inherit; }
.dlt-todo-title { font-size: 14px; font-weight: 500; color: var(--dlt-ink); line-height: 1.4; overflow-wrap: anywhere; }
.dlt-todo-row.is-done .dlt-todo-title { color: var(--dlt-subtle); text-decoration: line-through; }
.dlt-todo-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dlt-todo-meta .fa { font-size: 12px; color: var(--dlt-subtle); }
.dlt-tag { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 1px 8px; border-radius: 999px; background: var(--dlt-surface-2); border: 1px solid var(--dlt-border); color: var(--dlt-muted); font-size: 11.5px; }
.dlt-tag-ctx { background: var(--dlt-primary-50); border-color: var(--dlt-primary-100); color: var(--dlt-primary); }
.dlt-todo-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.dlt-todo-due { font-size: 12px; color: var(--dlt-muted); }
.dlt-todo-due.is-overdue { color: var(--dlt-danger); font-weight: 600; }
.dlt-todo-time { font-size: 11.5px; color: var(--dlt-subtle); }
.dlt-todo-empty { padding: 40px 20px; text-align: center; color: var(--dlt-muted); }
.dlt-todo-empty .fa { font-size: 32px; color: var(--dlt-success); margin-bottom: 8px; }
.dlt-todo-completed { padding: 10px 18px 14px; border-top: 1px solid var(--dlt-border); }
.dlt-todo-completed .dlt-todo-group { margin: 0 -18px; border-top: 0; }
.dlt-todo-linkbtn { padding: 4px 0; border: 0; background: none; color: var(--dlt-primary); font-size: 13px; font-weight: 600; cursor: pointer; }
.dlt-todo-linkbtn:hover { text-decoration: underline; }
.dlt-todo-linkbtn.is-danger { color: var(--dlt-danger); }

/* Folder view (zTree + legacy filters) */
.dlt-todo-tree .dlt-todo-treebox { margin: 0; }
.dlt-todo-tree #zTreeCon { max-height: 65vh; overflow: auto; }
.dlt-todo-legacy { background: var(--dlt-surface); border: 1px solid var(--dlt-border); border-radius: var(--dlt-radius-lg); padding: var(--dlt-space-4); margin-bottom: var(--dlt-space-4); }
.dlt-todo-legacy .notice2 .bar { display: none; }
.dlt-legacy-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: var(--dlt-space-3); }
.dlt-legacy-search .sidelabel { margin: 0; }
.dlt-todo-treebox .masteroptions { display: flex; gap: 2px; margin: 0; padding: 0; }
.dlt-todo-treebox .masteroptions li { float: none; border-radius: var(--dlt-radius-sm); transition: var(--dlt-ease); }
.dlt-todo-treebox .masteroptions li:hover { background: var(--dlt-surface-2); }

/* Details panel (form markup from todo_loaddetail.php) */
.dlt-todo-detail {
  position: sticky; top: 70px;
  background: var(--dlt-surface);
  border: 1px solid var(--dlt-border);
  border-radius: var(--dlt-radius-lg);
  box-shadow: var(--dlt-shadow);
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}
@media (max-width: 991px) { .dlt-todo-detail { position: static; max-height: none; } }

/* Folder view: folders sidebar beside the list (js/dlt_todo_list.js renderRail) */
.dlt-todo-page [hidden] { display: none !important; }
.is-folder-view .dlt-todo-main { display: grid; grid-template-columns: var(--dlt-rail-w, 290px) 14px minmax(0, 1fr); gap: 0; align-items: start; }
.is-folder-view .dlt-todo-main > .dlt-todo-list { grid-column: 3; }
/* drag handle between the folders and the list (width kept per browser) */
.dlt-rail-resizer { position: sticky; top: 70px; align-self: stretch; height: calc(100vh - 90px); max-height: 100%; cursor: col-resize; touch-action: none; }
.dlt-rail-resizer::before { content: ""; position: absolute; top: 0; bottom: 0; left: 6px; width: 2px; border-radius: 2px; background: transparent; transition: background-color .15s; }
.dlt-rail-resizer:hover::before, .dlt-rail-resizer:focus-visible::before, .dlt-rail-resizer.is-dragging::before { background: var(--dlt-primary); }
.dlt-rail-resizer:focus-visible { outline: none; }
body.dlt-resizing, body.dlt-resizing * { cursor: col-resize !important; user-select: none !important; }
.dlt-todo-rail { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow-y: auto; padding: 10px 8px; background: var(--dlt-surface); border: 1px solid var(--dlt-border); border-radius: var(--dlt-radius-lg); box-shadow: var(--dlt-shadow-sm); transition: box-shadow .15s, border-color .15s; }
.dlt-todo-rail.is-drop-ready { border-color: var(--dlt-primary-100); box-shadow: 0 0 0 3px var(--dlt-primary-50); }
.dlt-rail-head { display: flex; align-items: center; padding: 2px 4px 6px 8px; }
.dlt-rail-title { flex: 1 1 auto; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--dlt-muted); }
.dlt-rail-newform { padding: 0 4px 8px; }
.dlt-rail-newwhere { display: block; margin-top: 3px; font-size: 11.5px; color: var(--dlt-muted); }
.dlt-rail-tree, .dlt-rail-tree ul { list-style: none; margin: 0; padding: 0; }
.dlt-rail-sep { height: 1px; margin: 6px 4px; background: var(--dlt-border); }
.dlt-rail-node { display: flex; align-items: center; gap: 2px; min-height: 32px; padding-right: 2px; border-radius: var(--dlt-radius-sm); color: var(--dlt-text); transition: background-color .12s; }
.dlt-rail-node:hover { background: var(--dlt-surface-2); }
.dlt-rail-node.is-active { background: var(--dlt-primary-50); color: var(--dlt-primary); }
.dlt-rail-node.is-active .dlt-rail-name { font-weight: 600; }
.dlt-rail-node.is-drop { background: var(--dlt-primary-100); outline: 2px dashed var(--dlt-primary); outline-offset: -2px; }
.dlt-rail-node.is-empty .dlt-rail-name { color: var(--dlt-muted); }
.dlt-rail-toggle { flex: 0 0 18px; width: 18px; height: 24px; padding: 0; border: 0; background: transparent; color: var(--dlt-subtle); cursor: pointer; }
span.dlt-rail-toggle { cursor: default; }
.dlt-rail-pick { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 7px; padding: 5px 2px; border: 0; background: transparent; color: inherit; text-align: left; font-size: 13.5px; cursor: pointer; }
.dlt-rail-pick .fa { flex: 0 0 14px; color: var(--dlt-subtle); }
.dlt-rail-node.is-active .dlt-rail-pick .fa { color: var(--dlt-primary); }
.dlt-rail-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlt-rail-count { flex: 0 0 auto; min-width: 18px; font-size: 12px; text-align: right; color: var(--dlt-muted); }
.dlt-rail-menu { flex: 0 0 auto; opacity: 0; }
.dlt-rail-menu .dlt-icon-btn { width: 26px; height: 26px; }
.dlt-rail-node:hover .dlt-rail-menu, .dlt-rail-menu.open, .dlt-rail-node:focus-within .dlt-rail-menu { opacity: 1; }
.dlt-rail-menu .dropdown-menu a.is-danger { color: var(--dlt-danger); }
.dlt-rail-menu .dropdown-header { white-space: normal; max-width: 200px; font-size: 11.5px; }
.dlt-rail-rename { height: 28px; margin: 2px 0; }
.dlt-rail-empty { margin: 8px 8px 2px; font-size: 12.5px; }
.dlt-todo-row.is-dragging { opacity: .45; }
.dlt-todo-row[draggable="true"] { cursor: grab; }
@media (max-width: 1399px) {
  .is-folder-view .dlt-todo-main { grid-template-columns: minmax(0, 1fr); gap: var(--dlt-space-4); }
  .is-folder-view .dlt-todo-main > .dlt-todo-list { grid-column: auto; }
  .dlt-todo-rail { position: static; max-height: 260px; }
  #dltRailResizer { display: none !important; }
}
@media (hover: none) { .dlt-rail-menu { opacity: 1; } }
.dlt-todo-detail-empty { display: none; padding: 48px 24px; text-align: center; color: var(--dlt-muted); }
.dlt-todo-detail-empty .fa { font-size: 30px; color: var(--dlt-border-strong); margin-bottom: 10px; }
.dlt-todo-detail.is-empty .dlt-todo-detail-empty { display: block; }
.dlt-todo-detail.is-empty .dlt-todo-detail-head,
.dlt-todo-detail.is-empty #editbox1 { display: none !important; }
.dlt-todo-detail-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 4px 20px; }
.dlt-todo-detail-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dlt-subtle); }
#dltTodoDetail #editbox { margin: 0; width: auto; max-width: none; padding: 0 20px 20px; background: transparent; border-radius: 0; box-shadow: none; }
#dltTodoDetail #editbox1 { height: auto !important; overflow: visible !important; float: none !important; }
#dltTodoDetail .todoeditformcon > form > div { font-size: 13.5px !important; }
#dltTodoDetail .tabs { width: auto; margin: 0; padding: 0; border: 0; background: none; }
#dltTodoDetail .tab-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 14px; padding: 0; border-bottom: 1px solid var(--dlt-border); list-style: none; }
#dltTodoDetail .tab-links > li { float: none; margin: 0; }
#dltTodoDetail .tab-links > li > a { display: block; padding: 8px 12px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--dlt-muted); font-weight: 600; }
#dltTodoDetail .tab-links > li.active > a { color: var(--dlt-primary); border-bottom-color: var(--dlt-primary); }
#dltTodoDetail #updatetodoitem { order: 10; width: auto !important; margin: 0 0 6px auto !important; float: none !important; }
#dltTodoDetail .tab-links .shareitem { order: 9; margin: 0 !important; transform: none !important; }
#dltTodoDetail .tab-content { padding: 0; border: 0; background: none; }
#dltTodoDetail .tab-content .tab { padding: 0; }
#dltTodoDetail .todoborder { width: auto; float: none; padding: 0; border: 0; }
#dltTodoDetail .efield,
#dltTodoDetail .efield[style] { float: none !important; width: auto !important; margin: 0 0 14px !important; display: block; }
#dltTodoDetail .efield::after { content: ""; display: table; clear: both; }
#dltTodoDetail .efield label,
#dltTodoDetail .efield label.sidelabel,
#dltTodoDetail .efield h3 { display: block; float: none !important; width: auto !important; min-width: 0; margin: 0 0 6px !important; font-family: var(--dlt-font); font-size: 12.5px; font-weight: 600; color: var(--dlt-muted); }
#dltTodoDetail .efield input[type="text"],
#dltTodoDetail .efield select,
#dltTodoDetail .efield textarea { float: none !important; width: 100% !important; max-width: 100%; margin: 0 !important; }
#dltTodoDetail #edittitle { font-size: 16px; font-weight: 600; color: var(--dlt-ink); min-height: 42px; }
#dltTodoDetail #divTxtFormat { float: none !important; width: auto !important; height: auto !important; display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 6px; margin-top: 8px; }
#dltTodoDetail #divTxtFormat > div { float: none !important; }
#dltTodoDetail #timeTaken { width: 120px !important; }
#dltTodoDetail #timing2 { float: none !important; }
#dltTodoDetail #timing2 > select { margin-top: 8px !important; }
#dltTodoDetail .addnewtog2 { display: inline-block; float: none; margin: 0 0 6px !important; color: var(--dlt-primary); font-size: 12.5px; font-weight: 600; cursor: pointer; }
#dltTodoDetail .sceditor-container { width: 100% !important; border-radius: var(--dlt-radius-sm); border-color: var(--dlt-border-strong); }
#dltTodoDetail .tdedbx, #dltTodoDetail .tdefr, #dltTodoDetail .tdefnl,
#dltTodoDetail .tdedbx[style] { float: none !important; width: auto !important; max-width: none; margin: 0 0 14px !important; padding: 0; border: 0; background: none; }
#dltTodoDetail .maintodoformdone { display: flex !important; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
#dltTodoDetail .maintodoformdone > div:first-child { display: flex; align-items: center; gap: 8px; flex: 1 1 100%; }
#dltTodoDetail .maintodoformdone label { float: none !important; margin: 0 !important; padding: 0 !important; display: inline-block; }
#dltTodoDetail #citySel { float: none !important; flex: 1 1 auto; width: auto !important; cursor: pointer; }
#dltTodoDetail .maintodoformdone > br { display: none; }
#dltTodoDetail .donei { float: none !important; margin: 0; cursor: pointer; }
#dltTodoDetail .tdinfo { flex: 1 1 100%; width: auto !important; margin-top: 4px; padding: 8px 10px !important; border: 0 !important; border-radius: var(--dlt-radius-sm); background: var(--dlt-surface-2); color: var(--dlt-muted) !important; font-size: 12.5px; }
#dltTodoDetail .dlt-timing-field > select.is-goal-hidden { display: none; }
.dlt-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.dlt-pill { padding: 5px 12px; border: 1px solid var(--dlt-border-strong); border-radius: 999px; background: var(--dlt-surface); color: var(--dlt-text); font-size: 12.5px; font-weight: 500; cursor: pointer; transition: var(--dlt-ease); }
.dlt-pill:hover { border-color: var(--dlt-subtle); }
.dlt-pill.is-active { background: var(--dlt-primary-50); border-color: var(--dlt-primary-100); color: var(--dlt-primary); font-weight: 600; }
.dlt-todo-detail-foot { clear: both; display: flex; justify-content: flex-start; padding-top: 12px; margin-top: 8px; border-top: 1px solid var(--dlt-border); }

/* Toast with undo */
.dlt-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 2000;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 16px;
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border-radius: var(--dlt-radius);
  background: var(--dlt-ink); color: #fff;
  box-shadow: var(--dlt-shadow-lg);
  font-size: 13.5px;
  transition: opacity .3s ease-in-out;
}
.dlt-toast.is-leaving { opacity: 0; }
.dlt-toast button { padding: 2px 4px; border: 0; background: none; color: #8fd0ff; font-weight: 700; cursor: pointer; }

@media (max-width: 767px) {
  .dlt-todo-headtools { width: 100%; justify-content: space-between; }
  .dlt-quickadd-where { display: none; }
  .dlt-search { flex: 1 1 auto; }
  #dltTodoSearch { width: 100%; }
  .dlt-todo-row { padding: 10px 14px; }
}

/* ---------- 10f. Categories (categories-start.php, js/dlt_categories.js) ---------- */
.con:has(.dlt-cats-page) { background: transparent; border: 0; box-shadow: none; padding: 0; height: auto !important; }
.dlt-cats-summary { background: var(--dlt-surface); border: 1px solid var(--dlt-border); border-radius: var(--dlt-radius-lg); box-shadow: var(--dlt-shadow-sm); padding: 16px 20px; margin-bottom: var(--dlt-space-5); }
.dlt-cats-summary:empty { display: none; }
.dlt-cats-score { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.dlt-cats-score-value { font-size: 28px; font-weight: 700; color: var(--dlt-ink); }
.dlt-cats-score-label { color: var(--dlt-muted); }
.dlt-cats-summary .dlt-progress { height: 8px; }
.dlt-cats-summary .dlt-progress-bar { background: var(--dlt-primary); }
.dlt-cats-note { margin: 12px 0 0; padding: 8px 12px; border-radius: var(--dlt-radius-sm); background: var(--dlt-warning-50); color: #7a4d04; font-size: 13px; }

.dlt-cats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--dlt-space-4); margin-bottom: var(--dlt-space-5); }
.dlt-catcard {
  display: flex; flex-direction: column;
  background: var(--dlt-surface);
  border: 1px solid var(--dlt-border);
  border-radius: var(--dlt-radius-lg);
  box-shadow: var(--dlt-shadow-sm);
  transition: var(--dlt-ease);
}
.dlt-catcard:hover { box-shadow: var(--dlt-shadow); border-color: var(--dlt-border-strong); }
.dlt-catcard.is-selected { border-color: var(--dlt-primary); box-shadow: var(--dlt-ring); }
.dlt-catcard.is-empty { border-style: dashed; box-shadow: none; }
.dlt-catcard-head { display: flex; align-items: center; gap: 10px; padding: 14px 10px 0 18px; }
.dlt-catcard .dlt-cat-dot { width: 12px; height: 12px; box-shadow: inset 0 0 0 1px rgba(20,33,48,.15); }
.dlt-catcard-title { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 16px; font-weight: 600; color: var(--dlt-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlt-catcard-body { display: flex; flex-direction: column; gap: 10px; padding: 8px 18px 16px; border: 0; background: transparent; text-align: left; cursor: pointer; color: inherit; }
.dlt-catcard-perc { display: flex; align-items: baseline; gap: 6px; font-size: 26px; font-weight: 700; color: var(--dlt-ink); line-height: 1.2; }
.dlt-catcard-perc span { font-size: 13px; font-weight: 500; color: var(--dlt-muted); }
.dlt-catcard .dlt-progress { display: block; height: 8px; }
.dlt-catcard .dlt-progress-bar { display: block; box-shadow: inset 0 0 0 1px rgba(20,33,48,.08); }
.dlt-catcard-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dlt-tag.is-warn { background: var(--dlt-warning-50); border-color: #f3d9a4; color: #7a4d04; }
.dlt-catcard-emptytext { flex: 1 1 auto; margin: 8px 18px 0; color: var(--dlt-muted); font-size: 13px; }
.dlt-catcard-foot { display: flex; align-items: center; gap: 12px; padding: 12px 18px 16px; }

/* Editor */
.dlt-cat-editor { background: var(--dlt-surface); border: 1px solid var(--dlt-border); border-radius: var(--dlt-radius-lg); box-shadow: var(--dlt-shadow); margin-bottom: var(--dlt-space-5); scroll-margin-top: 70px; }
.dlt-cat-editor-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 4px 20px; }
.dlt-cat-editor-head .dlt-cat-dot { width: 14px; height: 14px; box-shadow: inset 0 0 0 1px rgba(20,33,48,.15); }
.dlt-cat-editor-title { flex: 1 1 auto; margin: 0; font-size: 18px; font-weight: 700; }
.dlt-cat-editor-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--dlt-space-6); padding: 12px 20px 8px; }
@media (max-width: 767px) { .dlt-cat-editor-body { grid-template-columns: minmax(0, 1fr); gap: var(--dlt-space-3); } }
.dlt-cat-editor .control-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--dlt-ink); }
.dlt-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.dlt-swatch {
  position: relative;
  width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(20,33,48,.15);
  cursor: pointer; transition: transform .15s ease-in-out;
}
.dlt-swatch:hover { transform: scale(1.08); }
.dlt-swatch.is-active { box-shadow: inset 0 0 0 1px rgba(20,33,48,.15), 0 0 0 3px var(--dlt-surface), 0 0 0 5px var(--dlt-primary); }
.dlt-swatch-custom { display: inline-flex; align-items: center; justify-content: center; margin: 0; background: var(--dlt-surface-2); border: 1px dashed var(--dlt-border-strong); box-shadow: none; color: var(--dlt-muted); overflow: hidden; }
.dlt-swatch-custom input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.dlt-importance { display: flex; align-items: center; gap: 12px; }
.dlt-importance input[type="range"] { flex: 1 1 auto; accent-color: var(--dlt-primary); }
.dlt-importance output { min-width: 40px; padding: 4px 8px; border-radius: var(--dlt-radius-sm); background: var(--dlt-primary-50); color: var(--dlt-primary); font-weight: 700; text-align: center; }
.dlt-subcat-list { list-style: none; margin: 0 0 10px; padding: 0; border: 1px solid var(--dlt-border); border-radius: var(--dlt-radius); }
.dlt-subcat-row { display: grid; grid-template-columns: minmax(0, 1fr) 72px auto 32px; align-items: center; gap: 8px; padding: 8px 10px; }
.dlt-subcat-row + .dlt-subcat-row { border-top: 1px solid var(--dlt-border); }
.dlt-subcat-imp { margin: 0; }
.dlt-subcat-count { font-size: 12px; color: var(--dlt-muted); white-space: nowrap; }
.dlt-subcat-del:hover { color: var(--dlt-danger); background: var(--dlt-danger-50); }
.dlt-subcat-none { padding: 10px 12px; color: var(--dlt-muted); font-size: 13px; }
.dlt-subcat-add { display: flex; gap: 8px; margin-bottom: 16px; }
.dlt-subcat-add .form-control { flex: 1 1 auto; }
.dlt-cat-editor-foot { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--dlt-border); background: var(--dlt-surface-2); border-radius: 0 0 var(--dlt-radius-lg) var(--dlt-radius-lg); }
.dlt-cat-editor-msg { flex: 1 1 auto; text-align: right; font-size: 13px; color: var(--dlt-danger); }

/* ---------- 10g. Action editor dialog (js/dlt_action_editor.js) ---------- */
.dlt-act-modal .modal-dialog { width: auto; max-width: 600px; margin: 40px auto; padding: 0 12px; }
.dlt-act-modal .modal-content { overflow: hidden; }
.dlt-act-modal [hidden] { display: none !important; } /* .form-control sets display:block */
.dlt-act-loading { padding: 40px 24px; text-align: center; color: var(--dlt-muted); }
.dlt-act-head { display: flex; align-items: flex-start; gap: 14px; padding: 18px 16px 12px 20px; }
.dlt-act-icon {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; padding: 4px;
  border: 1px dashed var(--dlt-border-strong); border-radius: var(--dlt-radius);
  background: var(--dlt-surface-2); color: var(--dlt-subtle); font-size: 20px;
  cursor: pointer; transition: var(--dlt-ease);
}
.dlt-act-icon:hover { border-color: var(--dlt-primary); color: var(--dlt-primary); }
.dlt-act-icon img { max-width: 100%; max-height: 100%; object-fit: contain; }
.dlt-act-headmain { flex: 1 1 auto; min-width: 0; }
#dltActTitle { height: 44px; font-size: 17px; font-weight: 600; color: var(--dlt-ink); }
.dlt-act-crumb { margin-top: 6px; font-size: 12px; color: var(--dlt-muted); }
.dlt-act-summary { margin: 0 20px 16px; padding: 12px 14px; border-radius: var(--dlt-radius); background: var(--dlt-primary-50); color: var(--dlt-primary-700); font-size: 14px; line-height: 1.5; }
.dlt-act-summary b { font-weight: 700; }
.dlt-act-sec { padding: 16px 20px; border-top: 1px solid var(--dlt-border); }
.dlt-act-sec .control-label { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--dlt-ink); }
.dlt-act-sec .control-label ~ .control-label { margin-top: 16px; }
.dlt-act-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 560px) { .dlt-act-grid { grid-template-columns: minmax(0, 1fr); } }
.dlt-act-target { display: flex; align-items: center; gap: 8px; }
.dlt-act-target input[type="number"] { width: 80px; flex: 0 0 auto; text-align: center; font-weight: 600; }
.dlt-act-target select { flex: 1 1 auto; min-width: 0; }
.dlt-act-to { font-size: 13px; color: var(--dlt-muted); white-space: nowrap; }
.dlt-act-often { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.dlt-muted { color: var(--dlt-muted); }
.dlt-stepper { display: inline-flex; align-items: center; border: 1px solid var(--dlt-border-strong); border-radius: var(--dlt-radius-sm); overflow: hidden; }
.dlt-stepper button { width: 34px; height: 34px; border: 0; background: var(--dlt-surface); color: var(--dlt-muted); font-size: 18px; cursor: pointer; transition: var(--dlt-ease); }
.dlt-stepper button:hover { background: var(--dlt-primary-50); color: var(--dlt-primary); }
.dlt-stepper output { min-width: 40px; padding: 0 6px; text-align: center; font-weight: 700; color: var(--dlt-ink); border-left: 1px solid var(--dlt-border); border-right: 1px solid var(--dlt-border); line-height: 34px; }
.dlt-daychips { display: flex; flex-wrap: wrap; gap: 6px; }
.dlt-daychip { min-width: 46px; padding: 6px 10px; border: 1px solid var(--dlt-border-strong); border-radius: 999px; background: var(--dlt-surface); color: var(--dlt-text); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: var(--dlt-ease); }
.dlt-daychip:hover { border-color: var(--dlt-subtle); }
.dlt-daychip.is-active { background: var(--dlt-primary); border-color: var(--dlt-primary); color: #fff; }
.dlt-act-note { margin: 10px 0 0; padding: 8px 12px; border-radius: var(--dlt-radius-sm); background: var(--dlt-warning-50); color: #7a4d04; font-size: 12.5px; }
.dlt-act-remhead { display: flex; align-items: center; gap: 10px; }
.dlt-act-remhead > span { flex: 1 1 auto; font-size: 13px; font-weight: 600; color: var(--dlt-ink); }
.dlt-act-remhead .fa { color: var(--dlt-subtle); }
#dltActRemindBody { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
#dltActRemindBody[hidden] { display: none; }
.dlt-act-at { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; color: var(--dlt-muted); }
.dlt-act-at select { width: auto; }
.dlt-switch { position: relative; display: inline-block; width: 40px; height: 22px; margin: 0; cursor: pointer; }
.dlt-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.dlt-switch span[aria-hidden] { position: absolute; inset: 0; border-radius: 999px; background: var(--dlt-border-strong); transition: background-color .2s ease-in-out; pointer-events: none; }
.dlt-switch span[aria-hidden]::before { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(20,33,48,.25); transition: transform .2s ease-in-out; }
.dlt-switch input:checked + span[aria-hidden] { background: var(--dlt-success); }
.dlt-switch input:checked + span[aria-hidden]::before { transform: translateX(18px); }
.dlt-switch input:focus-visible + span[aria-hidden] { box-shadow: var(--dlt-ring); }
.dlt-act-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--dlt-border); background: var(--dlt-surface-2); }
.dlt-act-catpick select { width: 100%; }

/* Create-action affordances on the All Actions page */
.dlt-add-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 120px; width: 100%; padding: 16px;
  border: 2px dashed var(--dlt-border-strong); border-radius: var(--dlt-radius);
  background: transparent; color: var(--dlt-muted); font-weight: 600; cursor: pointer;
  transition: border-color .15s, color .15s, background-color .15s;
  float: none; margin: 0; /* legacy .addsubaction rules float it right */
}
.dlt-add-tile .fa { font-size: 20px; }
.dlt-add-tile:hover, .dlt-add-tile:focus-visible {
  border-color: var(--dlt-primary); color: var(--dlt-primary); background: var(--dlt-primary-50); outline: none;
}
.dlt-add-tile.is-bar { flex-direction: row; gap: 8px; min-height: 0; padding: 10px 14px; font-weight: 400; font-size: 13px; }
.dlt-add-tile.is-bar .fa { font-size: 13px; }
.dlt-add-tile.is-bar strong { font-weight: 600; color: var(--dlt-primary); }
.dlt-act-move { margin: 0; max-width: 220px; }
.dlt-act-move select { width: 100%; }
.dlt-act-error { margin: 0; padding: 0 20px; color: var(--dlt-danger); font-size: 13px; }
.dlt-act-error:not(:empty) { padding: 0 20px 14px; background: var(--dlt-surface-2); }
.dlt-act-icons { margin: 0 20px 14px; padding: 12px; border: 1px solid var(--dlt-border); border-radius: var(--dlt-radius); background: var(--dlt-surface-2); }
.dlt-act-iconbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dlt-act-iconbar label { margin: 0; font-size: 12.5px; font-weight: 600; }
.dlt-act-iconbar select { width: auto; max-width: 220px; }
.dlt-act-icongrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; max-height: 240px; overflow-y: auto; }
.dlt-act-iconpick { display: flex; align-items: center; justify-content: center; height: 52px; padding: 6px; border: 1px solid transparent; border-radius: var(--dlt-radius-sm); background: var(--dlt-surface); cursor: pointer; transition: var(--dlt-ease); }
.dlt-act-iconpick:hover { border-color: var(--dlt-primary-100); }
.dlt-act-iconpick.is-active { border-color: var(--dlt-primary); box-shadow: var(--dlt-ring); }
.dlt-act-iconpick img { max-width: 36px; max-height: 36px; object-fit: contain; }

/* ---------- 10h. Sleep tracker (sleeptracker.php, js/dlt_sleep.js) ---------- */
.con:has(.dlt-sleep-page) { background: transparent; border: 0; box-shadow: none; padding: 0; }
.dlt-sleep-page { --dlt-sleep: #534ab7; --dlt-sleep-nap: #afa9ec; transition: opacity .15s; }
.dlt-sleep-page.is-loading { opacity: .6; }
.dlt-sleep-page [hidden] { display: none !important; }
.dlt-sleep-datepick { position: relative; display: inline-block; }
.dlt-sleep-datepick input[type="date"] { position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.dlt-date-nav .dlt-icon-btn { width: 38px; height: 38px; }
.dlt-sleep-kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.dlt-kpi-note { margin-top: 2px; font-size: 13px; color: var(--dlt-muted); }
.dlt-sleep-page .is-good { color: var(--dlt-success); }
.dlt-sleep-page .is-warn, .dlt-warn { color: var(--dlt-warning); }
.dlt-sleep-page .is-bad { color: var(--dlt-danger); }

.dlt-sleep-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--dlt-space-4); align-items: start; }
.dlt-sleep-grid .dlt-card { padding: 18px 20px; }
.dlt-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dlt-card-title { margin: 0; font-size: 16px; font-weight: 700; color: var(--dlt-ink); }
.dlt-sleep-goal { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; font-weight: 500; color: var(--dlt-muted); }
.dlt-sleep-goal select { height: 30px; padding: 2px 6px; font-size: 13px; border: 1px solid var(--dlt-border-strong); border-radius: var(--dlt-radius-sm); background: var(--dlt-surface); color: var(--dlt-text); }

.dlt-sleep-axis, .dlt-sleep-night { display: grid; grid-template-columns: 104px minmax(0, 1fr) 76px; gap: 10px; align-items: center; }
.dlt-sleep-axis { margin-bottom: 2px; }
.dlt-sleep-ticks { position: relative; height: 16px; font-size: 11px; color: var(--dlt-subtle); }
.dlt-sleep-ticks span { position: absolute; top: 0; transform: translateX(-50%); }
.dlt-sleep-ticks span:first-child { transform: none; }
.dlt-sleep-ticks span:last-child { transform: translateX(-100%); }
.dlt-sleep-nights { list-style: none; margin: 0; padding: 0; }
.dlt-sleep-night { width: 100%; padding: 5px 6px; margin: 0 -6px; width: calc(100% + 12px); border: 0; border-radius: var(--dlt-radius-sm); background: transparent; text-align: left; color: var(--dlt-text); cursor: pointer; transition: var(--dlt-ease); }
.dlt-sleep-night:hover { background: var(--dlt-surface-2); }
.dlt-sleep-night.is-selected { background: var(--dlt-primary-50); }
.dlt-sleep-night.is-future { opacity: .45; cursor: default; }
.dlt-sleep-day { font-size: 13px; color: var(--dlt-muted); white-space: nowrap; }
.dlt-sleep-night.is-selected .dlt-sleep-day { color: var(--dlt-primary); font-weight: 600; }
.dlt-sleep-track { position: relative; height: 20px; border-radius: 5px; background: linear-gradient(to right, transparent calc(25% - .5px), var(--dlt-border) calc(25% - .5px), var(--dlt-border) calc(25% + .5px), transparent calc(25% + .5px), transparent calc(50% - .5px), var(--dlt-border) calc(50% - .5px), var(--dlt-border) calc(50% + .5px), transparent calc(50% + .5px), transparent calc(75% - .5px), var(--dlt-border) calc(75% - .5px), var(--dlt-border) calc(75% + .5px), transparent calc(75% + .5px)), var(--dlt-surface-2); }
.dlt-sleep-bar { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; background: var(--dlt-sleep); }
.dlt-sleep-bar.is-nap { background: var(--dlt-sleep-nap); }
.dlt-sleep-hours { font-size: 13px; font-weight: 600; text-align: right; white-space: nowrap; }
.dlt-sleep-hours small { font-size: 11px; font-weight: 500; color: var(--dlt-muted); }
.dlt-sleep-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12px; color: var(--dlt-muted); }
.dlt-sleep-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--dlt-sleep); vertical-align: -1px; }
.dlt-sleep-swatch.is-nap { background: var(--dlt-sleep-nap); }

.dlt-sleep-log .dlt-card-title { margin-bottom: 12px; }
.dlt-sleep-log .control-label { display: block; margin: 14px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--dlt-muted); }
.dlt-sleep-times { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dlt-sleep-times label { display: block; margin: 0; font-size: 12.5px; font-weight: 600; color: var(--dlt-muted); }
.dlt-sleep-times .form-control { margin-top: 4px; width: 100%; }
.dlt-sleep-total { margin: 8px 0 12px; font-size: 13px; color: var(--dlt-muted); }
.dlt-sleep-total strong { color: var(--dlt-ink); }
.dlt-sleep-nap { margin-top: 4px; }
.dlt-sleep-nap .dlt-todo-linkbtn { margin-top: 6px; }
.dlt-sleep-log textarea.form-control { resize: vertical; min-height: 60px; }
.dlt-sleep-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 16px; }
.dlt-sleep-status { font-size: 13px; color: var(--dlt-success); }
.dlt-sleep-error { margin: 8px 0 0; color: var(--dlt-danger); font-size: 13px; }
.dlt-sleep-error:empty { display: none; }

@media (max-width: 1199px) {
  .dlt-sleep-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .dlt-sleep-axis, .dlt-sleep-night { grid-template-columns: 48px minmax(0, 1fr) 66px; gap: 8px; }
  .dlt-sleep-prev, .dlt-sleep-ticks span:first-child, .dlt-sleep-ticks span:last-child { display: none; }
  .dlt-sleep-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dlt-sleep-kpis .dlt-kpi { padding: 12px 14px; }
  .dlt-sleep-kpis .dlt-kpi-value { font-size: 21px; }
}

/* ---------- 10i. Diet tracker (diettracker.php, js/dlt_diet_day.js) ---------- */
.con:has(.dlt-diet-page) { background: transparent; border: 0; box-shadow: none; padding: 0; }
.dlt-diet-page { --dlt-good: #1d9e75; --dlt-neutral: #ef9f27; --dlt-bad: #e24b4a; transition: opacity .15s; }
.dlt-diet-page.is-loading { opacity: .6; }
.dlt-diet-page [hidden] { display: none !important; }
.dlt-diet-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: var(--dlt-space-4); margin-bottom: var(--dlt-space-5); }
.dlt-meter { height: 8px; margin-top: 10px; border-radius: 999px; background: var(--dlt-surface-2); overflow: hidden; }
.dlt-meter > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--dlt-success); transition: width .3s ease; }
.dlt-meter > span.is-over { background: var(--dlt-danger); }
.dlt-meter.is-carbs > span { background: #378add; }
.dlt-meter.is-fat > span { background: var(--dlt-neutral); }
.dlt-meter.is-protein > span { background: #7f77dd; }
.dlt-diet-page .dlt-kpi-note { margin-top: 6px; }
.dlt-diet-page .is-good { color: var(--dlt-success); }
.dlt-diet-page .is-bad { color: var(--dlt-danger); }
.dlt-diet-macros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 18px; }
.dlt-macro-val { margin-top: 4px; }
.dlt-macro-val strong { font-size: 20px; font-weight: 700; color: var(--dlt-ink); }
.dlt-macro-val span { font-size: 13px; color: var(--dlt-muted); }
.dlt-macro .dlt-meter { height: 6px; margin-top: 6px; }
.dlt-diet-ratings { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--dlt-muted); }
.dlt-food-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--dlt-border-strong); flex: 0 0 auto; }
.dlt-food-dot.is-good { background: var(--dlt-good); }
.dlt-food-dot.is-neutral { background: var(--dlt-neutral); }
.dlt-food-dot.is-bad { background: var(--dlt-bad); }

.dlt-diet-meals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--dlt-space-4); align-items: start; }
.dlt-meal { background: var(--dlt-surface); border: 1px solid var(--dlt-border); border-radius: var(--dlt-radius-lg); box-shadow: var(--dlt-shadow-sm); padding: 12px 16px 8px; }
.dlt-meal-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; }
.dlt-meal-head .fa { color: var(--dlt-subtle); width: 16px; text-align: center; }
.dlt-meal-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--dlt-ink); }
.dlt-meal-kcal { font-size: 14px; font-weight: 600; color: var(--dlt-ink); }
.dlt-food-list { list-style: none; margin: 0; padding: 0; }
.dlt-food-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 6px; margin: 0; border: 0; border-top: 1px solid var(--dlt-border); background: transparent; text-align: left; color: var(--dlt-text); cursor: pointer; border-radius: 0; transition: var(--dlt-ease); }
.dlt-food-item:hover, .dlt-food-item:focus-visible { background: var(--dlt-surface-2); }
.dlt-food-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.dlt-food-name { font-size: 14px; font-weight: 600; color: var(--dlt-ink); overflow-wrap: anywhere; }
.dlt-food-meta { font-size: 12px; color: var(--dlt-muted); }
.dlt-food-kcal { font-size: 14px; font-weight: 600; white-space: nowrap; }
.dlt-meal-addbtn { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 2px; padding: 6px 4px; border: 0; background: transparent; color: var(--dlt-primary); font-size: 13px; font-weight: 600; cursor: pointer; }
.dlt-meal-addbtn:hover { text-decoration: underline; }
.dlt-meal.is-empty { padding: 0; border-style: dashed; box-shadow: none; background: transparent; }
.dlt-meal-empty { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 16px; border: 0; background: transparent; color: var(--dlt-text); font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; border-radius: inherit; }
.dlt-meal-empty .fa { color: var(--dlt-subtle); width: 16px; text-align: center; }
.dlt-meal-empty .dlt-muted { font-weight: 400; }
.dlt-meal-empty:hover { background: var(--dlt-primary-50); }
.dlt-meal-add { color: var(--dlt-primary); font-size: 13px; }
.dlt-diet-credit { margin: var(--dlt-space-4) 0 0; font-size: 12px; text-align: right; }
.dlt-diet-credit a { color: var(--dlt-muted); }

/* add / edit food dialog (shares .dlt-act-modal sizing) */
#dltFoodModal .modal-dialog { max-width: 560px; }
.dlt-food-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 8px 20px; }
.dlt-food-find, .dlt-food-detail { padding: 0 20px 12px; }
.dlt-food-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dlt-food-tabs .dlt-chip.is-active { background: var(--dlt-primary-50); border-color: var(--dlt-primary-100); color: var(--dlt-primary); }
.dlt-food-search { position: relative; margin-bottom: 8px; }
.dlt-food-search .fa { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--dlt-subtle); }
.dlt-food-search .form-control { padding-left: 34px; }
.dlt-food-results { max-height: 340px; overflow-y: auto; margin: 0 -4px 8px; padding: 0 4px; }
.dlt-food-result { display: flex; flex-direction: column; gap: 2px; width: 100%; margin-bottom: 6px; padding: 8px 12px; border: 1px solid var(--dlt-border); border-radius: var(--dlt-radius); background: var(--dlt-surface); text-align: left; cursor: pointer; transition: var(--dlt-ease); }
.dlt-food-result:hover, .dlt-food-result:focus-visible { border-color: var(--dlt-primary); background: var(--dlt-primary-50); }
.dlt-food-result.is-loading { opacity: .6; cursor: progress; }
.dlt-food-msg { margin: 8px 2px; font-size: 13px; color: var(--dlt-muted); }
.dlt-food-detail .control-label { display: block; margin: 12px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--dlt-muted); }
.dlt-food-detail #dltFoodBack { margin-bottom: 4px; }
.dlt-food-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 10px; }
.dlt-food-row label, .dlt-food-nutr label { display: block; margin: 0; font-size: 12.5px; font-weight: 600; color: var(--dlt-muted); }
.dlt-food-row .form-control, .dlt-food-nutr .form-control { margin-top: 4px; width: 100%; }
.dlt-food-nutr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.dlt-food-nutr .form-control[readonly] { background: var(--dlt-surface-2); color: var(--dlt-text); }
.dlt-food-nutr-note { margin: 4px 0 0; font-size: 12px; color: var(--dlt-muted); }
.dlt-food-total { margin: 8px 0 0; font-size: 13px; color: var(--dlt-muted); }
.dlt-food-total strong { color: var(--dlt-ink); }
.dlt-food-rating .dlt-seg-btn.is-good.is-active { background: var(--dlt-success-50); color: var(--dlt-success); }
.dlt-food-rating .dlt-seg-btn.is-neutral.is-active { background: var(--dlt-warning-50); color: var(--dlt-warning); }
.dlt-food-rating .dlt-seg-btn.is-bad.is-active { background: var(--dlt-danger-50); color: var(--dlt-danger); }
.dlt-food-foot { display: flex; align-items: center; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--dlt-border); }
#dltFoodModal .dlt-sleep-error { padding: 0 20px 14px; margin: 0; }
#dltFoodManage { margin-left: 14px; }
.dlt-food-savemine { display: inline-flex; align-items: center; gap: 7px; margin: 12px 0 0; font-size: 13px; font-weight: 500; color: var(--dlt-text); cursor: pointer; }

/* My foods dialog */
#dltMyFoodsModal .modal-dialog { max-width: 560px; }
.dlt-myfood-intro { margin: 0 20px 10px; font-size: 13px; color: var(--dlt-muted); }
#dltMyFoodFilterWrap { margin: 0 20px 8px; }
.dlt-myfood-list { max-height: min(60vh, 520px); overflow-y: auto; padding: 0 20px 16px; }
.dlt-myfood-row { display: flex; align-items: center; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--dlt-border); }
.dlt-myfood-row:last-child { border-bottom: 0; }
.dlt-myfood-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.dlt-myfood-row.is-editing { display: block; margin: 6px 0; padding: 12px; border: 1px solid var(--dlt-primary-100); border-radius: var(--dlt-radius); background: var(--dlt-primary-50); }
.dlt-myfood-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dlt-myfood-grid label { display: block; margin: 0; font-size: 12px; font-weight: 600; color: var(--dlt-muted); }
.dlt-myfood-grid .form-control { margin-top: 4px; width: 100%; }
.dlt-myfood-grid .is-name { grid-column: span 2; }
.dlt-myfood-grid .is-per { grid-column: span 2; }
.dlt-myfood-grid .has-error .form-control { border-color: var(--dlt-danger); }
.dlt-myfood-form .dlt-sleep-error { margin: 6px 0 0; }
.dlt-myfood-form .dlt-sleep-error:empty { display: none; }
.dlt-myfood-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }

/* My foods / My meals buttons in the page head (left of the date controls) */
.dlt-diet-page .dlt-page-head { align-items: center; }
.dlt-diet-page .dlt-page-head > div:first-child { margin-right: auto; }
.dlt-diet-lib { display: flex; gap: var(--dlt-space-2); }
.dlt-diet-lib .btn { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--dlt-primary); border-color: var(--dlt-primary-100); background: var(--dlt-primary-50); }
.dlt-diet-lib .btn:hover, .dlt-diet-lib .btn:focus-visible { color: #fff; background: var(--dlt-primary); border-color: var(--dlt-primary); }
@media (max-width: 600px) {
  .dlt-diet-lib { order: 3; width: 100%; }
  .dlt-diet-lib .btn { flex: 1; justify-content: center; }
}

/* My meals dialog (list reuses .dlt-myfood-*) */
#dltMyMealsModal .modal-dialog { max-width: 600px; }
.dlt-meal-head .dlt-cat-menu { margin-right: -6px; }
.dlt-meal-edit { margin: 0; }
.dlt-meal-edit > .dlt-todo-linkbtn, .dlt-meal-edit > .control-label, .dlt-meal-edit > .form-control, .dlt-meal-total, .dlt-meal-items, .dlt-meal-add { margin-left: 20px; margin-right: 20px; }
.dlt-meal-edit > .form-control { width: calc(100% - 40px); }
.dlt-meal-edit .control-label { display: block; margin-top: 8px; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: var(--dlt-muted); }
.dlt-meal-total { margin-top: 10px; margin-bottom: 4px; padding: 8px 12px; border-radius: var(--dlt-radius); background: var(--dlt-surface-2); font-size: 13px; color: var(--dlt-text); }
.dlt-meal-total strong { font-size: 15px; color: var(--dlt-ink); }
.dlt-meal-total span { color: var(--dlt-muted); }
.dlt-meal-items { list-style: none; padding: 0; max-height: min(34vh, 320px); overflow-y: auto; }
.dlt-meal-item { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--dlt-border); }
.dlt-meal-amt { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; font-weight: 400; color: var(--dlt-muted); }
.dlt-meal-amt .form-control { width: 64px; height: 30px; padding: 3px 6px; }
.dlt-meal-amt span { width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlt-meal-item .dlt-meal-kcal { width: 44px; text-align: right; font-weight: 600; color: var(--dlt-ink); font-variant-numeric: tabular-nums; }
.dlt-meal-add { margin-top: 10px; margin-bottom: 4px; padding: 10px 12px 4px; border: 1px dashed var(--dlt-border-strong); border-radius: var(--dlt-radius); }
.dlt-meal-add .dlt-food-results { max-height: 220px; }
.dlt-meal-pending { padding-bottom: 8px; }
.dlt-meal-pendrow { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin-top: 8px; }
.dlt-meal-pendrow label { display: block; margin: 0; font-size: 12px; font-weight: 600; color: var(--dlt-muted); }
.dlt-meal-pendrow .form-control { margin-top: 4px; width: auto; max-width: 100%; }
.dlt-meal-pendrow label:first-child { flex: 1 1 220px; min-width: 0; }
.dlt-meal-pendrow select.form-control { width: 100%; }
.dlt-meal-pendrow input[type=number] { width: 80px; }
.dlt-meal-per { display: block; margin-top: 4px; padding: 6px 0; font-weight: 400; color: var(--dlt-text); }
#dltMyMealsModal .dlt-sleep-error { padding: 0 20px; margin: 6px 0 0; }
#dltMyMealsModal .dlt-sleep-error:empty { display: none; }

@media (max-width: 991px) {
  .dlt-diet-summary, .dlt-diet-meals { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .dlt-food-nutr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dlt-myfood-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dlt-myfood-grid .is-name, .dlt-myfood-grid .is-per { grid-column: 1 / -1; }
  .dlt-meal-item { flex-wrap: wrap; }
  .dlt-meal-item .dlt-myfood-main { flex-basis: calc(100% - 40px); }
  .dlt-meal-amt { flex: 1; }
  .dlt-diet-macros { gap: 8px 10px; }
  .dlt-macro-val strong { font-size: 17px; }
}

/* ---------- 10j. Body tracker (bodytracker.php, js/dlt_body_day.js) ---------- */
.con:has(.dlt-body-page) { background: transparent; border: 0; box-shadow: none; padding: 0; }
.dlt-body-page { transition: opacity .15s; }
.dlt-body-page.is-loading { opacity: .6; }
.dlt-body-page [hidden] { display: none !important; }
.dlt-body-page .dlt-kpi-note.is-good { color: var(--dlt-success); }
.dlt-body-page .dlt-kpi-note.is-warn { color: var(--dlt-warning); }
.dlt-body-page .dlt-kpi-note.is-bad { color: var(--dlt-danger); }
.dlt-body-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--dlt-space-4); align-items: start; }
.dlt-body-grid .dlt-card { padding: 18px 20px; }
.dlt-body-select { height: 30px; padding: 2px 6px; font-size: 13px; border: 1px solid var(--dlt-border-strong); border-radius: var(--dlt-radius-sm); background: var(--dlt-surface); color: var(--dlt-text); }
.dlt-trend-range { margin: 0; }
.dlt-trend-range .dlt-chip { padding: 3px 10px; font-size: 12px; }
.dlt-trend-range .dlt-chip.is-active { background: var(--dlt-primary-50); border-color: var(--dlt-primary-100); color: var(--dlt-primary); }
.dlt-trend-chart { min-height: 200px; }
.dlt-trend-chart svg { display: block; max-width: 100%; }
.dlt-trend-grid { stroke: var(--dlt-border); stroke-width: 1; }
.dlt-trend-axis { font-size: 11px; fill: var(--dlt-subtle); }
.dlt-trend-line { fill: none; stroke: #378add; stroke-width: 2; stroke-linejoin: round; }
.dlt-trend-line.is-second { stroke: #7f77dd; }
.dlt-trend-dot { fill: #378add; }
.dlt-trend-dot.is-second { fill: #7f77dd; }
.dlt-body-empty { margin: 60px 0; text-align: center; color: var(--dlt-muted); font-size: 13px; }
.dlt-body-subtitle { margin: 14px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--dlt-muted); }
.dlt-trend-list { list-style: none; margin: 0; padding: 0; }
.dlt-trend-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--dlt-border); font-size: 13px; }
.dlt-trend-list li > span:first-of-type { margin-left: auto; font-weight: 600; color: var(--dlt-ink); }
.dlt-trend-ch { min-width: 52px; text-align: right; color: var(--dlt-muted); font-size: 12px; }

.dlt-body-hint { margin: 4px 0 12px; font-size: 12.5px; color: var(--dlt-muted); }
.dlt-body-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.dlt-body-fields.is-vo2 .dlt-body-field.is-cont { margin-left: -4px; }
.dlt-body-field { display: block; margin: 0; }
.dlt-body-label { display: block; margin-bottom: 4px; font-size: 12.5px; font-weight: 600; color: var(--dlt-muted); }
.dlt-body-in, .dlt-body-bpin { display: flex; align-items: center; gap: 6px; }
.dlt-body-in .form-control, .dlt-body-bpin .form-control { min-width: 0; flex: 1 1 auto; }
.dlt-body-in .form-control[readonly] { background: var(--dlt-surface-2); }
.dlt-body-unit { flex: 0 0 auto; font-size: 12px; color: var(--dlt-muted); }
.dlt-body-page .form-control::placeholder { color: var(--dlt-subtle); opacity: .75; }
.dlt-body-sec { margin-top: 12px; border-top: 1px solid var(--dlt-border); }
.dlt-body-sechead { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 0 4px; border: 0; background: transparent; text-align: left; color: var(--dlt-text); cursor: pointer; }
.dlt-body-sechead > .fa:first-child { width: 16px; text-align: center; color: var(--dlt-subtle); }
.dlt-body-sectitle { font-size: 14px; font-weight: 600; color: var(--dlt-ink); }
.dlt-body-secsum { margin-left: auto; font-size: 12px; color: var(--dlt-muted); text-align: right; }
.dlt-body-chev { color: var(--dlt-subtle); transition: transform .2s; }
.dlt-body-sec.is-open .dlt-body-chev { transform: rotate(180deg); }
.dlt-body-secbody { padding: 10px 0 4px; }
.dlt-body-note { margin: -2px 0 8px; font-size: 12px; color: var(--dlt-muted); }
.dlt-body-tape { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 14px; align-items: start; }
.dlt-body-figure { width: 100%; height: auto; opacity: .85; }

@media (max-width: 1199px) {
  .dlt-body-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .dlt-body-tape { grid-template-columns: minmax(0, 1fr); }
  .dlt-body-figure { display: none; }
  .dlt-body-secsum { display: none; }
  .dlt-body-chev { margin-left: auto; }
  .dlt-body-bp { grid-column: 1 / -1; }
}

/* ---------- 10k. Journal (journal.php, js/dlt_journal_day.js) ---------- */
.con:has(.dlt-journal-page) { background: transparent; border: 0; box-shadow: none; padding: 0; }
.dlt-journal-page { transition: opacity .15s; }
.dlt-journal-page.is-loading { opacity: .6; }
.dlt-journal-page [hidden] { display: none !important; }
.dlt-journal-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--dlt-space-4); align-items: start; }
/* one shrinkable column: an auto track grows to fit the single-line past-entry snippets and pushed the card off the page */
.dlt-journal-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--dlt-space-4); min-width: 0; }
.dlt-journal-grid .dlt-card { padding: 16px 18px; }
.dlt-journal-write { margin: 0; }
.dlt-journal-write.is-editing { border-color: var(--dlt-primary); box-shadow: 0 0 0 3px var(--dlt-primary-50); }
.dlt-journal-write .sceditor-container { width: 100% !important; min-height: 220px; border: 1px solid var(--dlt-border); border-radius: var(--dlt-radius); overflow: hidden; }
.dlt-journal-write .sceditor-toolbar { background: var(--dlt-surface-2); border-bottom: 1px solid var(--dlt-border); }
.dlt-journal-write .sceditor-container iframe, .dlt-journal-write .sceditor-container textarea { width: 100% !important; }
.dlt-journal-writefoot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.dlt-journal-writefoot label { margin: 0; font-size: 13px; font-weight: 500; }
.dlt-journal-draft { font-size: 12px; color: var(--dlt-muted); }
.dlt-journal-daytitle { margin: var(--dlt-space-5) 0 var(--dlt-space-3); font-size: 13px; font-weight: 600; color: var(--dlt-muted); }
.dlt-jentry { margin-bottom: var(--dlt-space-3); }
.dlt-jentry.is-editing { opacity: .55; }
.dlt-jentry-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.dlt-jtime { font-size: 12px; color: var(--dlt-muted); font-variant-numeric: tabular-nums; }
.dlt-jtag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--dlt-surface-2); color: var(--dlt-muted); }
.dlt-jtag.is-cat { --tag: var(--dlt-primary); background: color-mix(in srgb, var(--tag) 14%, #fff); color: color-mix(in srgb, var(--tag) 70%, #000); }
.dlt-jentry-body { font-size: 15px; line-height: 1.65; color: var(--dlt-text); overflow-wrap: anywhere; }
.dlt-jentry-body p { margin: 0 0 .6em; }
.dlt-jentry-body p:last-child { margin-bottom: 0; }
.dlt-jentry .dropdown-menu a.is-danger { color: var(--dlt-danger); }

.dlt-journal-facts { list-style: none; margin: 8px 0 0; padding: 0; }
.dlt-journal-facts li + li { border-top: 1px solid var(--dlt-border); }
.dlt-journal-facts a { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--dlt-text); font-size: 13.5px; }
.dlt-journal-facts a:hover { color: var(--dlt-primary); text-decoration: none; }
.dlt-journal-facts .fa { width: 16px; text-align: center; color: var(--dlt-subtle); }
.dlt-jfact-label { flex: 1 1 auto; }
.dlt-jfact-val { font-weight: 600; text-align: right; }
.dlt-jfact-sub { margin: -4px 0 8px 26px; font-size: 12px; color: var(--dlt-muted); }
.dlt-jfact-none { padding: 6px 0; font-size: 13px; color: var(--dlt-muted); }

.dlt-journal-past .dlt-card-head { flex-wrap: wrap; }
.dlt-journal-past .dlt-food-search { margin: 4px 0 6px; }
#dltJPast { max-height: 460px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.dlt-jpast-month { margin: 12px 0 2px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--dlt-subtle); }
.dlt-jpast-item { display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 7px 6px; border: 0; border-top: 1px solid var(--dlt-border); border-radius: 0; background: transparent; text-align: left; font-size: 13px; cursor: pointer; }
.dlt-jpast-item:hover { background: var(--dlt-surface-2); }
.dlt-jpast-item.is-current { background: var(--dlt-primary-50); }
.dlt-jpast-date { flex: 0 0 52px; color: var(--dlt-primary); font-weight: 600; white-space: nowrap; }
.dlt-jpast-snip { min-width: 0; color: var(--dlt-text); line-height: 1.45; overflow-wrap: anywhere; }
#dltJMore { margin-top: 10px; }

@media (max-width: 991px) {
  .dlt-journal-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 10l. Dashboard (homepage.php, js/dlt_dashboard.js) ---------- */
.con:has(.dlt-dash) { background: transparent; border: 0; box-shadow: none; padding: 0; }
.dlt-dash-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.dlt-dash-quick .btn { display: inline-flex; align-items: center; gap: 6px; }
.dlt-dash-kpis .dlt-kpi { display: block; color: var(--dlt-text); text-decoration: none; transition: var(--dlt-ease); }
.dlt-dash-kpis .dlt-kpi:hover, .dlt-dash-kpis .dlt-kpi:focus-visible { border-color: var(--dlt-primary-100); box-shadow: var(--dlt-shadow); text-decoration: none; }
.dlt-dash .dlt-kpi-note.is-good, .dlt-dash .is-good { color: var(--dlt-success); }
.dlt-dash .dlt-kpi-note.is-warn { color: var(--dlt-warning); }
.dlt-dash .dlt-kpi-note.is-bad, .dlt-dash .is-bad { color: var(--dlt-danger); }
.dlt-spark, .dlt-spark-bars { display: block; width: 100%; height: 28px; margin: 6px 0 2px; }
.dlt-spark polyline { fill: none; stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.dlt-spark-bars rect { fill: #afa9ec; }
.dlt-spark-bars rect.is-today { fill: #534ab7; }
.dlt-spark-goal { stroke: var(--dlt-border-strong); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.dlt-dash .dlt-meter { display: block; height: 7px; margin-top: 8px; border-radius: 999px; background: var(--dlt-surface-2); overflow: hidden; }
.dlt-dash .dlt-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--dlt-success); }

.dlt-dash-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--dlt-space-4); margin-bottom: var(--dlt-space-4); align-items: start; }
.dlt-dash .dlt-card { padding: 16px 18px; }
.dlt-dash .dlt-card-head a { font-size: 13px; }
.dlt-dash-bars { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; }
.dlt-dash-bars a { display: block; color: var(--dlt-text); text-decoration: none; border-radius: var(--dlt-radius-sm); padding: 2px 4px; margin: 0 -4px; }
.dlt-dash-bars a:hover { background: var(--dlt-surface-2); }
.dlt-dash-barlabel { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.dlt-dash-bars .dlt-meter { margin-top: 5px; }
.dlt-dash-sub { margin-top: 16px; }
.dlt-dash-list { list-style: none; margin: 8px 0 0; padding: 0; }
.dlt-dash-list li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 13.5px; border-top: 1px solid var(--dlt-border); }
.dlt-dash-list li:first-child { border-top: 0; }

.dlt-dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--dlt-space-4); align-items: start; }
.dlt-dash-todos { list-style: none; margin: 4px 0 0; padding: 0; }
.dlt-dash-todos li { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13.5px; border-top: 1px solid var(--dlt-border); }
.dlt-dash-todos li:first-child { border-top: 0; }
.dlt-dash-todos li.is-done .dlt-todo-check { background: var(--dlt-success); border-color: var(--dlt-success); color: #fff; }
.dlt-dash-todos li.is-done .dlt-dash-todotitle { text-decoration: line-through; color: var(--dlt-muted); }
.dlt-dash-todotitle { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.dlt-dash-due { flex: 0 0 auto; font-size: 12px; color: var(--dlt-muted); }
.dlt-dash-meta { font-size: 12.5px; color: var(--dlt-muted); margin-top: 4px; }
.dlt-dash-quote { margin: 4px 0 8px; font-size: 14px; line-height: 1.55; color: var(--dlt-text); }
.dlt-dash-tip { margin-top: 6px; font-family: Georgia, "Times New Roman", serif; font-size: 15px; line-height: 1.5; color: var(--dlt-ink); }
.dlt-dash-tip p { margin: 0 0 .4em; }
.dlt-dash-tip.is-clamped { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.dlt-dash-more { margin-top: 4px; padding: 0; border: 0; background: none; color: var(--dlt-primary); font-size: 13px; cursor: pointer; }
.dlt-dash-stack { display: flex; height: 9px; margin: 8px 0 4px; border-radius: 999px; overflow: hidden; background: var(--dlt-surface-2); }
.dlt-dash-stack .is-good { background: #1d9e75; }
.dlt-dash-stack .is-neutral { background: #ef9f27; }
.dlt-dash-stack .is-bad { background: #e24b4a; }
@media (max-width: 991px) {
  .dlt-dash-row { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 10m. Reports (overview.php, js/dlt_reports.js) ---------- */
.con:has(.dlt-reports) { background: transparent; border: 0; box-shadow: none; padding: 0; }
.dlt-rep-range { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: var(--dlt-space-4); }
.dlt-rep-range > .dlt-muted { margin-right: 4px; font-size: 13px; }
.dlt-rep-range .dlt-chip.is-active { background: var(--dlt-primary-50); border-color: var(--dlt-primary-100); color: var(--dlt-primary); }
.dlt-rep-custom { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; color: var(--dlt-muted); }
.dlt-rep-custom .form-control { width: auto; height: 32px; }
.dlt-rep-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--dlt-space-4); align-items: start; }
.dlt-rep-nav { position: sticky; top: 70px; padding: 8px; background: var(--dlt-surface); border: 1px solid var(--dlt-border); border-radius: var(--dlt-radius-lg); box-shadow: var(--dlt-shadow-sm); }
.dlt-rep-pick { display: none; }
.dlt-rep-list { list-style: none; margin: 0; padding: 0; }
.dlt-rep-list .dlt-rep-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--dlt-radius-sm); background: transparent; color: var(--dlt-text); font-size: 14px; text-align: left; cursor: pointer; }
.dlt-rep-list .dlt-rep-item .fa { width: 16px; text-align: center; color: var(--dlt-subtle); }
.dlt-rep-list .dlt-rep-item:hover { background: var(--dlt-surface-2); }
.dlt-rep-list .dlt-rep-item.is-active { background: var(--dlt-primary-50); color: var(--dlt-primary); font-weight: 600; }
.dlt-rep-list .dlt-rep-item.is-active .fa { color: var(--dlt-primary); }
.dlt-rep-main { min-width: 0; transition: opacity .15s; }
.dlt-rep-main.is-loading { opacity: .55; }
.dlt-rep-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: var(--dlt-space-3); }
.dlt-rep-head h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--dlt-ink); }
.dlt-rep-stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: var(--dlt-space-4); }
.dlt-reports .dlt-kpi-note.is-good, .dlt-reports .is-good { color: var(--dlt-success); }
.dlt-reports .dlt-kpi-note.is-warn, .dlt-reports .is-warn { color: var(--dlt-warning); }
.dlt-reports .dlt-kpi-note.is-bad, .dlt-reports .is-bad { color: var(--dlt-danger); }
.dlt-rep-card { margin-bottom: var(--dlt-space-4); padding: 16px 20px; }
.dlt-rep-card .dlt-card-head { flex-wrap: wrap; }
.dlt-rep-chart { display: block; max-width: 100%; }
.dlt-rep-goal { stroke: var(--dlt-ink); stroke-width: 1; stroke-dasharray: 4 4; opacity: .5; }
.dlt-rep-bar { fill: #378add; }
.dlt-rep-bar.is-good { fill: #1d9e75; }
.dlt-rep-bar.is-warn { fill: #ef9f27; }
.dlt-rep-bar.is-bad { fill: #e24b4a; }
.dlt-rep-bar.is-c0 { fill: #1d9e75; } .dlt-rep-bar.is-c1 { fill: #d85a30; } .dlt-rep-bar.is-c2 { fill: #7f77dd; } .dlt-rep-bar.is-c3 { fill: #ef9f27; }
.dlt-band.is-good { fill: #1d9e75; opacity: .07; }
.dlt-band.is-warn { fill: #ef9f27; opacity: .09; }
.dlt-band.is-high { fill: #d85a30; opacity: .09; }
.dlt-band.is-bad { fill: #e24b4a; opacity: .1; }
.dlt-rep-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12.5px; color: var(--dlt-muted); }
.dlt-rep-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.dlt-rep-empty { margin: 24px 0; text-align: center; color: var(--dlt-muted); }
.dlt-rep-note { margin: 8px 0 0; font-size: 12px; color: var(--dlt-muted); }
.dlt-rep-compare-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.dlt-rep-compare-bar .dlt-chip.is-active { background: var(--dlt-primary-50); border-color: var(--dlt-primary-100); color: var(--dlt-primary); }
.dlt-rep-addaction { width: auto; max-width: 340px; }
.dlt-rep-action + .dlt-rep-action { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--dlt-border); }
.dlt-rep-sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 6px; font-size: 14.5px; font-weight: 600; color: var(--dlt-ink); }
.dlt-rep-sub i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.dlt-rep-sub .dlt-muted { font-size: 12.5px; font-weight: 400; }
.dlt-rep-notes { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.dlt-rep-notes li { padding: 4px 0; border-top: 1px solid var(--dlt-border); }
.dlt-rep-notes strong { margin-right: 6px; color: var(--dlt-muted); font-weight: 600; }
.dlt-rep-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dlt-rep-table th { padding: 6px 8px; border-bottom: 1px solid var(--dlt-border-strong); font-size: 12px; font-weight: 600; color: var(--dlt-muted); text-align: left; }
.dlt-rep-table td { padding: 7px 8px; border-bottom: 1px solid var(--dlt-border); vertical-align: top; }
.dlt-rep-table .is-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dlt-rep-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: var(--dlt-space-3); }
.dlt-rep-toolbar .dlt-food-search { flex: 1 1 260px; margin: 0; }
.dlt-rep-jentry { margin-bottom: var(--dlt-space-3); padding: 14px 18px; }
.dlt-rep-jhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.dlt-rep-done { list-style: none; margin: 0; padding: 0; }
.dlt-rep-done li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 6px 0; border-top: 1px solid var(--dlt-border); font-size: 13.5px; }
.dlt-rep-done li:first-child { border-top: 0; }
.dlt-rep-done .fa-check { color: var(--dlt-success); }
.dlt-rep-done li > span:first-of-type { flex: 1 1 200px; }
@media (max-width: 991px) {
  .dlt-rep-grid { grid-template-columns: minmax(0, 1fr); }
  .dlt-rep-nav { position: static; padding: 0; border: 0; box-shadow: none; background: transparent; }
  .dlt-rep-list { display: none; }
  .dlt-rep-pick { display: block; }
  .dlt-rep-custom { margin-left: 0; }
}
@media print {
  .main-sidebar, .main-header, .dlt-rep-nav, .dlt-rep-range, #dltRepPrint, .dlt-rep-addaction, .dlt-seg, .dlt-rep-metric, .dlt-rep-toolbar .dlt-food-search, [data-uncompare] .fa { display: none !important; }
  .content-wrapper { margin: 0 !important; }
  .dlt-rep-grid { display: block; }
  .dlt-rep-card, .dlt-kpi, .dlt-rep-jentry { box-shadow: none !important; break-inside: avoid; }
  body { background: #fff !important; }
}

/* ---------- 10n. Settings (mysettings.php, js/dlt_settings_page.js; nav reuses .dlt-rep-*) ---------- */
.con:has(.dlt-settings) { background: transparent; border: 0; box-shadow: none; padding: 0; }
.dlt-settings [hidden] { display: none !important; }
.dlt-set-main { min-width: 0; }
.dlt-set-card { margin-bottom: var(--dlt-space-4); padding: 18px 22px; scroll-margin-top: 70px; }
.dlt-set-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 12px; }
.dlt-set-head h2 { margin: 0; font-size: 17px; font-weight: 700; color: var(--dlt-ink); }
.dlt-set-status { margin-left: auto; font-size: 13px; }
.dlt-set-status.is-ok { color: var(--dlt-success); }
.dlt-set-status.is-ok::before { content: "\f00c"; font-family: FontAwesome; margin-right: 5px; }
.dlt-set-status.is-error { color: var(--dlt-danger); }
.dlt-set-intro { margin: -4px 0 12px; font-size: 13px; color: var(--dlt-muted); }
.dlt-set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.dlt-set-grid.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dlt-set-grid label, .dlt-set-modallabel { display: block; margin: 0; font-size: 12.5px; font-weight: 600; color: var(--dlt-muted); }
.dlt-set-grid label .form-control, .dlt-set-modallabel .form-control { margin-top: 5px; width: 100%; font-weight: 400; }
.dlt-set-grid label .dlt-muted { font-weight: 400; }
.dlt-set-grid .is-wide { grid-column: 1 / -1; }
.dlt-set-grid label.has-error .form-control { border-color: var(--dlt-danger); box-shadow: 0 0 0 3px var(--dlt-danger-50); }
.dlt-set-inline { display: flex; align-items: center; gap: 8px; }
.dlt-set-inline .form-control { flex: 1 1 auto; min-width: 0; margin-top: 5px; }
.dlt-set-inline .btn { margin-top: 5px; flex: 0 0 auto; }
.dlt-set-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.dlt-set-foot .btn { display: inline-flex; align-items: center; gap: 6px; }
.dlt-set-switches { list-style: none; margin: 0; padding: 0; }
.dlt-set-switches li { display: flex; align-items: flex-start; gap: 14px; padding: 10px 0; border-top: 1px solid var(--dlt-border); font-size: 14px; }
.dlt-set-switches li:first-child { border-top: 0; }
.dlt-set-switches strong { font-weight: 600; color: var(--dlt-ink); }
.dlt-set-switches .dlt-switch { flex: 0 0 auto; margin-top: 1px; }
.dlt-set-sub { margin: 22px 0 10px; padding-top: 16px; border-top: 1px solid var(--dlt-border); font-size: 14px; font-weight: 700; color: var(--dlt-ink); }
.dlt-set-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-bottom: 12px; }
.dlt-set-image { position: relative; margin: 0; padding: 6px; border: 1px solid var(--dlt-border); border-radius: var(--dlt-radius); text-align: center; }
.dlt-set-image img { width: 100%; height: 80px; object-fit: cover; border-radius: var(--dlt-radius-sm); }
.dlt-set-image figcaption { margin-top: 4px; font-size: 12px; color: var(--dlt-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlt-set-image .dlt-icon-btn { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; background: rgba(255, 255, 255, .92); }
.dlt-set-image .dlt-icon-btn:hover { color: var(--dlt-danger); }
.dlt-set-upload { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.dlt-set-upload label { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--dlt-muted); }
.dlt-set-upload input[type=file] { margin-top: 5px; font-weight: 400; color: var(--dlt-text); }
.dlt-set-upload .form-control { margin-top: 5px; }
.dlt-set-uoms { list-style: none; margin: 0 0 12px; padding: 0; }
.dlt-set-uoms li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--dlt-border); font-size: 14px; }
.dlt-set-uoms li:first-child { border-top: 0; }
.dlt-set-uoms .dlt-set-uomname, .dlt-set-uoms .form-control { flex: 1 1 auto; }
.dlt-set-shares { list-style: none; margin: 0 0 12px; padding: 0; }
.dlt-set-shares li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--dlt-border); font-size: 14px; }
.dlt-set-shares li:first-child { border-top: 0; }
.dlt-set-danger { border-color: var(--dlt-danger-50); }
.dlt-set-danger .dlt-set-head h2 { color: var(--dlt-danger); }
.dlt-set-dangerrow { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--dlt-border); font-size: 14px; }
.dlt-set-dangerrow:first-of-type { border-top: 0; }
.dlt-set-dangerrow > div { flex: 1 1 auto; }
.dlt-set-dangerrow strong { color: var(--dlt-ink); }
.dlt-settings .btn.is-danger, .dlt-set-dangerrow .btn.is-danger { color: var(--dlt-danger); border-color: var(--dlt-danger-50); }
.dlt-settings .btn.is-danger:hover { background: var(--dlt-danger-50); }
.dlt-set-modal .dlt-set-modalbody, .dlt-set-modalbody { padding: 4px 20px 8px; }
.dlt-set-modalbody .dlt-set-modallabel { margin-bottom: 12px; }
.dlt-set-warn { padding: 10px 12px; border-radius: var(--dlt-radius-sm); background: var(--dlt-danger-50); color: var(--dlt-danger); font-size: 13px; }
#dltSetModal .dlt-sleep-error { padding: 0 20px 10px; margin: 0; }
#dltThemeBody table { width: 100%; }
#dltThemeBody .ui-slider { margin: 8px 0; }
@media (max-width: 767px) {
  .dlt-set-grid, .dlt-set-grid.is-4 { grid-template-columns: minmax(0, 1fr); }
  .dlt-set-dangerrow { flex-direction: column; align-items: flex-start; }
}
@media (min-width: 768px) and (max-width: 1199px) {
  .dlt-set-grid.is-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 10o. Admin (dlt_admin.php, js/dlt_admin_page.js; nav reuses .dlt-rep-*, forms .dlt-set-grid) ---------- */
.con:has(.dlt-adm) { background: transparent; border: 0; box-shadow: none; padding: 0; }
.dlt-adm [hidden] { display: none !important; }
.dlt-adm-main { min-width: 0; }
.dlt-adm .dlt-card { padding: 16px 18px; margin-bottom: var(--dlt-space-4); }
.dlt-adm .dlt-card-title { margin: 0 0 8px; }
.dlt-adm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--dlt-space-3); }
.dlt-adm-kpi { display: flex; flex-direction: column; gap: 4px; text-align: left; color: var(--dlt-text); cursor: default; }
.dlt-adm-kpi[data-kpi] { cursor: pointer; }
.dlt-adm-kpi[data-kpi]:hover { border-color: var(--dlt-primary-100); }
.dlt-adm-kpi strong { font-size: 26px; font-weight: 700; color: var(--dlt-ink); font-variant-numeric: tabular-nums; }
.dlt-adm-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--dlt-space-4); }
.dlt-adm-people { list-style: none; margin: 0; padding: 0; }
.dlt-adm-people li + li { border-top: 1px solid var(--dlt-border); }
.dlt-adm-person { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 0; border: 0; background: none; text-align: left; color: var(--dlt-text); }
.dlt-adm-person span { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.dlt-adm-person small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; color: var(--dlt-muted); }
.dlt-adm-person em { font-style: normal; font-size: 12.5px; color: var(--dlt-muted); white-space: nowrap; }
.dlt-adm-person:hover span { color: var(--dlt-primary); }
.dlt-adm-link { padding: 0; border: 0; background: none; color: var(--dlt-primary); font-weight: 600; text-align: left; }
.dlt-adm-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--dlt-space-4); align-items: start; }
.dlt-adm-split:has(.dlt-adm-panel[hidden]) { grid-template-columns: minmax(0, 1fr); }
.dlt-adm-panel { position: sticky; top: 70px; }
.dlt-adm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.dlt-adm-bar .dlt-food-search { flex: 1 1 220px; margin: 0; }
.dlt-adm-bar select.form-control { width: auto; }
.dlt-adm-tablewrap { overflow-x: auto; }
.dlt-adm-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dlt-adm-table th { padding: 6px 8px; border-bottom: 1px solid var(--dlt-border); font-size: 12px; font-weight: 600; color: var(--dlt-muted); text-align: left; white-space: nowrap; }
.dlt-adm-table th button { padding: 0; border: 0; background: none; font: inherit; color: inherit; }
.dlt-adm-table th button.is-sorted { color: var(--dlt-primary); }
.dlt-adm-table td { padding: 8px; border-bottom: 1px solid var(--dlt-border); vertical-align: middle; }
.dlt-adm-table td small { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dlt-muted); font-size: 12px; }
.dlt-adm-table td.is-num { white-space: nowrap; font-variant-numeric: tabular-nums; }
#dltAdmUsers tbody tr[data-id] { cursor: pointer; }
#dltAdmUsers td:not(:first-child) { white-space: nowrap; }
#dltAdmUsers td:nth-child(2) { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
/* with the edit panel open, drop "Joined" so Status still fits */
.dlt-adm-split:not(:has(.dlt-adm-panel[hidden])) #dltAdmUsers :is(th, td):nth-child(4) { display: none; }
#dltAdmUsers tbody tr[data-id]:hover td { background: var(--dlt-surface-2); }
#dltAdmUsers tbody tr.is-on td { background: var(--dlt-primary-50); }
.dlt-adm-table tr.is-deleted td { color: var(--dlt-muted); }
.dlt-adm-table tr.is-editing td { background: var(--dlt-primary-50); }
.dlt-adm-rowbtns { white-space: nowrap; text-align: right; }
.dlt-adm-rowbtns .btn + .btn { margin-left: 6px; }
.dlt-adm-pager { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 10px; font-size: 13px; color: var(--dlt-muted); }
.dlt-adm-pager span { margin-right: 6px; }
.dlt-adm-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--dlt-surface-2); color: var(--dlt-muted); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.dlt-adm-tag.is-ok { background: var(--dlt-success-50); color: var(--dlt-success); }
.dlt-adm-tag.is-warn { background: var(--dlt-warning-50); color: var(--dlt-warning); }
.dlt-adm-tag.is-off { background: var(--dlt-danger-50); color: var(--dlt-danger); }
.dlt-adm-panelhead { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.dlt-adm-panelhead .dlt-card-title { flex: 1; margin: 0; overflow-wrap: anywhere; }
.dlt-adm-hint { margin: 0 0 12px; font-size: 12.5px; color: var(--dlt-muted); }
.dlt-adm-bar .dlt-adm-hint { flex: 1; margin: 0; }
.dlt-adm-panel .dlt-set-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dlt-adm-checks { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.dlt-adm-check { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13.5px; font-weight: 500; color: var(--dlt-text); cursor: pointer; }
.dlt-adm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--dlt-border); }
.dlt-adm .dlt-sleep-error { margin: 10px 0 0; }
.dlt-adm .dlt-sleep-error:empty, .dlt-adm-ok:empty { display: none; }
.dlt-adm-ok { margin: 10px 0 0; font-size: 13px; color: var(--dlt-success); }
.dlt-adm-ok::before { content: "\f00c"; font-family: FontAwesome; margin-right: 6px; }
.dlt-adm .has-error .form-control { border-color: var(--dlt-danger); }
.dlt-adm-secbar { display: flex; justify-content: flex-end; margin-bottom: var(--dlt-space-3); }
.dlt-adm-subhead { margin: 16px 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--dlt-subtle); }
.dlt-adm-feats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 16px; }
.dlt-adm-feat { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13.5px; font-weight: 500; color: var(--dlt-text); }
.dlt-adm-feat.is-ro .fa-check { color: var(--dlt-success); }
.dlt-adm-feat.is-ro .fa-times { color: var(--dlt-subtle); }
.dlt-adm-logo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.dlt-adm-logoprev { display: inline-flex; align-items: center; padding: 8px 12px; border-radius: var(--dlt-radius-sm); background: var(--dlt-ink); }
.dlt-adm-logoprev img { max-width: 220px; max-height: 45px; }
@media (max-width: 1199px) {
  .dlt-adm-split { grid-template-columns: minmax(0, 1fr); }
  .dlt-adm-panel { position: static; order: -1; }
}
@media (max-width: 767px) {
  .dlt-adm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dlt-adm-cols { grid-template-columns: minmax(0, 1fr); }
  .dlt-adm-feats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dlt-adm-table th:nth-child(4), .dlt-adm-table td:nth-child(4) { display: none; }
}
@media (max-width: 480px) {
  .dlt-adm-panel .dlt-set-grid { grid-template-columns: minmax(0, 1fr); }
  .dlt-adm-feats { grid-template-columns: minmax(0, 1fr); }
  #dltAdmUsers :is(th, td):is(:nth-child(2), :nth-child(3)) { display: none; }
}

/* ---------- 10p. Installable app (js/dlt_pwa.js) ---------- */
[data-install-app][hidden] { display: none !important; }
.dlt-install-help { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 2000; /* not "inset": iOS before 14.5 ignores it */ display: flex; align-items: flex-end; justify-content: center; padding: 16px; background: rgba(20, 33, 48, .55); }
.dlt-install-help[hidden] { display: none; }
.dlt-install-card { width: 100%; max-width: 400px; padding: 22px 20px 18px; border-radius: var(--dlt-radius-lg); background: var(--dlt-surface); box-shadow: var(--dlt-shadow-lg); text-align: center; }
.dlt-install-card img { border-radius: 13px; }
.dlt-install-card h2 { margin: 12px 0 10px; font-size: 18px; font-weight: 700; color: var(--dlt-ink); }
.dlt-install-card ol { margin: 0 0 16px; padding-left: 20px; text-align: left; font-size: 14px; line-height: 1.6; color: var(--dlt-text); }
.dlt-install-card li + li { margin-top: 4px; }
.dlt-install-card p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--dlt-text); }
.dlt-install-card .dlt-install-note { margin-top: -6px; font-size: 12.5px; color: var(--dlt-muted); }
/* the iOS share symbol: a box with an arrow out of the top */
.dlt-install-share { display: inline-block; position: relative; width: 13px; height: 13px; margin: 0 2px; border: 2px solid var(--dlt-primary); border-top: 0; border-radius: 0 0 2px 2px; vertical-align: -1px; }
.dlt-install-share::before { content: ""; position: absolute; left: 50%; top: -6px; width: 2px; height: 11px; margin-left: -1px; background: var(--dlt-primary); }
.dlt-install-share::after { content: ""; position: absolute; left: 50%; top: -7px; width: 6px; height: 6px; margin-left: -3px; border-left: 2px solid var(--dlt-primary); border-top: 2px solid var(--dlt-primary); transform: rotate(45deg); }

/* ---------- 11. Utilities ---------- */
.dlt-card { background: var(--dlt-surface); border: 1px solid var(--dlt-border); border-radius: var(--dlt-radius-lg); box-shadow: var(--dlt-shadow); padding: var(--dlt-space-5); }
.dlt-stack > * + * { margin-top: var(--dlt-space-4); }
.dlt-muted { color: var(--dlt-muted); }
.dlt-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--dlt-subtle); }
.dlt-shadow { box-shadow: var(--dlt-shadow); }
.dlt-rounded { border-radius: var(--dlt-radius); }
.dlt-gap > * { margin-right: var(--dlt-space-2); }
.dlt-gap > *:last-child { margin-right: 0; }
/* Row whose cards share the tallest card's height (body grows to fill) */
.dlt-row-equal { display: flex; flex-wrap: wrap; }
.dlt-row-equal > [class*="col-"] { display: flex; flex-direction: column; }
.dlt-row-equal > [class*="col-"] > .box { flex: 1 1 auto; display: flex; flex-direction: column; }
.dlt-row-equal > [class*="col-"] > .box > .box-body { flex: 1 1 auto; }
.dlt-row-equal::before, .dlt-row-equal::after { display: none; } /* drop BS3 clearfix pseudo-elements inside flex */
/* Fixed-height card body that scrolls its content; table header stays visible */
.dlt-scroll { overflow-y: auto; }
.dlt-scroll .table > thead > tr > th { position: sticky; top: 0; z-index: 1; white-space: nowrap; }

/* ---------- 12. Accessibility & motion ---------- */
a:focus-visible, .btn:focus-visible, .form-control:focus-visible { outline: none; box-shadow: var(--dlt-ring); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- 13. Responsive ---------- */
/* Keep long titles clear of the minimise/settings buttons */
.box-header:has(> .box-tools) { padding-right: 88px; }
@media (max-width: 991px) {
  .content-header > .breadcrumb { position: static; margin-top: var(--dlt-space-2); padding: 0; }
}
@media (max-width: 767px) {
  /* Wide legacy data tables scroll inside their card instead of overflowing it */
  table.dietentry, .diettable { display: block; overflow-x: auto; max-width: 100%; }
  /* Tracker page title rows (title + date picker + share icon were floated with fixed margins) */
  .titletabs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--dlt-space-3); }
  .titletabs > h2 { float: none; margin: 0; flex: 1 1 100%; }
  .titletabs > .btndietnext, .titletabs > .shareitem { float: none; margin: 0 !important; }
  .content { padding: var(--dlt-space-4); }
  .content-header { padding: var(--dlt-space-4) var(--dlt-space-4) 0; }
  .box-header, .box-body { padding: var(--dlt-space-4); }
  .table > thead > tr > th, .table > tbody > tr > td { padding: 10px 12px; }
}
