/* Native HTML edition overrides and additions. Theme tokens match the React edition. */
[hidden] {
  display: none !important;
}
.html-feedback {
  position: fixed;
  inset-inline-end: 22px;
  bottom: 16px;
  z-index: 2000;
  max-width: min(460px, calc(100vw - 32px));
}
.html-feedback .alert {
  padding-inline-end: 48px;
  box-shadow: 0 8px 30px #0002;
}
.html-feedback .btn-close {
  position: absolute;
  inset-inline-end: 14px;
  top: 18px;
}
.html-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  background: var(--surface);
  color: var(--text);
  overflow: auto;
}
.html-dialog::backdrop {
  background: #08181388;
}
.html-dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 20px;
}
.html-dialog-heading h2 {
  font-size: 22px;
  margin: 0;
}
.html-dialog .admin-form,
.html-form {
  display: grid;
  gap: 16px;
}
.html-dialog label,
.html-form label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
}
.html-pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 16px;
  font-size: 12px;
}
.html-pagination > span {
  margin-inline-end: auto;
}
.html-pagination label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.html-table-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 0;
}
.html-table-filters label {
  flex: 1 1 140px;
  font-size: 12px;
}
.html-popover {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  width: min(360px, calc(100vw - 32px));
  z-index: 1050;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 16px 40px #0002;
  max-height: 65dvh;
  overflow: auto;
}
.html-popover a {
  display: block;
  padding: 10px 8px;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
}
.html-popover a:hover,
.html-popover a:focus-visible {
  background: var(--canvas);
}
.html-popover strong {
  display: block;
  margin-bottom: 12px;
}
.html-popover p {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
  font-size: 13px;
}
.html-popover small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.workspace-menu,
.pro-header-actions,
.header-action-group {
  position: relative;
}
.html-search-results {
  inset-inline-start: 0;
  inset-inline-end: auto;
}
.html-top-navigation {
  display: none;
}
[data-navigation="horizontal"] .html-top-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: relative;
  z-index: 90;
}
.html-top-navigation > a,
.html-top-navigation summary {
  padding: 10px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}
.html-top-navigation [aria-current="page"] {
  color: var(--accent);
  font-weight: 700;
}
.html-top-navigation details {
  position: relative;
}
.html-top-navigation details > div {
  position: absolute;
  top: 100%;
  inset-inline-start: 0;
  width: 230px;
  max-height: 60dvh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 24px #0002;
  padding: 8px;
}
.html-top-navigation details a {
  display: block;
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
}
.html-top-navigation details a:hover {
  background: var(--canvas);
}
.recharts-responsive-container {
  max-width: 100%;
}
.recharts-wrapper {
  max-width: 100%;
}
.recharts-surface {
  max-width: 100%;
  height: auto;
  overflow: visible;
}
.html-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.html-settings label {
  display: grid;
  gap: 8px;
}
.html-settings label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
}
.html-badge {
  border-radius: 20px;
  padding: 4px 9px;
  background: var(--canvas);
  border: 1px solid var(--line);
  font-size: 11px;
  white-space: nowrap;
}
.html-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.html-project-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.html-project {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 16px;
  margin-top: 16px;
  background: var(--canvas);
}
.html-project h3 {
  font-size: 15px;
}
.admin-module > .html-card + .html-card {
  margin-top: 24px;
}
.html-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  min-width: 0;
}
.html-card h2 {
  font-size: 18px;
}
.html-card p {
  color: var(--muted);
  font-size: 13px;
}
.html-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.html-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.html-toolbar input {
  flex: 1 1 230px;
}
.html-toolbar select {
  width: auto;
}
.html-upload-list {
  list-style: none;
  padding: 0;
}
.html-upload-list li {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.html-color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.html-color-swatches button {
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
  color: var(--text);
}
.html-color-swatches button[aria-pressed="true"] {
  border-color: var(--accent);
}
.html-file-name {
  overflow-wrap: anywhere;
}
.html-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.html-calendar > strong {
  font-size: 12px;
  padding: 8px;
}
.html-calendar-day {
  min-height: 100px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.html-calendar-event {
  display: block;
  width: 100%;
  text-align: start;
  border: 0;
  background: var(--accent-solid);
  color: white;
  border-radius: 4px;
  font-size: 11px;
  padding: 5px;
  margin-top: 5px;
  overflow-wrap: anywhere;
}
[dir="rtl"] .form-select {
  background-position: left 0.75rem center;
  padding-left: 2.25rem;
  padding-right: 0.75rem;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
@media (max-width: 1100px) {
  .html-nav-open #workspace-sidebar {
    display: flex !important;
    position: fixed;
    inset: 0 auto 0 0;
    width: min(310px, 85vw);
    z-index: 1201;
    height: 100dvh;
    transform: none;
  }
  [dir="rtl"] .html-nav-open #workspace-sidebar {
    inset: 0 0 0 auto;
  }
  #html-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: #06140f88;
    border: 0;
  }
  .html-nav-open {
    overflow: hidden;
  }
  [data-navigation="horizontal"] .html-top-navigation {
    display: none;
  }
  .html-nav-open #workspace-sidebar > .icon-rail {
    display: none !important;
  }
  .html-nav-open #workspace-sidebar > :not(.icon-rail) {
    display: revert !important;
  }
}
@media (max-width: 700px) {
  .html-settings,
  .html-cards,
  .html-project-board {
    grid-template-columns: 1fr;
  }
  .html-dialog {
    padding: 18px;
  }
  .html-popover {
    position: fixed;
    top: 66px;
    inset-inline-end: 16px;
  }
  .html-table-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .html-pagination {
    gap: 8px;
  }
  .html-calendar {
    gap: 3px;
  }
  .html-calendar-day {
    min-height: 75px;
    padding: 3px;
  }
  .html-calendar-event {
    font-size: 9px;
    padding: 2px;
  }
}
@media print {
  .pro-sidebar,
  .pro-topbar,
  .html-top-navigation,
  .html-feedback,
  button {
    display: none !important;
  }
  .pro-body {
    margin: 0 !important;
  }
  .pro-main {
    padding: 0;
  }
}

