:root {
  --primary: #5856d6;
  --apricot: #ffb38a;
  --apricot-soft: #fff0e7;
  --ink: #24243d;
  --muted: #626179;
  --line: #dcdbea;
  --sidebar: #25243f;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
  color: #24243d;
  background: #f7f7fc;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  background: #5856d6;
  color: white;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px 15px;
  min-height: 40px;
  box-shadow: 0 1px 2px #0c21440a;
  cursor: pointer;
  font-weight: 600;
}
button:hover {
  background: #4542b5;
  border-color: #4542b5;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
.secondary {
  background: white;
  color: #42415f;
  border-color: #dcdbea;
}
input,
select,
textarea {
  background: white;
  color: #24243d;
  border: 1px solid #c3cede;
  border-radius: 6px;
  padding: 10px;
  max-width: 100%;
}
select {
  appearance: none;
  width: 100%;
  padding: 10px 38px 10px 10px;
  background-image:
    linear-gradient(45deg, transparent 50%, #625f78 50%),
    linear-gradient(135deg, #625f78 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 16px,
    calc(100% - 12px) 16px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #b9b7f0;
  outline-offset: 1px;
}
textarea {
  width: 100%;
  line-height: 1.6;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
  color: #494861;
}
p {
  line-height: 1.65;
  color: #626179;
}
h1 {
  font-size: 32px;
  font-weight: 750;
  letter-spacing: -1px;
  margin: 10px 0;
}
h2 {
  font-size: 20px;
}
h3 {
  font-size: 15px;
  margin-top: 24px;
}
.brand {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.7px;
}
.auth-card {
  max-width: 470px;
  margin: 10vh auto;
  background: white;
  padding: 40px;
  border: 1px solid #d4ddea;
  border-radius: 18px;
  box-shadow: 0 15px 70px #101e3b18;
}
.auth-card h1 {
  margin-top: 30px;
}
.tabs {
  display: flex;
  gap: 10px;
  margin: 25px 0;
}
#auth-submit {
  width: 100%;
  margin-top: 15px;
}
#portal {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr) 0;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
#portal > #portal-sidebar { grid-column: 1; }
#portal > main { grid-column: 2; min-width: 0; height: 100%; overflow: auto; }
#portal.sidebar-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
#portal.sidebar-collapsed > #portal-sidebar { display: none; }
@media (min-width: 1001px) {
  #portal.assistant-docked { grid-template-columns: 252px minmax(0, 1fr) 390px; }
  #portal.sidebar-collapsed.assistant-docked { grid-template-columns: 0 minmax(0, 1fr) 390px; }
  #portal.assistant-docked .assistant-panel { grid-column: 3; position: sticky; inset: auto; top: 0; width: 390px; height: 100%; border-width: 0 0 0 1px; border-radius: 0; box-shadow: -10px 0 32px rgba(31,27,65,.08); }
}
#portal-sidebar-toggle { position: fixed; left: 218px; top: 12px; z-index: 30; width: 28px; min-width: 28px; min-height: 28px; height: 28px; padding: 0; border: 1px solid #454361; border-radius: 8px; background: #302f4b; color: #fff; box-shadow: 0 3px 12px #17162b30; font-size: 18px; line-height: 1; }
#portal.sidebar-collapsed > #portal-sidebar-toggle { left: 12px; background: #5856d6; }
aside {
  background: #25243f;
  border-right: 1px solid #d2dce9;
  padding: 30px 22px;
  position: sticky;
  top: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
aside .brand {
  margin-bottom: 30px;
}
aside label {
  font-size: 12px;
}
nav {
  display: grid;
  gap: 7px;
  margin-top: 35px;
}
nav button {
  background: none;
  color: #d4cfe9;
  text-align: left;
  font-weight: 500;
}
nav button.active {
  background: #5856d6;
  color: #ffffff;
}
.aside-bottom {
  margin-top: auto;
  display: grid;
  gap: 14px;
  font-size: 12px;
}
main {
  padding: 38px;
  min-width: 0;
  width: 100%;
  max-width: none;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  color: #5856d6;
}
.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: white;
  padding: 15px;
  border: 1px solid #d3ddea;
  border-radius: 12px;
  margin-top: 25px;
}
.toolbar input {
  flex: 1;
  min-width: 180px;
}
#document-list {
  background: white;
  border: 1px solid #d3ddea;
  border-radius: 12px;
  overflow: hidden;
}
.doc-row {
  display: grid;
  grid-template-columns: 25px minmax(140px, 1fr) 120px 130px;
  gap: 12px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid #e3e9f2;
}
.doc-row:last-child {
  border: 0;
}
.doc-row button {
  background: none;
  color: #172b49;
  text-align: left;
  padding: 0;
  overflow-wrap: anywhere;
}
.doc-row small {
  display: block;
  color: #626179;
  margin-top: 5px;
  font-weight: 400;
}
.badge {
  display: inline-block;
  border-radius: 5px;
  border: 1px solid #cbd6e5;
  font-weight: 650;
  background: #e9eef6;
  padding: 5px 9px;
  font-size: 11px;
}
.badge.approved {
  background: #dbf2e4;
  color: #11623c;
}
.badge.queued {
  background: #e5edff;
  color: #1945ac;
}
.money {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.pagination {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 14px 0;
}
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.split {
  display: grid;
  grid-template-columns: minmax(250px, 0.9fr) minmax(350px, 1.1fr);
  gap: 22px;
}
#preview {
  position: sticky;
  top: 20px;
  align-self: start;
  background: #172238;
  border-radius: 10px;
  overflow: hidden;
}
#preview iframe {
  width: 100%;
  height: 80vh;
  border: 0;
}
#preview img {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
}
.editor {
  background: white;
  border: 1px solid #d2dce9;
  border-radius: 12px;
  padding: 20px;
  min-width: 0;
}
.actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.hint {
  font-size: 12px;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}
.fields label {
  font-size: 12px;
}
#issues {
  padding: 12px 12px 12px 28px;
  background: #fff4db;
  color: #82520b;
  border-radius: 8px;
  font-size: 12px;
}
#issues:empty {
  display: none;
}
.table-scroll {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
}
th {
  font-size: 10px;
  text-align: left;
  color: #40536f;
  padding: 5px;
}
td {
  padding: 3px;
}
td input {
  min-width: 75px;
  width: 100%;
  padding: 7px;
  font-size: 12px;
}
td:first-child input {
  min-width: 150px;
}
.inline-row {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}
.inline-row input {
  min-width: 0;
  width: 100%;
}
details {
  margin: 25px 0;
}
summary {
  cursor: pointer;
  margin-bottom: 10px;
}
#json {
  font:
    12px ui-monospace,
    monospace;
}
.history-card,
.member-card {
  border: 1px solid #d6dfeb;
  padding: 14px;
  margin: 10px 0;
  border-radius: 8px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.history-card p {
  margin: 5px 0;
}
#notice {
  position: fixed;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: #10213d;
  color: white;
  border-radius: 10px;
  padding: 14px 22px;
  max-width: 85vw;
  box-shadow: 0 5px 30px #0002;
}
#notice.error {
  background: #a72d37;
}
#prompts-view,
#audit-view {
  max-width: 850px;
}
#members-view {
  width: 100%;
  max-width: none;
}
fieldset {
  border: 1px solid #d2dce9;
  border-radius: 8px;
  margin: 15px 0;
}
fieldset label {
  flex-direction: row;
  align-items: center;
}
#prompt-text {
  margin-bottom: 15px;
}
small {
  color: #626179;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1000px) {
  #portal {
    grid-template-columns: 190px 1fr;
  }
  main {
    padding: 22px;
  }
  aside {
    padding: 25px 15px;
  }
  .split {
    grid-template-columns: 1fr;
  }
  #preview {
    position: static;
  }
  #preview iframe {
    height: 55vh;
  }
}
@media (max-width: 650px) {
  #portal {
    display: block;
  }
  aside {
    position: static;
    height: auto;
    border-bottom: 1px solid #d2dce9;
  }
  aside .brand {
    margin: 0;
  }
  nav {
    display: flex;
    flex-wrap: wrap;
    margin: 15px 0;
  }
  .aside-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  header {
    display: block;
  }
  .doc-row {
    grid-template-columns: 20px 1fr 85px;
  }
  .doc-row .money {
    grid-column: 2/4;
    text-align: left;
  }
  .fields {
    grid-template-columns: 1fr;
  }
  .auth-card {
    margin: 30px 15px;
    padding: 25px;
  }
  h1 {
    font-size: 25px;
  }
}

/* Skutečný stav zpracování dokumentu: animace zmizí po opuštění fronty. */
#preview {
  position: relative;
  overflow: hidden;
}
#preview.is-processing::before {
  content: "ZPRACOVÁVÁM DOKUMENT";
  position: absolute;
  z-index: 45;
  top: 58px;
  left: 50%;
  padding: 6px 11px;
  border: 1px solid #d7d4ff;
  border-radius: 999px;
  background: #292642e6;
  color: #fff;
  box-shadow: 0 8px 22px #211d3830;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .12em;
  pointer-events: none;
  transform: translateX(-50%);
  animation: processing-label 2.8s ease-in-out infinite;
}
#preview.is-processing::after {
  content: "";
  position: absolute;
  z-index: 44;
  left: 0;
  right: 0;
  top: 82px;
  height: 3px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, #ffb38a 16%, #fff 50%, #817ee8 84%, transparent);
  box-shadow: 0 0 10px #fff, 0 0 24px #625ee2, 0 -30px 65px 18px #716be31f, 0 30px 65px 18px #ff9d6624;
  animation: document-processing-scan 2.8s cubic-bezier(.45,.05,.55,.95) infinite;
}
#preview.is-processing iframe,
#preview.is-processing .image-viewport {
  animation: document-processing-surface 2.8s ease-in-out infinite;
}
@keyframes document-processing-scan {
  0% { top: 82px; opacity: 0; }
  8%, 88% { opacity: 1; }
  100% { top: calc(100% - 5px); opacity: 0; }
}
@keyframes processing-label {
  0%, 100% { opacity: .72; }
  50% { opacity: 1; }
}
@keyframes document-processing-surface {
  0%, 100% { filter: saturate(.84) brightness(.98); }
  50% { filter: saturate(1) brightness(1.02); }
}
@media (prefers-reduced-motion: reduce) {
  #preview.is-processing::before,
  #preview.is-processing::after,
  #preview.is-processing iframe,
  #preview.is-processing .image-viewport {
    animation: none;
  }
  #preview.is-processing::after { top: 50%; }
}

