.rules_card {
    padding: 20px;
    background: var(--card);
    border-radius: var(--br-16);
    min-height: 100px;
}
.rules_card-options {
    display: flex;
    gap: 10px;
}
.rules_card-header {
    padding: 1rem 1.5rem;
    color: var(--text-custom);
    font-size: 16px;
    font-weight: var(--font-weight-6);
    background: var(--transparent-3-w);
    border-radius: var(--br-16) var(--br-16) 0 0;
}
.rules_header {
    position: relative;
    padding-block: 5rem;
    text-align: center;
    background: var(--card);
    border-radius: var(--br-16);
    border: 1px solid var(--transparent-5-w);
    overflow: hidden;
}
.rules_header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, var(--span-middle), transparent 80%);
    z-index: 0;
    opacity: 0;
    animation: headerGlow 8s ease-in-out infinite alternate;
    filter: blur(10px);
}
@keyframes headerGlow {
    0% { opacity: 0.3; transform: scale(1); }
    100% { opacity: 0.5; transform: scale(1.1); }
}
.rules_header h5,
.rules_header h6 {
    position: relative;
    z-index: 2;
}
.rules_header h5 {
    font-family: var(--font-family-1);
    font-weight: var(--font-weight-8);
    color: var(--text-default);
    font-size: var(--font-size-5xl);
    text-transform: uppercase;
    margin: 0;
}
.rules_header h6 {
    font-weight: var(--font-weight-6);
    font-size: var(--font-size-l);
    color: var(--text-custom);
}
.rules_header_right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
    margin-top: 18px;
}
.rules_last_updated {
    font-size: 13px;
    font-weight: var(--font-weight-5);
    white-space: nowrap;
    color: var(--text-custom);
    opacity: .7;
}
.time_short_text {
    position: relative;
    z-index: 3;
    margin-top: 15px;
    padding-top: 12px;
    text-align: right;
    color: var(--text-custom);
    opacity: .7;
}
.rules_menu-header {
    font-weight: var(--font-weight-7);
    font-family: var(--font-family-1);
    color: var(--text-custom);
    margin: 5px 0 12px;
    display: flex;
    gap: 10px;
}
.rules_menu-btns {
    display: grid;
    gap: 4px;
}
.rules_menu-btns a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--button);
    border-radius: var(--br-8);
    font-weight: var(--font-weight-5);
    color: var(--text-default);
    cursor: pointer;
    transition: .2s ease-in-out;
}
.rules_menu-btns a:hover {
    background: var(--button-hover);
}
.rules_menu_icon {
    align-items: center;
    justify-content: center;
}
.rules_menu_icon svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}
.rules_menu_label {
    flex: 1;
}
.rules_active {
    background: var(--span) !important;
}
.rules_block {
    display: none;
    gap: 10px;
    width: 100%;
}
.rules_block.active {
    display: grid;
}
.rules_title {
    font-family: var(--font-family-1);
    color: var(--text-default);
    font-size: 22px;
    font-weight: var(--font-weight-7);
    margin-bottom: 12px;
    letter-spacing: -0.3px;
}
.rules_text {
    padding: 10px 15px;
    line-height: 1.6;
    color: var(--text-default);
    background: var(--transparent-3-w);
    border-radius: var(--br-6);
}
.rules_text.no-bg,
.punishment-no-bg,
.number-no-bg {
    background: transparent !important;
    padding: 0 !important;
    text-align: left !important;
    border-radius: 0;
}
.rules_text_line {
    margin-bottom: 9px;
    font-size: var(--font-size-m);
}
.rules_text .rules_number {
    font-weight: var(--font-weight-7);
    font-size: 15px;
    color: var(--text-default);
    background: var(--span-10);
    border-radius: var(--br-6);
    text-align: center;
    width: max-content;
    padding: 2px 8px;
    margin-right: 8px;
}
.rules_text .rules_number:empty {
    display: none;
}
.rules_text_punishment {
    display: inline-block;
    font-weight: var(--font-weight-6);
    color: var(--red);
    background: var(--red-10);
    border-radius: var(--br-8);
    width: max-content;
    padding: 2px 8px;
    font-size: 14px;
}
.rules_export {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    background: var(--button);
    border: 1px solid var(--transparent-10-w);
    border-radius: var(--br-6);
    height: 41px;
    color: var(--text-custom);
    font-size: var(--font-size-m);
    font-weight: var(--font-weight-5);
    gap: 8px;
    margin-bottom: 8px;
    text-decoration: none;
    transition: all .2s ease;
}
.rules_export:hover {
    background: var(--button-hover);
    color: var(--text-default);
}
.rules_export svg {
    fill: currentColor;
    height: 1.2rem;
    width: 1.2rem;
}
.rules_import-preview {
    display: block;
    margin-top: 15px;
    padding: 15px;
    background: var(--transparent-3-w);
    border-radius: var(--br-12);
    max-height: 400px;
    overflow-y: auto;
}
.rules_import-preview.visible {
    display: block;
}
.rules_import-preview-header {
    font-weight: 600;
    margin-bottom: 10px;
}
.rules_import-preview-stats {
    font-size: 13px;
    color: var(--text-custom);
    margin-bottom: 10px;
}
.rules_import-preview-list {
    display: grid;
    gap: 8px;
}
.rules_import-preview-item {
    background: var(--transparent-2-w);
    padding: 8px 12px;
    border-radius: var(--br-6);
}
.rules_import-preview-item-name {
    font-weight: var(--font-weight-6);
    margin-bottom: 4px;
}
.rules_import-preview-item-count {
    font-size: 13px;
    color: var(--text-custom);
}
.rules_import-preview-item-rules {
    font-size: 12px;
    color: var(--text-custom);
    opacity: 0.7;
    margin-top: 4px;
}
.rules_file-upload {
    justify-content: space-between;
}
.rules_file-info {
    flex: 1;
    font-size: 13px;
    opacity: 0.7;
    padding-left: 8px;
}
.rules_file-info.loaded {
    opacity: 1;
    color: var(--green);
}
.rulesopt_card-categories {
    position: sticky;
    top: 20px;
    z-index: 10;
}
.rulesopt_categories {
    display: grid;
    gap: 8px;
    margin-bottom: 15px;
}
.rulesopt_categories-wrapper {
    padding: 0;
    flex-shrink: 0;
}
.rulesopt_rules-wrapper {
    padding: 0;
    flex: 1;
}
.rulesopt_category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 15px;
    background: var(--transparent-5-w);
    border-radius: var(--br-8);
    cursor: pointer;
    transition: all .2s ease;
}
.rulesopt_category-active {
    background: var(--span) !important;
}
.rulesopt_category:hover {
    background: var(--transparent-10-w);
}
.rulesopt_category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.rulesopt_category-drag {
    font-size: 18px;
    cursor: grab;
    opacity: .5;
}
.rulesopt_category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.rulesopt_category-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}
.rulesopt_category-name {
    flex: 1;
}
.rulesopt_category-edit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--br-6);
    cursor: pointer;
    transition: all .2s ease;
}
.rulesopt_category-edit:hover {
    background: var(--transparent-2-w);
}
.rulesopt_category-edit svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: currentColor;
}
.rulesopt_rules-block {
    display: none;
    gap: 10px;
    width: 100%;
    margin-bottom: 20px;
    overflow-x: auto;
}
.rulesopt_rules-block-active {
    display: grid;
}
.rulesopt_rule {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 16px;
    background: var(--transparent-2-w);
    border-radius: var(--br-8);
    transition: .2s;
    width: auto;
    min-width: 0;
}
.rulesopt_removed {
    opacity: .5;
}
.rulesopt_text {
    color: var(--text-default);
    font-size: var(--font-size-m);
}
.rulesopt_text_punishment {
    color: var(--red);
    font-weight: var(--font-weight-6);
}
.rulesopt_rule-content {
    display: flex;
    justify-content: space-between;
    cursor: pointer;
}
.rulesopt_rule-left {
    display: flex;
    gap: 12px;
    flex: 1;
    align-items: flex-start;
}
.rulesopt_rule-drag {
    margin-top: 2px;
    font-size: 16px;
    cursor: grab;
    opacity: .4;
}
.rulesopt_rule-number {
    margin-top: 2px;
    min-width: 24px;
    font-size: var(--font-size-l);
    font-weight: var(--font-weight-8);
    color: var(--span);
}
.rules_content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.rulesopt_rule .rules_text {
    font-size: 14px;
    color: var(--text-default);
}
.rulesopt_rule .rules_text_punishment {
    font-size: 13px;
    font-weight: var(--font-weight-6);
    color: var(--red);
}
.rulesopt_rule-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-top: 2px;
    border-radius: var(--br-8);
    background: var(--red-10);
    cursor: pointer;
    flex-shrink: 0;
    transition: all .2s ease;
    opacity: 1 !important;
}
.rulesopt_rule-delete:hover {
    background: var(--red-20);
}
.rulesopt_rule-delete svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: var(--red);
    transition: all .2s ease;
}
.rulesopt_rule-delete.marked svg {
    fill: var(--green);
}
.rulesopt_rule-delete.marked {
    background: color-mix(in srgb, var(--green) 10%, transparent 90%) !important;
}
.rulesopt_rule-delete.marked:hover {
    background: color-mix(in srgb, var(--green) 20%, transparent 80%) !important;
}
.rulesopt_rule-fields {
    max-height: 0;
    overflow: hidden;
    width: 100%;
    border-top: 0 solid var(--transparent-5-w);
    transition: max-height 0.3s ease, border-top-width 0.3s ease;
    padding: 0 10px;
}
.rulesopt_rule.editing .rulesopt_rule-fields {
    max-height: 600px;
    border-top-width: 1px;
    padding-top: 10px;
}
.rulesopt_rule-fields .flex-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.rulesopt_rule-fields .inputs-inline {
    flex: 1;
    min-width: 150px;
}
.rulesopt_rule-fields .inputs-inline label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: var(--font-weight-5);
    color: var(--text-custom);
}
.rulesopt_addRule {
    width: 100%;
    padding: 10px;
    font-weight: 500;
    color: var(--span);
    background: transparent;
    border: 2px dashed var(--span-10);
    border-radius: var(--br-8);
    cursor: pointer;
    transition: all .2s ease;
}
.rulesopt_addRule:hover {
    background: var(--transparent-2-w);
    border-color: var(--span);
}
.rulesopt_placeholder {
    border: 2px dashed var(--span);
    border-radius: var(--br-8);
    background: var(--transparent-2-w);
    min-height: 50px;
    margin: 4px 0;
    transition: all 0.2s ease;
}
.rulesopt_dragging {
    position: fixed !important;
    pointer-events: none !important;
    z-index: 9999 !important;
    opacity: 0.9 !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4) !important;
    background: var(--card) !important;
    border-radius: var(--br-8) !important;
    transition: none !important;
    width: auto !important;
}
.rulesopt_sortable_active {
    cursor: grabbing !important;
}
.rulesopt_sortable_active .rulesopt_placeholder {
    border-color: var(--span);
    background: var(--span-10);
}
.rulesopt_category,
.rulesopt_rule {
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.rulesopt_category.rulesopt_dragging_source,
.rulesopt_rule.rulesopt_dragging_source {
    display: none !important;
}
.rulesopt_hint {
    display: block;
    font-weight: 400;
    opacity: 0.6;
    font-size: 12px;
    margin-top: 2px;
}
/* Keep the project rules module styled by the theme, including its admin editor. */
body.neo3-route-rules .container-fluid > .row:has(.admin_nav) {
  margin: 0 -5px 8px;
}

body.neo3-route-rules .admin_nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}

