:root {
  --ink: #18212b;
  --ink-strong: #0d151d;
  --muted: #64707d;
  --faint: #8b96a3;
  --line: #d8dde3;
  --line-strong: #bbc4ce;
  --surface: #ffffff;
  --soft: #f6f8fa;
  --soft-2: #eef5f3;
  --header: #202b37;
  --header-2: #17222e;
  --teal: #009879;
  --teal-dark: #007961;
  --teal-soft: #e3f4ef;
  --brass: #c9973f;
  --danger: #b84444;
  --warning: #b1780d;
  --radius: 8px;
  --shadow: 0 18px 46px rgba(24, 33, 43, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #f3f6f8;
  font-family: Inter, "Avenir Next", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 56px minmax(0, 1fr) auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 18px;
  background: linear-gradient(180deg, var(--header), var(--header-2));
  color: #f8fafc;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-mark {
  color: var(--brass);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}

.brand-title {
  font-size: 22px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(248, 250, 252, 0.88);
  font-size: 13px;
  white-space: nowrap;
}

.top-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.top-meta svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.save-state.error {
  color: #ffb7b7;
}

.divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.28);
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 310px minmax(500px, 1fr) 480px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.sidebar,
.editor,
.tree-panel {
  min-width: 0;
  min-height: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #fbfcfd;
}

.sidebar-body {
  flex: 1;
  overflow: auto;
  padding: 20px 18px;
}

.sidebar-title,
.tree-title {
  margin: 0;
  color: var(--ink-strong);
  font-size: 18px;
  line-height: 1.25;
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e9ed;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 160ms ease;
}

.department-list {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.department-button {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.department-button:hover .department-index,
.department-button.active .department-index {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.department-index {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  font-size: 12px;
  transition: 160ms ease;
}

.department-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.department-count {
  color: var(--muted);
  font-size: 12px;
}

.department-check {
  color: var(--teal);
}

.ghost-button,
.secondary-button,
.primary-button,
.danger-button,
.icon-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-weight: 650;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease;
}

.ghost-button,
.secondary-button,
.primary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
}

.icon-button {
  width: 38px;
  display: grid;
  place-items: center;
  padding: 0;
}

.ghost-button:hover,
.secondary-button:hover,
.icon-button:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.primary-button {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.danger-button {
  border-color: rgba(184, 68, 68, 0.25);
  color: var(--danger);
}

.danger-button:hover {
  border-color: var(--danger);
  background: #fff4f4;
}

.editor {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #fff;
}

.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 20px 18px;
  border-bottom: 1px solid var(--line);
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 18px;
  font-weight: 750;
}

.crumbs span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crumb-muted {
  color: var(--muted);
  font-weight: 600;
}

.editor-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.form-wrap {
  overflow: auto;
  padding: 22px 20px 92px;
}

.role-actions-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft-2);
}

.role-actions-panel strong,
.role-actions-panel span {
  display: block;
}

.role-actions-panel strong {
  color: var(--ink-strong);
  font-size: 14px;
}

.role-actions-panel span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.role-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field.double {
  grid-column: span 2;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.required::after {
  content: " *";
  color: var(--danger);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd2da;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

input,
select {
  height: 36px;
  padding: 0 11px;
}

textarea {
  min-height: 126px;
  resize: vertical;
  padding: 11px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 152, 121, 0.12);
}

.soft-missing input,
.soft-missing select,
.soft-missing textarea {
  border-color: rgba(177, 120, 13, 0.52);
  background: #fffdf6;
}

.char-count {
  justify-self: end;
  color: var(--faint);
  font-size: 11px;
}

.checkbox-row,
.messenger-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.check-label input {
  width: 15px;
  height: 15px;
}

.tree-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-left: 1px solid var(--line);
  background: #fbfcfd;
}

.tree-head {
  padding: 20px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.tree-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 10px;
  margin-top: 16px;
}

.tree-body {
  overflow: auto;
  padding: 14px 18px 90px;
}