.password-visibility {
  flex-direction: row;
  align-items: center;
  font-size: 12px;
}
.password-input {
  position: relative;
  display: block;
}
.password-input input {
  width: 100%;
  padding-right: 72px;
}
.password-input button {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  min-height: 30px;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: #5856d6;
  box-shadow: none;
  font-size: 12px;
}
.password-input button:hover {
  border: 0;
  background: #f0eef8;
  color: #4542b5;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: #f7f7fc;
  border-bottom: 1px solid #dcdbea;
}
.preview-toolbar button {
  padding: 7px 12px;
}
.preview-zoom {
  min-width: 55px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
.image-viewport {
  width: 100%;
  height: 70vh;
  min-height: 280px;
  overflow: auto;
  cursor: grab;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
}
.image-viewport.dragging {
  cursor: grabbing;
  user-select: none;
}
.image-stage {
  display: grid;
  place-items: start center;
}
#preview .image-stage img {
  display: block;
  max-width: none;
  max-height: none;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
@media (max-width: 1000px) {
  .image-viewport {
    height: 55vh;
  }
}

.source-picture {
  position: relative;
  line-height: 0;
}
.source-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.source-box {
  position: absolute;
  border: 2px solid #db6600;
  background: #ffb23c30;
  box-shadow: 0 0 0 1px #fff9;
  min-width: 3px;
  min-height: 3px;
}
.source-status {
  padding: 8px 12px;
  margin: 0;
  background: #f7f7fc;
  font-size: 12px;
  line-height: 1.5;
}
[data-source-field]:focus {
  outline: 2px solid #db6600;
}

#knowledge-view {
  width: 100%;
  max-width: none;
}
#rule-mapping select {
  max-width: 230px;
}
#rule-history pre {
  white-space: pre-wrap;
}
#rule-version {
  font-size: 12px;
  color: #626179;
}

.template-recognition {
  border: 1px solid #cfd9e7;
  background: #f0eef8;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 12px 0 20px;
}
.template-recognition strong {
  font-size: 15px;
}
.template-recognition p {
  margin: 5px 0 0;
  font-size: 13px;
}
.template-recognition.matched {
  border-color: #b2c9ff;
  background: #e8efff;
}
.template-recognition.matched strong {
  color: #5856d6;
}
.template-recognition.review,
.template-recognition.unverified,
.template-recognition.pending {
  background: #fff2d2;
  border-color: #dfbd72;
}
.template-tag {
  display: block;
  width: fit-content;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 5px;
  background: #f0eef8;
  color: #626179;
  font-size: 11px;
  font-weight: 500;
}
.template-tag.matched {
  background: #e5edff;
  color: #5856d6;
}
.template-tag.review,
.template-tag.unverified {
  background: #fff1cf;
  color: #80520b;
}

/* Product shell and high-contrast interaction hierarchy. */
button {
  transition:
    background-color 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}