body.neo3-route-rules .admin_nav > button {
  display: inline-flex;
  width: auto;
  min-width: 112px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--neo3-border);
  border-radius: 8px;
  background: var(--neo3-panel);
  color: var(--text-custom);
  font: 500 14px/1.2 var(--font-family-2), sans-serif;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

body.neo3-route-rules .admin_nav > button:hover {
  border-color: var(--neo3-border);
  background: var(--neo3-panel-soft);
  color: var(--text-default);
}

body.neo3-route-rules .admin_nav > button.active {
  border-color: var(--span-half);
  background: var(--span-low);
  color: var(--span);
}

body.neo3-route-rules .container-fluid > .row:has(#rulesopt_show_header) > .col-md-12 > .card,
body.neo3-route-rules .container-fluid > .row:has(.rulesopt_categories) > .col-md-12 > .card {
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--neo3-border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: none;
}

body.neo3-route-rules .rules_card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--neo3-border);
  border-radius: 14px;
  background: var(--card);
  color: var(--text-custom);
}

body.neo3-route-rules .rules_card-header {
  display: flex;
  min-height: 48px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--neo3-border);
  border-radius: 14px 14px 0 0;
  background: var(--transparent-2-w);
  color: var(--text-default);
  font-size: 14px;
  font-weight: 600;
}