.tree-root,
.tree-children {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tree-children {
  margin-left: 18px;
  padding-left: 15px;
  border-left: 1px solid #c9d1d9;
}

.tree-node {
  margin: 6px 0;
}

.tree-item {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 5px 7px;
  border-radius: 6px;
  color: var(--ink);
}

.tree-item.direct-report {
  background: #fff6df;
  box-shadow: inset 3px 0 0 var(--brass);
}

.tree-item.indirect-report {
  background: #f0f7f5;
  box-shadow: inset 2px 0 0 rgba(0, 152, 121, 0.45);
}

.tree-item:hover {
  background: #eaf4f1;
}

.tree-item.active {
  background: var(--teal-soft);
  box-shadow: inset 3px 0 0 var(--teal);
}

.tree-icon {
  margin-top: 1px;
  color: var(--muted);
}

.tree-label {
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
}

.tree-label strong {
  font-weight: 750;
}

.tree-label span {
  color: var(--muted);
}

.tree-empty {
  margin-top: 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.bottom-bar {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 30px rgba(24, 33, 43, 0.06);
}

.bottom-spacer {
  flex: 1;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.metric {
  min-width: 0;
  padding: 9px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.metric span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric strong {
  display: block;
  margin-top: 3px;
  font-size: 20px;
}

.role-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.role-list-heading {
  display: grid;
  gap: 3px;
  padding: 0 2px;
}

.role-list-heading strong {
  color: var(--ink-strong);
  font-size: 13px;
}

.role-list-heading span {
  color: var(--muted);
  font-size: 12px;
}

.role-tree,
.role-subtree {
  list-style: none;
  margin: 0;
  padding: 0;
}

.role-tree {
  display: grid;
  gap: 8px;
}

.role-subtree {
  margin-left: 17px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.role-branch {
  display: grid;
  gap: 7px;
}

.role-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 10px 10px calc(10px + (var(--level, 0) * 5px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
}

.role-row.active {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.role-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.role-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.role-row em {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--soft-2);
  color: var(--teal-dark);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.subordinate-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.subordinate-panel > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.subordinate-panel strong,
.subordinate-panel span {
  display: block;
}

.subordinate-panel strong {
  color: var(--ink-strong);
  font-size: 14px;
}

.subordinate-panel span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.subordinate-list {
  display: grid;
  gap: 8px;
}

.subordinate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  text-align: left;
}

.subordinate-row:hover,
.subordinate-row.active {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.subordinate-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subordinate-empty {
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--teal);
}

.status-dot.vacant {
  background: var(--warning);
}

.status-dot.missing {
  background: var(--line-strong);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 88px;
  z-index: 20;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--ink-strong);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 13px;
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: 160ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.print-report {
  display: none;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.telephony-app .brand-title {
  font-size: 20px;
}

.telephony-sections {
  gap: 5px;
}

.telephony-sections .department-button {
  min-height: 50px;
}

.telephony-sections .department-name strong,
.telephony-sections .department-name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telephony-sections .department-name strong {
  color: var(--ink);
  font-size: 13px;
}

.telephony-sections .department-name small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.telephony-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.warning-metric strong {
  color: var(--warning);
}

.sidebar-alert {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 18px;
  padding: 11px;
  border: 1px solid rgba(177, 120, 13, 0.35);
  border-radius: var(--radius);
  background: #fffaf0;
  color: #76500a;
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
}

.sidebar-alert svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.sidebar-alert.success {
  border-color: rgba(0, 152, 121, 0.28);
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.telephony-form-wrap {
  padding-bottom: 110px;
}

.telephony-app .editor-head {
  align-items: flex-start;
}

.editor-section-title {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.editor-section-title strong {
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 17px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-section-title span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.section-intro h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 17px;
  line-height: 1.3;
}

.section-intro p {
  max-width: 680px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.entity-strip {
  display: flex;
  gap: 8px;
  margin: 0 0 20px;
  padding: 1px 1px 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.entity-chip {
  flex: 0 0 190px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
}

.entity-chip:hover,
.entity-chip.active {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.entity-chip strong,
.entity-chip span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-chip strong {
  color: var(--ink-strong);
  font-size: 12px;
}

.entity-chip span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.empty-state {
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.empty-state.compact {
  padding: 12px;
  text-align: left;
}

.stage-row {
  padding: 10px 0;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-top: 14px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #eef1f3;
}

.segmented-control button {
  min-width: 0;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.segmented-control button.active {
  background: #fff;
  color: var(--teal-dark);
  box-shadow: 0 1px 3px rgba(24, 33, 43, 0.12);
}

.segmented-control svg {
  width: 16px;
  height: 16px;
}

.telephony-tree-body {
  display: grid;
  align-content: start;
  gap: 18px;
}

.map-section {
  display: grid;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.telephony-right .tree-label strong,
.telephony-right .tree-label span {
  display: block;
}

.map-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.map-heading strong {
  color: var(--ink-strong);
  font-size: 13px;
}

.map-heading span {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.phone-flow {
  display: grid;
  gap: 8px;
}

.flow-node {
  width: 100%;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
}

.flow-node:hover {
  border-color: var(--teal);
}

.flow-node.phone-node {
  border-color: rgba(201, 151, 63, 0.65);
  background: #fff8e8;
  color: #7d5918;
}

.flow-node.owner-node {
  border-color: rgba(0, 152, 121, 0.35);
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.flow-node strong,
.flow-node small {
  display: block;
}

.flow-node strong {
  color: var(--ink-strong);
  font-size: 12px;
}

.flow-node small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.flow-publications {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.flow-publications span,
.flow-note,
.flow-warning {
  padding: 6px 8px;
  border-radius: 4px;
  background: var(--soft);
  color: var(--muted);
  font-size: 10px;
}

.flow-warning {
  border: 1px solid rgba(177, 120, 13, 0.28);
  background: #fffaf0;
  color: #76500a;
}

.route-flow {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0 0 0 18px;
  list-style: none;
  border-left: 1px solid var(--line-strong);
}

.route-flow li {
  position: relative;
}

.route-flow li::before {
  content: "";
  position: absolute;
  top: 19px;
  left: -18px;
  width: 14px;
  border-top: 1px solid var(--line-strong);
}

.route-flow button {
  width: 100%;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  text-align: left;
}

.route-flow em {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.route-flow strong,
.route-flow small {
  display: block;
}

.route-flow strong {
  color: var(--ink-strong);
  font-size: 11px;
}

.route-flow small,
.route-flow p {
  color: var(--muted);
  font-size: 10px;
}

.route-flow p {
  margin: 3px 0 0 34px;
}

.related-number-list {
  display: grid;
  gap: 6px;
}

.related-number-list button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 9px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  text-align: left;
}

.related-number-list strong {
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-number-list span {
  color: var(--muted);
  font-size: 10px;
}

.visibility-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}

.visibility-dot.primary_public,
.visibility-dot.service_public {
  background: var(--teal);
}

.visibility-dot.share_after_assignment,
.visibility-dot.needs_decision {
  background: var(--warning);
}

.visibility-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
}

.visibility-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.visibility-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-public { background: var(--teal); }
.legend-limited { background: var(--warning); }
.legend-hidden { background: var(--line-strong); }

.visibility-list {
  display: grid;
  gap: 7px;
}

.visibility-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) minmax(100px, 1fr) minmax(100px, 1fr) minmax(95px, 1fr) 50px auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
}

.visibility-row:hover {
  border-color: var(--teal);
}

.visibility-row span {
  min-width: 0;
}

.visibility-row strong,
.visibility-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visibility-row strong {
  color: var(--ink-strong);
  font-size: 10px;
  white-space: normal;
}

.visibility-row small {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.visibility-row em {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff2d3;
  color: var(--warning);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.warning-list {
  display: grid;
  gap: 7px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.warning-list h3 {
  margin: 0 0 3px;
  color: var(--ink-strong);
  font-size: 13px;
}

.warning-list > button {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(177, 120, 13, 0.25);
  border-radius: 6px;
  background: #fffaf0;
  color: #76500a;
  font-size: 10px;
  line-height: 1.35;
  text-align: left;
}

.warning-list svg {
  width: 14px;
  height: 14px;
}

.telephony-bottom {
  gap: 9px;
}

.telephony-bottom .secondary-button,
.telephony-bottom .ghost-button {
  min-height: 36px;
  padding: 0 11px;
  font-size: 12px;
}

@media (max-width: 1450px) {
  .workspace {
    grid-template-columns: 290px minmax(490px, 1fr) 410px;
  }

  .visibility-row {
    grid-template-columns: minmax(110px, 1.3fr) minmax(100px, 1fr) minmax(100px, 1fr) auto;
  }

  .visibility-row > span:nth-child(4),
  .visibility-row > span:nth-child(5) {
    display: none;
  }
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 260px minmax(420px, 1fr);
  }

  .tree-panel {
    display: none;
  }
}

@media (max-width: 820px) {
  .app {
    grid-template-rows: auto auto auto;
  }

  .topbar,
  .bottom-bar {
    flex-wrap: wrap;
  }

  .topbar {
    padding: 12px;
  }

  .brand-title {
    font-size: 18px;
    white-space: normal;
  }

  .top-meta {
    width: 100%;
    justify-content: space-between;
  }

  .telephony-app .top-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    white-space: normal;
  }

  .telephony-app .top-meta .divider {
    display: none;
  }

  .telephony-app .editor-head {
    flex-direction: column;
  }

  .telephony-app .editor-nav {
    width: 100%;
  }

  .editor-section-title strong,
  .editor-section-title span {
    white-space: normal;
  }

  .workspace {
    display: block;
  }

  .sidebar,
  .editor,
  .tree-panel {
    display: block;
    border: 0;
  }

  .sidebar-body,
  .tree-body,
  .form-wrap {
    overflow: visible;
  }

  .form-grid,
  .role-actions-panel,
  .subordinate-panel > div:first-child,
  .metric-row {
    grid-template-columns: 1fr;
  }

  .telephony-form-wrap,
  .form-grid,
  .field,
  .section-intro,
  .editor-section-title {
    min-width: 0;
    max-width: 100%;
  }

  .telephony-form-wrap {
    padding-right: 14px;
    padding-left: 14px;
  }

  .section-intro {
    display: grid;
  }

  .entity-chip {
    flex-basis: 220px;
  }

  .visibility-row {
    grid-template-columns: 1fr;
  }

  .visibility-row > span:nth-child(4),
  .visibility-row > span:nth-child(5) {
    display: block;
  }

  .role-actions-panel,
  .subordinate-panel > div:first-child {
    display: grid;
  }

  .role-actions {
    justify-content: stretch;
  }

  .role-actions .primary-button,
  .role-actions .secondary-button,
  .role-actions .danger-button {
    width: 100%;
  }

  .field.double {
    grid-column: auto;
  }

  .bottom-bar {
    position: sticky;
    bottom: 0;
    z-index: 10;
  }

  .bottom-spacer {
    display: none;
  }

  .telephony-bottom > .secondary-button,
  .telephony-bottom > .ghost-button {
    flex: 1 1 145px;
    min-width: 0;
    height: auto;
    padding-top: 8px;
    padding-bottom: 8px;
    white-space: normal;
  }
}

@media print {
  body {
    background: #fff;
  }

  .app {
    display: none;
  }

  .print-report {
    display: block;
    padding: 24px;
    color: #111;
    font-family: Arial, sans-serif;
  }

  .print-report h1 {
    margin: 0 0 8px;
    font-size: 24px;
  }

  .print-report h2 {
    margin: 24px 0 8px;
    font-size: 16px;
  }

  .print-report table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
  }

  .print-report th,
  .print-report td {
    padding: 6px;
    border: 1px solid #bbb;
    vertical-align: top;
    text-align: left;
  }

  .print-report ul {
    margin: 8px 0 0;
    padding-left: 20px;
    font-size: 12px;
  }
}
