.rules-active #workspace,.rules-active #welcome,.rules-active #resource-library,.rules-active #viral-notes,.rules-active .sidebar>#new-project,.rules-active .sidebar>.search-box,.rules-active .sidebar>.list-heading,.rules-active #project-list{display:none!important}
.rules-directory{flex:1;min-height:0;overflow:auto}.rules-directory>.list-heading{padding:0 7px;margin:0 0 16px}
.rules-workspace{padding:38px 40px 70px;max-width:1560px;margin:auto}.rules-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:28px}.rules-heading h1{font-size:26px;letter-spacing:-.5px;margin:0 0 10px}.rules-heading p{font-size:13px;color:#8b95a3;line-height:1.8}.rules-heading .button{padding:12px 20px;border-radius:8px}
.rules-stats{display:flex;gap:14px;margin-bottom:18px}.rules-stat{display:flex;align-items:center;gap:12px;padding:17px 23px;background:#fff;border:1px solid #e8ecf1;border-radius:10px;min-width:155px}.rules-stat strong{font-size:25px;line-height:1.2;color:#35465c;font-weight:600}.rules-stat span{font-size:12px;color:#8a95a5}
.rules-help{font-size:12px;color:#8a95a5;margin:0 0 27px}.rules-help summary{cursor:pointer;display:list-item;list-style:disclosure-closed inside}.rules-help[open] summary{list-style-type:disclosure-open}.rules-explanation{padding:12px 16px;margin-top:10px;background:#ecf4ff;border-radius:7px;font-size:12px;color:#63758a;line-height:1.9}
.rules-toolbar{display:flex;gap:10px;align-items:center;padding:14px 16px;background:#fff;border:1px solid #e8ecf1;border-radius:10px}.rules-toolbar input{flex:1;min-width:100px;border:0!important;background:#f5f7fa!important}.rules-toolbar select{width:145px}.rules-toolbar .button{background:#fff;border-color:#dfe5ed;color:#728097;border-radius:7px}.rules-workspace input,.rules-workspace select,.rules-dialog input:not([type=checkbox]),.rules-dialog select,.rules-dialog textarea{padding:10px 12px;border:1px solid #e1e6ee;border-radius:7px;background:#fff;color:#35465c;font:inherit;min-width:0}.rules-dialog input:not([type=checkbox]),.rules-dialog select,.rules-dialog textarea{width:100%}
.rules-layout{display:block;margin-top:20px}#rule-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;align-items:stretch}.rule-item{display:flex;flex-direction:column;padding:23px 24px 0;margin:0;border:1px solid #e8ecf1;border-radius:12px;background:#fff;min-width:0;box-shadow:0 3px 14px #1e345003;transition:box-shadow .2s,border-color .2s}.rule-item:hover{border-color:#cbdced;box-shadow:0 6px 20px #1e345009}.rule-card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:17px}.rule-category-badge{font-size:10px;border-radius:5px;padding:4px 8px;background:#edf4ff;color:#5b82b8}.rule-category-badge.product{color:#368a77;background:#eaf6f1}.rule-category-badge.style{color:#8d6eb5;background:#f3eefa}.rule-category-badge.idea{color:#b08a4d;background:#faf3e6}.rule-state{font-size:10px;color:#a0a8b3}.rule-state:before{content:'●';font-size:8px;margin-right:5px}.rule-state.enabled{color:#56a284}.rule-title{border:0;background:transparent;color:#33445b;font:inherit;font-size:16px;font-weight:600;line-height:1.7;text-align:left;padding:0;cursor:pointer}.rule-item>.rule-body{color:#7d8999;font-size:12px;line-height:1.95;margin:13px 0 24px;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;min-height:94px;flex:1}.rule-card-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid #f0f2f6;padding:15px 0;color:#a3acb8;font-size:10px}.rule-edit{font:inherit;font-size:11px;color:#5b8bbf;border:0;background:transparent;cursor:pointer;padding:3px 0}.rule-empty{padding:50px;color:#909399;grid-column:1/-1;text-align:center}
#rules-message{font-size:11px;color:#9aa4b2;margin:17px 2px 0;line-height:1.8}.rules-dialog{width:min(650px,94vw);max-height:90vh;padding:0;border:0;border-radius:15px;background:#fff;box-shadow:0 25px 100px #15284330}.rules-dialog::backdrop{background:#23364c77;backdrop-filter:blur(5px)}.rules-dialog-close{position:absolute;right:20px;top:20px;z-index:1}.rules-dialog .rules-editor{padding:30px 32px 26px;border:0;border-radius:15px}.rules-editor h2{font-size:19px;margin:0 40px 24px 0;color:#34445b}.rules-editor label{display:flex;flex-direction:column;gap:8px;margin:18px 0;font-size:12px;color:#8793a4}.rules-editor textarea{min-height:160px;resize:vertical;line-height:1.9!important}.rules-fields{display:grid;grid-template-columns:1fr 1fr;gap:14px}.rules-fields label{margin:0}.rules-editor .rules-enabled{flex-direction:row;align-items:center;padding:12px;background:#f6f9fc;border-radius:7px;color:#718096}.rules-enabled input{accent-color:#409eff}.rules-editor #rule-save{min-width:120px;border-radius:7px}.rule-meta{font-size:11px;color:#8993a0;margin:10px 0}.rule-body{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.85;font-size:13px}.rule-history-item{padding:14px 0;border-top:1px solid #edf0f4}.rules-editor details{margin-top:22px;font-size:12px;color:#8a95a5}.rules-editor summary{cursor:pointer}#rule-save-message{font-size:11px;color:#8a95a5;white-space:pre-wrap;line-height:1.8;margin-top:12px}
@media(max-width:1250px){#rule-list{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:760px){.rules-workspace{padding:25px 16px}.rules-heading{align-items:start;flex-wrap:wrap;margin-bottom:20px}.rules-heading h1{font-size:22px}.rules-stats{gap:8px}.rules-stat{min-width:0;flex:1;flex-direction:column;gap:7px;padding:13px 8px}.rules-stat strong{font-size:22px}.rules-stat span{font-size:10px}.rules-toolbar{padding:10px;flex-wrap:wrap}.rules-toolbar input{width:100%;flex-basis:100%}.rules-toolbar select{flex:1}#rule-list{grid-template-columns:1fr}.rules-dialog .rules-editor{padding:27px 22px}.rule-item>.rule-body{min-height:0}}
/* Dense rule list: one rule per row, full text in the edit dialog. */
.rules-workspace{max-width:none;padding:24px 26px 45px}.rules-heading{margin-bottom:14px}.rules-heading h1{font-size:23px;margin-bottom:7px}.rules-heading p{font-size:12px}.rules-stats{display:flex;align-items:center;gap:24px;margin:0 0 12px}.rules-stat{min-width:0;flex:0 0 auto;flex-direction:row;padding:0;gap:7px;border:0;background:transparent;border-radius:0}.rules-stat strong{font-size:16px;color:#566c85}.rules-stat span{font-size:11px}.rules-help{margin:0 0 15px;font-size:11px}.rules-toolbar{padding:10px 12px;border-radius:7px}.rules-layout{margin-top:13px}#rules-message{margin-top:12px}#rule-list{display:block;overflow-x:auto;border:1px solid #e4e9f0;border-radius:7px;background:#fff}.rules-table{border-collapse:collapse;table-layout:fixed;width:100%;min-width:1000px;color:#65758a;font-size:12px}.rules-table th,.rules-table td{padding:12px 14px;text-align:left;border-bottom:1px solid #edf0f4;height:49px;white-space:nowrap;vertical-align:middle}.rules-table th{background:#f8fafc;font-size:11px;color:#8290a2;font-weight:500;height:43px}.rules-table tr:last-child td{border-bottom:0}.rules-table tbody tr:hover{background:#f6faff}.rules-table th:nth-child(1){width:23%}.rules-table th:nth-child(2){width:auto}.rules-table th:nth-child(3){width:92px}.rules-table th:nth-child(4){width:85px}.rules-table th:nth-child(5){width:95px}.rules-table th:nth-child(6){width:100px}.rules-table th:nth-child(7){width:65px}.rules-table th:nth-child(8){width:65px}.rule-table-title{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:0;background:transparent;color:#4c7fae;font:inherit;text-align:left;padding:0;cursor:pointer}.rule-table-text{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#8794a5}.rules-table .rule-empty{text-align:center;height:120px}.rules-dialog:focus{outline:none}@media(max-width:760px){.rules-workspace{padding:20px 15px}.rules-stats{gap:18px;flex-wrap:wrap}.rules-heading h1{font-size:21px}.rules-stat{flex:0 0 auto}.rules-table th,.rules-table td{padding:11px 12px}}
.rule-image-field{margin:20px 0}.rule-image-label{display:flex;justify-content:space-between;color:#8793a4;font-size:12px;margin-bottom:9px}.rule-image-drop{border:1px dashed #cddced;border-radius:8px;background:#f7faff;padding:15px;display:flex;align-items:center;gap:12px;flex-wrap:wrap;font-size:11px;color:#8b98aa}.rule-image-drop.dragging{border-color:#409eff;background:#eaf4ff}.rule-image-drop .button{font-size:12px;padding:8px 13px}.rule-image-drop small{flex-basis:100%;font-size:10px;color:#a0abb9}.rule-images{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:12px}.rule-image-item{min-width:0}.rule-image-thumb{position:relative;display:block;width:100%;height:110px;padding:0;border:1px solid #e1e7ef;border-radius:6px;background:#f3f6fa;overflow:hidden;cursor:zoom-in}.rule-image-thumb img{display:block;width:100%;height:100%;object-fit:contain}.rule-image-number{position:absolute;top:4px;left:5px;color:#fff;background:#425a7799;border-radius:3px;padding:1px 5px;font-size:10px}.rule-image-filename{display:block;font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#96a0ad;margin:5px 0}.rule-image-actions{display:flex;justify-content:space-between;gap:4px}.rule-image-actions button{border:0;background:transparent;color:#6d8cb0;cursor:pointer;font-size:10px;padding:3px 0}.rule-image-actions button:disabled{opacity:.35;cursor:default}.rule-image-badge{display:inline-block;font-size:10px;border-radius:4px;padding:2px 5px;background:#edf5ff;color:#7e9bc0;margin-left:6px;white-space:nowrap}.rule-col-title .rule-table-title{display:inline-block;max-width:calc(100% - 42px);vertical-align:middle}.rule-image-preview{width:min(1050px,94vw);max-height:94vh;border:0;border-radius:12px;padding:18px;background:#fff;box-shadow:0 25px 100px #15284330}.rule-image-preview::backdrop{background:#23364c99;backdrop-filter:blur(4px)}.rule-image-preview-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;color:#536d8b;font-size:12px;margin-bottom:12px}.rule-image-preview>img{display:block;width:100%;max-height:78vh;object-fit:contain}.rule-history-images{display:flex;gap:8px;flex-wrap:wrap}.rule-history-images .rule-image-thumb{width:80px;height:90px}#rule-image-message{font-size:11px;color:#cc7979;line-height:1.7;margin:8px 0 0}@media(max-width:760px){.rule-images{grid-template-columns:repeat(3,minmax(0,1fr))}.rule-image-thumb{height:100px}}
.rules-table{min-width:1190px}.rules-table th:nth-child(1){width:19%}.rules-table th:nth-child(2){width:22%}.rules-table th:nth-child(3){width:26%}.rules-table th:nth-child(4){width:85px}.rules-table th:nth-child(5){width:76px}.rules-table th:nth-child(6){width:88px}.rules-table th:nth-child(7){width:92px}.rules-table th:nth-child(8){width:50px}.rules-table th:nth-child(9){width:50px}.rule-ai-summary{display:block;border:0;background:transparent;color:#6485a6;font:inherit;text-align:left;cursor:pointer;padding:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.7}.rule-reading-tag{display:inline-block;color:#a2adba;background:#f2f5f8;border-radius:3px;font-size:9px;margin:4px 5px 0 0;padding:1px 5px}.rule-reading-tag.confirmed{color:#5c9c84;background:#edf7f2}.rule-reading-panel{padding:13px 15px;border:1px solid #e5edf5;border-radius:8px;background:#f9fbfe}.rule-reading-panel>summary{color:#6987a7;font-size:12px}.rule-reading-panel>summary span{font-size:10px;color:#a5afbc;margin-left:7px}.rule-reading-help{font-size:11px;line-height:1.8;color:#93a1b3;margin-top:12px}.rule-reading-panel textarea{min-height:100px!important}.rule-reading-panel label{margin:13px 0}.rule-reading-panel .button{font-size:11px;padding:8px 12px}

.rule-category-hint{display:block;margin-top:5px;font-size:11px;line-height:1.65;color:var(--ui-muted,#85888f)}

.rule-row-actions{display:flex;align-items:center;gap:15px}.rule-delete-button{color:var(--ui-danger,#c23a3a);background:transparent;border:0;padding:4px 0;font:inherit;font-size:11px;cursor:pointer}.rule-delete-button:hover{text-decoration:underline}.rule-delete-button:disabled{opacity:.45;cursor:default}.rule-editor-actions{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-top:20px}.rules-dialog .rule-editor-actions .rule-delete-button{padding:9px 12px;border:1px solid var(--ui-danger-line,#fbc4c4);border-radius:7px;font-size:12px}.rules-table th:nth-child(9){width:108px}.rule-state.deleted{color:var(--ui-muted,#85888f)}.rule-table-title:disabled{cursor:default}

.rules-dialog .rules-fields{display:flex;flex-direction:column;gap:18px;margin-top:18px}.rule-choice-field{min-width:0;display:flex;flex-direction:column;gap:9px}.rule-choice-label{font-size:12px;color:var(--ui-muted,#8793a4)}.rule-choice-tags{display:flex;flex-wrap:wrap;gap:7px}.rule-choice-tag{display:inline-flex;align-items:center;gap:7px;max-width:100%;padding:7px 10px;border:1px solid var(--ui-border,#dcdfe6);border-radius:5px;background:var(--ui-surface,#fff);color:var(--ui-secondary,#606266);font:inherit;font-size:12px;line-height:1.6;text-align:left;cursor:pointer}.rule-choice-tag::before{content:'';display:grid;place-items:center;flex:0 0 13px;width:13px;height:13px;border:1px solid currentColor;border-radius:3px;font-size:11px;line-height:1}.rule-choice-tag[aria-pressed=true]::before{content:'✓';background:currentColor;color:inherit}.rule-choice-tag[aria-pressed=true]{font-weight:600;background:var(--ui-accent-soft);border-color:var(--ui-accent);color:var(--ui-accent)}.rule-choice-tag:disabled{opacity:.55;cursor:default}.rule-choice-tag:focus-visible{outline:2px solid currentColor;outline-offset:2px}.rule-custom-category{display:flex;align-items:center;gap:8px;margin-top:1px}.rule-custom-category input{flex:1;min-width:0!important;font-size:12px!important}.rule-custom-category .button{flex:none;white-space:nowrap;padding:9px 12px;font-size:12px}.rule-category-message{font-size:11px;line-height:1.6;color:var(--ui-accent)}.rule-category-message:empty{display:none}.rule-table-categories{display:flex;flex-wrap:wrap;gap:5px;max-width:150px}.rule-table-categories .rule-category-badge{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:1px solid transparent;line-height:1.5}.rules-table th:nth-child(4){width:142px}.rules-table td:has(>.rule-table-categories){white-space:normal}.rules-directory .rule-category-color{margin-bottom:4px;border-radius:5px}@media(max-width:500px){.rule-choice-tag{font-size:11px;padding:6px 8px}.rule-custom-category input{font-size:11px!important}}

.rules-category-filters{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:16px 0}.rules-category-filter{display:inline-flex;align-items:center;gap:8px;padding:7px 11px;min-height:33px;border:1px solid var(--ui-line,#ebeef5);border-radius:5px;background:var(--ui-surface,#fff);color:var(--ui-secondary,#606266);font-size:12px;line-height:1.5}.rules-category-filter small{font-size:10px;color:var(--ui-muted,#85888f);font-variant-numeric:tabular-nums}.rules-category-filter:hover{border-color:var(--ui-accent-line);color:var(--ui-accent)}.rules-category-filter[aria-pressed=true]{background:var(--ui-accent-soft);border-color:var(--ui-accent-line);color:var(--ui-accent);font-weight:600}.rules-category-filter[aria-pressed=true] small{color:var(--ui-accent)}.rules-category-filter:focus-visible{outline:2px solid var(--ui-accent-line);outline-offset:2px}@media(max-width:760px){.rules-category-filters{gap:6px;margin:12px 0}.rules-category-filter{font-size:11px;padding:6px 9px}}