body.neo3-route-rules .rules_card:has(#rulesopt_show_header) > .flex-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

body.neo3-route-rules .rules_card:has(#rulesopt_title) > .flex-inline:has(#rulesopt_title) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

body.neo3-route-rules .rules_card:has(#rulesopt_title) .inputs-inline:has(> input[type="text"]) {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

body.neo3-route-rules .rules_card:has(#rulesopt_title) .inputs-inline > label {
  margin: 0;
  color: var(--text-custom);
  font-size: 13px;
  font-weight: 500;
}

body.neo3-route-rules .rules_card:has(#rulesopt_title) .inputs-inline > input[type="text"],
body.neo3-route-rules .rulesopt_rule-fields input[type="text"] {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--neo3-border);
  border-radius: 8px;
  background: var(--input-form);
  color: var(--text-default);
  font: 400 14px/1.4 var(--font-family-2), sans-serif;
  color-scheme: dark;
}

body.neo3-route-rules .rules_card:has(#rulesopt_title) .inputs-inline > input[type="text"]:focus,
body.neo3-route-rules .rulesopt_rule-fields input[type="text"]:focus {
  border-color: var(--span-half);
  outline: 2px solid var(--span-low);
  outline-offset: 1px;
}

body.neo3-route-rules .container-fluid > .row:has(.rulesopt_categories) > .col-md-12 > .card > .rules_card-options {
  display: grid;
  grid-template-columns: minmax(230px, 26%) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

body.neo3-route-rules .rulesopt_categories-wrapper,
body.neo3-route-rules .rulesopt_rules-wrapper {
  width: auto !important;
  max-width: none !important;
  min-width: 0;
  padding: 0 !important;
}

body.neo3-route-rules .rulesopt_categories {
  gap: 7px;
  margin-bottom: 12px;
}

body.neo3-route-rules .rulesopt_category {
  min-height: 46px;
  padding: 7px 11px;
  border: 1px solid var(--neo3-border);
  border-radius: 9px;
  background: var(--neo3-panel-soft);
  color: var(--text-custom);
}

body.neo3-route-rules .rulesopt_category-active {
  border-color: var(--span-half);
  background: var(--span-low) !important;
  color: var(--span);
}

body.neo3-route-rules .rulesopt_category-edit:hover {
  background: var(--transparent-10-w);
}

body.neo3-route-rules #rulesopt_addCategory,
body.neo3-route-rules #rulesopt_save,
body.neo3-route-rules .rules_export,
body.neo3-route-rules .rulesopt_addRule {
  min-height: 40px;
  border-radius: 9px;
  font-family: var(--font-family-2), sans-serif;
  font-size: 14px;
}

body.neo3-route-rules #rulesopt_addCategory,
body.neo3-route-rules #rulesopt_save {
  border: 1px solid var(--neo3-border);
  background: var(--neo3-panel-soft);
  color: var(--text-custom);
}

body.neo3-route-rules #rulesopt_addCategory:hover,
body.neo3-route-rules #rulesopt_save:hover {
  background: var(--button-hover);
  color: var(--text-default);
}

body.neo3-route-rules .rules_export {
  box-sizing: border-box;
  border: 1px solid var(--neo3-border);
  opacity: 1;
  color: var(--text-custom);
  text-decoration: none;
}

body.neo3-route-rules .rulesopt_rule {
  padding: 12px 14px;
  border: 1px solid var(--neo3-border);
  border-radius: 10px;
  background: var(--transparent-2-w);
}

body.neo3-route-rules .rulesopt_rule-fields {
  display: grid;
  grid-template-columns: minmax(140px, .65fr) minmax(0, 1.35fr);
  grid-template-areas: "number punishment" "text text";
  gap: 12px;
  box-sizing: border-box;
  border-color: var(--neo3-border);
}

body.neo3-route-rules .rulesopt_rule-fields > .inputs-inline:nth-child(1) { grid-area: number; }
body.neo3-route-rules .rulesopt_rule-fields > .inputs-inline:nth-child(2) { grid-area: text; }
body.neo3-route-rules .rulesopt_rule-fields > .inputs-inline:nth-child(3) { grid-area: punishment; }

body.neo3-route-rules .rulesopt_rule-fields > .inputs-inline {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

body.neo3-route-rules .rulesopt_rule-fields > .inputs-inline > label {
  margin: 0;
  color: var(--text-custom);
  font-size: 13px;
  font-weight: 500;
}

body.neo3-route-rules .rulesopt_rule-fields textarea,
body.neo3-route-rules #rulesopt_modalCategory input[type="text"] {
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--transparent-10-w);
  border-radius: 8px;
  background: var(--input-form);
  color: var(--text-default);
  font: 400 14px/1.5 var(--font-family-2), sans-serif;
  color-scheme: dark;
}

body.neo3-route-rules .rulesopt_rule-fields textarea:focus,
body.neo3-route-rules #rulesopt_modalCategory input[type="text"]:focus {
  border-color: var(--span-half);
  outline: 2px solid var(--span-low);
  outline-offset: 1px;
}

body.neo3-route-rules .rulesopt_rule-fields textarea {
  min-height: 104px;
  resize: vertical;
}

body.neo3-route-rules .rules_file-upload {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

body.neo3-route-rules .rules_file-upload > input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

body.neo3-route-rules .rules_file-upload > label {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--neo3-border);
  border-radius: 8px;
  background: var(--neo3-panel-soft);
  color: var(--text-custom);
  cursor: pointer;
}

body.neo3-route-rules .rules_file-upload > label:hover {
  background: var(--button-hover);
  color: var(--text-default);
}

body.neo3-route-rules .rules_file-upload .rules_file-info {
  flex: 1 1 130px;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.neo3-route-rules #rulesopt_modalCategory .popup_modal_content {
  box-sizing: border-box;
  width: min(520px, calc(100vw - 32px));
  min-width: 0;
  max-width: 520px;
  max-height: min(90vh, 720px);
  gap: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--neo3-border);
  border-radius: 14px;
  background: var(--card);
  color: var(--text-default);
}

