/* Home chrome: one reading hierarchy, one search surface, six calm categories. */
body:has(.rh-shell) .rh-shell .rh-top{
  min-height:calc(64px + env(safe-area-inset-top));
  padding:calc(24px + env(safe-area-inset-top)) 12px 0 64px;
  margin-bottom:0;gap:16px;
  background:var(--ui-canvas);box-shadow:none;border:0;
}
body:has(.rh-shell)>#menu-toggle{top:calc(24px + env(safe-area-inset-top))}
body:has(.rh-shell)>#menu-toggle,.rh-shell .rh-top #manual-sync{
  background:transparent;box-shadow:none;border-radius:12px;
}
body:has(.rh-shell)>#menu-toggle img,.rh-shell .rh-top #manual-sync img{opacity:.7}
.rh-shell .rh-top .rh-top-title{gap:5px}
.rh-shell .rh-top .rh-top-title #page-title{font-size:18px;font-weight:500;letter-spacing:-.025em;line-height:1.25;color:#59564f;gap:9px}
.rh-shell .rh-top .rh-top-title h2 #heading-count{font-size:10px;color:#918b81;font-weight:400;letter-spacing:0}
.rh-shell .rh-top .rh-top-title #page-description{font-size:9px;letter-spacing:.015em;color:#a39b8e;line-height:1.35}
.rh-shell .rh-search-row{
  display:grid;grid-template-columns:minmax(0,1fr) 64px 36px;align-items:center;
  gap:0;height:44px;padding:0 6px 0 10px;margin:0 0 10px;
  background:#eeeae3;border-radius:14px;box-shadow:none;
  transition:background-color 160ms linear,box-shadow 160ms linear;
}
.rh-shell .rh-search-row :is(.rh-search,.rh-sort,#select-mode){height:36px;min-height:36px;background:transparent;box-shadow:none;border:0;border-radius:9px}
.rh-shell .rh-search-row .rh-search{padding:0;gap:7px;min-width:0}
.rh-shell .rh-search-row .rh-search img{width:15px;height:15px;opacity:.42}
.rh-shell .rh-search-row #search{font-size:11px;height:36px;line-height:1.4;color:#817c73;min-width:0}
.rh-shell .rh-search-row #search::placeholder{font-size:11px;color:#a6a095;opacity:1}
.rh-shell .rh-search-row .rh-sort{display:flex;align-items:center;padding:0}
.rh-shell .rh-search-row #sort{width:100%;height:36px;min-height:36px;gap:6px;padding:0 5px;font-size:10px;color:#9b958b;border-radius:9px}
.rh-shell .rh-search-row #sort img{width:11px;height:11px;opacity:.5}
.rh-shell .rh-search-row #select-mode{width:36px;min-width:36px;padding:0;display:grid;place-items:center;color:#918b81;transition:background-color 140ms linear,transform 100ms linear}
.rh-shell .rh-search-row #select-mode img{width:17px;height:17px;opacity:.5}
.rh-shell .rh-search-row #select-mode.active{background:#e1e5df}
.rh-shell .rh-search-row #select-mode.active img{opacity:.85}
.rh-shell .rh-search-row:focus-within{background:#f0ede7;box-shadow:0 3px 10px rgba(57,46,31,.035)}
.rh-shell .collection-filters{height:46px;padding:0;margin-bottom:0;overflow:visible}
.rh-shell .collection-filters .filter-row{
  display:flex;align-items:center;flex-wrap:nowrap;
  width:calc(100% + 8px);height:46px;margin-inline:-4px;
  padding:4px 4px 8px;gap:4px;overflow-x:auto;overflow-y:hidden;
  scrollbar-width:none;
}
.rh-shell .filter-row::-webkit-scrollbar{display:none}
body:has(.workspace) .rh-shell .filter-row .filter-chip,
body:has(.workspace) .rh-shell .filter-row .filter-chip.active{
  flex:0 0 calc((100% - 20px)/6);width:calc((100% - 20px)/6);min-width:0;
  height:32px;min-height:32px;line-height:32px;padding:0 2px!important;
  border:0;border-radius:999px;gap:3px;
  box-shadow:0 2px 8px rgba(57,46,31,.07),inset 0 1px 0 rgba(255,255,255,.64);
  font-size:10.5px!important;font-weight:400;color:#999287;background:transparent;
  transition:background-color 160ms linear,color 160ms linear,box-shadow 160ms linear,transform 100ms linear;
}
body:has(.workspace) .rh-shell .filter-row .filter-chip.active{
  background:var(--ui-surface);color:#656d62;font-weight:500;
  box-shadow:0 3px 10px rgba(57,46,31,.10),inset 0 1px 0 rgba(255,255,255,.76);
}
.rh-shell .filter-row .filter-chip .chip-count{font-size:7.5px!important;font-weight:400;color:inherit;opacity:.64}
.rh-shell .filter-row .filter-chip .tag-dot{display:none}
.rh-shell .modern-group-label{margin:10px 6px 8px;font-size:9px!important;line-height:1.4;font-weight:400;color:#aaa294}
@media(hover:hover){
  body:has(.rh-shell)>#menu-toggle:hover,.rh-shell .rh-top #manual-sync:hover{background:#eeeae3;box-shadow:none}
  .rh-shell .rh-search-row #sort:hover,.rh-shell .rh-search-row #select-mode:hover{background:#e6e2db}
  body:has(.workspace) .rh-shell .filter-row .filter-chip:not(.active):hover{background:#eeeae3;color:#746f65}
}
@media(min-width:720px){body:has(.rh-shell) .rh-shell .rh-top{padding-left:var(--rh-gutter)}}
@media(max-width:350px){
  .rh-shell .rh-search-row{grid-template-columns:minmax(0,1fr) 54px 32px;padding-left:9px;padding-right:4px}
  .rh-shell .rh-search-row #select-mode{width:32px;min-width:32px}
  .rh-shell .rh-search-row #search::placeholder{font-size:10px}
}
@media(prefers-reduced-motion:reduce){
  .rh-shell .rh-search-row,.rh-shell .rh-search-row #select-mode,body:has(.workspace) .rh-shell .filter-row .filter-chip{transition:none!important}
}
/* Empty reminder rows must not introduce a third title line. */
.rh-shell .rh-top{align-items:flex-start}
.rh-shell .rh-top .rh-top-title{min-height:40px}
.rh-shell .rh-top #cancellation-reminders:empty{display:none}
body:has(.workspace) .rh-shell .collection-filters{margin-bottom:0}
body:has(.workspace) .rh-shell .modern-group-label{margin:10px 6px 4px}
body:has(.workspace) .rh-shell .modern-group-label:first-child{margin-top:4px;margin-bottom:0}

/* Keep the five primary sidebar destinations on one shared alignment grid.
   The cards disclosure control sits inside the first row instead of shrinking
   the "全部卡片" button. */
body:has(.workspace) #sidebar .sidebar-primary-nav .sidebar-card-row{
  position:relative;display:block;width:100%;
}
body:has(.workspace) #sidebar .sidebar-primary-nav #cards-nav-link{
  display:flex;width:100%;min-width:0;min-height:40px;height:40px;
  padding-right:42px!important;
}
body:has(.workspace) #sidebar .sidebar-primary-nav #cards-nav-toggle{
  position:absolute;z-index:1;top:0;right:0;width:34px;min-width:34px;
  min-height:40px;height:40px;padding:0;
}
body:has(.workspace) #sidebar .sidebar-primary-nav > .sidebar-primary-link{
  width:100%;min-width:0;box-sizing:border-box;
}

