/* WRITE V10.2.0 cloud rule library */
.cloud-rule-library{margin-top:18px}.cloud-rule-head{align-items:center}.cloud-rule-badge{display:flex;align-items:center;gap:8px;font-size:12px;opacity:.78}.cloud-rule-badge i{width:8px;height:8px;border-radius:50%;background:#34c759}
.cr-toolbar{display:grid;grid-template-columns:minmax(280px,1fr) auto auto auto;gap:8px;padding:0 18px 14px}.cr-search{display:flex;gap:8px;align-items:flex-start;border:1px solid var(--border,#ddd);border-radius:12px;padding:9px 11px}.cr-search textarea{width:100%;resize:vertical;min-height:34px;border:0;outline:0;background:transparent;color:inherit;font:inherit}.cr-toolbar button,.cr-batchbar button,.cr-actions button,.cr-rule button,.cr-other button{border:1px solid var(--border,#ddd);background:var(--surface,#fff);color:inherit;border-radius:10px;padding:9px 12px;font-weight:650;cursor:pointer}.cr-toolbar button:disabled,.cr-batchbar button:disabled{opacity:.35;cursor:not-allowed}.danger{color:#d92d20!important}
.cr-batchbar{display:flex;align-items:center;gap:10px;padding:0 18px 14px}.cr-batchbar span{margin-right:auto;font-size:12px;opacity:.7}
.cr-summary{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;padding:0 18px 16px}.cr-summary>div{background:rgba(127,127,127,.07);border:1px solid rgba(127,127,127,.12);border-radius:12px;padding:11px}.cr-summary span,.cr-summary b{display:block}.cr-summary span{font-size:11px;opacity:.58}.cr-summary b{font-size:20px;margin-top:3px}
.cr-table{padding:0 18px 18px;overflow:auto}.cr-grid{display:grid;grid-template-columns:34px minmax(180px,1.5fr) minmax(100px,.7fr) minmax(120px,.8fr) minmax(190px,1.2fr) 150px 190px;gap:10px;align-items:center;min-width:980px}.cr-th{font-size:11px;opacity:.55;padding:8px 10px;border-bottom:1px solid rgba(127,127,127,.18)}.cr-row{padding:11px 10px;border-bottom:1px solid rgba(127,127,127,.12)}.cr-row b,.cr-row small{display:block}.cr-row small{font-size:11px;opacity:.58;margin-top:2px;white-space:normal}.cr-actions{display:flex;gap:5px}.cr-actions button{padding:6px 8px;font-size:11px}
.cr-details{padding:12px 12px 18px 44px;background:rgba(127,127,127,.035)}.cr-detail-head{display:flex;justify-content:space-between;margin-bottom:9px}.cr-rule{border:1px solid rgba(127,127,127,.14);border-radius:12px;padding:11px;margin:8px 0}.cr-rule>div:first-child{display:flex;justify-content:space-between}.cr-rule small{opacity:.55}.cr-rule pre{white-space:pre-wrap;word-break:break-word;max-height:240px;overflow:auto;background:rgba(127,127,127,.06);padding:10px;border-radius:8px;font-size:11px}.cr-rule>div:last-child{display:flex;gap:7px;justify-content:flex-end}.cr-empty{padding:30px;text-align:center;opacity:.58}.cr-empty.bad{color:#d92d20;opacity:1}
.cr-other{padding:0 18px 18px}.cr-other>button{width:100%;text-align:left}.cr-other>div{margin-top:10px}
@media(max-width:900px){.cr-toolbar{grid-template-columns:1fr 1fr}.cr-search{grid-column:1/-1}.cr-summary{grid-template-columns:repeat(2,1fr)}}
/* V10.2.1 visual hardening */
.cloud-rule-library{overflow:hidden}.cloud-rule-head{position:sticky;top:0;z-index:3;background:var(--surface,#fff);padding-bottom:10px}
html[data-theme="dark"] .cloud-rule-head{background:#1c1c1e}
.cr-toolbar{position:sticky;top:58px;z-index:2;background:var(--surface,#fff);padding-top:8px;border-bottom:1px solid rgba(127,127,127,.1)}
html[data-theme="dark"] .cr-toolbar{background:#1c1c1e}
.cr-table{max-height:min(62vh,720px);overflow:auto}.cr-th{position:sticky;top:0;z-index:1;background:var(--surface,#fff)}html[data-theme="dark"] .cr-th{background:#1c1c1e}
.cr-row-wrap:hover>.cr-row{background:rgba(127,127,127,.045)}.cr-actions{flex-wrap:wrap}.cr-actions button{white-space:nowrap}
.canonical-release-history{padding:0!important;overflow:hidden}.canonical-current{display:flex;justify-content:flex-end;align-items:center;gap:10px;padding:16px 20px;border-bottom:1px solid rgba(127,127,127,.14)}.canonical-current span{font-size:12px;opacity:.55}.canonical-current b{padding:8px 12px;border:1px solid rgba(127,127,127,.2);border-radius:12px}
.canonical-history-summary{padding:18px 22px;font-weight:700;border-bottom:1px solid rgba(127,127,127,.14)}.canonical-release-entry{display:grid;grid-template-columns:160px 1fr;gap:18px;padding:22px;border-bottom:1px solid rgba(127,127,127,.14)}.canonical-release-entry:last-child{border-bottom:0}.canonical-release-version b,.canonical-release-version small{display:block}.canonical-release-version b{display:inline-block;padding:5px 9px;border-radius:8px;background:rgba(127,127,127,.14)}.canonical-release-version small{margin-top:8px;opacity:.55}.canonical-release-entry h3{margin:0 0 10px;font-size:16px}.canonical-release-entry p{margin:7px 0;opacity:.72;line-height:1.55}
@media(max-width:720px){.canonical-release-entry{grid-template-columns:1fr}.cr-toolbar{position:static}.cloud-rule-head{position:static}.cr-table{max-height:none}}

/* V10.2.2 dark UI visual correction */
html[data-theme="dark"] .cloud-rule-library,
html[data-theme="dark"] .cr-other,
html[data-theme="dark"] .cr-table{color:#f4f4f5}
html[data-theme="dark"] .cr-search{border-color:#4b4b50;background:#18181a;color:#f4f4f5}
html[data-theme="dark"] .cr-search textarea{color:#f4f4f5}
html[data-theme="dark"] .cr-search textarea::placeholder{color:#8d8d94}
html[data-theme="dark"] .cr-toolbar button,
html[data-theme="dark"] .cr-batchbar button,
html[data-theme="dark"] .cr-actions button,
html[data-theme="dark"] .cr-rule button,
html[data-theme="dark"] .cr-other>button{
  background:#303034!important;color:#f5f5f7!important;border-color:#48484d!important;box-shadow:none!important
}
html[data-theme="dark"] .cr-toolbar button:hover,
html[data-theme="dark"] .cr-actions button:hover{background:#3a3a3f!important}
html[data-theme="dark"] button.danger{color:#ff6961!important;background:#382625!important;border-color:#5b3835!important}
html[data-theme="dark"] .cr-toolbar button:disabled,
html[data-theme="dark"] .cr-batchbar button:disabled{background:#252528!important;color:#74747b!important;border-color:#333337!important}
.cr-toolbar{grid-template-columns:minmax(360px,1fr) 104px 76px 116px;align-items:stretch}
.cr-toolbar button{min-height:48px;white-space:nowrap}
.cr-search{min-height:48px;box-sizing:border-box}
.cr-summary{grid-template-columns:repeat(5,minmax(120px,1fr));overflow-x:auto}
.cr-summary small{display:block;font-size:10px;opacity:.5;margin-top:4px}
.cr-grid{grid-template-columns:34px minmax(210px,1.5fr) minmax(120px,.75fr) minmax(160px,.9fr) minmax(190px,1.15fr) 150px 176px}
.cr-actions button{min-width:46px}
.cr-other>button{display:block;width:100%;min-height:44px;text-align:left}
.cr-conflict-card{cursor:help}
@media(max-width:1080px){.cr-toolbar{grid-template-columns:1fr 1fr 1fr}.cr-search{grid-column:1/-1}.cr-toolbar button{width:100%}}

/* V10.2.3 — Data Management single-page layout */
[data-view-panel="learning"] > [data-v1023-legacy-hidden="1"]{display:none!important}
[data-view-panel="learning"] .page-head{margin-bottom:16px!important}
[data-view-panel="learning"] .page-head h1{margin-bottom:6px!important}
.cloud-rule-library{margin-top:0!important;border-radius:16px!important}
.cloud-rule-head{position:static!important;padding:18px 20px 14px!important}
.cr-toolbar{position:static!important;display:grid!important;grid-template-columns:minmax(420px,1fr) 112px 76px 116px!important;gap:10px!important;padding:12px 18px!important;align-items:stretch!important}
.cr-search{min-height:52px!important;padding:10px 13px!important;align-items:center!important}
.cr-search textarea{min-height:28px!important;max-height:92px!important;line-height:1.4!important}
.cr-toolbar button{height:52px!important;min-width:0!important;padding:0 12px!important}
.cr-batchbar{padding:12px 18px!important;border-top:1px solid rgba(127,127,127,.10)!important;border-bottom:1px solid rgba(127,127,127,.10)!important;min-height:48px!important}
.cr-summary{padding:14px 18px 16px!important;grid-template-columns:repeat(5,minmax(130px,1fr))!important;gap:10px!important}
.cr-summary>div{min-height:76px!important;box-sizing:border-box!important}
.cr-table{padding:0 18px 18px!important;max-height:66vh!important;overflow:auto!important}
.cr-grid{grid-template-columns:34px minmax(240px,1.65fr) minmax(150px,.8fr) minmax(190px,.95fr) minmax(220px,1.15fr) 160px 176px!important;gap:14px!important;min-width:1120px!important}
.cr-th{height:42px!important;box-sizing:border-box!important;padding:0 12px!important;align-items:center!important}
.cr-row{min-height:76px!important;padding:12px!important;box-sizing:border-box!important;align-items:center!important}
.cr-row>span{min-width:0!important;overflow:visible!important;line-height:1.28!important}
.cr-row>span:nth-child(2) b{font-size:14px!important;line-height:1.25!important;white-space:normal!important;overflow-wrap:anywhere!important}
.cr-row small{line-height:1.3!important;white-space:normal!important;overflow-wrap:anywhere!important}
.cr-row-wrap{position:relative!important}
.cr-row-wrap + .cr-row-wrap{border-top:0!important}
.cr-actions{display:grid!important;grid-template-columns:repeat(3,1fr)!important;gap:6px!important;align-items:center!important}
.cr-actions button{width:100%!important;min-width:0!important;height:34px!important;padding:0 7px!important}
.cr-details{position:relative!important;padding:14px 14px 18px 48px!important}
.cr-other{padding:0 18px 18px!important}
.cr-other>button{margin-top:2px!important;background:transparent!important}
html[data-theme="dark"] .cloud-rule-library{background:#1c1c1e!important}
html[data-theme="dark"] .cr-th{background:#1c1c1e!important}
html[data-theme="dark"] .cr-row{background:#1c1c1e!important}
html[data-theme="dark"] .cr-row-wrap:hover .cr-row{background:#232326!important}
html[data-theme="dark"] .cr-summary>div{background:#242427!important;border-color:#35353a!important}
html[data-theme="dark"] .cr-batchbar{background:#1c1c1e!important}
@media(max-width:1180px){
  .cr-toolbar{grid-template-columns:1fr 1fr 1fr!important}
  .cr-search{grid-column:1/-1!important}
  .cr-toolbar button{width:100%!important}
}
@media(max-width:760px){
  .cr-summary{grid-template-columns:repeat(2,minmax(120px,1fr))!important}
  .cr-table{max-height:none!important}
  .cr-grid{min-width:980px!important}
}


/* ============================================================
   WRITE V10.2.4 — Canonical Data Management UI
   This block intentionally overrides all older cloud-rule UI patches.
   ============================================================ */

[data-view-panel="learning"]{
  overflow:visible!important;
}
[data-view-panel="learning"] .page-head{
  margin-bottom:18px!important;
}
[data-view-panel="learning"] .page-head h1{
  font-size:34px!important;
  line-height:1.08!important;
  margin:0 0 8px!important;
}
[data-view-panel="learning"] .page-head p{
  font-size:13px!important;
  line-height:1.5!important;
  opacity:.66!important;
}

#cloudRuleLibrary.cloud-rule-library{
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
  border-radius:16px!important;
}
#cloudRuleLibrary .cloud-rule-head{
  position:static!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:18px!important;
  padding:18px 20px 16px!important;
}
#cloudRuleLibrary .cloud-rule-head h2{
  margin:0 0 5px!important;
  font-size:18px!important;
  line-height:1.2!important;
}
#cloudRuleLibrary .cloud-rule-head p{
  margin:0!important;
  font-size:12px!important;
  line-height:1.45!important;
  opacity:.62!important;
}
#cloudRuleLibrary .cloud-rule-badge{
  flex:0 0 auto!important;
  font-size:12px!important;
  white-space:nowrap!important;
}

/* Search toolbar */
#cloudRuleLibrary .cr-toolbar{
  position:static!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 108px 72px 108px!important;
  gap:10px!important;
  align-items:center!important;
  padding:12px 18px!important;
  box-sizing:border-box!important;
}
#cloudRuleLibrary .cr-search{
  display:flex!important;
  align-items:center!important;
  min-width:0!important;
  height:46px!important;
  min-height:46px!important;
  padding:0 13px!important;
  box-sizing:border-box!important;
  border-radius:12px!important;
}
#cloudRuleLibrary .cr-search textarea{
  display:block!important;
  width:100%!important;
  height:30px!important;
  min-height:30px!important;
  max-height:30px!important;
  resize:none!important;
  overflow:hidden!important;
  padding:5px 0!important;
  margin:0!important;
  font-size:13px!important;
  line-height:20px!important;
}
#cloudRuleLibrary .cr-toolbar button{
  width:100%!important;
  height:46px!important;
  min-height:46px!important;
  margin:0!important;
  padding:0 10px!important;
  border-radius:11px!important;
  font-size:13px!important;
  line-height:1!important;
  white-space:nowrap!important;
}

/* Batch controls */
#cloudRuleLibrary .cr-batchbar{
  display:flex!important;
  align-items:center!important;
  gap:12px!important;
  min-height:48px!important;
  padding:10px 18px!important;
  margin:0!important;
  box-sizing:border-box!important;
}
#cloudRuleLibrary .cr-batchbar label,
#cloudRuleLibrary .cr-batchbar span,
#cloudRuleLibrary .cr-batchbar button{
  font-size:12px!important;
  line-height:1.2!important;
}
#cloudRuleLibrary .cr-batchbar button{
  height:36px!important;
  min-height:36px!important;
  padding:0 12px!important;
}

/* Summary cards */
#cloudRuleLibrary .cr-summary{
  display:grid!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:10px!important;
  padding:14px 18px 16px!important;
  margin:0!important;
  overflow:visible!important;
}
#cloudRuleLibrary .cr-summary>div{
  min-width:0!important;
  min-height:72px!important;
  padding:12px!important;
  box-sizing:border-box!important;
}
#cloudRuleLibrary .cr-summary span{
  font-size:11px!important;
  line-height:1.2!important;
}
#cloudRuleLibrary .cr-summary b{
  font-size:21px!important;
  line-height:1.05!important;
}
#cloudRuleLibrary .cr-summary small{
  font-size:10px!important;
  line-height:1.2!important;
}

/* Table: deliberately wider than the viewport, with contained horizontal scrolling.
   This prevents column collisions instead of shrinking typography until it overlaps. */
#cloudRuleLibrary .cr-table{
  width:100%!important;
  max-width:100%!important;
  max-height:64vh!important;
  padding:0 18px 18px!important;
  overflow:auto!important;
  box-sizing:border-box!important;
}
#cloudRuleLibrary .cr-grid{
  display:grid!important;
  grid-template-columns:
    34px
    minmax(250px,1.55fr)
    minmax(180px,.90fr)
    minmax(250px,1.15fr)
    minmax(250px,1.15fr)
    165px
    170px!important;
  column-gap:18px!important;
  row-gap:0!important;
  align-items:center!important;
  min-width:1320px!important;
  box-sizing:border-box!important;
}
#cloudRuleLibrary .cr-th{
  position:sticky!important;
  top:0!important;
  z-index:4!important;
  height:42px!important;
  min-height:42px!important;
  padding:0 12px!important;
  box-sizing:border-box!important;
  font-size:11px!important;
  line-height:1.2!important;
}
#cloudRuleLibrary .cr-row{
  min-height:78px!important;
  height:auto!important;
  padding:12px!important;
  box-sizing:border-box!important;
  font-size:13px!important;
  line-height:1.34!important;
}
#cloudRuleLibrary .cr-row>span{
  display:block!important;
  min-width:0!important;
  max-width:100%!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}
#cloudRuleLibrary .cr-cell{
  font-size:13px!important;
  line-height:1.34!important;
}
#cloudRuleLibrary .cr-product b,
#cloudRuleLibrary .cr-fact b{
  display:block!important;
  margin:0!important;
  font-size:13px!important;
  line-height:1.32!important;
  font-weight:700!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}
#cloudRuleLibrary .cr-category{
  font-size:12px!important;
  line-height:1.3!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}
