:root {
  font-family: Inter, Manrope, "Segoe UI", sans-serif;
  color-scheme: dark;
  --bg: #101112;
  --surface: #171819;
  --surface2: #1e2021;
  --text: #f1f1ee;
  --muted: #a3a5a5;
  --line: #303233;
  --accent: #e2e2dc;
  --accent-text: #131414;
  --shadow: 0 24px 90px #0006;
  --positive: #b1c7b7;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f6f3;
  --surface: #fff;
  --surface2: #f1f1ee;
  --text: #202323;
  --muted: #686e6c;
  --line: #e2e3de;
  --accent: #292d2b;
  --accent-text: #fff;
  --shadow: 0 24px 90px #0002;
  --positive: #346847;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button {
  color: inherit;
}
a {
  color: inherit;
}
svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
button {
  border: 0;
  background: none;
}
button,
input,
select,
textarea {
  outline-offset: 4px;
}
:focus-visible {
  outline: 2px solid var(--muted);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(30px, 3vw, 44px);
  font-weight: 450;
  letter-spacing: -1.7px;
  line-height: 1.15;
  margin-bottom: 14px;
}
h2 {
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.6px;
}
h3 {
  font-weight: 500;
}
p {
  line-height: 1.65;
}
.muted,
small {
  color: var(--muted);
}
small {
  font-size: 12px;
  line-height: 1.5;
}
.eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 15px;
}
.primary,
.secondary,
.danger {
  border: 1px solid var(--line);
  padding: 12px 18px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  white-space: nowrap;
}
.primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}
.secondary {
  background: var(--surface2);
}
.danger {
  color: #d88787;
  margin-right: auto;
}
.text-button {
  padding: 6px 0;
  font-size: 12px;
  white-space: nowrap;
}
.icon-button {
  height: 38px;
  width: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex: none;
}
.icon-button:hover,
.nav-item:hover {
  background: var(--surface2);
}
.brand-image {
  position: absolute;
  width: 134.8%;
  max-width: none;
  height: auto;
  left: -17.4%;
  top: 50%;
  transform: translateY(-50%);
  mix-blend-mode: screen;
}
.brand,
.auth-brand,
.compact-brand {
  position: relative;
  overflow: hidden;
  flex: none;
  aspect-ratio: 6.5;
}
.brand {
  width: 174px;
  height: auto;
  margin: -3px 0 43px 12px;
  padding: 0;
}
:root[data-theme="light"] .brand-image {
  width: 119.5%;
  left: -9.75%;
  mix-blend-mode: multiply;
}
.compact-brand {
  display: none;
  width: 100px;
}
.nav-collapsed .compact-brand {
  display: block;
}
.workspace {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 250px;
  padding: 30px 22px 0;
  border-right: 1px solid var(--line);
  height: 100vh;
  position: sticky;
  top: 0;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  z-index: 20;
}
.sidebar-label {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
  margin: 0 12px 18px;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 12px 13px;
  width: 100%;
  text-align: left;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  min-height: 43px;
}
.nav-item.active {
  background: var(--surface2);
  color: var(--text);
}
.nav-dot {
  height: 5px;
  width: 5px;
  background: var(--accent);
  border-radius: 100%;
  margin-left: auto;
}
.sidebar-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  font-size: 11px;
}
.sidebar-bottom strong {
  display: block;
  max-width: 135px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-bottom small {
  display: block;
  font-size: 10px;
}
.sidebar-bottom button {
  margin-left: auto;
}
.avatar {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
}
.main-wrap {
  min-width: 0;
  flex: 1;
}
.topbar {
  height: 80px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 35px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
.global-search {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  flex: 1;
  max-width: 600px;
  color: var(--muted);
}
.global-search input {
  border: 0;
  background: none;
  width: 100%;
  padding: 10px 0;
  color: var(--text);
  font-size: 12px;
}
.key-hint {
  border: 1px solid var(--line);
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 12px;
}
.workspace-badge {
  margin-left: auto;
  font-size: 8px;
  letter-spacing: 1.3px;
  border: 1px solid var(--line);
  padding: 7px 10px;
  border-radius: 4px;
  color: var(--muted);
}
#theme {
  margin-left: auto;
}
#main {
  max-width: 1600px;
  margin: auto;
  padding: 48px 44px 55px;
  min-height: calc(100vh - 140px);
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 34px;
}
.page-heading p:last-child {
  margin-bottom: 0;
  font-size: 13px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 30px;
  background: var(--surface);
}
.stat {
  padding: 25px;
  text-align: left;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 21px;
}
.stat:last-child {
  border-right: 0;
}
.stat > span:first-child {
  font-size: 12px;
  color: var(--muted);
}
.stat > strong {
  font-size: 42px;
  font-weight: 400;
  letter-spacing: -2px;
}
.stat-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
}
.stat-bottom svg {
  width: 14px;
}
.overview-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 26px;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
  background: var(--surface);
  min-width: 0;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-header h2 {
  margin-bottom: 22px;
}
.panel-header .eyebrow {
  margin-bottom: 8px;
}
.context-search {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: var(--bg);
  min-width: 180px;
}
.context-search svg {
  width: 16px;
  color: var(--muted);
}
.context-search input {
  border: 0;
  background: none;
  padding: 12px 0;
  width: 100%;
  color: var(--text);
  font-size: 12px;
  min-width: 0;
}
.overview-row {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.overview-row:last-child {
  border-bottom: 0;
}
.overview-row > span:nth-child(2) {
  flex: 1;
}
.overview-row strong {
  font-size: 12px;
  font-weight: 500;
  display: block;
}
.overview-row small {
  display: block;
  margin-top: 6px;
}
.activity-mark {
  height: 34px;
  width: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
}
.territory-steps {
  margin-top: 28px;
}
.territory-steps button {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 19px 0;
  border-top: 1px solid var(--line);
  width: 100%;
  text-align: left;
  font-size: 12px;
}
.territory-steps button > span {
  font-size: 10px;
  color: var(--muted);
}
.territory-steps svg {
  margin-left: auto;
  width: 17px;
}
.small-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
  margin: 20px 0 0;
}
.main-footer {
  display: flex;
  gap: 18px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 22px 44px;
  letter-spacing: 2px;
  font-size: 10px;
}
.main-footer span {
  letter-spacing: 0;
  color: var(--muted);
  font-size: 10px;
}
.main-footer span:last-child {
  margin-left: auto;
}
.pill {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 10px;
  color: var(--muted);
  display: inline-block;
  white-space: nowrap;
}
.pill.positive {
  color: var(--positive);
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.toolbar .context-search {
  flex: 1;
}
.toolbar #result-count {
  font-size: 11px;
  white-space: nowrap;
}
.toolbar select,
.inline-label input {
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 5px;
  font-size: 11px;
}
.inline-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}
.records-panel {
  padding: 24px;
}
.table-wrap {
  overflow: auto;
  margin: 0 -24px;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 12px;
}
th {
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 20px 18px;
  border-bottom: 1px solid var(--line);
  max-width: 270px;
  overflow-wrap: anywhere;
}
td:first-child,
th:first-child {
  padding-left: 24px;
}
tr:last-child td {
  border-bottom: 0;
}
td > small {
  display: block;
  margin-top: 8px;
  max-width: 210px;
  font-size: 10px;
}
td .record-open {
  font-size: 12px;
  text-align: left;
  padding: 0;
}
tbody tr:hover {
  background: var(--surface2);
}
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty > svg {
  width: 32px;
  height: 32px;
  margin-bottom: 18px;
  opacity: 0.55;
}
.empty h3 {
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 10px;
}
.empty p {
  font-size: 12px;
  max-width: 350px;
  margin: auto;
}
.connect-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 25px;
}
.integration {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 25px;
}
.integration h3 {
  font-size: 13px;
  margin: 20px 0;
}
.integration-symbol {
  color: var(--muted);
}
.roadmap-row {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.roadmap-row:last-child {
  border-bottom: 0;
}
.roadmap-row > div {
  flex: 1;
}
.roadmap-row h2 {
  font-size: 19px;
  margin-bottom: 12px;
}
.roadmap-row p {
  font-size: 12px;
  margin: 0;
}
.phase-number {
  color: var(--muted);
  font-size: 14px;
}
.audit-row {
  display: flex;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  font-size: 12px;
}
.audit-row code {
  color: var(--muted);
  font-size: 10px;
}
.audit-panel{padding:22px}.audit-filters{display:grid;grid-template-columns:repeat(3,minmax(140px,1fr)) auto;align-items:end;gap:12px;margin:18px 0 22px;padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}.audit-filters label{display:grid;gap:6px;color:var(--muted);font-size:11px}.audit-filters input{width:100%;min-width:0}.audit-filters>button{justify-self:start;margin-bottom:7px}@media(max-width:650px){.audit-filters{grid-template-columns:1fr 1fr}.audit-filters label:nth-child(3){grid-column:1/-1}.audit-filters>button{grid-column:1/-1}}
.search-results {
  position: absolute;
  top: 44px;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow);
  max-height: 430px;
  overflow: auto;
  color: var(--text);
}
.search-results button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 15px;
  border-bottom: 1px solid var(--line);
}
.search-results button:hover {
  background: var(--surface2);
}
.search-results small,
.search-results strong,
.search-results span {
  display: block;
}
.search-results strong {
  font-size: 13px;
  margin: 5px 0;
}
.search-results span {
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}
.search-results p {
  font-size: 12px;
  padding: 20px;
  margin: 0;
}
#notice {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-text);
  padding: 16px 25px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: var(--shadow);
}
dialog {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 0;
  border-radius: 12px;
  width: 760px;
  max-width: 94vw;
  max-height: 90vh;
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: #0009;
  backdrop-filter: blur(5px);
}
.dialog-header {
  padding: 25px 28px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.dialog-header h2 {
  font-size: 21px;
  margin: 0;
}
.dialog-header .eyebrow {
  margin-bottom: 8px;
}
.dialog-body {
  padding: 28px;
  max-height: 63vh;
  overflow: auto;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-grid label,
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 11px;
  color: var(--muted);
}
.form-grid .full {
  grid-column: 1/-1;
}
.form-grid .checkbox-label {
  flex-direction: row;
  align-items: center;
}
.form-grid input,
.form-grid select,
.form-grid textarea,
.auth-form input {
  padding: 12px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  font-size: 12px;
  width: 100%;
}
.form-grid input[type="checkbox"] {
  width: 18px;
  height: 18px;
}
.dialog-footer {
  padding: 20px 28px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.error {
  background: #922a2a20;
  color: #e99a9a;
  border: 1px solid #922a2a66;
  border-radius: 6px;
  padding: 12px;
  font-size: 12px;
  margin-bottom: 20px;
}
details {
  font-size: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
summary {
  cursor: pointer;
}
dl {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.auth {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  min-height: 100vh;
}
.auth-story {
  background: #060707;
  padding: 30px 65px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-story:after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  border: 1px solid #ffffff0b;
  transform: rotate(45deg);
  bottom: -300px;
  right: -180px;
  pointer-events: none;
}
.auth-brand {
  width: 210px;
  height: auto;
  margin-top: 20px;
}
.auth-story h1 {
  font-size: clamp(40px, 4vw, 65px);
  line-height: 1.08;
  letter-spacing: -3px;
  font-weight: 350;
}
.auth-story .eyebrow {
  font-size: 9px;
  margin-bottom: 25px;
}
.lead {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.8;
  margin: 28px 0 70px;
}
.auth-story footer {
  font-size: 14px;
  letter-spacing: 5px;
}
.auth-story footer span {
  font-size: 8px;
  letter-spacing: 2px;
  margin-left: 20px;
  color: var(--muted);
}
.auth-panel {
  display: grid;
  place-items: center;
  padding: 50px;
}
.auth-form {
  width: 100%;
  max-width: 350px;
}
.auth-form h2 {
  font-size: 32px;
  letter-spacing: -1px;
  margin-bottom: 12px;
}
.auth-form > .muted {
  font-size: 13px;
  margin-bottom: 35px;
}
.auth-form label {
  margin-bottom: 20px;
}
.auth-form small {
  font-size: 10px;
  display: block;
  margin-top: -12px;
  margin-bottom: 25px;
}
.wide {
  width: 100%;
  justify-content: space-between;
}
.auth-switch {
  font-size: 12px;
  margin: 25px 0;
  text-align: center;
  color: var(--muted);
}
.auth-switch button {
  color: var(--text);
  margin-left: 5px;
}
.setup-note {
  font-size: 10px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 20px;
  line-height: 1.7;
}
.nav-collapsed .sidebar {
  display: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: fixed;
  top: -100px;
  left: 15px;
  background: var(--accent);
  color: var(--accent-text);
  padding: 15px;
  z-index: 100;
}
.skip:focus {
  top: 15px;
}
.fatal {
  padding: 70px;
}
.auth button:hover,
.primary:hover {
  filter: brightness(0.92);
}
@media (max-width: 1150px) {
  .sidebar {
    width: 220px;
    padding-left: 14px;
    padding-right: 14px;
  }
  .nav-item {
    font-size: 11px;
    gap: 9px;
  }
  .brand {
    margin-left: 12px;
    margin-right: 0;
  }
  #main {
    padding: 35px 25px;
  }
  .topbar {
    padding: 0 20px;
  }
  .stat {
    padding: 20px 16px;
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .connect-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .auth-story {
    padding: 30px 40px;
  }
}
@media (max-width: 850px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 80px;
    height: calc(100dvh - 80px);
    box-shadow: 20px 20px 80px #0006;
    width: 250px;
  }
  .sidebar .brand {
    display: none;
  }
  .compact-brand {
    display: block;
    width: 86px;
  }
  .global-search,
  .global-search input {
    min-width: 0;
  }
  .sidebar-label {
    margin-top: 10px;
  }
  .workspace-badge {
    display: none;
  }
  .topbar {
    height: 68px;
  }
  .sidebar {
    top: 68px;
    height: calc(100dvh - 68px);
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat:nth-child(2) {
    border-right: 0;
  }
  .stat:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
  .page-heading {
    align-items: flex-start;
  }
  .page-heading > .primary {
    font-size: 11px;
    padding: 10px;
  }
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-story {
    min-height: 330px;
    padding: 15px 30px 30px;
  }
  .auth-story h1 {
    font-size: 37px;
    letter-spacing: -1.7px;
  }
  .auth-brand {
    height: auto;
    width: 170px;
    margin-top: 15px;
  }
  .auth-story .eyebrow {
    margin-bottom: 15px;
  }
  .auth-story .lead,
  .auth-story footer {
    display: none;
  }
  .auth-panel {
    padding: 35px 28px;
  }
  .main-footer {
    padding: 20px 25px;
  }
  .main-footer span:nth-child(2) {
    display: none;
  }
}
@media (max-width: 600px) {
  #main {
    padding: 28px 16px;
  }
  .topbar {
    gap: 8px;
    padding: 0 12px;
  }
  .global-search {
    gap: 8px;
  }
  .key-hint {
    display: none;
  }
  .page-heading {
    display: block;
    margin-bottom: 24px;
  }
  .page-heading > .primary {
    margin-top: 20px;
  }
  h1 {
    font-size: 31px;
    letter-spacing: -1.2px;
  }
  .panel {
    padding: 20px;
  }
  .stats {
    margin-bottom: 20px;
  }
  .stat {
    gap: 16px;
    padding: 20px;
  }
  .stat > span:first-child {
    font-size: 10px;
  }
  .stat > strong {
    font-size: 36px;
  }
  .stat-bottom {
    font-size: 9px;
  }
  .overview-grid {
    gap: 18px;
  }
  .panel-header {
    align-items: flex-start;
  }
  .panel-header .text-button {
    font-size: 10px;
  }
  .panel h2 {
    font-size: 19px;
  }
  .toolbar .context-search {
    flex-basis: 100%;
  }
  .table-wrap {
    margin: 0;
  }
  .records-panel {
    padding: 16px;
  }
  table,
  tbody,
  tr,
  td {
    display: block;
  }
  thead {
    display: none;
  }
  tr {
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
  }
  td {
    border: 0;
    max-width: none;
    padding: 7px 0;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    text-align: right;
    font-size: 11px;
  }
  td:first-child {
    padding: 0 0 12px;
    text-align: left;
    display: block;
  }
  td:before {
    content: attr(data-label);
    color: var(--muted);
    text-align: left;
  }
  td:first-child:before,
  td:last-child:before {
    display: none;
  }
  td:last-child {
    padding-bottom: 0;
  }
  tr:last-child {
    border: 0;
  }
  .connect-grid {
    grid-template-columns: 1fr;
  }
  .roadmap-row {
    gap: 12px;
    flex-wrap: wrap;
  }
  .roadmap-row > div {
    min-width: 75%;
  }
  .roadmap-row > .pill {
    margin-left: 32px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .dialog-header,
  .dialog-body {
    padding: 20px;
  }
  .dialog-header h2 {
    font-size: 17px;
  }
  .dialog-body {
    max-height: 60vh;
  }
  .dialog-footer {
    padding: 15px;
    gap: 8px;
  }
  .dialog-footer button {
    padding: 10px;
    font-size: 10px;
  }
  .search-results {
    position: fixed;
    top: 62px;
    left: 12px;
    right: 12px;
  }
  .auth-panel {
    padding-top: 30px;
  }
  .auth-story {
    min-height: 290px;
  }
  .auth-story:after {
    display: none;
  }
  .overview-row .pill {
    font-size: 9px;
  }
  .inline-label {
    flex: 1;
  }
  .toolbar select {
    max-width: 100%;
  }
}
.demo-banner {
  padding: 9px 24px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: 0.7px;
  color: var(--muted);
  background: var(--surface);
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition:
      background 0.15s ease,
      color 0.15s ease;
  }
  dialog[open] {
    animation: appear 0.15s ease;
  }
  @keyframes appear {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
.voice-input-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  flex: 1;
}
.voice-input-wrap > input,
.voice-input-wrap > textarea {
  width: 100%;
  min-width: 0;
  padding-right: 50px !important;
}
.voice-input-button {
  position: absolute;
  z-index: 2;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-height: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.voice-input-button svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.8;
}
.voice-input-button:hover,
.voice-input-button:focus-visible {
  color: var(--text);
  border-color: var(--muted);
  background: var(--surface2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
  outline: none;
}
.voice-input-button.listening {
  color: #fff;
  background: #aa3945;
  border-color: #aa3945;
  box-shadow: 0 0 0 4px color-mix(in srgb, #aa3945 20%, transparent);
  animation: voice-listening-pulse 1.6s ease-out infinite;
}
@keyframes voice-listening-pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, #aa3945 16%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, #aa3945 25%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .voice-input-button.listening { animation: none; }
}
.voice-input-wrap:has(> textarea) > .voice-input-button {
  top: 8px;
  transform: none;
}
.voice-input-status {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 20;
  width: min(300px, 100%);
  padding: 10px;
  font-size: 12px;
  line-height: 1.5;
  font-weight: normal;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.voice-input-status[hidden] {
  display: none;
}
.crm-type-filter {
  display: grid;
  gap: 6px;
  min-width: 180px;
  color: var(--muted);
  font-size: 11px;
}
.crm-type-filter select {
  width: 100%;
  min-height: 42px;
}
.crm-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.7fr) minmax(165px, 1fr) auto minmax(165px, 1fr) auto;
  align-items: end;
  gap: 12px;
}
.crm-toolbar .context-search { min-width: 0; width: 100%; }
.crm-toolbar .crm-type-filter { min-width: 0; }
.crm-hot-filter { display: flex; align-items: center; gap: 8px; min-height: 42px; white-space: nowrap; color: var(--text); font-size: 13px; }
.crm-hot-filter input { margin: 0; accent-color: var(--accent); }
.crm-toolbar #result-count { justify-self: end; align-self: center; }
@media (max-width: 1120px) {
  .crm-toolbar { grid-template-columns: minmax(210px, 1.5fr) minmax(155px, 1fr) minmax(155px, 1fr); }
  .crm-hot-filter { align-self: center; }
}
@media (max-width: 650px) {
  .crm-toolbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; }
  .crm-toolbar .context-search, .crm-toolbar #result-count { grid-column: 1 / -1; }
  .crm-toolbar .crm-hot-filter { grid-column: 1 / -1; justify-self: start; }
}

.assistant-panel { display: grid; gap: 16px; max-width: 980px; }
.assistant-privacy { margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.assistant-prompts { display: flex; flex-wrap: wrap; gap: 8px; }
.assistant-prompts .is-selected { border-color:var(--muted); background:var(--surface2); }
.developer-feedback { display:grid; gap:12px; max-width:980px; }
.developer-feedback > p { margin:0; color:var(--muted); }
.developer-feedback-item { padding:14px 0; border-top:1px solid var(--line); }
.developer-feedback-item header { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.developer-feedback-item time,.developer-feedback-item small { color:var(--muted); font-size:12px; }
.developer-feedback-item p { margin:8px 0; white-space:pre-wrap; }
.assistant-chat-actions { display:flex; flex:0 0 auto; align-items:center; gap:6px; padding:0 14px 8px; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:thin; scrollbar-color:var(--line) transparent; }
.assistant-shortcut { flex:0 0 auto; min-height:32px; padding:7px 10px; border:1px solid var(--line); border-radius:999px; background:var(--surface); color:var(--muted); font:inherit; font-size:12px; white-space:nowrap; transition:background .18s ease,border-color .18s ease,color .18s ease; }
.assistant-shortcut:hover,.assistant-shortcut.is-selected { border-color:var(--muted); background:var(--surface2); color:var(--text); }
.assistant-shortcut:focus-visible { outline:2px solid var(--muted); outline-offset:-3px; }
.assistant-thread { display: grid; gap: 12px; max-height: min(48vh, 520px); overflow-y: auto; padding: 4px; }
.assistant-bubble { max-width: min(82%, 720px); padding: 13px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.assistant-bubble.user { justify-self: end; background: var(--surface-raised, var(--surface)); }
.assistant-bubble strong { font-size: 12px; color: var(--muted); }
.assistant-bubble p { margin: 7px 0 0; white-space: pre-wrap; line-height: 1.55; }
.assistant-typing { display:flex; align-items:center; gap:8px; }
.assistant-typing-dots { display:inline-flex; align-items:center; gap:4px; padding:4px 2px; }
.assistant-typing-dots i { width:6px; height:6px; border-radius:50%; background:var(--accent); animation:assistantTypingPulse 1s ease-in-out infinite; }
.assistant-typing-dots i:nth-child(2) { animation-delay:140ms; }
.assistant-typing-dots i:nth-child(3) { animation-delay:280ms; }
@keyframes assistantTypingPulse { 0%,60%,100% { opacity:.35; transform:translateY(0); } 30% { opacity:1; transform:translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .assistant-typing-dots i { animation:none; opacity:.75; } }
.assistant-form { display: grid; gap: 10px; }
.assistant-form > label { color:var(--muted); font-size:12px; font-weight:500; letter-spacing:.02em; }
.assistant-form textarea { display:block; width:100%; min-height:112px; max-height:300px; padding:16px 60px 16px 18px; resize:vertical; border:1px solid var(--line); border-radius:16px; background:var(--bg); color:var(--text); font-size:14px; line-height:1.65; box-shadow:none; transition:border-color .18s ease; }
.assistant-form textarea::placeholder { color:var(--muted); opacity:1; }
.assistant-form textarea:focus-visible { outline:none; border-color:color-mix(in srgb,var(--muted) 55%,var(--line)); }
.assistant-form textarea:disabled { opacity:.6; cursor:not-allowed; }
.assistant-form .voice-input-wrap:has(> textarea) { flex:initial; border:1px solid var(--line); border-radius:16px; background:var(--bg); transition:border-color .18s ease; }
.assistant-form .voice-input-wrap:has(> textarea):focus-within { border-color:color-mix(in srgb,var(--muted) 55%,var(--line)); }
.assistant-form .voice-input-wrap > textarea { border:0; border-radius:15px; background:transparent; }
.assistant-form .voice-input-wrap > .voice-input-button { top:12px; right:12px; width:34px; height:34px; border-radius:10px; }
.assistant-form .voice-input-button:not(.listening) { border-color:transparent; background:var(--surface); color:var(--muted); box-shadow:none; }
.assistant-form .voice-input-button:not(.listening):hover,.assistant-form .voice-input-button:not(.listening):focus-visible { border-color:var(--line); background:var(--surface2); color:var(--text); box-shadow:none; }
.assistant-form .voice-input-button:focus-visible { outline:2px solid var(--muted); outline-offset:2px; }
.assistant-consent { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.assistant-consent input { flex: 0 0 auto; margin-top: 2px; accent-color: var(--accent); }
.assistant-submit { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.assistant-submit small { color: var(--muted); }
@media (max-width: 650px) {
  .assistant-form textarea { font-size:16px; padding-left:14px; }
  .assistant-bubble { max-width: 94%; }
  .assistant-submit { align-items: stretch; flex-direction: column; }
  .assistant-submit button { width: 100%; }
}

.portal-brand { display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.portal-brand h3 { margin:0; }
.portal-brand-icon { width:48px; height:48px; object-fit:contain; border-radius:10px; flex-shrink:0; }
.assistant-profile { display:flex; align-items:center; gap:24px; padding:8px 0 20px; border-bottom:1px solid var(--line); }
.assistant-avatar { display:block; width:240px; height:auto; aspect-ratio:2 / 3; object-fit:contain; object-position:center; border-radius:18px; flex-shrink:0; box-shadow:0 8px 24px #0002; }
.assistant-profile h2 { margin:4px 0 8px; }
.assistant-profile p { margin:6px 0 12px; }
.assistant-message-avatar { width:32px; height:32px; object-fit:cover; object-position:center; border-radius:50%; vertical-align:middle; margin-right:8px; }
@media(max-width:600px) { .assistant-profile { gap:16px; align-items:flex-start; } .assistant-avatar { width:144px; height:auto; border-radius:14px; } .assistant-profile h2 {font-size:20px;} }
.assistant-chat-widget { position:fixed; z-index:90; width:64px; height:64px; touch-action:none; }
.assistant-chat-fab { position:relative; display:block; width:64px; height:64px; padding:0; overflow:hidden; border:0; border-radius:50%; background:var(--surface); box-shadow:0 5px 16px #0005; cursor:grab; touch-action:none; }
.assistant-chat-fab:active { cursor:grabbing; }
.assistant-chat-fab img { display:block; width:100%; height:100%; object-fit:cover; object-position:center 29%; border-radius:50%; pointer-events:none; }
.assistant-chat-panel { position:fixed; display:flex; flex-direction:column; width:min(360px,calc(100vw - 24px)); height:min(460px,calc(100dvh - 24px)); min-height:min(320px,calc(100dvh - 24px)); overflow:hidden; border:1px solid var(--line); border-radius:18px; background:var(--bg); color:var(--text); box-shadow:0 18px 64px #0005; }
.assistant-chat-panel[hidden] { display:none; }
.assistant-chat-header { position:relative; display:flex; flex:0 0 auto; align-items:center; gap:18px; padding:16px 18px; border-bottom:1px solid var(--line); background:var(--surface); }
.assistant-chat-header img { width:136px; height:204px; flex:0 0 136px; object-fit:contain; object-position:center; border-radius:14px; }
.assistant-chat-header strong { padding-right:24px; font-size:20px; }
.assistant-chat-header .icon-button { position:absolute; top:8px; right:8px; }
.assistant-chat-intro-message { margin:8px 0 0; color:var(--text); font-size:14px; line-height:1.6; overflow-wrap:break-word; }
.assistant-chat-header div { display:grid; gap:4px; flex:1; min-width:0; }
.assistant-chat-header small,.assistant-chat-footnote { color:var(--muted); font-size:11px; }
.assistant-chat-thread { display:flex; flex:1 1 auto; min-height:0; flex-direction:column; gap:10px; overflow-y:auto; padding:14px; overscroll-behavior:contain; }
.assistant-chat-thread .assistant-bubble { flex-shrink:0; max-width:94%; padding:10px 12px; border-radius:13px; }
.assistant-chat-thread .assistant-message-avatar { width:28px; height:28px; }
.assistant-chat-welcome { align-self:flex-start; max-width:90%; padding:12px 14px; border:1px solid var(--line); border-radius:14px; background:var(--surface); line-height:1.5; }
.assistant-chat-form { display:flex; flex:0 0 auto; align-items:flex-end; gap:10px; padding:12px; border-top:1px solid var(--line); background:var(--surface); }
.assistant-chat-form .voice-input-wrap { flex:1 1 auto; width:auto; min-width:0; padding:3px; border:1px solid var(--line); border-radius:16px; background:var(--bg); box-shadow:inset 0 1px 2px #0002; transition:border-color .18s ease,box-shadow .18s ease; }
.assistant-chat-form .voice-input-wrap:focus-within { border-color:var(--muted); box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 16%,transparent); }
.assistant-chat-form textarea { display:block; flex:1; min-width:0; min-height:42px; max-height:120px; padding:10px 48px 10px 12px; resize:vertical; border:0; border-radius:13px; background:transparent; color:var(--text); font-size:13px; line-height:1.5; outline:0; }
.assistant-chat-form textarea::placeholder { color:var(--muted); opacity:.85; }
.assistant-chat-form textarea:focus-visible { outline:0; }
.assistant-chat-form .voice-input-button { top:7px; right:7px; transform:none; }
.assistant-chat-form button.primary { min-height:42px; align-self:flex-end; padding:9px 14px; border-radius:13px; box-shadow:0 3px 12px #0002; }
.assistant-chat-form button.primary:hover { transform:translateY(-1px); }
.assistant-chat-footnote { flex:0 0 auto; margin:0; padding:0 14px 10px; }
.assistant-chat-widget .assistant-chat-fab:focus-visible { outline:2px solid #858783; outline-offset:2px; }
.assistant-chat-widget button:focus-visible:not(.assistant-chat-fab) { outline:3px solid var(--accent); outline-offset:3px; }
.mail-inbox { position: relative; margin-left: auto; flex-shrink: 0; }
#mail-inbox-toggle { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; background: var(--bg); color: var(--text); cursor: pointer; }
#mail-inbox-toggle svg { width: 20px; height: 20px; }
#mail-inbox-count { background: var(--text); color: var(--bg); border-radius: 20px; min-width: 22px; padding: 2px 6px; font-size: 11px; }
#mail-inbox-count[hidden], #mail-inbox-panel[hidden] { display: none; }
#mail-inbox-panel { position: absolute; top: calc(100% + 15px); right: 0; width: min(410px, calc(100vw - 24px)); background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 60px #0004; overflow: hidden; }
#mail-inbox-panel > header, #mail-inbox-panel > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; }
#mail-inbox-panel > header { border-bottom: 1px solid var(--line); }
#mail-inbox-panel > footer { border-top: 1px solid var(--line); flex-wrap: wrap; }
#mail-inbox-panel small { font-size: 10px; color: var(--muted); }
#mail-inbox-items { max-height: min(480px, 65vh); overflow-y: auto; overscroll-behavior: contain; }
#mail-inbox-items > p { padding: 18px; }
.mail-inbox-item { display: block; padding: 16px 18px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.mail-inbox-item:last-child { border-bottom: 0; }
.mail-inbox-item:hover, .mail-inbox-item:focus-visible { background: color-mix(in srgb, var(--text) 6%, var(--bg)); }
.mail-inbox-item > div { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 10px; color: var(--muted); }
.mail-inbox-item strong, .mail-inbox-item p { display: block; overflow-wrap: anywhere; }
.mail-inbox-item strong { font-size: 13px; }
.mail-inbox-item p { margin: 5px 0 8px; font-size: 12px; }
.mail-inbox-empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 30px 24px; }
.mail-inbox-empty svg { width: 30px; height: 30px; color: var(--muted); }
.mail-inbox-empty p { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 0; }
@media (max-width: 600px) { #mail-inbox-toggle { padding: 8px; gap: 5px; } #mail-inbox-toggle > span { display: none; } #mail-inbox-panel { position: fixed; top: 66px; right: 12px; } }

/* Select PRIME: stile uniforme nei menu e nelle schede di tutti i temi. */
select {
  min-height: 42px;
  padding: 10px 42px 10px 14px;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a3a5a5' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
  transition: border-color .18s ease,background-color .18s ease,box-shadow .18s ease;
}
:root[data-theme="light"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23686e6c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
select:hover { border-color:var(--muted); background-color:var(--surface2); }
select:focus-visible { border-color:var(--muted); outline:3px solid color-mix(in srgb,var(--accent) 18%,transparent); outline-offset:1px; }
select:disabled { opacity:.58; cursor:not-allowed; }
select option { background:var(--surface); color:var(--text); }
.prime-select-wrap{position:relative;display:inline-flex;flex:1 1 auto;width:100%;min-width:0;vertical-align:middle}
.prime-select-source{position:absolute!important;width:1px!important;height:1px!important;min-height:0!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;clip-path:inset(50%)!important;white-space:nowrap!important;border:0!important;background:none!important;pointer-events:none!important}
.prime-select-trigger{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-width:0;min-height:42px;padding:10px 14px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--text);font-size:13px;line-height:1.35;text-align:left;box-shadow:0 1px 2px #0000000a;transition:border-color .18s ease,background .18s ease,box-shadow .18s ease}
.prime-select-trigger:hover,.prime-select-wrap.is-open .prime-select-trigger{border-color:color-mix(in srgb,var(--accent) 48%,var(--line));background:var(--surface2)}
.prime-select-trigger:focus-visible{outline:3px solid color-mix(in srgb,var(--accent) 18%,transparent);outline-offset:2px;border-color:var(--muted)}
.prime-select-trigger[aria-invalid="true"]{border-color:#ad5151;box-shadow:0 0 0 2px #ad515122}
.prime-select-trigger:disabled{opacity:.58;cursor:not-allowed}
.prime-select-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.prime-select-trigger.is-placeholder .prime-select-value{color:var(--muted)}
.prime-select-arrow{width:8px;height:8px;flex:0 0 8px;margin:0 2px 4px;border-right:1.5px solid var(--muted);border-bottom:1.5px solid var(--muted);transform:rotate(45deg);transition:transform .18s ease,border-color .18s ease}
.prime-select-wrap.is-open .prime-select-arrow{margin-bottom:-4px;transform:rotate(225deg);border-color:var(--text)}
.prime-select-menu{position:absolute;z-index:1200;inset-inline:0;top:calc(100% + 6px);max-height:min(340px,55vh);overflow:auto;padding:6px;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:0 18px 44px #0005,0 2px 8px #0002;overscroll-behavior:contain;animation:select-menu-in .14s ease-out}
.prime-select-menu[hidden]{display:none}
.prime-select-option{display:block;width:100%;min-height:38px;padding:9px 11px;border:0;border-radius:7px;background:transparent;color:var(--text);font-size:13px;line-height:1.4;text-align:left;overflow-wrap:anywhere;transition:background .12s ease,color .12s ease}
.prime-select-option:hover,.prime-select-option.is-active{background:var(--surface2);color:var(--text)}
.prime-select-option.is-selected{color:var(--text);background:color-mix(in srgb,var(--accent) 12%,var(--surface));font-weight:600}
.prime-select-option.is-selected.is-active{background:color-mix(in srgb,var(--accent) 20%,var(--surface2))}
.prime-select-option:disabled{opacity:.42;cursor:not-allowed}
@keyframes select-menu-in{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.prime-select-menu{animation:none}.prime-select-trigger,.prime-select-arrow,.prime-select-option{transition:none}}
@media (max-width: 480px) {
  .assistant-chat-header { gap:12px; padding:12px; }
  .assistant-chat-header img { width:88px; height:132px; flex-basis:88px; border-radius:10px; }
  .assistant-chat-form { gap:7px; padding:10px; }
  .assistant-chat-form button.primary { min-height:42px; padding-inline:11px; }
  .assistant-chat-form textarea { font-size:16px; }
}
@media (max-height: 560px) {
  .assistant-chat-header { gap:12px; padding:10px 14px; }
  .assistant-chat-header img { width:64px; height:96px; flex-basis:64px; }
  .assistant-chat-form textarea { min-height:42px; max-height:80px; }
}
.buyer-matches { display:grid; gap:12px; margin-top:16px; padding:16px; }
.nav-section-label { margin:18px 0 5px; padding:0 12px; color:var(--muted); font-size:9px; font-weight:700; letter-spacing:.18em; }
.buyer-match-row { display:grid; gap:5px; width:100%; padding:13px 15px; border:1px solid var(--line); border-radius:12px; background:var(--surface2); color:var(--text); text-align:left; cursor:pointer; }
.buyer-match-row:hover { border-color:var(--accent); }
.buyer-match-row span,.buyer-match-row small { color:var(--muted); }
.document-file-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-top:16px; padding:14px; border:1px solid var(--line); border-radius:12px; }
.document-file-actions p { flex-basis:100%; margin:0; }
.stack-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 14px 16px;
  width: min(100%, 760px);
  margin: 20px 0 12px;
}
.stack-form > label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}
.stack-form input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}
.stack-form > button {
  justify-self: start;
  min-height: 44px;
}
.stack-form + #totp-enroll {
  max-width: 760px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface2);
}
.stack-form code,
#totp-enroll code {
  display: block;
  max-width: 100%;
  padding: 12px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}
@media (max-width: 560px) {
  .stack-form { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .stack-form > button { width: 100%; }
}

.assistant-action-card{margin-top:12px;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--bg);font-size:13px}.assistant-action-card>strong{display:block;color:var(--text)}.assistant-action-card dl{display:grid;gap:10px;max-height:220px;overflow:auto;margin:12px 0}.assistant-action-card dl>div{display:grid;gap:4px;padding-bottom:9px;border-bottom:1px solid var(--line)}.assistant-action-card dt{color:var(--muted);font-size:11px}.assistant-action-card dd{display:grid;gap:4px;margin:0;white-space:pre-wrap;overflow-wrap:anywhere}.assistant-action-card>small{display:block;margin-top:10px;line-height:1.5}.assistant-action-card [role=status]:empty{display:none}.assistant-action-buttons{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.assistant-action-buttons button{padding:9px 12px;min-height:38px;border-radius:10px;font-size:12px}.assistant-record-manager{width:min(740px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:0;border:1px solid var(--line);border-radius:18px;background:var(--surface);color:var(--text);box-shadow:var(--shadow)}.assistant-record-manager::backdrop{background:#0007;backdrop-filter:blur(4px)}.assistant-manager-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;align-items:end;margin:16px 0}.assistant-record-manager label{display:grid;gap:8px;color:var(--muted);font-size:12px}.assistant-record-manager input,.assistant-record-manager select{width:100%;min-width:0;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--bg);color:var(--text)}.assistant-manager-records{display:grid;gap:8px;max-height:320px;overflow:auto;margin-top:14px}.assistant-manager-record{display:grid;gap:6px;width:100%;padding:14px;text-align:left;border:1px solid var(--line);border-radius:12px;background:var(--bg);color:var(--text)}.assistant-manager-record small{overflow-wrap:anywhere}.assistant-manager-record span{font-size:11px;color:var(--muted)}.assistant-manager-record:hover{border-color:var(--muted);background:var(--surface2)}.assistant-manager-areas{margin-top:18px;padding-top:14px;border-top:1px solid var(--line)}.assistant-manager-areas summary,.assistant-memory-list summary{cursor:pointer;font-size:13px}.assistant-memory-list{margin-top:14px}.assistant-memory-list article{padding:12px 0;border-bottom:1px solid var(--line)}.assistant-memory-list article p{overflow-wrap:anywhere;font-size:13px}.assistant-chat-thread .assistant-action-card{padding:10px}.assistant-chat-thread .assistant-action-card dl{max-height:180px}@media(max-width:480px){.assistant-manager-toolbar{grid-template-columns:1fr}.assistant-record-manager .dialog-body{padding:16px}}

.assistant-manager-examples { margin: 16px 0; color: var(--muted); font-size: .88rem; }
.assistant-manager-examples p { line-height: 1.5; }

/* Shared record presentation: readable figures and distinct workflow states. */
.records-table { font-size: 13px; }
.records-table th { padding-top: 19px; padding-bottom: 19px; font-size: 10px; font-weight: 600; background: var(--surface); }
.records-table td { overflow-wrap: normal; word-break: normal; line-height: 1.6; padding-top: 22px; padding-bottom: 22px; vertical-align: middle; }
.records-table td:first-child { min-width: 200px; max-width: 290px; }
.records-table td:first-child .record-open { font-size: 14px; font-weight: 600; line-height: 1.65; }
.record-reference { display: inline-block; min-width: 145px; max-width: 235px; }
.record-value { overflow-wrap: break-word; }
.record-number { display: inline-block; white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; font-size: 14px; font-weight: 600; letter-spacing: .15px; }
.record-money { font-size: 15px; color: var(--text); }
.pill.record-status { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 9px; font-size: 12px; font-weight: 500; line-height: 1.3; color: hsl(var(--status-hue) 72% 78%); border: 1px solid hsl(var(--status-hue) 45% 48% / .32); background: hsl(var(--status-hue) 55% 50% / .12); white-space: nowrap; }
.status-dot { flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: hsl(var(--status-hue) 68% 63%); }
:root[data-theme="light"] .pill.record-status { color: hsl(var(--status-hue) 65% 28%); background: hsl(var(--status-hue) 55% 50% / .09); border-color: hsl(var(--status-hue) 45% 40% / .25); }
:root[data-theme="light"] .status-dot { background: hsl(var(--status-hue) 65% 38%); }
.records-table td:last-child { white-space: nowrap; }
.records-table td:last-child .record-open { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 12px; }
.records-table tbody tr { transition: background .15s ease; }
@media (min-width: 601px) {
  .records-table { min-width: 1050px; }
  .records-table-wrap { scrollbar-width: thin; scrollbar-color: var(--muted) var(--surface); }
}
@media (max-width: 600px) {
  .records-table td:first-child { min-width: 0; max-width: none; }
  .records-table td { padding-top: 8px; padding-bottom: 8px; gap: 14px; }
  .records-table td::before { flex: 0 0 40%; font-size: 11px; }
  .record-reference { min-width: 0; max-width: 58%; text-align: right; }
  .record-number, .record-money { font-size: 15px; }
  .records-table tr { margin-bottom: 14px; padding: 18px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
}

/* Compact records; colors are defined in the stylesheet to respect CSP. */
.status-hue-0{--status-hue:0}.status-hue-30{--status-hue:30}.status-hue-60{--status-hue:60}.status-hue-90{--status-hue:90}.status-hue-120{--status-hue:120}.status-hue-150{--status-hue:150}.status-hue-180{--status-hue:180}.status-hue-210{--status-hue:210}.status-hue-240{--status-hue:240}.status-hue-270{--status-hue:270}.status-hue-300{--status-hue:300}.status-hue-330{--status-hue:330}
.records-table{font-size:12px}
.records-table th{padding:13px 14px;font-size:9px}
.records-table td{padding:15px 14px;line-height:1.5}
.records-table td:first-child{min-width:160px;max-width:240px}
.records-table td:first-child .record-open{font-size:12px;line-height:1.55;font-weight:500}
.record-reference{min-width:115px;max-width:205px;font-size:12px}
.record-number,.record-money{font-size:13px;letter-spacing:0}
.pill.record-status{font-size:11px;padding:5px 8px;gap:6px;border-radius:7px}
.records-table td:last-child .record-open{padding:6px 9px;font-size:11px}
.records-table tr:is([data-record-status="vinta"],[data-record-status="venduto"],[data-record-status="incassata"],[data-record-stage="conclusa"]) td:first-child .record-open{color:#78d6a0}
.records-table tr:is([data-record-status="vinta"],[data-record-status="venduto"],[data-record-status="incassata"],[data-record-stage="conclusa"]) td:first-child{box-shadow:inset 3px 0 #42a870}
:root[data-theme="light"] .records-table tr:is([data-record-status="vinta"],[data-record-status="venduto"],[data-record-status="incassata"],[data-record-stage="conclusa"]) td:first-child .record-open{color:#237345}
@media(min-width:601px){.records-table{min-width:900px}}
@media(max-width:600px){.records-table td{padding:7px 0}.records-table td:first-child{min-width:0;max-width:none;padding:0 0 12px}.records-table tr{padding:14px}.record-reference{min-width:0;max-width:58%}}

.operations-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin-top:20px}.operations-grid .panel{min-width:0}.operations-grid .overview-row{width:100%;text-align:left}.operations-grid small{white-space:normal;overflow-wrap:anywhere}.operations-admin{margin-top:20px}.operations-admin label{display:block;margin:12px 0}.operations-admin #import-mapping{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.operations-admin #import-report .table-wrap{max-height:420px;overflow:auto}.operations-admin td{max-width:520px;overflow-wrap:anywhere}@media(max-width:800px){.operations-grid{grid-template-columns:1fr}.operations-admin #import-mapping{grid-template-columns:1fr}}

.backup-settings{border-bottom:1px solid var(--line);padding-bottom:20px;margin-bottom:20px}.backup-settings h3{margin-top:20px}.backup-settings code{overflow-wrap:anywhere;white-space:normal}.backup-settings details{margin-top:16px}.backup-device{display:grid;gap:8px;padding:14px 0;border-bottom:1px solid var(--line)}.backup-device small{color:var(--muted)}.backup-device button{justify-self:start}

/* All shortcuts stay together below the conversation and wrap into the available space. */
.assistant-chat-actions{flex:0 1 auto;flex-wrap:wrap;align-content:flex-start;min-height:0;max-height:120px;overflow-x:hidden;overflow-y:auto}.assistant-chat-thread:empty{display:none}

/* Original user portraits for Veronica in the live local demo. */
.assistant-avatar{aspect-ratio:1198 / 1313;filter:none;opacity:1}
.assistant-message-avatar,.assistant-chat-fab img{object-position:center 25%}

/* Veronica: face-focused launcher and a portrait filling the chat header. */
.assistant-chat-fab img{position:absolute;width:230%;height:230%;max-width:none;left:-65%;top:-12%;object-fit:cover;object-position:center 25%;border-radius:0;filter:none}
.assistant-chat-panel{width:min(420px,calc(100vw - 24px));height:min(600px,calc(100dvh - 24px))}
.assistant-chat-header{display:grid;grid-template-columns:44% minmax(0,1fr);align-items:stretch;gap:0;padding:0;min-height:210px}
.assistant-chat-header>img{display:block;width:100%;height:100%;min-height:210px;max-height:240px;object-fit:cover;object-position:center 20%;border-radius:0;filter:none}
.assistant-chat-header>div{align-content:center;padding:32px 18px 22px}
.assistant-chat-header strong{padding-right:12px}
.assistant-chat-intro-message{font-size:13px;line-height:1.5}
.assistant-chat-header .icon-button{z-index:1;top:6px;right:6px}
@media(max-width:480px){.assistant-chat-header{grid-template-columns:42% minmax(0,1fr);min-height:180px}.assistant-chat-header>img{min-height:180px;max-height:210px}.assistant-chat-header>div{padding:30px 14px 18px}.assistant-chat-header strong{font-size:19px}.assistant-chat-intro-message{font-size:12px}}
@media(max-height:560px){.assistant-chat-header{min-height:140px}.assistant-chat-header>img{min-height:140px;max-height:155px}.assistant-chat-header>div{padding:24px 12px 12px}.assistant-chat-intro-message{font-size:11px;margin-top:3px}}
.assistant-chat-form{margin-top:auto}
.assistant-chat-fab img{left:-65%;top:-7%}
.assistant-chat-fab img{width:200%;height:200%;left:-50%;top:-5%}
/* Use the full-resolution originals and shift the launcher portrait to the right. */
.assistant-chat-fab img{width:200%;height:200%;left:-38%;top:-5%;image-rendering:auto;filter:none;opacity:1}
.assistant-avatar{width:300px;height:auto;aspect-ratio:auto;object-fit:contain;image-rendering:auto;filter:none;opacity:1}
.assistant-chat-header>img{image-rendering:auto;filter:none;opacity:1}
@media(max-width:900px){.assistant-avatar{width:240px}}
@media(max-width:600px){.assistant-profile{flex-wrap:wrap}.assistant-avatar{width:min(280px,100%)}.assistant-profile>div{min-width:0;flex:1 1 220px}}
.agency-document-notice{display:flex;align-items:center;justify-content:space-between;gap:24px;margin:18px 40px 0;padding:18px 22px;border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:12px;background:var(--surface);color:var(--text)}
.agency-document-notice strong{font-size:14px}.agency-document-notice p{margin:6px 0 0;font-size:13px;line-height:1.6;color:var(--muted)}.agency-document-notice small{display:block;margin-top:8px;color:var(--muted)}.agency-document-notice>.primary{flex-shrink:0;font-size:12px}
@media(max-width:700px){.agency-document-notice{margin:14px 16px 0;flex-direction:column;align-items:stretch;gap:14px}}