/* Homepage layout authority. Loaded after the shared skin; business data and swipe actions stay unchanged. */
.rh-shell #cancellation-reminders{
  display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;
  width:100%!important;max-width:none!important;gap:6px!important;
  padding:0!important;margin:0 0 8px!important;box-sizing:border-box;
}
.rh-shell #cancellation-reminders:empty{display:none!important;margin:0!important}
.rh-shell #cancellation-reminders .cancellation-reminder{
  display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;
  width:100%!important;min-width:0!important;height:30px!important;min-height:30px!important;
  padding:2px 3px!important;margin:0!important;gap:1px!important;overflow:hidden!important;
}
.rh-shell #cancellation-reminders .cancellation-reminder::before{display:none!important}
.rh-shell #cancellation-reminders .cancellation-reminder :is(strong,span){display:block!important;width:100%!important;text-align:center!important;margin:0!important;line-height:1.15!important}
.rh-shell #cancellation-reminders .cancellation-reminder strong{font-size:10px!important}
.rh-shell #cancellation-reminders .cancellation-reminder span{font-size:7px!important}
/* Six equal category slots; scroll additional categories without clipping shadows. */
body:has(.workspace) .rh-shell .collection-filters{height:44px!important;padding:0!important}
body:has(.workspace) .rh-shell .collection-filters .filter-row{
  width:calc(100% + 8px)!important;height:44px!important;margin-inline:-4px!important;
  padding:4px 4px 8px!important;gap:6px!important;box-sizing:border-box!important;
}
body:has(.workspace) .rh-shell .filter-row .filter-chip,
body:has(.workspace) .rh-shell .filter-row .filter-chip.active{
  flex:0 0 calc((100% - 30px)/6)!important;width:calc((100% - 30px)/6)!important;
  min-width:0!important;max-width:none!important;height:32px!important;min-height:32px!important;
}
/* Index is an inset label. Four named data columns use the entire row; swipe actions sit behind it. */
.rh-shell #modern-list .modern-card{position:relative!important;height:auto!important;min-height:46px!important;overflow:hidden!important}
.rh-shell #modern-list .modern-scroll{width:100%!important;min-width:0!important;overflow:hidden!important}
.rh-shell #modern-list .modern-line{
  display:grid!important;grid-template-columns:94px minmax(0,.95fr) minmax(0,1.2fr) minmax(0,1.2fr)!important;
  grid-auto-columns:0!important;column-gap:7px!important;row-gap:0!important;
  height:auto!important;min-height:46px!important;padding:7px 10px 7px 17px!important;
  width:100%!important;min-width:0!important;align-items:center!important;box-sizing:border-box!important;
}
.rh-shell #modern-list .modern-index{
  display:block!important;position:absolute!important;left:3px!important;top:50%!important;
  width:9px!important;height:auto!important;min-height:0!important;
  grid-column:auto!important;grid-row:auto!important;transform:translateY(-50%)!important;
}
.rh-shell #modern-list .modern-category{display:none!important}
.rh-shell #modern-list .modern-number{grid-column:1!important;grid-row:1!important}
.rh-shell #modern-list .modern-source{grid-column:2!important;grid-row:1!important}
.rh-shell #modern-list .modern-record{grid-column:3!important;grid-row:1!important}
.rh-shell #modern-list .modern-device-value{grid-column:4!important;grid-row:1!important;display:block!important}
.rh-shell #modern-list .modern-card :is(.modern-number,.modern-value,[data-modern-field]),
.rh-shell #modern-list .modern-card [contenteditable="true"]{
  width:100%!important;max-width:none!important;min-width:0!important;
  height:auto!important;min-height:0!important;padding:0!important;margin:0!important;
  overflow:visible!important;text-overflow:clip!important;line-height:1.35!important;
  white-space:normal!important;overflow-wrap:anywhere!important;letter-spacing:normal!important;
  background:transparent!important;outline:none!important;box-shadow:none!important;
}
.rh-shell #modern-list .modern-card .modern-number{
  font-size:11.5px!important;font-weight:650!important;white-space:nowrap!important;
  display:flex!important;align-items:center!important;letter-spacing:-.025em!important;
}
.rh-shell #modern-list .modern-source{display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:2px!important}
.rh-shell #modern-list .modern-source [data-modern-field]{display:block!important;flex:none!important;font-size:9px!important;font-weight:400!important}
.rh-shell #modern-list .modern-source-divider{display:none!important}
.rh-shell #modern-list .modern-card :is(.modern-record,.modern-device-value){display:block!important;font-size:10px!important;font-weight:450!important}
.rh-shell #modern-list .modern-actions{
  position:absolute!important;inset:0 0 0 auto!important;width:88px!important;
  height:100%!important;min-width:88px!important;grid-column:auto!important;
  padding:0 2px!important;gap:0!important;justify-content:space-evenly!important;
}
.rh-shell #modern-list .modern-actions button{width:40px!important;min-width:40px!important;height:100%!important;min-height:42px!important}
@media(max-width:370px){
  .rh-shell #modern-list .modern-line{grid-template-columns:86px minmax(0,.95fr) minmax(0,1.1fr) minmax(0,1.15fr)!important;column-gap:5px!important;padding-inline:14px 7px!important}
  .rh-shell #modern-list .modern-card .modern-number{font-size:10.5px!important}
  .rh-shell #modern-list .modern-source [data-modern-field]{font-size:8.5px!important}
  .rh-shell #modern-list .modern-card :is(.modern-record,.modern-device-value){font-size:9.5px!important}
}
@media(min-width:700px){
  .rh-shell #modern-list .modern-line{grid-template-columns:110px minmax(0,1fr) minmax(0,1.2fr) minmax(0,1.2fr)!important}
  .rh-shell #modern-list .modern-card .modern-number{font-size:13px!important}
  .rh-shell #modern-list .modern-source [data-modern-field]{font-size:10px!important}
  .rh-shell #modern-list .modern-card :is(.modern-record,.modern-device-value){font-size:11px!important}
}