#cloudRuleLibrary .cr-scope{
  font-size:12px!important;
  line-height:1.34!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}
#cloudRuleLibrary .cr-row small{
  display:block!important;
  margin-top:3px!important;
  font-size:10.5px!important;
  line-height:1.3!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  opacity:.60!important;
}
#cloudRuleLibrary .cr-updated small{
  margin:0!important;
  font-size:10.5px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
#cloudRuleLibrary .cr-actions{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:6px!important;
  width:100%!important;
  min-width:0!important;
  align-items:center!important;
}
#cloudRuleLibrary .cr-actions button{
  width:100%!important;
  min-width:0!important;
  height:34px!important;
  min-height:34px!important;
  padding:0 6px!important;
  margin:0!important;
  border-radius:9px!important;
  font-size:11px!important;
  line-height:1!important;
  white-space:nowrap!important;
}
#cloudRuleLibrary .cr-details{
  padding:14px 18px 18px 52px!important;
  box-sizing:border-box!important;
}
#cloudRuleLibrary .cr-rule{
  font-size:12px!important;
}
#cloudRuleLibrary .cr-rule pre{
  font-size:11px!important;
  line-height:1.45!important;
}

/* Bottom non-product control */
#cloudRuleLibrary .cr-other{
  padding:0 18px 18px!important;
}
#cloudRuleLibrary .cr-other>button{
  width:100%!important;
  height:42px!important;
  min-height:42px!important;
  padding:0 12px!important;
  font-size:12px!important;
  border-radius:10px!important;
}

