body {
    background: #eef0f4;
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.container {
    margin: 40px auto;
    max-width: 500px;
    background: #fff;
    padding: 32px 28px 24px 28px;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

h1 {
  text-align: center;
    margin: 0 0 12px 0;
    font-size: 2.4rem;
    letter-spacing: 0.01em;
    color: #383b44;
}

h1 > span {
    font-style: italic;
    font-weight: 800;
    color: #e2231a;
    text-shadow: 2px 2px 0 rgba(226, 35, 26, 0.25);
    display: inline-block;
    transform: skewX(-6deg);
}

.subtitle {
    margin: -8px 0 0 0;
    text-align: center;
    font-size: 0.95rem;
    color: #8a92a3;
}

textarea {
    resize: vertical;
    min-height: 200px;
    padding: 9px 12px;
    margin-bottom: 6px;
    border: 1px solid #bcc3ce;
    border-radius: 6px;
    background: #f8fafc;
    color: #22242a;
    outline: none;
    transition: border 0.18s;
}

textarea:focus {
    border-color: #75a5e2;
    background: #fff;
}

#rulesSection {
    font-size: 0.92rem;
    color: #475065;
    border: 1px solid #d5d9e3;
    border-radius: 10px;
    padding: 12px 14px;
}

#rulesSection summary {
    cursor: pointer;
    font-weight: 500;
}

.rules-tabs {
    display: flex;
    gap: 4px;
    margin-top: 12px;
    border-bottom: 1px solid #e3e5f1;
}

.rules-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 6px 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #8a92a3;
    cursor: pointer;
}

.rules-tab:hover {
    color: #475065;
}

.rules-tab.active {
    color: #377ef7;
    border-bottom-color: #377ef7;
}

.rules-panel {
    margin-top: 10px;
}

.rules-format {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #475065;
}

.rules-format label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 400;
    cursor: pointer;
}

#rawRulesTa {
    width: 100%;
    min-height: 160px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.rules-error {
    color: #b23b3b;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

#rulesList {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.rule-row {
    display: flex;
    gap: 8px;
}

.rule-row input {
    flex: 1;
    min-width: 0;
    font-size: 0.95rem;
    padding: 6px 10px;
    border: 1px solid #bcc3ce;
    border-radius: 5px;
    background: #f8fafc;
    color: #22242a;
    outline: none;
}

.rule-row input:focus {
    border-color: #75a5e2;
    background: #fff;
}

.rule-remove {
    background: none;
    border: 1px solid #bcc3ce;
    border-radius: 5px;
    color: #8a92a3;
    cursor: pointer;
    padding: 0 10px;
    font-size: 1rem;
    line-height: 1;
}

.rule-remove:hover {
    background: #f4e6e6;
    color: #b23b3b;
    border-color: #e0b8b8;
}

.rules-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

#addRuleBtn,
#exportRulesBtn,
#importRulesBtn {
    background: none;
    border: 1px dashed #bcc3ce;
    border-radius: 5px;
    padding: 6px 14px;
    font-size: 0.9rem;
    color: #475065;
    cursor: pointer;
}

#addRuleBtn:hover,
#exportRulesBtn:hover,
#importRulesBtn:hover {
    background: #f4f4f5;
}

.live-row {
    display: flex;
    margin-top: -8px;
}

.live-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.92rem;
    font-weight: 400;
    color: #475065;
    cursor: pointer;
}

.input-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 6px;
}

button#clearBtn {
    background: #edf1f7;
    color: #383b44;
    border: 1px solid #bcc3ce;
    border-radius: 5px;
    padding: 7px 26px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

button#clearBtn:hover {
    background: #dde3ee;
}

button#redactBtn {
    background: #377ef7;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 7px 26px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

button#redactBtn:hover {
    background: #2764c7;
}

.copy-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

button#copyBtn {
    background: #edf1f7;
    color: #383b44;
    border: 1px solid #bcc3ce;
    border-radius: 5px;
    padding: 7px 26px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

button#copyBtn:hover {
    background: #dde3ee;
}

.hint {
    font-size: 0.85rem;
    color: #8a92a3;
}

label {
    font-size: 1rem;
    color: #475065;
    font-weight: 500;
}

textarea[readonly] {
    background: #f4f4f5;
    color: #4c5060;
    border-color: #e3e5f1;
}