/* Captured SVG charts must not inherit the measurement wrapper zero width. */
.recharts-responsive-container > div {
  width: 100% !important;
  height: 100% !important;
}
.recharts-responsive-container .recharts-wrapper {
  width: 100% !important;
}

.html-tooltip {
  position: absolute;
  z-index: 20;
  background: var(--text);
  color: var(--surface);
  border-radius: 6px;
  padding: 6px 10px;
  max-width: 220px;
  font-size: 12px;
  bottom: calc(100% + 6px);
  left: 0;
}

/* Workspace dashboard accordion shares the library row styling. */
:is(.pro-library, .workspace-dashboard-group) .library-nav-row {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  border: 0;
  border-radius: 7px;
  padding: 11px 12px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-align: start;
}
:is(.pro-library, .workspace-dashboard-group) .library-nav-row:hover {
  color: var(--text);
  background: var(--canvas);
  text-decoration: none;
}
:is(.pro-library, .workspace-dashboard-group) .library-nav-row.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}

.workspace-dashboard-group .nav-arrow { margin-inline-start:auto; }
.workspace-dashboard-group button[aria-expanded="true"] .nav-arrow { transform:rotate(180deg); }

/* Compact navigation: fixed placement escapes the rail scroll container. */
.pro-sidebar .icon-rail .rail-submenu {
  position: fixed; inset-inline-start: 66px; z-index: 120; width: 260px;
  max-height: calc(100dvh - 110px); overflow-y: auto; padding: 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  color: var(--text); box-shadow: 0 12px 36px #0002; text-align: start;
}
.rail-submenu-title { display: block; padding: 8px 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.rail-submenu h3 { font-size: 11px; color: var(--muted); margin: 18px 10px 6px; }
.pro-sidebar .icon-rail .rail-submenu a {
  width: 100%; min-height: 38px; justify-content: flex-start; padding: 9px 10px;
  border-radius: 7px; font-size: 13px; text-decoration: none; color: var(--text);
}
.pro-sidebar .icon-rail .rail-submenu a.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
@media (max-width: 991px) { .rail-submenu { display: none; } }

.sidebar-swatch-auto { background: linear-gradient(135deg, #fff 50%, #18232f 50%); color: #8b98a8; }