/* Three-line reminders and one-line ICCID / source. */
.rh-shell #cancellation-reminders .cancellation-reminder{
  height:56px!important;min-height:56px!important;padding:6px 4px!important;gap:4px!important;
}
.rh-shell #cancellation-reminders .cancellation-reminder .reminder-time{font-size:8px!important;color:#92655f!important}
.rh-shell #cancellation-reminders .cancellation-reminder .reminder-device{font-size:9px!important;color:#78524d!important}
.rh-shell #modern-list .modern-source{
  flex-direction:row!important;align-items:center!important;gap:4px!important;
  white-space:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;scrollbar-width:none;
}
.rh-shell #modern-list .modern-source::-webkit-scrollbar{display:none}
.rh-shell #modern-list .modern-source [data-modern-field],
.rh-shell #modern-list .modern-source [data-modern-field][contenteditable="true"]{
  display:block!important;flex:0 0 auto!important;width:auto!important;max-width:none!important;
  white-space:nowrap!important;overflow-wrap:normal!important;
}
.rh-shell #modern-list .modern-line{grid-template-columns:94px minmax(0,1.15fr) minmax(0,1.05fr) minmax(0,1.1fr)!important}
@media(max-width:370px){.rh-shell #modern-list .modern-line{grid-template-columns:86px minmax(0,1.35fr) minmax(0,.95fr) minmax(0,.95fr)!important}}
@media(min-width:700px){.rh-shell #modern-list .modern-line{grid-template-columns:110px minmax(0,1.15fr) minmax(0,1.1fr) minmax(0,1.15fr)!important}}

/* Compact reminders: name, device, timestamp / minute countdown. */
.rh-shell #cancellation-reminders .cancellation-reminder{
  height:42px!important;min-height:42px!important;padding:4px!important;gap:2px!important;
}
.rh-shell #cancellation-reminders .cancellation-reminder strong{font-size:8.5px!important}
.rh-shell #cancellation-reminders .cancellation-reminder .reminder-device{font-size:7.65px!important}
.rh-shell #cancellation-reminders .cancellation-reminder .reminder-time{font-size:6.8px!important;font-variant-numeric:tabular-nums}
.rh-shell #cancellation-reminders .cancellation-reminder[data-reminder-stage="1"]{
  background:linear-gradient(145deg,#f3e7da,#ecddce)!important;
  border-color:rgba(159,130,100,.2)!important;
  box-shadow:0 4px 12px rgba(128,101,77,.12),inset 0 1px 0 rgba(255,255,255,.65)!important;
}
.rh-shell #cancellation-reminders .cancellation-reminder[data-reminder-stage="1"] :is(strong,.reminder-device,.reminder-time){color:#806d57!important}

/* Soft blush for active countdowns; shadows replace all alert outlines. */
.rh-shell{--reminder-pending-surface:#f3eded;--reminder-pending-ink:#876f73;--reminder-soft-shadow:var(--fig-shadow)}
.rh-shell #modern-list .modern-card[data-alert="3"],
.rh-shell #cancellation-reminders .cancellation-reminder[data-reminder-stage="1"]{
  background:var(--reminder-pending-surface)!important;
}

/* 2026-10-24 card density: keep every value on one visual line. */
.rh-shell #modern-list{gap:6px!important}
.rh-shell #modern-list .modern-card{height:44px!important;min-height:44px!important}
.rh-shell #modern-list .modern-line{
  height:44px!important;min-height:44px!important;padding:5px 9px 5px 16px!important;column-gap:6px!important;
}
.rh-shell #modern-list .modern-card :is(.modern-number,.modern-value,[data-modern-field],[contenteditable="true"]){
  min-height:0!important;height:auto!important;line-height:1.1!important;white-space:nowrap!important;
  overflow:hidden!important;overflow-wrap:normal!important;word-break:keep-all!important;text-overflow:ellipsis!important;
}
.rh-shell #modern-list .modern-card .modern-number{font-size:11px!important}
.rh-shell #modern-list .modern-source [data-modern-field]{font-size:8.5px!important;max-width:100%!important}
.rh-shell #modern-list .modern-card :is(.modern-record,.modern-device-value){font-size:9.5px!important}
.rh-shell #modern-list .modern-actions button{height:44px!important;min-height:44px!important}
@media(min-width:700px){
  .rh-shell #modern-list .modern-card .modern-number{font-size:12.5px!important}
  .rh-shell #modern-list .modern-source [data-modern-field]{font-size:9.5px!important}
  .rh-shell #modern-list .modern-card :is(.modern-record,.modern-device-value){font-size:10px!important}
}
.rh-shell #modern-list .modern-card[data-alert="3"] .modern-line>*{color:var(--reminder-pending-ink)!important}
.rh-shell #cancellation-reminders .cancellation-reminder[data-reminder-stage="1"] :is(strong,.reminder-device,.reminder-time){color:var(--reminder-pending-ink)!important}
.rh-shell #modern-list .modern-card:is([data-alert="3"],[data-alert="7"]),
.rh-shell #cancellation-reminders .cancellation-reminder[data-reminder-stage]{
  border:0!important;box-shadow:var(--reminder-soft-shadow)!important;
}
.rh-shell #modern-list .modern-card:is([data-alert="3"],[data-alert="7"])::before{display:none!important}