body.neo3-route-rules #rulesopt_modalCategory .modal-body {
  display: grid;
  gap: 14px;
  padding: 0;
}

body.neo3-route-rules #rulesopt_modalCategory .modal-body .inputs-inline {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

body.neo3-route-rules #rulesopt_modalCategory .modal-body label {
  margin: 0;
  color: var(--text-custom);
  font-size: 13px;
  font-weight: 500;
}

body.neo3-route-rules #rulesopt_modalCategory .popup_modal_content > .flex-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

body.neo3-route-rules #rulesopt_saveCategory {
  box-sizing: border-box;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--neo3-border);
  border-radius: 8px;
  background: var(--neo3-panel-soft);
  color: var(--text-default);
  font: 500 14px/1.2 var(--font-family-2), sans-serif;
  cursor: pointer;
}

body.neo3-route-rules #rulesopt_saveCategory:hover {
  background: var(--button-hover);
}

body.neo3-route-rules #rulesopt_deleteCategory {
  display: inline-flex;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--red-20);
  border-radius: 8px;
  background: var(--red-10);
  color: var(--red);
  cursor: pointer;
}

body.neo3-route-rules #rulesopt_deleteCategory:hover {
  background: var(--red-20);
}

body.neo3-route-rules #rulesopt_deleteCategory > svg {
  display: block;
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px;
  fill: currentColor;
}

