.master-wire-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.master-wire-side {
  background: #f4f4f4;
  border: 0;
  box-shadow: none;
  padding: 8px;
}

.master-wire-side-item {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 1px solid #d9d9d9;
  box-shadow: none;
  background: transparent;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  outline: none;
}

.master-wire-side-item + .master-wire-side-item {
  margin-top: 0;
}

.master-wire-side-item.is-active {
  background: #dcdcdc;
  border-bottom-color: transparent;
  color: #333;
  font-weight: 700;
}

.master-wire-main {
  display: grid;
  gap: 14px;
}

.master-client-grid {
  display: grid;
  align-items: start;
  gap: 10px;
}

.master-subcard {
  border: 0;
  box-shadow: none;
  padding: 0;
}

.master-list-header {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.master-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 10px 10px;
  padding: 12px 14px;
  border: 1px solid #e2e5ea;
  border-radius: 10px;
  background: #fbfbfc;
}

.master-list-header-stacked {
  display: grid;
  justify-content: stretch;
}

.master-ota-filter-bar {
  display: flex;
  align-items: end;
  justify-content: flex-start;
  gap: 10px 14px;
  flex-wrap: wrap;
  margin: 0 10px 10px;
  padding: 12px 14px;
  border: 1px solid #e2e5ea;
  border-radius: 10px;
  background: #fbfbfc;
}

.master-filter-field {
  display: grid;
  gap: 5px;
  min-width: 220px;
}

.master-filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.master-filter-field select {
  min-width: 220px;
  padding: 6px 10px;
  border: 1px solid #d5d9e0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.master-filter-field select:hover {
  border-color: #b7bdc9;
}

.master-filter-field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.master-required-note {
  margin: 8px 10px;
  padding: 8px 10px;
  border: 1px solid #d8d8d8;
  background: #f7f7f7;
  color: #555;
  font-size: 12px;
  font-weight: 700;
}

.master-required-note[hidden] {
  display: none;
}

.master-disabled-table {
  opacity: 0.45;
  background: #f5f5f5;
}

.master-disabled-table th,
.master-disabled-table td {
  color: #777;
}

.master-action-row {
  display: flex;
  justify-content: flex-start;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.master-ota-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.master-inline-check {
  align-self: end;
  min-height: 38px;
}

.master-form-panel,
.master-auth-panel {
  margin-top: 14px;
  border: 1px solid #c8d8ea;
  border-radius: 4px;
  background: #f5f8fb;
}

.master-auth-panel {
  border-color: #d8c9ea;
  background: #f9f6ff;
}

.master-wire-form-panel,
.master-auth-table-panel {
  margin-top: 0;
}

.master-form-title {
  padding: 5px 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  background: #4a7ebb;
}

.master-form-stack {
  gap: 14px;
}

.master-form-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.master-form-row-facility-base {
  align-items: end;
}

.master-form-row-split {
  grid-template-columns: 0.85fr 1.15fr;
}

.master-form-row-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.master-form-row-ota-stack {
  grid-template-columns: 1fr;
}

.master-option-card {
  border: 1px solid #c8d8ea;
  border-radius: 3px;
  background: #fff;
  padding: 10px 12px;
}

.master-option-card-neutral {
  background: #f5f5f5;
  border-color: #dddddd;
}

.master-option-card-check {
  background: #fff;
}

.review-price-card {
  background: #f9f6ff;
  border-color: #c8b0e0;
}

.master-option-title {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
}

.master-option-subtitle {
  font-weight: 400;
  color: #777;
}

.master-form-note,
.master-form-help-inline {
  font-size: 10px;
  color: #777;
}

.master-form-help-inline {
  margin-bottom: 6px;
}

.master-form-help-danger {
  margin-top: 6px;
  font-size: 10px;
  color: #c0392b;
}

.master-service-options,
.master-inline-input,
.master-template-grid,
.master-auth-grid {
  display: grid;
  gap: 10px;
}

.master-service-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.master-service-choice {
  display: grid;
  gap: 4px;
  align-content: start;
}

.master-service-choice-name {
  font-size: 12px;
  font-weight: 700;
}

.master-service-choice-name.is-message {
  color: #4a7ebb;
}

.master-service-choice-name.is-review {
  color: #8e6bb0;
}

.master-service-choice-note {
  font-size: 10px;
  color: #777;
}

.master-inline-input {
  grid-template-columns: 80px auto;
  align-items: center;
}

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

.master-auth-card {
  border: 1px solid #d8c9ea;
  background: #fff;
  padding: 10px 12px;
}

.master-check-toggle-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.master-auth-card-name {
  font-weight: 700;
}

.master-auth-card-status {
  display: inline-block;
  margin: 6px 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.master-auth-card-status.is-ready {
  background: #e7f6ec;
  color: #217a41;
}

.master-auth-card-status.is-partial {
  background: #fff4df;
  color: #b36a00;
}

.master-auth-card-status.is-missing {
  background: #f2f2f2;
  color: #666;
}

.master-mini-badge,
.master-state-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
}

.master-mini-badge {
  color: #fff;
  margin-right: 4px;
}

.master-mini-badge.is-message {
  background: #4a7ebb;
}

.master-mini-badge.is-review {
  background: #8e6bb0;
}

.master-state-badge.is-ready {
  background: #e7f6ec;
  color: #217a41;
}

.master-state-badge.is-missing {
  background: #f2f2f2;
  color: #666;
}

.master-readonly-value {
  background: #f7f7f7;
  border: 1px solid #bfbfbf;
  border-radius: 3px;
  color: #333;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  margin-top: 6px;
  padding: 8px 10px;
}

.master-switch-text.is-on {
  color: #217a41;
  font-weight: 700;
}

.master-switch-text.is-off {
  color: #999;
}

.compact-table th,
.compact-table td {
  font-size: 11px;
}

@media (max-width: 1100px) {
  .master-form-row,
  .master-form-row-split,
  .master-form-row-compact,
  .master-wire-layout,
  .master-service-options,
  .master-template-grid,
  .master-auth-grid {
    grid-template-columns: 1fr;
  }

  .master-ota-filter-bar {
    align-items: stretch;
  }

  .master-filter-field,
  .master-filter-field select {
    min-width: 0;
    width: 100%;
  }

}
.master-option-card.is-disabled {
  opacity: 0.48;
  background: #f3f3f3;
}

.master-option-card.is-disabled input {
  cursor: not-allowed;
}

.master-imap-secure {
  align-self: end;
  min-height: 32px;
}

.master-form-row-ota-stack > label:not(.inline-check) {
  max-width: 360px;
}

.master-ota-fields-layout {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.master-ota-fields-left {
  display: grid;
  gap: 10px;
}

.master-ota-fields-right > label {
  display: block;
  max-width: 560px;
}

.master-ota-fields-right textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 140px;
  resize: vertical;
  font: inherit;
}

@media (max-width: 760px) {
  .master-ota-fields-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