/* Keep serial numbers directly on the card surface in both reminder states. */
.rh-shell #modern-list .modern-card:is([data-alert="3"],[data-alert="7"]) .modern-index{background:transparent!important;box-shadow:none!important;border:0!important}

/* 2026-10-29 mobile card typography: smaller, tighter, and never wrap long values. */
@media(max-width:699px){
  .rh-shell #modern-list{gap:5px!important}
  .rh-shell #modern-list .modern-line{
    column-gap:4px!important;
    padding:5px 8px 5px 15px!important;
  }
  .rh-shell #modern-list .modern-card :is(.modern-number,.modern-value,[data-modern-field],[contenteditable="true"]){
    line-height:1.05!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    overflow-wrap:normal!important;
    word-break:keep-all!important;
    text-overflow:ellipsis!important;
    letter-spacing:-.02em!important;
  }
  .rh-shell #modern-list .modern-card .modern-number{
    font-size:9.5px!important;
    letter-spacing:-.035em!important;
  }
  .rh-shell #modern-list .modern-source [data-modern-field]{
    font-size:7.2px!important;
    letter-spacing:-.025em!important;
  }
  .rh-shell #modern-list .modern-card :is(.modern-record,.modern-device-value){
    font-size:8.25px!important;
    letter-spacing:-.025em!important;
  }
}
@media(max-width:370px){
  .rh-shell #modern-list .modern-card .modern-number{font-size:9px!important}
  .rh-shell #modern-list .modern-source [data-modern-field]{font-size:6.8px!important}
  .rh-shell #modern-list .modern-card :is(.modern-record,.modern-device-value){font-size:7.8px!important}
}