/* Dark theme */
html[data-theme="dark"] #cloudRuleLibrary{
  background:#1c1c1e!important;
}
html[data-theme="dark"] #cloudRuleLibrary .cloud-rule-head,
html[data-theme="dark"] #cloudRuleLibrary .cr-toolbar,
html[data-theme="dark"] #cloudRuleLibrary .cr-batchbar,
html[data-theme="dark"] #cloudRuleLibrary .cr-th{
  background:#1c1c1e!important;
}
html[data-theme="dark"] #cloudRuleLibrary .cr-search{
  background:#18181a!important;
  border-color:#46464b!important;
}
html[data-theme="dark"] #cloudRuleLibrary .cr-search textarea{
  color:#f4f4f5!important;
}
html[data-theme="dark"] #cloudRuleLibrary .cr-search textarea::placeholder{
  color:#85858d!important;
}
html[data-theme="dark"] #cloudRuleLibrary button{
  background:#303034!important;
  color:#f5f5f7!important;
  border-color:#48484d!important;
}
html[data-theme="dark"] #cloudRuleLibrary button.danger{
  color:#ff716b!important;
  background:#392625!important;
  border-color:#603a37!important;
}
html[data-theme="dark"] #cloudRuleLibrary button:disabled{
  background:#242427!important;
  color:#66666e!important;
  border-color:#303034!important;
}
html[data-theme="dark"] #cloudRuleLibrary .cr-summary>div{
  background:#242427!important;
  border-color:#35353a!important;
}
html[data-theme="dark"] #cloudRuleLibrary .cr-row{
  background:#1c1c1e!important;
}
html[data-theme="dark"] #cloudRuleLibrary .cr-row-wrap:hover .cr-row{
  background:#232326!important;
}

@media(max-width:1180px){
  #cloudRuleLibrary .cr-toolbar{
    grid-template-columns:minmax(0,1fr) 96px 68px 100px!important;
  }
}
@media(max-width:900px){
  #cloudRuleLibrary .cr-toolbar{
    grid-template-columns:1fr 1fr 1fr!important;
  }
  #cloudRuleLibrary .cr-search{
    grid-column:1/-1!important;
  }
  #cloudRuleLibrary .cr-summary{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  #cloudRuleLibrary .cr-table{
    max-height:none!important;
  }
}
