.card {
  background: #ffffff;
  border: 1px solid #dce3ed;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(16, 32, 51, 0.04);
  padding: 26px;
}
.panel { margin-top: 18px; }
.section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.section-title span {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e8f1ff;
  color: #1769e0;
  font-weight: 700;
}
.section-title h3 { margin: 0; font-size: 1.15rem; }
.spacing-top { margin-top: 28px; }
.form-row { margin-bottom: 16px; }
label { display: block; margin-bottom: 7px; font-weight: 650; }
input, select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #ccd6e2;
  border-radius: 9px;
  background: #ffffff;
  color: #102033;
}
input:focus, select:focus { outline: 2px solid rgba(23, 105, 224, 0.18); border-color: #1769e0; }
.optional, .field-help { color: #526173; font-size: 0.9rem; }
.pattern-box {
  margin-top: 12px;
  padding: 13px 14px;
  border-radius: 12px;
  background: #f1f6ff;
  border: 1px solid #d6e4ff;
}
.pattern-box strong { display: block; margin-bottom: 6px; color: #526173; }
.pattern-box code { color: #174ea6; font-weight: 800; overflow-wrap: anywhere; }
.button-row { display: flex; gap: 12px; margin-top: 20px; }
.primary-button, .secondary-button {
  border: 0;
  border-radius: 9px;
  padding: 12px 18px;
  font-weight: 700;
}
.primary-button { color: #ffffff; background: #1769e0; }
.primary-button:hover { background: #1157bd; }
.secondary-button { color: #102033; border: 1px solid #d6dee8; background: #edf2f7; }
.secondary-button:hover { background: #e2e8f0; }
.result-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #dce3ed;
  border-radius: 12px;
  padding: 20px;
  background: #f9fbfe;
}
.result-box code { font-size: 1.2rem; font-weight: 800; color: #078236; overflow-wrap: anywhere; }
.badge, .status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 700;
  font-size: 0.85rem;
}
.badge.neutral, .status-pill { background: #eef4ff; color: #1769e0; }
.badge.valid { background: #e8f7ed; color: #087333; }
.badge.invalid { background: #fdecea; color: #b42318; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  min-width: 110px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f1f6ff;
  border: 1px solid #d6e4ff;
}
.chip strong { display: block; color: #526173; font-size: 0.78rem; margin-bottom: 4px; }
.message-list { padding-left: 20px; }
.hidden { display: none !important; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
th { font-size: 0.9rem; color: #526173; }
.history-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.abbreviation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.reference-links {
  margin-top: 30px;
  padding: 18px;
  background: #f9fbfe;
  border: 1px solid #dce3ed;
  border-radius: 14px;
}
.reference-links a { color: #1769e0; font-weight: 700; }
.rules-catalog { display: grid; gap: 18px; }
.rule-card { border: 1px solid #dce3ed; border-radius: 14px; padding: 18px; background: #f9fbfe; }
.rule-card h4 { margin: 0 0 8px; }
.rule-card code {
  display: inline-block;
  margin: 6px 0 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #eef4ff;
  color: #174ea6;
  font-weight: 800;
}
.rule-card ul { margin: 8px 0; }
.checkbox-group {
  margin: 18px 0;
  padding: 14px;
  border-radius: 12px;
  background: #f9fbfe;
  border: 1px solid #dce3ed;
}
.checkbox-group h4 { margin: 0 0 10px; }
.checkbox-group label { display: block; font-weight: 500; }
.checkbox-group input { width: auto; margin-right: 8px; }

.structure-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.copy-hint { color: #526173; font-size: 0.9rem; }
.tree-output {
  min-height: 420px;
  padding: 12px 0;
  border-radius: 12px;
  background: #0b1220;
  color: #d9e8ff;
  overflow: auto;
  font-family: "Segoe UI", system-ui, sans-serif;
}

.portal-tree-row {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  color: #d9e8ff;
}

.portal-tree-row:hover {
  background: rgba(88, 166, 255, 0.08);
}

.portal-tree-indent {
  flex: 0 0 auto;
}

.portal-tree-icon {
  width: 28px;
  flex: 0 0 28px;
  font-size: 1.25rem;
  line-height: 1;
  text-align: center;
  margin-right: 10px;
}

.portal-tree-label {
  font-weight: 650;
  font-size: 1rem;
  white-space: nowrap;
}

.portal-tree-row.management-group .portal-tree-label {
  color: #d9e8ff;
}

.portal-tree-row.subscription {
  cursor: pointer;
}

.portal-tree-row.subscription .portal-tree-label {
  color: #ffd54f;
  font-family: Consolas, "Courier New", monospace;
  font-weight: 800;
}

.portal-tree-row.subscription:hover .portal-tree-label {
  text-decoration: underline;
}

.portal-tree-row.note .portal-tree-icon::before {
  content: "ℹ";
}

.portal-tree-row.note .portal-tree-icon {
  font-size: 0;
}

.portal-tree-row.note .portal-tree-label {
  color: #94a3b8;
  font-style: italic;
  font-weight: 500;
}

.toast {
  position: fixed;
  right: 26px;
  bottom: 26px;
  background: #0f6cbd;
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  font-weight: 700;
}

@media (max-width: 850px) {
  .abbreviation-grid, .history-header { display: block; }
}