button:focus-visible {
  outline: 3px solid #9dbbff;
  outline-offset: 3px;
}
.secondary:hover {
  background: #eff4ff;
  border-color: #a8bbdb;
  color: #163e9a;
}
input:hover,
select:hover,
textarea:hover {
  border-color: #8fa5c4;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #5856d6;
  outline-offset: 1px;
}
input[type="checkbox"] {
  accent-color: #5856d6;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
input[readonly],
textarea:disabled {
  background: #f5f7fb;
}
h1,
h2,
h3 {
  color: #13233e;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.4px;
}
h3 {
  font-weight: 700;
}
label {
  font-weight: 550;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #24243d;
  white-space: nowrap;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 36px;
  background: #5856d6;
  color: white;
  border-radius: 7px;
  font-size: 21px;
  letter-spacing: -1px;
  font-weight: 750;
  box-shadow: 0 3px 8px #08265420;
}
aside {
  color: #edf3ff;
  border-right: 1px solid #0b1424;
  padding: 28px 20px;
}
aside .brand {
  color: white;
  margin-bottom: 30px;
}
aside label {
  color: #c9c5e4;
  font-size: 11px;
  letter-spacing: 0.35px;
  font-weight: 650;
}
aside select {
  background-color: #33314f;
  background-image:
    linear-gradient(45deg, transparent 50%, #d7d3ed 50%),
    linear-gradient(135deg, #d7d3ed 50%, transparent 50%);
  color: #f1f5ff;
  border-color: #565272;
  font-size: 13px;
  font-weight: 500;
  min-height: 40px;
}
aside select:hover,
aside select:focus {
  border-color: #7394d1;
}
aside option {
  background: #33314f;
  color: #f1f5ff;
}
aside .secondary {
  background: transparent;
  border-color: #625b7e;
  color: #e1eaff;
  box-shadow: none;
}
aside .secondary:hover {
  background: #3f3b5d;
  border-color: #6a85ad;
  color: white;
}
nav {
  gap: 6px;
  margin-top: 28px;
}
nav button {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 12px 13px;
  border-radius: 6px;
  font-size: 13px;
  color: #d4cfe9;
  box-shadow: none;
}
nav button:hover {
  background: #383554;
  border-color: transparent;
  color: white;
}
nav button.active {
  background: #5856d6;
  color: white;
  border-color: #817ee8;
  font-weight: 650;
  box-shadow: 0 3px 8px #0002;
}
.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.95;
}
.platform-admin-mark {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-left: auto;
  flex: 0 0 auto;
  border: 1px solid #ffb276;
  border-radius: 7px;
  background: #ffeadb;
  color: #7f3d15;
  vertical-align: middle;
}
.platform-admin-mark svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.platform-admin-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 3px 7px 3px 4px;
  border: 1px solid #f1b98e;
  border-radius: 999px;
  background: #fff2e8;
  color: #78401d;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .045em;
  white-space: nowrap;
}
.platform-admin-label .platform-admin-mark {
  width: 18px;
  height: 18px;
  margin-left: 0;
  border: 0;
  background: #ffd8ba;
}
.platform-admin-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.platform-admin-action .platform-admin-mark { margin-left: 2px; }
nav button.active .platform-admin-mark {
  border-color: #ffd2b0;
  background: #fff3e9;
  color: #70320d;
}
.template-catalog {
  margin: 22px 0;
  padding: 18px;
  border: 1px solid #ddd9ec;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff 0%, #faf8ff 62%, #fff4eb 100%);
  box-shadow: 0 8px 28px #39315e0a;
}
.template-catalog-heading,
.supplier-template-heading,
.template-catalog-stats {
  display: flex;
  align-items: center;
}
.template-catalog-heading { justify-content: space-between; gap: 18px; }
.template-catalog-heading h2 { margin: 2px 0 0; }
.template-catalog-heading .eyebrow { margin: 0; }
.template-catalog-stats { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.template-catalog-stats span,
.template-kind-badge,
.fingerprint-missing {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.template-catalog-stats span { background: #eeecfb; color: #4542a8; }
.template-catalog-note { margin: 12px 0 0; color: #66627a; font-size: 12px; }
.supplier-template-catalog { display: grid; gap: 10px; margin-top: 16px; }
.supplier-template-card {
  padding: 13px 14px;
  border: 1px solid #e6e2f1;
  border-radius: 12px;
  background: #fff;
}
.supplier-template-heading { justify-content: space-between; gap: 12px; }
.supplier-template-card p { margin: 7px 0 10px; color: #66627a; font-size: 12px; line-height: 1.45; }
.template-kind-badge { background: #e8e6ff; color: #4542a8; white-space: nowrap; }
.fingerprint-missing { display: inline-block; background: #fff0e4; color: #8a4a20; }
@media (max-width: 700px) {
  .template-catalog-heading, .supplier-template-heading { align-items: flex-start; flex-direction: column; }
  .template-catalog-stats { justify-content: flex-start; }
}
.knowledge-workbench {
  display: grid;
  grid-template-columns: minmax(310px, 38%) minmax(0, 1fr);
  gap: 0;
  min-height: 620px;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid #ddd9e9;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 38px #3028500d;
}
.knowledge-master {
  min-width: 0;
  padding: 16px 0;
  border-right: 1px solid #e4e0ed;
  background: #f8f7fc;
}
.knowledge-master-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px 12px; }
.knowledge-master-header h2 { margin: 2px 0 0; font-size: 19px; }
.knowledge-master-header .eyebrow { margin: 0; }
.knowledge-master-header button { width: 34px; height: 34px; padding: 0; border-radius: 10px; font-size: 21px; }
.knowledge-search { display: grid; gap: 5px; padding: 0 14px 12px; color: #6b667c; font-size: 11px; font-weight: 700; }
.knowledge-search input { min-height: 38px; background: #fff; }
.knowledge-table-wrap { max-height: 680px; overflow: auto; }
.knowledge-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.knowledge-table th { padding: 5px 10px; border-top: 1px solid #e5e1ed; border-bottom: 1px solid #e5e1ed; color: #777185; font-size: 9px; line-height: 1.1; text-align: left; text-transform: uppercase; letter-spacing: .04em; }
.knowledge-table th:first-child { width: 55%; padding-left: 14px; }
.knowledge-table th:nth-child(2) { width: 28%; }
.knowledge-table th:last-child { width: 17%; }
.knowledge-table td { padding: 5px 10px; border-bottom: 1px solid #e8e5ef; line-height: 1.1; vertical-align: middle; }
.knowledge-table td:first-child { padding-left: 14px; }
.knowledge-table td strong, .knowledge-table td small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-table td strong { color: #29263d; font-weight: 720; }
.knowledge-table td small { margin-top: 1px; color: #888296; font-size: 9px; line-height: 1.05; }
.knowledge-table tbody tr { cursor: pointer; transition: background .14s ease, box-shadow .14s ease; }
.knowledge-table tbody tr:hover { background: #efedf9; }
.knowledge-table tbody tr.selected { background: #e8e6fb; box-shadow: inset 3px 0 #5856d6; }
.knowledge-table tbody tr.selected td strong { color: #302d8f; }
.knowledge-table tbody tr:focus-visible { outline: 2px solid #5856d6; outline-offset: -2px; }
.rule-type { font-size: 10px; font-weight: 700; }
.rule-type.supplier { color: #4542b5; }
.rule-type.default { color: #8a4a20; }
.knowledge-editor { min-width: 0; padding: 20px 22px 26px; background: #fff; }
.knowledge-editor #knowledge-form { margin: 0; }
.advanced-rule-settings > summary {
  cursor: pointer;
  color: #4f4b68;
  font-weight: 700;
}
.advanced-rule-settings > section { margin-top: 16px; }
@media (max-width: 900px) {
  .knowledge-workbench { grid-template-columns: 1fr; }
  .knowledge-master { border-right: 0; border-bottom: 1px solid #e4e0ed; }
  .knowledge-table-wrap { max-height: 300px; }
}
.aside-bottom {
  padding-top: 24px;
  border-top: 1px solid #474361;
  color: #d4cfe9;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
header {
  padding-bottom: 8px;
}
header p {
  max-width: 760px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 750;
}
.toolbar {
  border-radius: 8px;
  box-shadow: 0 2px 5px #11223d05;
}
#count {
  font-size: 12px;
  font-weight: 650;
  color: #3e516e;
}
#document-list {
  border-radius: 8px;
  box-shadow: 0 2px 6px #11223d05;
}
.doc-row {
  padding: 20px;
  border-left: 3px solid transparent;
  transition: background 0.15s;
}
.doc-row:hover {
  background: #f2f0fc;
  border-left-color: #5856d6;
}
.doc-row button {
  min-height: 0;
  line-height: 1.5;
  font-size: 14px;
  box-shadow: none;
  border: 0;
}
.doc-row button:hover {
  background: transparent;
  color: #4542b5;
}
.doc-row small {
  font-size: 12px;
  line-height: 1.5;
}
.badge {
  width: fit-content;
  white-space: nowrap;
}
.badge.review {
  background: #fff2d5;
  color: #80520b;
  border-color: #e8c88d;
}
.badge.approved {
  border-color: #a5d4b8;
}
.badge.queued {
  border-color: #b3c9ff;
}
.money {
  font-size: 14px;
  font-weight: 650;
  color: #152b49;
}
.detail-header {
  margin: 30px 0 10px;
  gap: 10px;
  flex-wrap: wrap;
}
.detail-header h2 {
  margin-right: auto;
  overflow-wrap: anywhere;
}
.package-document-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 12px;
  padding: 4px 4px 0;
  overflow-x: auto;
  border-bottom: 1px solid #d9d8e5;
}
.package-document-tabs[hidden] { display: none; }
.document-relations { margin: 8px 0 12px; display: grid; gap: 6px; }
.document-relations[hidden] { display: none; }
.advance-relation-card { padding: 10px 12px; border: 1px solid #d8d2ef; border-left: 4px solid #5856d6; border-radius: 9px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; background: #f4f1ff; }
.advance-relation-card strong { color: #39345b; font-size: 12px; }
.advance-relation-card span { color: #625b73; font-size: 11px; }
.advance-relation-card button { min-height: 29px; padding: 5px 9px; font-size: 10px; }
.package-document-tabs button {
  display: grid;
  min-width: 132px;
  padding: 8px 13px 9px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  background: transparent;
  color: #575269;
  text-align: left;
  box-shadow: none;
}
.package-document-tabs button:hover { background: #f2f0f8; }
.package-document-tabs button.active {
  margin-bottom: -1px;
  border-color: #d9d8e5;
  background: #fff;
  color: #36319a;
}
.package-document-tabs button span { font-size: 12px; font-weight: 750; }
.package-document-tabs button small {
  max-width: 180px;
  overflow: hidden;
  color: #7a7488;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.editor {
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 3px 12px #13233e08;
}
.fields {
  gap: 2px 16px;
}
.fields label {
  font-size: 12px;
  color: #494861;
}
.ares-fill {
  font-size: 11px;
  min-height: 32px;
  padding: 6px 10px;
  align-self: flex-start;
  color: #4542b5;
  border-color: #b9ccf3;
  background: #f3f7ff;
}
.actions {
  padding-bottom: 14px;
  border-bottom: 1px solid #e0e6f0;
  margin-bottom: 12px;
  gap: 8px;
}
#issues {
  border: 1px solid #e8c88d;
  border-left: 3px solid #c78d20;
  line-height: 1.6;
}
.table-scroll {
  border: 1px solid #d2dce9;
  border-radius: 6px;
  margin-bottom: 12px;
}
th {
  padding: 10px 7px;
  background: #f2f0f9;
  font-weight: 650;
  border-bottom: 1px solid #d2dce9;
  font-size: 10px;
}
td {
  padding: 5px 3px;
  border-bottom: 1px solid #f0eef8;
}
tr:last-child td {
  border-bottom: 0;
}
td input {
  border-color: #d6dfec;
}
summary {
  font-weight: 600;
  color: #243c60;
}
pre {
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.history-card,
.member-card {
  border-radius: 6px;
  background: #fafbfd;
  line-height: 1.6;
}
#preview {
  border: 1px solid #bccbdd;
  border-radius: 8px;
  box-shadow: 0 3px 14px #13233e15;
}
.preview-toolbar {
  background: #fff;
  border-bottom-color: #dcdbea;
}
.preview-zoom {
  color: #243c60;
  font-weight: 650;
}
.image-viewport {
  background: #29273f;
}
.source-status {
  background: #f5f7fc;
  border-bottom: 1px solid #d2dce9;
  color: #3e516e;
}
.template-recognition {
  border-radius: 7px;
  border-left: 4px solid #71839d;
}
.template-recognition.matched {
  border-left-color: #5856d6;
}
.template-recognition.review,
.template-recognition.unverified,
.template-recognition.pending {
  border-left-color: #c78d20;
}
.template-recognition.matched strong {
  color: #4542b5;
}
.template-tag {
  font-size: 10px;
  border: 1px solid #d0dae8;
  letter-spacing: 0.1px;
}
.template-tag.matched {
  color: #4542b5;
  border-color: #b8ccfa;
}
#auth {
  height: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: auto;
  background: #25243f;
  padding: 40px 20px;
}
.auth-card {
  width: min(100%, 460px);
  margin: 0;
  padding: 38px;
  border-radius: 12px;
  border: 1px solid #d0d9e8;
  box-shadow: 0 24px 70px #02081455;
}
.auth-card h1 {
  font-size: 29px;
  letter-spacing: -0.8px;
  line-height: 1.2;
}
.auth-card p {
  font-size: 13px;
}
.tabs {
  padding: 4px;
  background: #f0eef8;
  border: 1px solid #dae2ee;
  border-radius: 7px;
  gap: 4px;
  margin: 24px 0;
}
.tabs button {
  flex: 1;
  border-radius: 4px;
  box-shadow: none;
}
.tabs .secondary {
  border-color: transparent;
  background: transparent;
}
#forgot {
  width: 100%;
  margin-top: 10px;
  font-size: 12px;
}
.registration-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
#registration-resend-status {
  display: block;
  min-height: 38px;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}
#registration-password-form > button {
  width: 100%;
  margin-top: 18px;
}
.password-requirements {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  margin: 14px 0 0;
  padding: 14px 16px;
  border: 1px solid #e1deef;
  border-radius: 10px;
  background: #f8f7fc;
  list-style: none;
  color: var(--muted);
  font-size: 12px;
}
.password-requirements li::before {
  content: "○";
  display: inline-block;
  width: 18px;
  color: #89879b;
}
.password-requirements li.valid {
  color: #247044;
}
.password-requirements li.valid::before {
  content: "✓";
  color: #247044;
  font-weight: 750;
}
.registration-back {
  width: 100%;
  margin-top: 16px;
  padding: 8px;
  min-height: 36px;
  border: 0;
  background: transparent;
  color: #5856d6;
  box-shadow: none;
}
.registration-back:hover {
  border: 0;
  background: #f0eef8;
  color: #4542b5;
}
@media (max-width: 1000px) {
  aside {
    padding: 24px 14px;
  }
  nav button {
    padding: 11px 9px;
    font-size: 12px;
    gap: 8px;
  }
  .brand {
    font-size: 19px;
    gap: 8px;
  }
  .brand-mark {
    width: 28px;
    height: 30px;
    font-size: 18px;
  }
  main {
    padding: 25px;
  }
  .editor {
    padding: 20px;
  }
}
@media (max-width: 650px) {
  aside {
    border-bottom-color: #474361;
  }
  .aside-bottom {
    margin-top: 10px;
    padding-top: 16px;
  }
  nav {
    gap: 4px;
  }
  .toolbar {
    padding: 10px;
  }
  .doc-row {
    padding: 14px 10px;
  }
  .detail-header {
    align-items: flex-start;
  }
  .detail-header h2 {
    width: 100%;
  }
  .auth-card {
    padding: 28px;
  }
  #auth {
    padding: 20px;
  }
  .registration-actions {
    grid-template-columns: 1fr;
  }
  .password-requirements {
    grid-template-columns: 1fr;
  }
  main {
    padding: 20px 14px;
  }
  #rule-mapping .inline-row {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  button,
  .doc-row {
    transition: none;
  }
}

.source-connector {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 15;
  pointer-events: none;
  overflow: hidden;
}
.source-link-underlay {
  fill: none;
  stroke: #fff;
  stroke-width: 5;
  stroke-opacity: 0.9;
}
.source-link-path {
  fill: none;
  stroke: #db6600;
  stroke-width: 2.5;
  stroke-linecap: round;
}
.source-link-start {
  fill: #fff;
  stroke: #db6600;
  stroke-width: 2;
}
[data-source-field].source-selected {
  border-color: #db6600;
  outline: 2px solid #db6600;
  outline-offset: 1px;
  box-shadow: 0 0 0 4px #db660014;
}

.source-link-path.offscreen {
  stroke-dasharray: 6 4;
}
.source-edge {
  position: fixed;
  z-index: 16;
  transform: translate(-50%, -50%);
  background: #fff7e8;
  color: #864000;
  border: 1px solid #db6600;
  border-radius: 6px;
  min-height: 30px;
  padding: 6px 10px;
  font-size: 11px;
  box-shadow: 0 2px 10px #17223825;
  white-space: nowrap;
}
.source-edge:hover {
  background: #ffe8c1;
  color: #6b3300;
  border-color: #b75400;
}

.rotation-toolbar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.preview-toolbar {
  flex-wrap: wrap;
}

.original-dialog {
  width: min(1200px, 94vw);
  height: 90vh;
  max-width: 94vw;
  padding: 16px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  overflow: auto;
  background: #fff;
  color: #172033;
}
.original-dialog::backdrop {
  background: #0f172abb;
}
.original-dialog .toolbar {
  position: sticky;
  top: 0;
  background: #fff;
  padding: 8px;
  z-index: 1;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.original-dialog img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 16px auto;
}
.original-dialog iframe {
  width: 100%;
  height: calc(100% - 65px);
  border: 0;
}

/* Dokumenty.Store — Borůvka a meruňka */
button { border-radius: 10px; transition: background 150ms, box-shadow 150ms; }
.secondary:hover { background: #f0eefb; color: #4542b5; border-color: #b9b7e8; }
button:focus-visible { outline: 3px solid #b9b7f0; outline-offset: 3px; }
#auth {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #f7f7fc;
}
#auth::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 12% 15%, #ffdcc5 0, transparent 46%),
              radial-gradient(ellipse at 88% 85%, #dedbfc 0, transparent 48%), #f7f7fc;
  background-size: 106% 106%, 106% 106%, auto;
  animation: auth-background-breathe 15s ease-in-out infinite alternate;
}
@keyframes auth-background-breathe {
  from { background-position: -2.5% -1.5%, 102.5% 101.5%, 0 0; }
  to { background-position: 2.5% 1.5%, 97.5% 98.5%, 0 0; }
}
.auth-card { position: relative; z-index: 1; border-color: #e1deef; border-radius: 24px; box-shadow: 0 24px 80px #38305b18; }
.brand-mark { background: var(--apricot); color: #352c44; border-radius: 11px 11px 11px 3px; box-shadow: none; }
.auth-card .brand { color: #4542b5; }
.auth-card h1 { color: #24243d; }
.tabs { border-color: #e1deef; border-radius: 12px; }
.tabs button { border-radius: 8px; }
.tabs button[aria-pressed="true"] { background: #5856d6; color: white; }
.tabs button[aria-pressed="false"] { background: transparent; color: #494861; border-color: transparent; }
nav button { border-radius: 10px; }
nav button.active { border-left: 3px solid var(--apricot); }
.eyebrow { color: #5856d6; }
#portal.onboarding-mode { grid-template-columns: 1fr; }
#portal.onboarding-mode > aside { display: none; }
#portal.onboarding-mode > main { grid-column: 1; padding: 0; }
#onboarding-view { width: 100%; max-width: none; min-height: 100vh; padding: 32px 24px; display: grid; align-content: center; justify-items: center; text-align: center; }
#onboarding-view[hidden] { display: none; }
#onboarding-view > h1 { font-size: clamp(32px, 4vw, 48px); }
#onboarding-view > p { max-width: 580px; margin: 12px auto; font-size: 16px; }
#first-company-form { width: min(100%, 640px); max-width: none; margin: 34px auto 0; text-align: left; }
.onboarding-kind { display: flex; justify-content: center; gap: 22px; margin: 0 0 30px; padding: 0; border: 0; }
.onboarding-kind legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.onboarding-kind label { flex-direction: row; align-items: center; gap: 9px; margin: 0; padding: 9px 4px; border: 0; background: transparent; font-weight: 650; cursor: pointer; }
.onboarding-kind input {
  appearance: none;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  flex: 0 0 22px;
  border: 2px solid #8a88a0;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}
.onboarding-kind input:checked {
  border-color: #5856d6;
  background: #5856d6;
  box-shadow: inset 0 0 0 5px #fff;
}
.onboarding-kind input:focus-visible {
  outline: 3px solid #d8d5fa;
  outline-offset: 2px;
}
.onboarding-kind + div > label, #personal-profile label { color: var(--ink); font-weight: 650; }
#first-company-search, #first-person-name { width: 100%; min-height: 58px; padding: 15px 18px; border-radius: 15px; border-color: #d5d1e8; box-shadow: 0 10px 35px #38305b10; font-size: 17px; }
#first-company-search:focus, #first-person-name:focus { outline: 3px solid #d8d5fa; border-color: #817de0; }
.ares-suggestions { display: grid; gap: 6px; margin: -4px 0 10px; padding: 6px; border: 1px solid #d9d6e9; border-radius: 10px; background: white; box-shadow: 0 12px 30px #38305b16; }
.ares-suggestion { display: block; width: 100%; min-height: 0; padding: 10px; border: 0; background: transparent; color: var(--ink); text-align: left; box-shadow: none; }
.ares-suggestion:hover { border: 0; background: #f2f0fc; color: var(--ink); }
.ares-suggestion strong, .ares-suggestion small { display: block; }
.ares-suggestion small { margin-top: 4px; color: var(--muted); font-weight: 400; }
#ares-onboarding-status { display: block; min-height: 20px; color: var(--muted); }
.onboarding-company-card { margin-top: 20px; padding: 20px 22px; border: 1px solid #e1deef; border-radius: 14px; background: #fff; box-shadow: 0 12px 35px #38305b0d; }
.onboarding-company-card strong, .onboarding-company-card span, .onboarding-company-card small { display: block; }
.onboarding-company-card strong { font-size: 18px; color: var(--ink); }
.onboarding-company-card span { margin-top: 7px; color: #5856d6; font-weight: 650; }
.onboarding-company-card small { margin-top: 7px; color: var(--muted); }
.onboarding-submit { display: block; min-width: 220px; margin: 24px auto 0; }
#onboarding-cancel { max-width: 280px; margin-left: auto; margin-right: auto; }
.profile-identifiers { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.profile-chip { padding: 7px 11px; border: 1px solid #dcd9ec; border-radius: 999px; background: #f6f4fc; color: #4b4963; font-size: 12px; font-weight: 650; }
.vat-status-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 24px 0 32px; padding: 22px; border: 1px solid #e1deef; border-left: 5px solid var(--apricot); border-radius: 14px; background: #fff; }
.vat-status-card h2 { margin: 6px 0; }
.vat-status-card p { margin: 0; }
.registry-actions { display: flex; align-items: center; gap: 12px; }
.data-box-status-card { margin-top: 36px; margin-bottom: 14px; border-left-color: var(--blueberry, #5145cd); }
.data-box-card strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; }
.data-box-pdz { color: #4d3baa !important; font-weight: 650; }
.data-box-warning { color: #9a5b12 !important; font-weight: 650; }
.compact-action { min-height: 0; padding: 7px 11px; font-size: 12px; }
.manual-data-box-form { max-width: 620px; margin: 12px 0 20px; padding: 18px; border: 1px solid #dfdbea; border-radius: 12px; background: #faf9fd; }
.manual-data-box-form label { display: grid; gap: 6px; margin-bottom: 10px; }
.data-box-actions { display: flex; gap: 8px; margin-top: 5px; }
.data-box-actions button { min-height: 0; padding: 6px 9px; font-size: 11px; }
.vat-reliable { background: #e7f6ec; color: #17643a; border-color: #add8bc; }
.vat-unreliable { background: #fde8e8; color: #9b2530; border-color: #e7afb4; }
.bank-account-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 12px; margin: 18px 0 28px; }
.bank-account-card { display: grid; gap: 7px; padding: 18px; border: 1px solid #e1deef; border-radius: 12px; background: #fff; }
.bank-account-card strong { font-size: 17px; color: var(--ink); }
.bank-account-card small { color: var(--muted); }
.account-active { color: #247044; font-size: 12px; font-weight: 650; }
.account-inactive { color: #8a5960; font-size: 12px; font-weight: 650; }
.empty-state { padding: 18px; border: 1px dashed #d8d4e8; border-radius: 12px; background: #faf9fd; }
.history-card, .member-card, .editor, #document-list { border-radius: 12px; }
.people-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.people-header h1 { margin: 4px 0 8px; }
.people-header p { margin: 0; }
.people-header > button { flex: 0 0 auto; }
.people-form { margin: 18px 0 26px; padding: 22px; border: 1px solid #ded9eb; border-left: 5px solid var(--apricot); border-radius: 14px; background: #fff; box-shadow: 0 12px 36px #37305a0d; }
.people-form.access-form { border-left-color: var(--blueberry, #5145cd); }
.people-form h2, .people-form h3 { margin: 5px 0 12px; }
.people-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; }
.people-notes { grid-column: 1 / -1; }
.contact-method-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; }
.contact-method-row { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(180px, 1fr) minmax(180px, .8fr) auto; gap: 8px; align-items: center; margin: 8px 0; }
.contact-method-row input, .contact-method-row select { margin: 0; }
.people-form-actions { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.people-form-actions .secondary { margin-left: 2px; }
.role-description { min-height: 42px; margin: 8px 0; padding: 11px 13px; border-radius: 9px; background: #f3f1fa; color: #4e4a68; }
.access-details { margin: 14px 0; }
.people-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 12px 0; color: var(--muted); font-size: 12px; }
.people-toolbar-end { display: flex; align-items: center; gap: 12px; }
.people-view-switch { display: inline-flex; padding: 3px; border: 1px solid #d9d4e8; border-radius: 10px; background: #f5f3fa; }
.people-view-switch button { min-height: 0; margin: 0; padding: 6px 10px; border: 0; border-radius: 7px; background: transparent; box-shadow: none; color: #625d76; font-size: 11px; }
.people-view-switch button[aria-pressed="true"] { background: #5145cd; color: #fff; box-shadow: 0 3px 9px #5145cd2c; }
.people-view-switch button:focus-visible { outline: 3px solid #d6d1fb; outline-offset: 2px; }
.people-list { display: grid; gap: 12px; }
.person-card { display: grid; gap: 13px; padding: 19px; border: 1px solid #ded9eb; border-radius: 14px; background: #fff; box-shadow: 0 8px 28px #37305a0a; }
.person-heading { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.person-heading strong { display: block; color: var(--ink); font-size: 16px; }
.person-heading p { margin: 5px 0 0; color: var(--muted); }
.people-status { flex: 0 0 auto; padding: 5px 9px; border: 1px solid #d7d3e5; border-radius: 999px; background: #f5f3fa; color: #625d76; font-size: 11px; font-weight: 700; }
.people-status.active { border-color: #a9d8b9; background: #e8f7ed; color: #17643a; }
.people-status.pending_invitation { border-color: #edc98c; background: #fff4de; color: #85500d; }
.people-status.inactive { border-color: #dfc5c9; background: #f9ecee; color: #86404a; }
.contact-method-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.contact-chip { padding: 6px 9px; border: 1px solid #e0dced; border-radius: 8px; background: #f8f7fc; color: #514c68; font-size: 12px; overflow-wrap: anywhere; }
.person-access-summary { display: flex; align-items: baseline; gap: 10px; padding: 11px 13px; border-radius: 9px; background: #f4f2fb; }
.person-access-summary span { color: var(--muted); font-size: 12px; }
.person-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 2px; }
.person-actions button { min-height: 0; padding: 8px 11px; font-size: 12px; }
.people-table-wrap { width: 100%; overflow-x: auto; border: 1px solid #ded9eb; border-radius: 14px; background: #fff; box-shadow: 0 8px 28px #37305a0a; }
.people-table { width: 100%; min-width: 980px; table-layout: fixed; }
.people-table th { padding: 11px 10px; background: #f3f1fa; color: #56506d; }
.people-table td { padding: 13px 10px; vertical-align: top; border-bottom: 1px solid #ece9f3; overflow-wrap: anywhere; }
.people-table tr:last-child td { border-bottom: 0; }
.people-table th:nth-child(1) { width: 13%; }
.people-table th:nth-child(2) { width: 13%; }
.people-table th:nth-child(3) { width: 18%; }
.people-table th:nth-child(4) { width: 12%; }
.people-table th:nth-child(5) { width: 16%; }
.people-table th:nth-child(6) { width: 28%; }
.people-table td > strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.people-table td > span, .people-table td > small { display: block; }
.people-table td > small { margin-top: 4px; background: transparent; color: var(--muted); }
.people-table .table-actions { flex-wrap: nowrap; gap: 5px; white-space: nowrap; }
.people-table .table-actions button { flex: 0 0 auto; padding: 7px 9px; }
.table-contact-methods { display: grid; gap: 4px; min-width: 0; }
.table-contact-methods span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #514c68; }
.table-access { display: grid; gap: 4px; }
.table-access span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.table-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 5px; white-space: nowrap; }
.table-actions button { flex: 0 0 auto; width: auto; padding: 7px 9px; white-space: nowrap; }
.danger-action { color: #8b3541; border-color: #dec0c5; background: #fff8f8; }
.muted { color: var(--muted); font-size: 12px; }
.ares-fill { color: #4542b5; border-color: #d3cff1; background: #f3f1fc; }
.structure-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.structure-header h1 { margin: 4px 0 8px; }
.structure-header p { margin: 0; }
.structure-header-actions { display: flex; gap: 7px; align-items: center; }
.structure-header-actions button { min-height: 34px; padding: 6px 10px; font-size: 11px; }
#portal.outlook-workspace-mode > main { height: 100%; padding: 10px 12px; overflow: hidden; }
#portal.outlook-workspace-mode #structure-view { height: 100%; }
#structure-view { position: relative; }
#portal.outlook-workspace-mode .structure-header { height: 54px; margin: 0; align-items: center; }
#portal.outlook-workspace-mode .structure-header h1 { margin: 1px 0 0; font-size: 21px; }
#portal.outlook-workspace-mode .structure-header .eyebrow { display: none; }
.structure-layout { --agenda-pane-width: 252px; --document-list-width: 340px; display: grid; grid-template-columns: var(--agenda-pane-width) 5px var(--document-list-width) 5px minmax(360px, 1fr); gap: 0; align-items: stretch; }
.structure-layout.agenda-pane-collapsed { grid-template-columns: 38px 5px var(--document-list-width) 5px minmax(360px, 1fr); }
.pane-resizer { position: relative; z-index: 8; width: 5px; min-width: 5px; height: 100%; background: #e5e1eb; cursor: col-resize; touch-action: none; }
.pane-resizer::after { content: ""; position: absolute; inset: 0 -3px; }
.pane-resizer:hover, .pane-resizer.dragging { background: #8f83dc; box-shadow: 0 0 0 1px #8f83dc; }
.structure-panel { padding: 22px; border: 1px solid #ded9eb; border-radius: 14px; background: #fff; box-shadow: 0 8px 28px #37305a0a; }
.structure-panel h2 { margin-top: 0; }
.agenda-tree ul, .document-type-tree ul { list-style: none; margin: 0; padding-left: 20px; }
.agenda-tree > ul, .document-type-tree > ul { padding-left: 0; }
.outlook-shell { height: calc(100% - 54px); min-height: 0; overflow: hidden; border: 1px solid #dcd8e7; border-radius: 14px; background: #fff; box-shadow: 0 10px 32px #31245d12; }
.outlook-shell .structure-panel { border: 0; border-radius: 0; box-shadow: none; }
.outlook-folders { padding: 14px 8px 18px; background: #f2f0f8; border-right: 1px solid #ded9eb !important; color: var(--ink); }
.outlook-shell > .outlook-folders { position: static; top: auto; height: 100%; display: block; overflow: auto; }
.outlook-pane-title { min-height: 32px; margin: 0 4px 5px; padding: 0 4px; display: flex; align-items: center; gap: 7px; color: #302d4a; }
.outlook-pane-title strong { min-width: 0; overflow: hidden; color: inherit; font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.outlook-pane-title button { width: 16px; min-width: 16px; min-height: 0; height: 20px; padding: 0; border: 0; background: transparent; box-shadow: none; color: #77718d; font-size: 15px; line-height: 1; }
#agenda-pane-toggle { margin-left: auto; width: 28px; min-width: 28px; height: 28px; border: 1px solid #4542b5; border-radius: 8px; background: #5856d6; color: #fff; box-shadow: 0 3px 10px #4542b538; font-size: 16px; font-weight: 800; }
#agenda-pane-toggle:hover { border-color: #3734a5; background: #4542b5; color: #fff; box-shadow: 0 4px 14px #4542b550; }
#agenda-pane-toggle:focus-visible { outline: 3px solid #ffcfb5; outline-offset: 2px; }
.agenda-pane-collapsed .outlook-folders { padding: 14px 5px; }
.agenda-pane-collapsed .outlook-pane-title { margin: 0; padding: 0; justify-content: center; }
.agenda-pane-collapsed #agenda-root-toggle,
.agenda-pane-collapsed #agenda-root-title,
.agenda-pane-collapsed .agenda-tree,
.agenda-pane-collapsed .outlook-status-section,
.agenda-pane-collapsed .agenda-section-label,
.agenda-pane-collapsed .agenda-trash,
.agenda-pane-collapsed .outlook-saved-searches { display: none; }
.agenda-pane-collapsed #agenda-pane-toggle { margin: 0; width: 28px; min-width: 28px; height: 30px; background: #5856d6; }
.agenda-tree ul { padding-left: 9px; }
.outlook-status-section { margin: 1px 0 10px; padding-bottom: 9px; border-bottom: 1px solid #d9d5e4; }
.outlook-section-label { display: block; padding: 4px 9px 5px; color: #80798f; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.agenda-section-label { padding-top: 1px; }
.processing-folders { display: grid; gap: 1px; }
.processing-folder { width: 100%; min-height: 25px; padding: 2px 8px; border: 0; border-radius: 13px; display: grid; grid-template-columns: 17px minmax(0, 1fr) auto; gap: 6px; align-items: center; background: transparent; box-shadow: none; color: #59546c; text-align: left; }
.processing-folder:hover { background: #e6e2f3; color: #35304f; }
.processing-folder.selected { background: #5856d6; color: #fff; box-shadow: inset 3px 0 0 var(--apricot); }
.processing-folder strong { overflow: hidden; color: inherit; font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.processing-folder-icon { color: #79728e; font-size: 13px; text-align: center; }
.processing-folder.selected .processing-folder-icon { color: #ffd0b6; }
.processing-folder.selected .structure-count { color: #ffd0b6; }
.structure-drop-overlay { position: absolute; z-index: 80; inset: 54px 0 0; padding: 22px; background: #eeebfff0; backdrop-filter: blur(4px); }
.structure-drop-overlay[hidden] { display: none; }
.structure-drop-overlay > div { width: 100%; height: 100%; border: 2px dashed #5856d6; border-radius: 18px; display: grid; place-content: center; justify-items: center; gap: 6px; color: #4542b5; }
.structure-drop-overlay strong { font-size: 24px; }
.structure-drop-overlay span { color: #69627c; font-size: 13px; }
.structure-detail-overlay { position: absolute; z-index: 70; inset: 54px 0 0; overflow: auto; background: #f7f7fc; border: 1px solid #dcd8e7; border-radius: 14px; }
.structure-detail-overlay[hidden] { display: none; }
.structure-detail-host { min-height: 100%; padding: 10px 14px 24px; }
.structure-detail-host #detail { margin: 0; }
.structure-detail-host .detail-header { position: sticky; z-index: 15; top: -10px; margin: -10px -14px 10px; padding: 10px 14px; background: #fff; border-bottom: 1px solid #ded9eb; box-shadow: 0 5px 18px #30295212; }
.structure-detail-host .split { align-items: start; }
.agenda-tree .structure-node { margin: 0; }
.agenda-tree .structure-node > ul { margin-left: 5px; border-left: 0; }
.agenda-tree .structure-node > small { display: none; }
.agenda-tree .structure-node-heading { cursor: pointer; border-radius: 13px; padding: 2px 8px 2px 2px; display: flex; align-items: center; gap: 7px; min-height: 25px; color: #59546c; }
.agenda-tree .structure-node-heading:hover { background: #e6e2f3; color: #35304f; }
.agenda-tree .structure-node-heading.selected { background: #5856d6; color: #fff; box-shadow: inset 3px 0 0 var(--apricot); }
.agenda-tree .structure-node-heading strong { min-width: 0; color: inherit; font-size: 12px; line-height: 1.2; font-weight: 450; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-routing-summary { display: block; margin: 1px 8px 6px 31px; color: #716a80; font-size: 9px; line-height: 1.35; }
.agenda-routing-summary strong { color: #514a68; font-weight: 750; }
.folder-icon { width: 15px; height: 11px; position: relative; flex: 0 0 auto; border: 1px solid currentColor; border-radius: 2px; background: transparent; color: #77718d; }
.folder-icon::before { content: ""; position: absolute; left: 1px; top: -4px; width: 7px; height: 4px; border: 1px solid currentColor; border-bottom: 0; border-radius: 2px 2px 0 0; background: #f2f0f8; }
.structure-node-heading:hover .folder-icon::before { background: #e6e2f3; }
.structure-node-heading.selected .folder-icon { color: var(--apricot); }
.structure-node-heading.selected .folder-icon::before { background: #5856d6; }
.tree-disclosure { width: 15px; min-width: 15px; min-height: 0; height: 18px; padding: 0; border: 0; background: transparent !important; color: #77718d; box-shadow: none; font-size: 14px; font-weight: 400; line-height: 1; }
.structure-node-heading.selected .tree-disclosure { color: #fff; }
.tree-disclosure:disabled { opacity: 0; }
.structure-count { margin-left: auto; min-width: 20px; padding: 0 3px; border-radius: 0; background: transparent; color: #5856d6; text-align: right; font-size: 10px; line-height: 16px; font-weight: 700; }
.structure-node-heading.selected .structure-count { background: transparent; color: #ffd0b6; }
.agenda-tree .draggable-agenda { cursor: grab; }
.agenda-tree .draggable-agenda.dragging { opacity: .45; }
.agenda-tree .structure-node-heading.agenda-drop-target { outline: 2px solid #5856d6; outline-offset: -1px; background: #e6e2ff; color: #3f36a3; }
.folder-delete { display: none; width: 18px; min-width: 18px; min-height: 0; height: 18px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: currentColor; box-shadow: none; font-size: 16px; line-height: 1; }
.draggable-agenda:hover .folder-delete, .folder-delete:focus-visible { display: inline-grid; place-items: center; }
.folder-routing-edit { display: none; width: 20px; min-width: 20px; min-height: 0; height: 20px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #635b79; box-shadow: none; font-size: 12px; line-height: 1; }
.draggable-agenda:hover .folder-routing-edit, .folder-routing-edit:focus-visible { display: inline-grid; place-items: center; }
.folder-routing-edit:hover { background: #ded9f0; color: #4542b5; }
.agenda-trash { margin: 18px 4px 0; padding: 8px 7px; border: 1px dashed #c8c2d8; border-radius: 9px; display: grid; grid-template-columns: 20px 1fr; gap: 1px 7px; align-items: center; color: #625d76; transition: background 150ms, border-color 150ms, color 150ms; }
.agenda-trash .trash-icon { grid-row: 1 / 3; font-size: 18px; }
.agenda-trash strong { font-size: 12px; }
.agenda-trash small { color: #8b8598; font-size: 9px; }
.agenda-trash.drag-over { border-color: #5856d6; background: #e6e2ff; color: #3f36a3; }
.outlook-saved-searches { margin: 22px 4px 0; padding: 8px 4px; border-top: 1px solid #d5d0e2; color: #3f3a55; font-size: 13px; }
.outlook-saved-searches > div:first-child { display: flex; align-items: center; gap: 8px; }
.outlook-saved-searches span { color: #77718d; font-size: 17px; font-weight: 300; }
#saved-search-list { margin-top: 5px; display: grid; gap: 1px; }
#saved-search-list button { min-height: 27px; padding: 4px 8px 4px 25px; border: 0; border-radius: 5px; background: transparent; color: #5d576c; box-shadow: none; text-align: left; font-size: 11px; }
#saved-search-list button:hover, #saved-search-list button.selected { background: #e9e5f6; color: #332e50; }
.structure-documents { min-height: 0; height: 100%; padding: 0 !important; overflow: hidden; }
.outlook-list-heading { height: 78px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e4e1ea; }
.outlook-list-heading h2 { margin: 0 0 3px; font-size: 20px; }
.outlook-list-heading p { margin: 0; font-size: 12px; color: #797382; }
.outlook-total { color: #817a8d; font-size: 13px; }
.outlook-column-head, .agenda-document-row { display: grid; grid-template-columns: minmax(260px, 1fr) 130px 130px 115px; gap: 16px; align-items: center; }
.outlook-column-head { padding: 9px 18px; background: #faf9fc; border-bottom: 1px solid #e9e6ee; color: #7f788b; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.outlook-messages { border-right: 1px solid #ded9eb !important; }
.outlook-messages .outlook-list-heading { height: 62px; padding: 0 14px; }
.outlook-messages .outlook-list-heading h2 { font-size: 17px; }
.outlook-messages .outlook-column-head { display: none; }
#agenda-document-list { display: block; height: calc(100% - 62px); margin: 0; overflow: auto; }
.agenda-document-row { width: 100%; text-align: left; padding: 13px 18px; background: #fff; color: inherit; border: 0; border-bottom: 1px solid #ece9f0; border-radius: 0; box-shadow: none; }
.agenda-document-row:hover { background: #f4f1ff; }
.outlook-messages .agenda-document-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 8px 12px; min-height: 58px; cursor: pointer; }
.outlook-messages .agenda-document-row.selected { background: #eeebff; box-shadow: inset 3px 0 0 #5856d6; }
.outlook-messages .agenda-document-row .badge { padding: 3px 6px; font-size: 9px; }
.outlook-row-actions { align-self: center; display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.outlook-open-document { min-height: 25px; padding: 3px 7px; border: 1px solid #d4cfea; border-radius: 7px; background: #fff; box-shadow: none; color: #4542b5; font-size: 9px; font-weight: 700; }
.outlook-open-document:hover { border-color: #5856d6; background: #f2efff; }
.outlook-related-document { width: calc(100% - 28px); min-height: 30px; margin: -1px 10px 0 18px; padding: 5px 9px 6px 15px; display: grid; grid-template-columns: 16px minmax(0, auto) minmax(0, 1fr) auto; gap: 6px; align-items: center; border: 0; border-bottom: 1px solid #ece9f0; border-radius: 0; background: #fbfaff; box-shadow: none; color: #625b73; text-align: left; cursor: pointer; }
.outlook-related-document:hover { background: #f1edff; color: #3f3aa8; }
.outlook-related-document.selected { background: #ece8ff; box-shadow: inset 3px 0 0 #f18452; }
.outlook-related-document[aria-busy="true"] { opacity: .65; cursor: wait; }
.outlook-related-document small { color: #81798d; font-size: 9px; white-space: nowrap; }
.outlook-related-document strong { min-width: 0; color: #48425b; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.outlook-related-icon { color: #f18452; font-size: 14px; font-weight: 800; }
.outlook-related-open { color: #5550bd; font-size: 9px; font-weight: 750; white-space: nowrap; }
.outlook-related-document:focus-visible { outline: 2px solid #5856d6; outline-offset: -2px; }

/* Conversational assistant: intentionally resembles a working notebook, not a generic chat bubble. */
.assistant-launcher { position: fixed; right: 0; top: 50%; z-index: 80; width: 38px; min-height: 108px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,.18); border-right: 0; border-radius: 12px 0 0 12px; background: #29254f; color: #fff; box-shadow: -8px 8px 26px rgba(41,37,79,.24); font-weight: 750; transform: translateY(-50%); }
.assistant-launcher:hover { transform: translateY(-50%) translateX(-2px); background: #393370; }
.assistant-launcher span:last-child { writing-mode: vertical-rl; letter-spacing: .04em; }
.assistant-launcher-mark { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: #f28b55; color: #29254f; font-size: 14px; }
.assistant-panel { position: fixed; right: 18px; bottom: 18px; z-index: 90; width: min(410px, calc(100vw - 24px)); height: min(680px, calc(100vh - 36px)); grid-template-rows: auto auto minmax(0, 1fr) auto auto; border: 1px solid #dcd6e8; border-radius: 18px; background: #fbf8f3; box-shadow: 0 28px 80px rgba(31,27,65,.32); overflow: hidden; }
.assistant-panel:not([hidden]) { display: grid; animation: assistant-in .24s ease-out; }
.assistant-header { padding: 19px 20px 15px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid #e4ded7; background: linear-gradient(130deg,#fffaf4,#f0ecff); }
.assistant-header .eyebrow { display: block; margin: 0 0 3px; color: #f18452; font-size: 9px; }
.assistant-header h2 { margin: 0; color: #29254f; font-size: 21px; }
.assistant-close { width: 32px; min-height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #716a7e; box-shadow: none; font-size: 24px; }
.assistant-close:hover { background: #e8e3f1; }
.assistant-context { margin: 0; padding: 8px 20px; border-bottom: 1px solid #ebe6df; color: #777080; font-size: 10px; }
.assistant-messages { min-height: 0; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.assistant-message { max-width: 90%; padding: 10px 12px; border-radius: 12px; color: #413b4d; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.assistant-message.user { align-self: flex-end; border-bottom-right-radius: 3px; background: #e9e5ff; }
.assistant-message.assistant { align-self: flex-start; border: 1px solid #e5ded7; border-bottom-left-radius: 3px; background: #fff; }
.assistant-message.thinking { color: #766f80; font-style: italic; }
.assistant-proposal { width: 100%; margin-top: 10px; padding-top: 9px; display: grid; gap: 6px; border-top: 1px solid #ece6df; }
.assistant-proposal span { color: #5c5568; font-size: 11px; }
.assistant-proposal button { min-height: 32px; padding: 6px 10px; border-radius: 7px; background: #29254f; font-size: 11px; }
.assistant-proposal.destructive { border-top-color: #e6b9ad; }
.assistant-proposal.destructive .assistant-choice-row button:first-child { background: #a84135; }
.assistant-choice-row,.assistant-quick-replies { display: flex; flex-wrap: wrap; gap: 7px; }
.assistant-choice-row button { flex: 1 1 110px; }
.assistant-choice-row button.secondary { border: 1px solid #d9d2e4; background: #fff; color: #5b5469; }
.assistant-action-result { width: 100%; padding: 8px 10px; border-radius: 8px; background: #ece9f5; color: #514a68; font-size: 11px; font-weight: 750; text-align: center; }
.assistant-quick-replies { width: 100%; margin-top: 10px; padding-top: 9px; border-top: 1px solid #ece6df; }
.assistant-quick-replies button { min-height: 30px; padding: 5px 11px; border: 1px solid #cfc7e1; border-radius: 999px; background: #fff; color: #4e4770; box-shadow: none; font-size: 11px; }
.assistant-quick-replies button:hover { border-color: #6b62c7; background: #f1eeff; }
.assistant-command-history { margin: 0 14px 9px; border: 1px solid #e2dce8; border-radius: 9px; background: #fff; overflow: hidden; }
.assistant-command-history summary { padding: 7px 10px; display: flex; justify-content: space-between; cursor: pointer; color: #686173; font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.assistant-command-history summary::marker { content: ""; }
.assistant-command-history summary span { color: #938ba0; }
#assistant-command-list { max-height: 122px; padding: 2px 5px 5px; display: grid; gap: 2px; overflow: auto; }
.assistant-command-row { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) 28px; gap: 3px; }
.assistant-command-load, .assistant-command-repeat { min-height: 28px; padding: 4px 7px; border: 0; border-radius: 6px; background: transparent; box-shadow: none; color: #514b5e; font-size: 10px; }
.assistant-command-load { overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.assistant-command-repeat { padding: 0; color: #5953bd; font-size: 15px; }
.assistant-command-load:hover, .assistant-command-repeat:hover { background: #f0edff; }
.assistant-form { padding: 12px 14px 13px; border-top: 1px solid #dfd9d2; background: #fff; }
.assistant-form label { margin: 0 0 5px 3px; color: #716a78; font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.assistant-form > div { display: grid; grid-template-columns: 1fr 39px; gap: 7px; align-items: end; }
.assistant-form textarea { min-height: 48px; max-height: 120px; margin: 0; padding: 10px 11px; resize: vertical; border-radius: 10px; font-size: 12px; }
.assistant-form button { width: 39px; min-height: 39px; padding: 0; border-radius: 50%; background: #f18452; color: #29254f; font-size: 18px; }
.assistant-form small { display: block; margin: 6px 3px 0; color: #8a8390; font-size: 9px; }
.automation-layout { margin-top: 24px; min-height: 520px; display: grid; grid-template-columns: 290px minmax(0,1fr); border: 1px solid #ded8e7; border-radius: 14px; background: #fff; overflow: hidden; }
.automation-list-panel { padding: 0; border-right: 1px solid #e3deea; background: #f8f6fb; }
.automation-list-heading { padding: 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e3deea; }
.automation-list-heading button { min-height: 30px; padding: 5px 9px; font-size: 10px; }
#new-automation.secondary { border: 1px solid #4f49b8; background: #5856d6; color: #fff; box-shadow: 0 3px 9px rgba(74,68,176,.18); font-weight: 750; }
#new-automation.secondary:hover { border-color: #39358e; background: #4542b5; color: #fff; }
#new-automation.secondary:focus-visible { outline-color: #f18452; }
#automation-list { display: grid; }
.automation-list-item { padding: 12px 14px; border: 0; border-bottom: 1px solid #e8e3ed; border-radius: 0; background: transparent; box-shadow: none; color: #423c51; text-align: left; }
.automation-list-item:hover, .automation-list-item.active { background: #eeeaff; box-shadow: inset 3px 0 0 #5856d6; }
.automation-list-item strong, .automation-list-item small { display: block; }
.automation-list-item small { margin-top: 3px; color: #847d90; font-size: 9px; }
.automation-empty { padding: 22px 14px; color: #81798c; font-size: 11px; }
.automation-editor { padding: 28px; }
.automation-editor label { margin-top: 17px; }
.automation-editor textarea { resize: vertical; }
.automation-examples { margin: 13px 0 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.automation-examples small { width: 100%; color: #817a8d; }
.automation-examples button { min-height: 29px; padding: 5px 8px; border: 1px solid #ddd7e7; border-radius: 14px; background: #faf8fd; box-shadow: none; color: #5d566b; font-size: 9px; }
@media (max-width: 760px) { .automation-layout { grid-template-columns: 1fr; } .automation-list-panel { border-right: 0; border-bottom: 1px solid #e3deea; } }
@keyframes assistant-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@media (max-width: 1000px) { #portal.assistant-docked { padding-right: 0; } }
@media (max-width: 600px) { .assistant-launcher { right: 12px; top: auto; bottom: 12px; width: auto; min-height: 44px; padding: 8px 13px 8px 8px; flex-direction: row; border-right: 1px solid rgba(255,255,255,.18); border-radius: 24px; transform: none; } .assistant-launcher:hover { transform: translateY(-2px); } .assistant-launcher span:last-child { writing-mode: horizontal-tb; } .assistant-panel { inset: 8px; width: auto; height: auto; border-radius: 14px; } }
@media (prefers-reduced-motion: reduce) { .assistant-panel:not([hidden]) { animation: none; } .assistant-launcher:hover { transform: none; } }
.outlook-messages .agenda-document-row .outlook-amount { grid-column: 1; font-size: 11px; font-weight: 650; }
.outlook-messages .agenda-document-row .outlook-date { grid-column: 2; grid-row: 2; justify-self: end; font-size: 10px; }
.agenda-document-row > span:first-child { display: grid; gap: 3px; min-width: 0; }
.agenda-document-row small { color: #716b80; overflow: hidden; text-overflow: ellipsis; }
.outlook-amount, .outlook-date { color: #514b5d; font-size: 13px; }
.outlook-reader { min-width: 0; min-height: 0; height: 100%; padding: 0 !important; background: #f8f7fb !important; overflow: hidden; }
.outlook-preview-empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: 7px; color: #77718d; }
.outlook-preview-empty[hidden], #agenda-preview[hidden] { display: none; }
.outlook-preview-symbol { font-size: 42px; color: #c9c4dd; }
.outlook-preview-empty small { color: #938da2; }
#agenda-preview { height: 100%; }
.outlook-preview-header { height: 62px; padding: 8px 14px; border-bottom: 1px solid #ded9eb; background: #fff; }
.outlook-preview-header h2 { margin: 0 0 2px; font-size: 15px; }
.outlook-preview-header p { margin: 0; color: #77718d; font-size: 11px; }
.outlook-preview-header button { min-height: 30px; padding: 5px 9px; font-size: 11px; }
.agenda-package-nav { height: 66px; padding: 6px 9px; border-bottom: 1px solid #ded9eb; display: grid; grid-template-columns: 28px auto 28px minmax(0, 1fr); gap: 6px; align-items: center; background: #f7f5fc; }
.agenda-package-nav[hidden] { display: none; }
.agenda-package-nav[aria-busy="true"] { opacity: .68; }
.package-nav-arrow { min-height: 28px; width: 28px; padding: 0; font-size: 19px; }
.package-position { color: #625c72; font-size: 10px; font-weight: 750; white-space: nowrap; }
.package-member-list { min-width: 0; display: flex; gap: 5px; overflow-x: auto; scrollbar-width: thin; }
.package-member-item { flex: 0 0 auto; padding: 2px; border: 1px solid #d9d4e8; border-radius: 9px; display: flex; gap: 2px; background: #fff; box-shadow: 2px 2px 0 #e7e2f1; }
.package-member-item.active { border-color: #5856d6; background: #eeebff; box-shadow: 3px 3px 0 #d8d1f2; }
.package-member-select, .package-member-open { min-height: 28px; padding: 4px 7px; border: 0; background: transparent; box-shadow: none; color: #514b63; font-size: 9px; }
.package-member-select { font-weight: 750; }
.package-member-open { border-left: 1px solid #ded9eb; color: #4542b5; }
.package-preview .agenda-preview-body { height: calc(100% - 128px); }
.package-preview .agenda-document-pane { position: relative; margin: 8px 8px 8px 4px; border: 1px solid #d4cede; border-radius: 7px; background: #fff; box-shadow: 5px 5px 0 #e6e1ee, 10px 10px 0 #f0edf5; overflow: hidden; }
.package-row { position: relative; }
.package-row::after { content: ""; position: absolute; right: 7px; bottom: 5px; width: 20px; height: 3px; border-radius: 4px; background: #d5cfea; box-shadow: 0 3px 0 #ebe7f3; }
.agenda-preview-body { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 5px 250px; height: calc(100% - 62px); min-height: 0; }
.inner-resizer { grid-column: 2; }
.agenda-document-pane { min-width: 0; min-height: 0; border-right: 1px solid #d8d4e1; }
.agenda-extraction-pane { position: relative; top: auto; width: auto; height: auto; min-width: 0; padding: 0; display: block; overflow: auto; border: 0; background: #fff; }
.agenda-extraction-title { position: sticky; top: 0; z-index: 2; padding: 9px 10px; border-bottom: 1px solid #e4e0e9; display: grid; gap: 1px; background: #faf9fc; }
.agenda-extraction-title strong { font-size: 12px; }
.agenda-extraction-title small { color: #8a8497; font-size: 9px; }
#agenda-extraction-fields { padding: 4px 0; }
.agenda-extraction-section { margin: 7px 9px 3px; padding-top: 7px; border-top: 1px solid #ebe8f0; color: #514b62; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.agenda-extraction-row { width: 100%; min-height: 0; padding: 5px 9px; border: 0; border-radius: 0; display: grid; grid-template-columns: 42% 58%; gap: 6px; background: transparent; box-shadow: none; color: #383348; text-align: left; }
.agenda-extraction-row:hover { background: #f1eff9; }
.agenda-extraction-row.selected { background: #e8e4ff; box-shadow: inset -3px 0 0 #5856d6; }
.agenda-extraction-row span { color: #77718d; font-size: 9px; line-height: 1.25; }
.agenda-extraction-row strong { overflow-wrap: anywhere; font-size: 10px; line-height: 1.25; font-weight: 650; }
#agenda-source-link { position: absolute; inset: 0; z-index: 5; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
#agenda-source-link path { fill: none; stroke: #ff8b52; stroke-width: 2; marker-end: url(#agenda-arrow-head); }
#agenda-arrow-head path { fill: #ff8b52; stroke: none; }
#agenda-source-lines { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
#agenda-source-lines[hidden] { display: none; }
.agenda-source-line { position: absolute; height: 3px; border-radius: 2px; background: #ff6f32; box-shadow: 0 0 0 1px #fff8; transform-origin: 0 50%; }
.agenda-source-line::after { content: ""; position: absolute; right: -1px; top: 50%; width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 10px solid #ff6f32; transform: translateY(-50%); }
.agenda-image-toolbar { height: 38px; padding: 4px 10px; border-bottom: 1px solid #ded9eb; display: flex; align-items: center; justify-content: center; gap: 6px; background: #fff; }
.agenda-image-toolbar[hidden] { display: none; }
.agenda-image-toolbar button { min-width: 30px; min-height: 28px; height: 28px; padding: 3px 8px; font-size: 11px; }
#agenda-zoom-label { min-width: 48px; color: #514b5d; text-align: center; font-size: 11px; font-variant-numeric: tabular-nums; }
.agenda-image-viewport { width: 100%; height: calc(100% - 38px); overflow: hidden; background: #f7f5f1; cursor: default; overscroll-behavior: contain; user-select: none; }
.agenda-image-viewport.zoomed { overflow: auto; cursor: grab; }
.agenda-image-viewport.dragging { cursor: grabbing; }
.agenda-image-viewport[hidden] { display: none; }
.agenda-image-stage { display: grid; place-items: start center; min-width: 100%; min-height: 100%; }
.agenda-image-picture { position: relative; flex: 0 0 auto; }
#agenda-preview-image { display: block; max-width: none; max-height: none; background: #fff; box-shadow: 0 5px 24px #27233b30; -webkit-user-drag: none; user-select: none; }
#agenda-preview-image.preview-failed, #preview img.preview-failed { min-width: 220px; min-height: 300px; border: 1px dashed #d7cfdf; background: #faf8f5; }
#agenda-source-overlay { position: absolute; inset: 0; pointer-events: none; }
.agenda-source-box { position: absolute; border: 2px solid #ff8b52; border-radius: 3px; background: #ffb38a35; box-shadow: 0 0 0 2px #fff8; }
#agenda-preview-frame { display: block; width: 100%; height: 100%; border: 0; background: #e9e7ee; }
#agenda-preview-frame[hidden] { display: none; }
.structure-types { margin-top: 18px; }
.structure-types > summary { cursor: pointer; font-size: 18px; font-weight: 700; }
.outlook-settings { box-shadow: none; border-color: #e3dfea; }
.settings-drawer { position: fixed; z-index: 1200; top: 64px; right: 18px; bottom: 18px; width: min(520px, calc(100vw - 36px)); margin: 0; overflow: auto; border-radius: 14px; box-shadow: 0 20px 70px #28204038; }
.settings-drawer[hidden] { display: none; }
.settings-drawer-heading, .settings-drawer-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.settings-drawer-heading { margin-bottom: 16px; }
.settings-drawer-heading h2 { margin: 0; }
.settings-drawer-close { min-height: 30px; padding: 5px 9px; font-size: 11px; }
.settings-drawer.distribution-editor { margin: 0; }
#distribution-settings-panel.routing-workspace { inset: 0; width: 100vw; max-width: none; height: 100vh; height: 100dvh; padding: 24px 28px; border: 0; border-radius: 0; background: #f8f7fb; }
#distribution-settings-panel.routing-workspace .structure-prompt-heading { position: sticky; top: -24px; z-index: 20; margin: -24px -28px 18px; padding: 18px 28px 14px; border-bottom: 1px solid #ddd8e8; background: rgba(248,247,251,.96); backdrop-filter: blur(12px); }
#distribution-settings-panel.routing-workspace #distribution-prompt { min-height: 125px; max-height: 210px; resize: vertical; }
#distribution-settings-panel.routing-workspace .routing-flow-view { min-height: 440px; height: calc(100dvh - 390px); }
#distribution-settings-panel.routing-workspace .routing-flow-canvas { min-height: 100%; }
#distribution-settings-panel.routing-workspace .routing-table-view { max-height: calc(100dvh - 340px); }
#distribution-settings-panel.routing-workspace .settings-drawer-close { min-width: 90px; }
.routing-prompt-intro { margin: 10px 0 8px; display: grid; gap: 4px; }
.routing-prompt-intro strong { color: #393247; font-size: 14px; }
.routing-prompt-intro span { color: #756e80; font-size: 10px; }
.structure-node { position: relative; margin: 7px 0; }
.structure-node > ul { margin-left: 7px; border-left: 1px solid #ded9eb; }
.structure-node-heading { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 6px 8px; border-radius: 8px; }
.structure-node-heading:hover { background: #f6f4fc; }
.structure-node-heading strong { color: var(--ink); }
.structure-node-heading code { margin-left: auto; color: #777188; font-size: 10px; }
.structure-node > small { display: block; margin: 0 8px 8px; color: var(--muted); }
.structure-direction { padding: 3px 6px; border-radius: 999px; background: var(--apricot-soft); color: #8d4e2d; font-size: 10px; }
.distribution-editor { margin-top: 18px; }
.structure-prompt-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.structure-prompt-heading h2 { margin: 5px 0; }
.system-prompt-details { margin-top: 22px; padding-top: 16px; border-top: 1px solid #e3dfed; }
.system-prompt-details summary { cursor: pointer; color: #5145cd; font-weight: 700; }
.system-prompt-details pre { max-height: 340px; overflow: auto; padding: 16px; border: 1px solid #dcd7ea; border-radius: 10px; background: #27243f; color: #f3f1ff; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.global-normalizations { display: grid; gap: 10px; }
.routing-view-tabs { margin: 18px 0 8px; display: flex; justify-content: space-between; gap: 12px; }
.routing-view-tabs > div { display: flex; gap: 5px; }
.routing-view-tabs button { min-height: 31px; padding: 5px 11px; border: 1px solid #d8d2e5; background: #fff; color: #5c5570; box-shadow: none; font-size: 10px; }
.routing-view-tabs button.active { border-color: #5856d6; background: #eeebff; color: #403ba2; }
.routing-validation { margin: 14px 0; padding: 10px 12px; border: 1px solid #e0b989; border-radius: 9px; background: #fff8e8; }
.routing-validation.invalid { border-color: #dca99f; background: #fff0ed; }
.routing-validation p { margin: 2px 0; color: #704b38; font-size: 10px; }
.routing-flow-workbench { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 10px; min-height: 440px; height: calc(100dvh - 390px); }
.routing-flow-workbench.prompt-mode { grid-template-columns: minmax(0,1fr); }
.routing-flow-workbench.prompt-mode .routing-node { cursor: default; }
.routing-palette { min-height: 0; padding: 13px; overflow: auto; border: 1px solid #dfd9e9; border-radius: 12px; background: #fff; }
.routing-palette > div:first-child { display: grid; gap: 3px; margin-bottom: 10px; }
.routing-palette-item { width: 100%; min-height: 48px; margin: 0 0 7px; padding: 8px 9px; display: flex; align-items: center; gap: 9px; border: 1px solid #ded8e8; background: #faf9fd; color: #4b445b; box-shadow: none; text-align: left; cursor: grab; }
.routing-palette-item > span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: #eeeaff; color: #4f48b6; font-weight: 800; }
.routing-palette-item div { display: grid; gap: 2px; }
.routing-palette-item strong { font-size: 10px; }
.routing-palette-item small { color: #817a8d; font-size: 8px; }
.routing-palette-heading { margin: 14px 2px 7px; color: #777083; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.routing-palette-targets { display: grid; gap: 4px; max-height: 190px; overflow: auto; }
.routing-target-item { width: 100%; min-height: 31px; padding: 5px 8px; display: flex; align-items: center; gap: 7px; border: 1px solid transparent; background: #f7f5fa; color: #554e62; box-shadow: none; font-size: 9px; text-align: left; cursor: grab; }
.routing-target-item::before { content: "▱"; color: #645bc4; font-size: 13px; }
.routing-inspector { margin-top: 14px; padding-top: 12px; border-top: 1px solid #e7e2ed; }
.routing-inspector > small { color: #817a8d; font-size: 9px; line-height: 1.45; }
.routing-inspector h3 { margin: 0 0 9px; font-size: 12px; }
.routing-inspector label { margin: 6px 0; display: grid; gap: 3px; color: #777083; font-size: 8px; font-weight: 700; }
.routing-inspector input,.routing-inspector select { width: 100%; min-height: 31px; padding: 5px 7px; font-size: 9px; }
.routing-condition-card { margin: 7px 0; padding: 7px; border: 1px solid #e0dbe8; border-radius: 8px; background: #faf9fc; }
.routing-condition-card header { display: flex; justify-content: space-between; align-items: center; }
.routing-condition-card header strong { color: #6d6579; font-size: 8px; }
.routing-condition-card header button { min-width: 24px; min-height: 24px; padding: 2px; box-shadow: none; }
.routing-condition-actions { display: flex; gap: 5px; margin-top: 7px; }
.routing-condition-actions button { min-height: 29px; padding: 4px 7px; font-size: 8px; }
.routing-flow-view { position: relative; min-height: 340px; padding: 22px; overflow: auto; border: 1px solid #dfd9e9; border-radius: 12px; background: radial-gradient(circle at 1px 1px,#ddd8e8 1px,transparent 1px) 0 0/18px 18px,#faf9fd; }
#routing-flow-lines { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.routing-flow-line { fill: none; stroke: #8176c9; stroke-width: 2; }
.routing-flow-canvas { position: relative; z-index: 2; min-width: 900px; min-height: 600px; }
.routing-node { position: absolute; width: 210px; padding: 11px 13px; border: 1px solid #d5cee4; border-radius: 11px; background: #fff; box-shadow: 4px 5px 0 #ebe7f2; color: #494259; cursor: grab; touch-action: none; user-select: none; }
.routing-node.dragging { cursor: grabbing; box-shadow: 8px 10px 24px rgba(45,38,80,.2); }
.routing-node.selected { outline: 3px solid #b8b1ff; outline-offset: 2px; }
.routing-node.drop-target { outline: 3px solid #f4a47c; outline-offset: 2px; }
.routing-node.rule { border-left: 4px solid #f18452; }
.routing-node.target { border-left: 4px solid #5856d6; }
.routing-node.source { border-left: 4px solid #6b9a81; }
.routing-node small,.routing-node strong,.routing-node span { display: block; }
.routing-node small { margin-bottom: 3px; color: #80778c; font-size: 8px; letter-spacing: .05em; }
.routing-node strong { font-size: 11px; }
.routing-node span { margin-top: 5px; color: #716a7e; font-size: 9px; line-height: 1.4; }
@media (max-width: 900px) { .routing-flow-workbench { grid-template-columns: 190px minmax(0,1fr); } }
.routing-table-view { max-width: 100%; overflow: auto; border: 1px solid #dfd9e9; border-radius: 10px; }
.routing-table-view table { width: 100%; border-collapse: collapse; }
.routing-table-view th { padding: 7px; background: #f4f1f8; color: #6a6276; font-size: 8px; text-align: left; white-space: nowrap; }
.routing-table-view td { padding: 5px; border-top: 1px solid #ebe7f0; }
.routing-table-view input,.routing-table-view select { min-width: 105px; min-height: 30px; padding: 5px 7px; font-size: 9px; }
.routing-table-view input[type="checkbox"] { min-width: 18px; }
.routing-rule-remove { width: 25px; min-width: 25px; min-height: 25px; padding: 0; border: 0; background: transparent; color: #9a5148; box-shadow: none; font-size: 16px; }
.routing-empty { padding: 20px; border: 1px dashed #cfc7dc; border-radius: 10px; text-align: center; }
.normalization-card { padding: 14px 16px; border: 1px solid #ded9eb; border-left: 4px solid var(--apricot); border-radius: 10px; background: #faf9fd; }
.normalization-card strong, .normalization-card span { display: block; }
.normalization-card span { margin-top: 4px; color: var(--muted); font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.normalization-card p { margin: 8px 0 0; }
@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
  #auth::before { animation: none; }
}
@media (max-width: 650px) {
  .onboarding-kind { grid-template-columns: 1fr; }
  .people-header { display: grid; }
  .people-header > button { width: 100%; }
  .people-form-grid { grid-template-columns: 1fr; }
  .people-notes { grid-column: auto; }
  .contact-method-row { grid-template-columns: 1fr; padding: 12px; border: 1px solid #e3dfed; border-radius: 10px; }
  .contact-method-row button { justify-self: start; }
  .people-form-actions { flex-direction: column; align-items: stretch; }
  .person-heading { display: grid; }
  .people-status { justify-self: start; }
  .person-access-summary { display: grid; gap: 3px; }
  .people-toolbar { align-items: flex-start; }
  .people-toolbar-end { align-items: flex-end; flex-direction: column-reverse; }
  .structure-header { display: grid; }
  .structure-header > button { width: 100%; }
  .structure-layout { grid-template-columns: 1fr; }
  .outlook-shell { overflow: visible; }
  .outlook-folders { border-right: 0 !important; border-bottom: 1px solid #dedbe7 !important; }
  .outlook-column-head { display: none; }
  .agenda-document-row { grid-template-columns: minmax(0, 1fr) auto; }
  .agenda-document-row .outlook-amount, .agenda-document-row .outlook-date { grid-column: 1; }
}
.processing-assessment {
  margin: 0.65rem 0 0.9rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--primary, #4458a6) 22%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface, #fff) 92%, var(--primary, #4458a6));
}
.processing-assessment.clear { border-color: rgba(42, 139, 105, 0.38); }
.processing-assessment.ambiguous { border-color: rgba(190, 92, 56, 0.45); }
.processing-assessment-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.assessment-score {
  flex: 0 0 auto;
  padding: 0.15rem 0.48rem;
  border-radius: 999px;
  background: rgba(68, 88, 166, 0.12);
  font-size: 0.78rem;
  font-weight: 700;
}
.processing-assessment p { margin: 0.42rem 0 0; }
.assessment-checks {
  display: grid;
  gap: 0.28rem;
  margin-top: 0.6rem;
}
.assessment-check {
  display: grid;
  grid-template-columns: 1.1rem minmax(7rem, auto) 1fr;
  gap: 0.38rem;
  align-items: baseline;
}
.assessment-check small { opacity: 0.78; }
.assessment-check.ok .assessment-icon { color: #187653; }
.assessment-check.warn .assessment-icon { color: #a55a1d; }
.assessment-check.fail .assessment-icon { color: #b13f38; }