/* 2026-10-29 mobile card balance: tighter columns with a small readability lift. */
@media(max-width:699px){
  .rh-shell #modern-list{gap:4px!important}
  .rh-shell #modern-list .modern-line{
    column-gap:3px!important;
    padding:5px 6px 5px 14px!important;
  }
  .rh-shell #modern-list .modern-source{gap:2px!important}
  .rh-shell #modern-list .modern-card .modern-number{
    font-size:10.2px!important;
    letter-spacing:-.035em!important;
  }
  .rh-shell #modern-list .modern-source [data-modern-field]{font-size:7.8px!important}
  .rh-shell #modern-list .modern-card :is(.modern-record,.modern-device-value){font-size:8.8px!important}
}
@media(max-width:370px){
  .rh-shell #modern-list .modern-card .modern-number{font-size:9.8px!important}
  .rh-shell #modern-list .modern-source [data-modern-field]{font-size:7.4px!important}
  .rh-shell #modern-list .modern-card :is(.modern-record,.modern-device-value){font-size:8.4px!important}
}

/* 7-20 day notice uses a quiet sage tint. */
.rh-shell{--reminder-extended-surface:#eef3ee;--reminder-extended-ink:#687a6c}
.rh-shell #modern-list .modern-card[data-alert="20"],
.rh-shell #cancellation-reminders .cancellation-reminder[data-reminder-stage="2"]{background:var(--reminder-extended-surface)!important;border:0!important;box-shadow:var(--reminder-soft-shadow)!important}
.rh-shell #modern-list .modern-card[data-alert="20"] .modern-line>*{color:var(--reminder-extended-ink)!important}
.rh-shell #cancellation-reminders .cancellation-reminder[data-reminder-stage="2"] :is(strong,.reminder-device,.reminder-time){color:var(--reminder-extended-ink)!important}

.rh-shell #modern-list .modern-card.extended-cancellation-soft{background:var(--reminder-extended-surface)!important;border:0!important;box-shadow:var(--reminder-soft-shadow)!important}
.rh-shell #modern-list .modern-card.extended-cancellation-soft .modern-line>*{color:var(--reminder-extended-ink)!important}