body.neo3-route-rules .container-fluid > .row:has(.rules_menu) {
  margin: 0 -5px;
}

body.neo3-route-rules .container-fluid > .row:has(.rules_menu) > [class*="col-"] {
  min-width: 0;
  padding: 5px;
}

body.neo3-route-rules .rules_menu {
  height: auto;
  padding: 16px;
  border-radius: 14px;
  background: var(--card);
}

body.neo3-route-rules .rules_menu-item,
body.neo3-route-rules .rules_menu-btns a {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--neo3-border);
  border-radius: 9px;
  background: var(--neo3-panel-soft);
  color: var(--text-custom);
}

body.neo3-route-rules .rules_menu-btns > a > svg {
  display: block;
  width: 16px !important;
  height: 16px !important;
  flex: 0 0 16px;
}

body.neo3-route-rules .rules_menu-btns a:hover {
  background: var(--button-hover);
  color: var(--text-default);
}

body.neo3-route-rules .rules_menu-btns a.rules_active {
  border-color: var(--span-half);
  background: var(--span-low) !important;
  color: var(--span);
}

body.neo3-route-rules .rules_header {
  min-height: 160px;
  padding: 36px 20px;
  border-radius: 14px;
  background: var(--card);
}

body.neo3-route-rules .rules_header h5 {
  font-family: var(--font-family-1), sans-serif;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.25;
}

body.neo3-route-rules .rules_header h6 {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.5;
}

body.neo3-route-rules .rules_text {
  border: 1px solid var(--neo3-border);
  border-radius: 9px;
  background: var(--neo3-panel-soft);
  color: var(--text-custom);
}

body.neo3-route-rules .rules_text_line {
  line-height: 1.6;
}

body.neo3-route-rules .rules_text_punishment {
  border-radius: 7px;
}


/* Public rules match Neo3: plain heading with accent edges and inset rows. */
body.neo3-route-rules .rules_card:has(> .rules_header) { background: transparent; padding: 30px 0; border: 0; }
body.neo3-route-rules .rules_header { padding: 20px; min-height: 86px; border: 0; border-inline: 3px solid var(--span); border-radius: 0; background: transparent; }
body.neo3-route-rules .rules_header::before { display: none; }
body.neo3-route-rules .rules_header h5 { font-size: clamp(20px, 2.4vw, 30px); }
body.neo3-route-rules .rules_header h6 { margin: 3px 0 0; color: var(--span); }
body.neo3-route-rules .rules_menu { padding: 20px; }
body.neo3-route-rules .rules_menu-btns a { min-height: 46px; padding: 12px 16px; background: transparent; border: 1px solid var(--transparent-5-w); border-radius: 12px; }
body.neo3-route-rules .rules_menu-btns a:is(:hover, .rules_active) { background: var(--button) !important; color: var(--text-default); }
body.neo3-route-rules .rules_text { font-size: 14px; }
body.neo3-route-rules .rules_card:has(#rulesopt_show_header) > .flex-inline > .switch-container { flex: 1 1 240px; width: auto; }
body.neo3-route-rules .rules_title { font-size: 22px; }
body.neo3-route-rules #rulesopt_deleteCategory { width: 41px; flex: 0 0 41px; min-height: 41px; padding: 0; }
body.neo3-route-rules #rulesopt_deleteCategory svg { width: 18px; height: 18px; }
@media (max-width: 900px) {
  body.neo3-route-rules .rules_card-options { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; }
  body.neo3-route-rules .rulesopt_rule-fields { grid-template-columns: minmax(0, 1fr); grid-template-areas: "number" "text" "punishment"; }
  body.neo3-route-rules .rules_card:has(#rulesopt_title) > .flex-inline:has(#rulesopt_title) { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
  body.neo3-route-rules .rules_title { font-size: 18px; }
  body.neo3-route-rules .rules_header { padding: 12px; }
}
