

:root{
  /* ---- 字阶 ---- */
  --rh-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  --rh-fs-display: 28px;
  --rh-fs-title:   22px;
  --rh-fs-body:    17px;
  --rh-fs-sub:     15px;
  --rh-fs-cap:     13px;
  --rh-lh:         1.5;

  /* ---- 间距 ---- */
  --rh-gap:      12px;
  --rh-gutter:   18px;
  --rh-tap:      44px;

  /* ---- 圆角 ---- */
  --rh-r-lg:  28px;
  --rh-r-md:  24px;
  --rh-r-sm:  16px;
  --rh-r-pill: 999px;

  /* ---- 奶油色板（浅色）----
     底色走米黄而非冷灰：canvas 是纸张，surface 是叠在上面的卡片。
     层级靠「越靠前越白、越靠后越黄」拉开，不靠边框硬切。 */
  --rh-canvas:     #f6f1e7;
  --rh-surface:    #fffdf9;
  --rh-surface-2:  #f3ece0;
  --rh-surface-3:  #ebe2d3;
  --rh-line:       #e4dac7;
  --rh-text:       #2a2419;
  --rh-text-2:     #5c5343;
  --rh-muted:      #8b8069;

  /* ---- 强调色：陶土棕 ----
     奶油底上暖色才成立；蓝的全被换掉了。
     6.1:1 对比（#a04a1f on #fffdf9），正文级可读。 */
  --rh-accent:      #a04a1f;
  --rh-accent-ink:  #fffdf9;
  --rh-accent-soft: #f7e7dc;

  /* ---- 语义色 ---- */
  --rh-danger:  #e5484d;
  --rh-warn:    #d97706;
  --rh-ok:      #10b981;

  /* ---- 阴影 / 玻璃 ---- */
  --rh-shadow:      0 1px 2px rgba(58,44,26,.04), 0 8px 24px rgba(58,44,26,.06);
  --rh-shadow-lift: 0 2px 6px rgba(58,44,26,.06), 0 16px 40px rgba(58,44,26,.10);
  --rh-glass-blur:  20px;
  --rh-glass-bg:    rgba(255,255,255,.72);

  --rh-ease: cubic-bezier(.22,.61,.36,1);
  --rh-dur:  .2s;
}

/* ===========================================================================
   基础
   =========================================================================== */
html{
  font-size: 100%;                 /* 不再用 15px 缩放，回到 16px 基准 */
  -webkit-text-size-adjust: 100%;
  background: var(--rh-canvas);
}
body{
  font-family: var(--rh-font);
  font-size: var(--rh-fs-body);
  line-height: var(--rh-lh);
  color: var(--rh-text);
  background: var(--rh-canvas);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

/* 重做后的外壳：改用 flex 两栏，侧栏抽屉化 */
.rh-shell{
  min-height: 100svh;
  min-height: 100vh;
  background: var(--rh-canvas);
}

/* ===========================================================================
   侧栏：抽屉 + 玻璃，宽 78vw，最大 320px
   =========================================================================== */
.rh-shell .sidebar{
  position: fixed;
  inset: 0 auto 0 0;
  width: min(78vw, 320px);
  margin: 0;                                        /* 干掉旧的 margin-left 偏移 */
  padding: calc(20px + env(safe-area-inset-top)) var(--rh-gutter)
           calc(20px + env(safe-area-inset-bottom));
  background: var(--rh-surface);
  border-right: 1px solid var(--rh-line);
  border-radius: 0 var(--rh-r-lg) var(--rh-r-lg) 0;
  box-shadow: var(--rh-shadow-lift);
  transform: translateX(-102%);
  transition: transform var(--rh-dur) var(--rh-ease);
  z-index: 60;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.rh-shell .sidebar.open{ transform: translateX(0); }
.rh-shell .sidebar :is(a,button){ border-radius: var(--rh-r-sm); }

.rh-shell .brand{ display: flex; align-items: center; gap: 12px; padding: 4px 2px 20px; text-decoration: none; color: var(--rh-text); }
.rh-shell .brand-mark{
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  border-radius: var(--rh-r-sm);
  background: var(--rh-accent-soft);
}
.rh-shell .brand-mark img{ width: 22px; height: 22px; }
.rh-shell .brand > span{ display: flex; flex-direction: column; line-height: 1.25; }
.rh-shell .brand .brand-en{ font-size: var(--rh-fs-cap); letter-spacing: .16em; color: var(--rh-muted); font-weight: 600; }
.rh-shell .brand small{ font-size: var(--rh-fs-cap); color: var(--rh-muted); font-weight: 400; }

/* 新建按钮 */
.rh-shell .new-note{
  width: 100%; min-height: var(--rh-tap);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 18px; padding: 0 16px;
  font: inherit; font-weight: 650; font-size: var(--rh-fs-body);
  color: var(--rh-accent-ink); background: var(--rh-accent);
  border: 0; border-radius: var(--rh-r-md);
  box-shadow: var(--rh-shadow);
}
.rh-shell .new-note img{ width: 18px; height: 18px; filter: brightness(0) invert(1); }
.rh-shell .new-note .shortcut{ opacity: .6; font-size: var(--rh-fs-cap); font-weight: 500; }

/* 导航项：改成大行高列表 */
.rh-shell .main-nav, .rh-shell #tag-nav{ display: flex; flex-direction: column; gap: 2px; }
.rh-shell .nav-item{
  width: 100%; min-height: var(--rh-tap);
  display: flex; align-items: center; gap: 12px;
  padding: 0 12px; margin: 0;
  font: inherit; font-size: var(--rh-fs-body); font-weight: 500;
  color: var(--rh-text); background: transparent;
  border: 0; border-radius: var(--rh-r-sm);
  text-align: left;
}
.rh-shell .nav-item img{ width: 20px; height: 20px; opacity: .75; }
.rh-shell .nav-item:nth-child(n+3){ } /* 保留结构 */
.rh-shell .nav-item .count{
  margin-left: auto; min-width: 26px; padding: 2px 8px;
  font-size: var(--rh-fs-cap); font-weight: 600; text-align: center;
  color: var(--rh-text-2); background: var(--rh-surface-2);
  border-radius: var(--rh-r-pill);
}
.rh-shell .nav-item.active{ background: var(--rh-accent-soft); color: var(--rh-accent); font-weight: 650; }
.rh-shell .nav-item.active img{ opacity: 1; }
.rh-shell .nav-item.active .count{ background: var(--rh-accent); color: var(--rh-accent-ink); }

.rh-shell .nav-heading{
  display: flex; align-items: center; justify-content: space-between;
  margin: 22px 0 8px; padding: 0 12px;
  font-size: var(--rh-fs-cap); font-weight: 600; letter-spacing: .04em;
  color: var(--rh-muted); text-transform: uppercase;
}
.rh-shell .icon-button{
  width: var(--rh-tap); height: var(--rh-tap);
  display: grid; place-items: center;
  padding: 0; border: 0; border-radius: var(--rh-r-sm);
  background: transparent; color: inherit;
}
.rh-shell .icon-button img{ width: 20px; height: 20px; }

/* 侧栏底部工具区 */
.rh-shell .sidebar-stock-entry{ margin-top: 6px; }
.rh-shell .sidebar-stock-entry a, .rh-shell .sidebar-stock-entry button{
  width: 100%; min-height: var(--rh-tap);
  display: flex; align-items: center; gap: 12px;
  padding: 0 12px;
  font: inherit; font-size: var(--rh-fs-sub); font-weight: 500;
  color: var(--rh-text); background: transparent;
  border: 0; border-radius: var(--rh-r-sm);
  text-decoration: none;
}
.rh-shell .sidebar-stock-entry img{ width: 20px; height: 20px; opacity: .7; }
.rh-shell .sidebar-stock-entry span{ display: flex; flex-direction: column; line-height: 1.3; }
.rh-shell .sidebar-stock-entry small{ font-size: var(--rh-fs-cap); color: var(--rh-muted); }

.rh-shell .side-bottom{ margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rh-line); }
.rh-shell .connection{
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--rh-r-sm); background: var(--rh-surface-2);
}
.rh-shell .connection-icon{ width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: var(--rh-r-sm); background: var(--rh-surface-3); }
.rh-shell .connection-icon img{ width: 16px; height: 16px; }
.rh-shell .connection strong{ display: block; font-size: var(--rh-fs-sub); font-weight: 600; }
.rh-shell .connection small{ font-size: var(--rh-fs-cap); color: var(--rh-muted); }

/* 遮罩 */
.rh-shell .scrim{
  position: fixed; inset: 0; z-index: 55;
  background: rgba(58,44,26,.42);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  border: 0;
}

/* ===========================================================================
   工作区
   =========================================================================== */
.rh-shell .workspace{
  min-height: 100svh; min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--rh-canvas);
}
.rh-shell main{
  flex: 1;
  width: 100%; max-width: 720px; margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) var(--rh-gutter)
           calc(28px + env(safe-area-inset-bottom));
}

/* ---- 吸顶迷你栏：菜单 / 标题 / 同步 ---- */
.rh-shell .rh-top{
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  margin: calc(-12px - env(safe-area-inset-top)) calc(-1 * var(--rh-gutter)) 14px;
  padding: calc(8px + env(safe-area-inset-top)) var(--rh-gutter) 10px;
  background: var(--rh-glass-bg);
  backdrop-filter: blur(var(--rh-glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--rh-glass-blur)) saturate(160%);
  border-bottom: 1px solid var(--rh-line);
}
.rh-shell .rh-top-title{ flex: 1; min-width: 0; }
.rh-shell .rh-top-title h2{
  margin: 0; font-size: var(--rh-fs-title); font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rh-shell .rh-top-title h2 #heading-count{
  margin-left: 7px; font-size: var(--rh-fs-cap); font-weight: 600;
  color: var(--rh-muted); vertical-align: middle;
}
.rh-shell .rh-top-title p{
  margin: 1px 0 0; font-size: var(--rh-fs-cap); color: var(--rh-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rh-shell .rh-icon-btn{
  flex: none; width: var(--rh-tap); height: var(--rh-tap);
  display: grid; place-items: center; padding: 0;
  border: 1px solid var(--rh-line); border-radius: var(--rh-r-sm);
  background: var(--rh-surface); color: var(--rh-text);
}
.rh-shell .rh-icon-btn img{ width: 20px; height: 20px; }
.rh-shell .rh-icon-btn:active{ background: var(--rh-surface-2); }

/* ---- 搜索 + 排序行 ---- */
.rh-shell .rh-search-row{
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.rh-shell .rh-search{
  flex: 1; min-width: 0; min-height: 46px;
  display: flex; align-items: center; gap: 9px;
  padding: 0 14px;
  background: var(--rh-surface);
  border: 1px solid var(--rh-line);
  border-radius: var(--rh-r-md);
}
.rh-shell .rh-search img{ width: 19px; height: 19px; opacity: .45; flex: none; }
.rh-shell .rh-search input{
  flex: 1; min-width: 0;
  font: inherit; font-size: var(--rh-fs-body);
  color: var(--rh-text); background: transparent; border: 0; outline: 0;
}
.rh-shell .rh-search input::placeholder{ color: var(--rh-muted); }
.rh-shell .rh-sort{
  position: relative; flex: none;
  display: flex; align-items: center;
  min-height: 46px; padding: 0 10px;
  background: var(--rh-surface); border: 1px solid var(--rh-line);
  border-radius: var(--rh-r-md);
}
.rh-shell .rh-sort select{
  appearance: none; -webkit-appearance: none;
  padding-right: 18px; max-width: 4.6em;
  font: inherit; font-size: var(--rh-fs-sub); color: var(--rh-text);
  background: transparent; border: 0; outline: 0;
}
.rh-shell .rh-sort img{
  position: absolute; right: 8px; width: 15px; height: 15px;
  opacity: .45; pointer-events: none;
}
.rh-shell #select-mode{
  width: 46px; height: 46px;
  display: grid; place-items: center; padding: 0;
  border: 1px solid var(--rh-line); border-radius: var(--rh-r-md);
  background: var(--rh-surface);
}
.rh-shell #select-mode img{ width: 20px; height: 20px; }
.rh-shell #select-mode.active{ background: var(--rh-accent); border-color: var(--rh-accent); }
.rh-shell #select-mode.active img{ filter: brightness(0) invert(1); }

/* ---- 分类筛选 chips ---- */
.rh-shell .collection-filters{ margin-bottom: 16px; }
.rh-shell .filter-row{
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.rh-shell .filter-row::-webkit-scrollbar{ display: none; }
.rh-shell .filter-chip{
  flex: none; min-height: 38px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 14px;
  font: inherit; font-size: var(--rh-fs-sub); font-weight: 550;
  color: var(--rh-text-2); background: var(--rh-surface);
  border: 1px solid var(--rh-line); border-radius: var(--rh-r-pill);
  white-space: nowrap;
}
.rh-shell .filter-chip.active{
  color: var(--rh-accent-ink); background: var(--rh-accent); border-color: var(--rh-accent);
}
.rh-shell .filter-chip .chip-count{ font-size: var(--rh-fs-cap); opacity: .65; }
.rh-shell .filter-chip .tag-dot{ width: 10px; height: 10px; border-radius: 50%; }

/* ---- 提示条 ---- */
.rh-shell .notice{
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 12px; padding: 12px 14px;
  font-size: var(--rh-fs-sub);
  background: var(--rh-surface); border: 1px solid var(--rh-line);
  border-radius: var(--rh-r-sm);
}
.rh-shell .notice button{
  min-height: 34px; padding: 0 12px;
  font: inherit; font-size: var(--rh-fs-cap); font-weight: 600;
  color: var(--rh-accent-ink); background: var(--rh-accent);
  border: 0; border-radius: var(--rh-r-pill);
}

/* 底部导航栏已撤除，视图切换收进侧栏（.nav-item[data-view]）。
   app.js 里写的是 .rh-tab[data-view], .nav-item[data-view] 两个一起选，
   所以撤掉标签栏后侧栏那三个按钮照样点亮。 */


/* ===========================================================================
   接管原站 token
   ---------------------------------------------------------------------------
   style.css 把 --accent 定成青柠 #c9fb46、--radius-control 定成 16px，
   分组圆点、卡片描边、卡片圆角全部吃这两个变量。我这边只定义了 --rh-*，
   没接上，所以第一轮看起来"只换了配色、而且配色还是原站的"。
   这里把原站变量在同一作用域整体改写，所有既有组件自动跟随新体系。
   =========================================================================== */
.rh-shell{
  /* 圆角：原站 16px -> 大圆角 */
  --radius-xs: 12px;
  --radius-sm: var(--rh-r-sm);
  --radius-md: 20px;
  --radius-control: var(--rh-r-md);
  --radius-card: var(--rh-r-lg);

  /* 强调色：青柠 -> 冷蓝 */
  --accent: var(--rh-accent);
  --accent-strong: #7d3614;
  --accent-soft: var(--rh-accent-soft);
  --accent-ink: var(--rh-accent-ink);

  /* 文字与分隔线：暖灰 -> 冷中性 */
  --muted: var(--rh-muted);
  --muted-2: #a99a7e;
  --line: var(--rh-line);
  --line-strong: #cfc1a8;

  /* 表面对齐到新的玻璃体系 */
  --surface-glass: rgba(255,255,255,.72);
  --shadow-card: 0 1px 2px rgba(58,44,26,.05), 0 10px 28px rgba(58,44,26,.07);
}

/* ---- 卡片单行网格 ----
   显式指派列位，手机号码、分类、来源、记录、设备和操作各占一格，
   让窄屏也能完整看到设备信息。 */
.rh-shell .modern-line{
  grid-template-columns: 96px 16px minmax(140px,1fr) 94px minmax(90px,.7fr) auto;
  align-items: center;
  gap: 4px;
  min-height: 60px;
  padding: 10px 8px;
  font-size: var(--rh-fs-sub);
}
.rh-shell .modern-index{ display: none; }
.rh-shell .modern-device-value{ display: inline-flex; grid-column: 5; }
.rh-shell .modern-number{ grid-column: 1; }
.rh-shell .modern-category{ grid-column: 2; }
.rh-shell .modern-source{
  grid-column: 3;
  display: inline-flex; align-items: center; min-width: 0;
  /* 容器自身的 padding 0 4px 与 gap 6px 会挤掉内层字段的可用宽度：
     65px 的轨道里内层只剩 57px。ICCID 与分隔点现在都隐藏，
     容器只剩一个可见子元素，二者归零，字段拿满整条轨道。 */
  padding: 0;
  gap: 0;
}
.rh-shell .modern-record{ grid-column: 4; }
.rh-shell .modern-actions{ grid-column: 6; }
.rh-shell .modern-index{
  font-size: var(--rh-fs-cap); font-weight: 600;
  color: var(--rh-muted); font-variant-numeric: tabular-nums;
}
.rh-shell .modern-number{
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 14px; font-weight: 650; letter-spacing: -0.01em;
  color: var(--rh-text); font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rh-shell .modern-category i{ width: 12px; height: 12px; border-radius: 50%; display: block; }

.rh-shell .modern-value{
  min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--rh-text-2);
}
/* 来源列的字段宽 = 轨道宽，不留内边距。
   style.css 里 [data-modern-field] 与 [data-modern-field="source"] 两条规则
   各带 padding 0 4px，在 65px 的列里吃掉 8px —— "联通线上办理" 正差这 8px。
   这里用同等具体度的属性选择器压过去，而不是靠 :not()。 */
.rh-shell .modern-source > span:not(.modern-source-divider), .rh-shell .modern-source > [data-modern-field]{
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0;
}
.rh-shell .modern-source-divider{
  flex: none; width: 3px; height: 3px; border-radius: 50%;
  background: var(--rh-muted); opacity: .6;
}

/* 分类圆点：按钮收成 16px 宽，圆点居中。
   原按钮固有宽度 22px，单行预算里那 6px 是纯浪费。 */
.rh-shell .modern-category{
  width: 16px; min-width: 16px; height: 38px;
  display: grid; place-items: center;
  padding: 0; border: 0; background: transparent;
}

/* 操作按钮：默认收起，编辑/选中时展开 */
.rh-shell .modern-actions{ display: flex; align-items: center; gap: 2px; flex: none; }
.rh-shell .modern-actions button{
  height: 40px; min-height: 40px;
  border: 0; border-radius: var(--rh-r-pill);
  background: transparent; color: var(--rh-muted);
  transition: background var(--rh-dur) var(--rh-ease);
}
.rh-shell .modern-actions button img{ width: 18px; height: 18px; }
.rh-shell .modern-actions button span{ display: none; }   /* 图标按钮，文字给读屏 */
.rh-shell .modern-actions button:active{ background: var(--rh-surface-2); }

/* 行内编辑态 */
.rh-shell .modern-card.modern-editing{
  border-color: var(--rh-accent);
  box-shadow: 0 0 0 3px var(--rh-accent-soft), var(--rh-shadow-lift);
}
.rh-shell [data-modern-active]{
  outline: 0; background: var(--rh-accent-soft);
  border-radius: 8px; box-shadow: 0 0 0 4px var(--rh-accent-soft);
  color: var(--rh-text);
}

/* 危险态：待删除 / 预警 */

/* 隐藏真实表格但保留可访问性 */
.rh-shell #records-scroll{
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
.rh-shell #records-scroll:not([hidden]) ~ *{ }

/* ---- 空状态 ---- */
.rh-shell .empty-state{
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 10px; padding: 56px 24px;
}
.rh-shell .empty-icon{
  width: 64px; height: 64px; display: grid; place-items: center;
  border-radius: var(--rh-r-md); background: var(--rh-surface-2);
}
.rh-shell .empty-icon img{ width: 28px; height: 28px; opacity: .6; }
.rh-shell .empty-state h2{ margin: 6px 0 0; font-size: var(--rh-fs-title); font-weight: 700; letter-spacing: -0.02em; }
.rh-shell .empty-state p{ margin: 0; max-width: 30ch; font-size: var(--rh-fs-sub); color: var(--rh-muted); }
.rh-shell .empty-state .primary{
  min-height: var(--rh-tap); margin-top: 8px; padding: 0 22px;
  font: inherit; font-size: var(--rh-fs-body); font-weight: 650;
  color: var(--rh-accent-ink); background: var(--rh-accent);
  border: 0; border-radius: var(--rh-r-md);
}

/* ---- 页脚计数 ---- */
.rh-shell .workspace-footer{
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 24px; padding-top: 16px;
  font-size: var(--rh-fs-cap); color: var(--rh-muted);
  border-top: 1px solid var(--rh-line);
}
.rh-shell .workspace-footer span{ display: inline-flex; align-items: center; gap: 6px; }
.rh-shell .workspace-footer img{ width: 15px; height: 15px; opacity: .6; }


.rh-shell .bulk-bar, body .bulk-bar{
  position: fixed; left: var(--rh-gutter); right: var(--rh-gutter);
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 80;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--rh-glass-bg);
  backdrop-filter: blur(var(--rh-glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--rh-glass-blur)) saturate(160%);
  border: 1px solid var(--rh-line);
  border-radius: var(--rh-r-lg);
  box-shadow: var(--rh-shadow-lift);
}
.rh-shell .bulk-bar span{ flex: 1; font-size: var(--rh-fs-sub); font-weight: 600; }
.rh-shell .bulk-bar button{
  min-height: 40px; padding: 0 16px;
  font: inherit; font-size: var(--rh-fs-sub); font-weight: 600;
  color: var(--rh-text); background: var(--rh-surface-2);
  border: 0; border-radius: var(--rh-r-pill);
}
.rh-shell .bulk-bar #bulk-delete{ background: var(--rh-danger); color: #fff; }
.rh-shell .bulk-bar #bulk-cancel{ width: 40px; padding: 0; background: transparent; }
.rh-shell .bulk-bar #bulk-cancel img{ width: 18px; height: 18px; }

/* 弹层 */
body .modal-backdrop{
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(58,44,26,.42);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
body .editor, body .utility{
  width: 100%; max-width: 720px;
  max-height: 92svh; overflow-y: auto;
  padding: 18px var(--rh-gutter) calc(20px + env(safe-area-inset-bottom));
  background: var(--rh-surface);
  border-radius: var(--rh-r-lg) var(--rh-r-lg) 0 0;
  box-shadow: var(--rh-shadow-lift);
}
body .editor-top, body .utility > header{
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
body .editor-top #editor-heading{ flex: 1; font-size: var(--rh-fs-body); font-weight: 650; }
body .editor-top .icon-button, body .utility .icon-button{
  width: var(--rh-tap); height: var(--rh-tap);
  display: grid; place-items: center;
  border: 0; border-radius: var(--rh-r-sm); background: var(--rh-surface-2);
}
body .editor-top .icon-button img, body .utility .icon-button img{ width: 20px; height: 20px; }
body .editor-top .primary.small{
  min-height: 38px; padding: 0 18px;
  font: inherit; font-size: var(--rh-fs-sub); font-weight: 650;
  color: var(--rh-accent-ink); background: var(--rh-accent);
  border: 0; border-radius: var(--rh-r-pill);
}
body .editor .phone-input, body .editor .phone-fields input, body .editor .note-title{
  width: 100%; min-height: var(--rh-tap);
  padding: 0 14px;
  font: inherit; font-size: var(--rh-fs-body); color: var(--rh-text);
  background: var(--rh-surface-2);
  border: 1px solid var(--rh-line); border-radius: var(--rh-r-sm);
}
body .editor .phone-editor-heading{ margin-bottom: 14px; }
body .editor .phone-editor-heading label{ display: block; margin-top: 4px; font-size: var(--rh-fs-body); font-weight: 600; }
body .editor .editor-kicker{ font-size: var(--rh-fs-cap); letter-spacing: .14em; color: var(--rh-muted); font-weight: 600; }
body .editor .phone-fields{ display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
body .editor .phone-fields label{ display: flex; flex-direction: column; gap: 6px; font-size: var(--rh-fs-cap); color: var(--rh-muted); font-weight: 600; }

/* 登录 */
body .auth-screen{
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: var(--rh-gutter);
  background: var(--rh-canvas);
}
body .auth-card{
  width: 100%; max-width: 360px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 32px 24px calc(28px + env(safe-area-inset-bottom));
  text-align: center;
  background: var(--rh-surface);
  border: 1px solid var(--rh-line);
  border-radius: var(--rh-r-lg);
  box-shadow: var(--rh-shadow-lift);
}
body .auth-card h1{ margin: 8px 0 0; font-size: var(--rh-fs-title); font-weight: 700; letter-spacing: -0.02em; }
body .auth-card p{ margin: 0; font-size: var(--rh-fs-sub); color: var(--rh-muted); }
body .auth-card .router-link{
  margin-top: 12px; min-height: var(--rh-tap);
  display: inline-flex; align-items: center; padding: 0 20px;
  font-size: var(--rh-fs-sub); font-weight: 600; text-decoration: none;
  color: var(--rh-accent-ink); background: var(--rh-accent); border-radius: var(--rh-r-pill);
}

/* Toast */
body .toast{
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 120;
  max-width: calc(100vw - 2 * var(--rh-gutter));
  padding: 12px 20px;
  font-size: var(--rh-fs-sub); font-weight: 550;
  color: #fff; background: rgba(58,44,26,.92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: var(--rh-r-pill);
  box-shadow: var(--rh-shadow-lift);
}

/* ===========================================================================
   窄屏收窄
   =========================================================================== */
/* 序号（装饰位）让位给号码 —— 列宽归零，轨道不塌 */
@media (max-width: 430px){
  :root{ --rh-gutter: 8px; }
  .rh-shell .modern-line{
    grid-template-columns: minmax(88px,1.2fr) 16px minmax(42px,.75fr) minmax(68px,1fr) minmax(46px,.7fr) 54px;
    gap: 2px; padding: 10px 6px; min-height: 60px;
  }
  .rh-shell .modern-index{ display: none; }
  .rh-shell .modern-value{ font-size: 12px; letter-spacing: -.03em; }
}
/* 更窄的手机继续保留设备列，缩短固定轨道并收紧字距。 */
@media (max-width: 380px){
  .rh-shell .modern-line{
    grid-template-columns: minmax(82px,1.1fr) 16px minmax(34px,.65fr) minmax(58px,.9fr) minmax(40px,.6fr) 50px;
    gap: 1px; padding: 10px 5px;
  }
  .rh-shell .modern-value{ font-size: 12px; letter-spacing: -.03em; }
}

/* 动效降级 */
@media (prefers-reduced-motion: reduce){
  *{ animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 分组标题：从"小圆点+全大写小字"改为"色点+正常字重标题" */
.rh-shell .modern-group-label{
  margin: 20px 2px 9px;
  font-size: var(--rh-fs-cap);
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  color: var(--rh-text-2);
}
.rh-shell .modern-group-label i{ width: 8px; height: 8px; box-shadow: 0 0 0 3px var(--rh-accent-soft); }

/* ICCID 是 20 位数字，在单行卡片上既读不出也认不下；
   它仍在编辑器里完整可编辑，这里只是不在卡片上占位。 */
.rh-shell .modern-source > [data-modern-field="code"]{ display: none; }
.rh-shell .modern-source-divider{ display: none; }

/* 号码是这一行的身份，任何情况下都不许截断。
   字距收紧一级，把 11 位号码的实测宽度从 106px 压到 ~100px，
   再配上面的 minmax(106px,…) 硬下限，留出 6px 余量。 */
.rh-shell .modern-number{
  letter-spacing: -.04em;
  text-overflow: clip;
}

/* 图钉绝对定位到号码右上角，不再占用号码本身的宽度预算。
   这正是置顶行号码被截的成因：13px 图钉 + 4px 间隙挤在同一格里。 */
.rh-shell .modern-number{
  position: relative;
  overflow: visible;
  padding: 0;
}
/* 置顶图钉：绝对定位到号码右上角，不参与号码的宽度预算
   （内联时它吃掉 17px，正是此前置顶行号码被截的成因）。
   号码文字上沿与单元格上沿相距约 10px，top/-3px 让它贴着文字而非悬在行外。 */
.rh-shell .modern-pin-mark{
  position: absolute;
  top: -3px; right: 0;
  width: 11px; height: 11px;
  opacity: .6;
}

/* 注销时间：11px 紧凑排版，横向内边距归零。
   它原本带 padding 0 4px，94px 轨道里只剩 86px 给文字，而"2026-08-30 注销"
   在 11px 下需要 90.2px —— 截断的成因是这 8px，不是轨道宽度。
   完整日期在编辑器里始终可读可改。 */
.rh-shell .modern-record{
  font-size: 11px;
  letter-spacing: -.01em;
  padding: 0;
  color: var(--rh-muted);
  font-variant-numeric: tabular-nums;
}

.rh-shell .modern-actions button img{ width: 14px; height: 14px; }

/* 手机档：号码与注销时间优先保完整，来源列承担截断。
   实测 375px 下五项并存的预算：号码 96 + 分类 16 + 日期 94 + 按钮 54 = 260，
   余下约 70px 给来源（"移动营业厅" 5 字 ≈ 55px、"联通线上办理" 6 字 = 65px，均完整）。 */

/* ===========================================================================
   侧栏重排（v2）
   ---------------------------------------------------------------------------
   上一版侧栏是「大行高列表」，功能没错但没结构：六块内容一个接一个平铺，
   彼此只差 margin，读起来是一长条。这一版把它们收成同一套语法：

     · .sb-group  —— 一个分组，用间距而不是分割线划分
     · .sb-label  —— 分组标题，小字大字距
     · 行高统一 44px，圆角统一 --rh-r-sm，图标统一 20px

   底部导航栏已撤除，视图切换（全部 / 星标 / 删除）现在只在这里，
   因此这三行是侧栏的主干，用点缀色强调得比其它行重。
   =========================================================================== */

/* ---- 侧栏底：暖色纸面 + 极轻的分层，靠圆角收边 ---- */
.rh-shell .sidebar{
  background:
    linear-gradient(180deg, var(--rh-surface) 0%, var(--rh-surface) 62%, var(--rh-surface-2) 100%);
  border-right: 1px solid var(--rh-line);
  box-shadow: 0 0 0 1px rgba(58,44,26,.03), 0 24px 64px rgba(58,44,26,.22);
  padding: calc(18px + env(safe-area-inset-top)) 14px
           calc(14px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;   /* 让底部状态块能贴底 */
}

/* ---- 滚动条：细、暖、不抢眼 ---- */
.rh-shell .sidebar::-webkit-scrollbar{ width: 6px; }
.rh-shell .sidebar::-webkit-scrollbar-thumb{
  background: var(--rh-line); border-radius: 999px;
}

/* ---- 分组骨架 ----
   标记是既有的 section，不新增 wrapper：节奏靠每个 section 自己的
   margin 拉开，行内间隔靠 2px gap。 */
.rh-shell .main-nav, .rh-shell #tag-nav, .rh-shell .sidebar-tools{ display: flex; flex-direction: column; gap: 2px; }

.rh-shell .sidebar-categories{ margin-top: 18px; }
.rh-shell .sidebar-memos{ margin-top: 18px; }
.rh-shell .sidebar-stock-entry{ margin-top: 6px; }
.rh-shell .sidebar-stock-entry:first-of-type{ margin-top: 16px; }

/* 分组标题：小字 + 大字距，用留白而不是分割线划分 */
.rh-shell .nav-heading{
  min-height: 28px;
  margin: 0 0 6px; padding: 0 10px;
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--rh-muted);
}

/* ---- 品牌 ---- */
.rh-shell .brand{ padding: 2px 10px 16px; gap: 11px; border-radius: var(--rh-r-sm); }
.rh-shell .brand-mark{
  width: 42px; height: 42px;
  border-radius: 14px;
  background: var(--rh-accent-soft);
  box-shadow: inset 0 0 0 1px rgba(160,74,31,.10);
}
.rh-shell .brand-mark img{ width: 21px; height: 21px; }
.rh-shell .brand > span{ gap: 1px; }
.rh-shell .brand strong, .rh-shell .brand > span > span:first-child{ font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.rh-shell .brand .brand-en{ font-size: 9.5px; letter-spacing: .2em; margin-top: 3px; }
.rh-shell .brand small{ font-size: 11px; margin-top: 3px; }

/* ---- 新建按钮：整条侧栏唯一实心色块 ---- */
.rh-shell .new-note{
  margin-bottom: 16px;
  min-height: 50px;
  border-radius: var(--rh-r-md);
  font-size: 16px; font-weight: 650;
  letter-spacing: -.01em;
  box-shadow: 0 6px 18px rgba(160,74,31,.24);
}
.rh-shell .new-note:active{ transform: scale(.985); }
.rh-shell .new-note .shortcut{
  margin-left: auto;
  padding: 2px 7px;
  font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,.18);
  border-radius: 7px;
}

/* ---- 导航行（视图 / 分类 / 工具，共用一套语法）---- */
/* 优先级必须与 memo-categories.css 的第 148 行打平：
   它写的是 `.sidebar .main-nav .nav-item`（0,3,0），而 `.rh-shell .nav-item`
   只有（0,2,0）—— 同层叠顺序下矮一级就是输，行高会停在它的 35px。
   所以这里显式写成同样三段。 */
.rh-shell .nav-item, .rh-shell .sidebar .main-nav .nav-item, .rh-shell .sidebar-stock-entry a, .rh-shell .sidebar-stock-entry button, .rh-shell .sidebar #tag-nav .nav-item, .rh-shell .sidebar-tools .nav-item, .rh-shell .sidebar-tools a{
  width: 100%;
  min-height: 44px;
  display: flex; align-items: center; gap: 11px;
  padding: 0 10px; margin: 0;
  font-family: inherit; font-size: 15px; font-weight: 500;
  color: var(--rh-text);
  background: transparent;
  border: 0; border-radius: var(--rh-r-sm);
  text-align: left; text-decoration: none;
  transition: background var(--rh-dur) var(--rh-ease);
}
.rh-shell .nav-item img, .rh-shell .sidebar-stock-entry img, .rh-shell .sidebar-tools img{ width: 20px; height: 20px; flex: none; opacity: .62; }
.rh-shell .nav-item > span:first-of-type{ min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 分类行密度略高一点，毕竟可能有很多条 */
.rh-shell #tag-nav .nav-item{ min-height: 40px; font-size: 14px; }
.rh-shell #tag-nav{ gap: 1px; max-height: 220px; }

/* 计数：默认是中性的胶囊，选中时才染上强调色 */
.rh-shell .nav-item .count{
  margin-left: auto; flex: none;
  min-width: 24px; padding: 2px 8px;
  font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums; text-align: center;
  color: var(--rh-text-2); background: var(--rh-surface-2);
  border-radius: 999px;
}

/* 选中态：底纹 + 左侧一道短竖条，比整行反色更克制 */
.rh-shell .nav-item.active{
  position: relative;
  background: var(--rh-accent-soft);
  color: var(--rh-accent);
  font-weight: 650;
}
.rh-shell .nav-item.active::before{
  content: ''; position: absolute; left: 0; top: 11px; bottom: 11px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--rh-accent);
}
.rh-shell .nav-item.active img{ opacity: 1; }
.rh-shell .nav-item.active .count{ background: var(--rh-accent); color: var(--rh-accent-ink); }

/* ---- 分类区的「管理」按钮 ---- */
.rh-shell .nav-heading .icon-button, .rh-shell .sb-label .icon-button{
  width: 28px; min-height: 28px; height: 28px;
  display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 8px;
  background: transparent; color: var(--rh-muted);
}
.rh-shell .nav-heading .icon-button img{ width: 16px; height: 16px; opacity: .8; }

/* ---- 备忘录预览：侧栏里唯一的「卡片」 ---- */
.rh-shell .sidebar-memos{
  padding: 12px;
  background: var(--rh-surface-2);
  border: 1px solid var(--rh-line);
  border-radius: var(--rh-r-md);
}
.rh-shell .sidebar-memos header{ min-height: 28px; }
.rh-shell .memo-nav{ font-size: 14px; font-weight: 650; color: var(--rh-text); }
.rh-shell .memo-nav img{ opacity: .7; }
.rh-shell #sidebar-memo-count, .rh-shell .sidebar-memos header > span{ font-size: 12px; color: var(--rh-muted); }

.rh-shell .mc-toolbar{ margin: 8px 0 6px; gap: 6px; }
.rh-shell .sidebar-memos .mc-toolbar > button, .rh-shell .sidebar-memos .mc-trigger{
  min-height: 30px; padding: 0 10px;
  font-size: 12px; font-weight: 600;
  color: var(--rh-text-2); background: var(--rh-surface);
  border: 1px solid var(--rh-line); border-radius: 999px;
}
.rh-shell .sidebar-memos .mc-trigger span{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* JS 生成的行：白底改成纸面，行高与圆角对齐新体系 */
.rh-shell .sidebar-memo-row{
  height: 34px; gap: 4px;
  margin: 1px 0;
  background: transparent;
  border-radius: 10px;
}
.rh-shell .sidebar-memo-row:hover{ background: var(--rh-surface-3); }
.rh-shell .sidebar-memo-row .sidebar-memo-item{
  min-width: 0; flex: 1;
  font-size: 13px; color: var(--rh-text-2);
  background: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rh-shell .sidebar-memo-row .mc-trigger{
  background: transparent; border: 0;
  font-size: 10.5px; padding: 0 5px; min-height: 26px;
}
.rh-shell .sidebar-memo-row .mc-dot{ width: 7px; height: 7px; }
.rh-shell .sidebar-memo-copy{ color: var(--rh-muted); }
.rh-shell #sidebar-memo-list p{ margin: 6px 2px; font-size: 12.5px; color: var(--rh-muted); }

.rh-shell .sidebar-memos footer{ margin-top: 8px; }
.rh-shell .sidebar-memos footer button{
  width: 30px; min-height: 30px; padding: 0;
  font-size: 16px; color: var(--rh-text-2);
  background: var(--rh-surface); border: 1px solid var(--rh-line);
  border-radius: 10px;
}
.rh-shell #sidebar-memo-page{ font-size: 11.5px; color: var(--rh-muted); }

/* ---- 工具条目：图标 + 主标题 + 副标题 ---- */
.rh-shell .sidebar-stock-entry a{ min-height: 48px; padding: 0 10px; }
.rh-shell .sidebar-stock-entry span{ display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.rh-shell .sidebar-stock-entry a > span{ font-size: 14px; font-weight: 600; }
.rh-shell .sidebar-stock-entry small{
  margin-top: 2px; font-size: 11px; font-weight: 400; color: var(--rh-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rh-shell .sidebar-tools{ gap: 1px; }
.rh-shell .sidebar-tools span{ font-size: 14px; font-weight: 500; }

/* ---- 连接状态：贴底、做成一张小卡 ---- */
.rh-shell .side-bottom{ margin-top: auto; padding-top: 20px; }
.rh-shell .connection{
  gap: 10px; padding: 10px;
  background: var(--rh-surface-2);
  border: 1px solid var(--rh-line);
  border-radius: var(--rh-r-sm);
}
.rh-shell .connection-icon{
  width: 30px; height: 30px;
  background: var(--rh-surface); border-radius: 9px;
}
.rh-shell .connection-icon img{ width: 15px; height: 15px; opacity: .7; }
.rh-shell .connection strong{ font-size: 13px; font-weight: 650; }
.rh-shell .connection small{ font-size: 11px; }
.rh-shell .connection .icon-button{ width: 30px; min-height: 30px; height: 30px; padding: 0; }
.rh-shell .connection .icon-button img{ width: 15px; height: 15px; }

/* ---- 遮罩：暖调压暗，别用冷黑 ---- */
.rh-shell .scrim, body .scrim{
  background: rgba(58,44,26,.40);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}

/* 窄屏：侧栏占比再放一点，行高微收 */
@media (max-width: 380px){
  .rh-shell .sidebar{ width: min(82vw, 320px); padding-left: 12px; padding-right: 12px; }
  .rh-shell .nav-item, .rh-shell .sidebar-stock-entry a{ font-size: 14.5px; }
}

/* ===========================================================================
   顶掉 memo-categories.css 的侧栏缩排版
   ---------------------------------------------------------------------------
   那个文件从第 140 行起有一整套 `.sidebar …` 的紧凑规则，把侧栏字号压到
   8–10.4px、行高压到 26.4–35px。它当初是为了在侧栏塞进更多条目，但
   iPhone 上 8px 中文字根本读不出来，与「易读」直接冲突。

   优先级账：它的选择器多为 (0,2,0)（`.sidebar .brand`）到 (0,3,0)
   （`.sidebar .main-nav .nav-item`）。本文件最后加载，所以只要**同优先级**
   就赢；对 (0,3,0) 那几条，我在中间补一层 `.rh-shell .sidebar …` 凑够三段。
   逐条覆盖而不靠 !important，是为了以后好改。
   =========================================================================== */

.rh-shell .sidebar{ padding-left: 14px; padding-right: 14px; }

/* 品牌 */
.rh-shell .sidebar .brand{ font-size: 17px; gap: 11px; margin-bottom: 0; padding: 2px 10px 16px; }
.rh-shell .sidebar .brand small{ font-size: 11px; }
.rh-shell .sidebar .brand-mark{ width: 42px; height: 42px; }
.rh-shell .sidebar .brand-mark img{ width: 21px; height: 21px; }

/* 新建按钮 */
.rh-shell .sidebar .new-note{
  font-size: 16px; min-height: 50px;
  margin-bottom: 16px; padding: 0 16px;
}

/* 主导航（视图切换）—— 对应它的 (0,3,0) 规则，这里凑满三段 */
.rh-shell .sidebar .main-nav{ gap: 2px; }
.rh-shell .sidebar .main-nav .nav-item{
  font-size: 15px; min-height: 44px;
  padding: 0 10px; gap: 11px;
}
.rh-shell .sidebar .main-nav .nav-item img{ width: 20px; height: 20px; }

/* 分组标题 */
.rh-shell .sidebar .nav-heading{
  font-size: 11px;
  margin: 0 0 6px; padding: 0 10px;
}
.rh-shell .sidebar .nav-heading .icon-button{
  width: 28px; height: 28px; min-height: 28px; padding: 0;
}

/* 分类行
   原来卡在 max-height:220px，7 个分类就要 286px，于是生出内层滚动条，
   那条滚动条正好压在右侧计数徽章上。侧栏本身已经能整体滚动，这里不再
   设高度上限：让它自然撑开，滚动交给侧栏。 */
.rh-shell .sidebar #tag-nav{
  min-height: 0; max-height: none; overflow: visible;
}
.rh-shell .sidebar #tag-nav .nav-item, .rh-shell .sidebar #category-settings-open{
  min-height: 40px; font-size: 14px; line-height: 1.3;
  padding: 0 10px; gap: 10px;
  margin-top: 0;
}
.rh-shell .sidebar #category-settings-open img{ width: 20px; height: 20px; }
.rh-shell .sidebar .count{ font-size: 12px; }
.rh-shell .sidebar #tag-nav .tag-dot{ width: 9px; height: 9px; margin: 0 2px 0 0; }

/* 备忘录卡片 */
.rh-shell .sidebar-memos{ margin-top: 18px; padding: 12px; border-radius: var(--rh-r-md); }
.rh-shell .sidebar-memos .memo-nav{ font-size: 14px; gap: 7px; }
.rh-shell .sidebar-memos .memo-nav img{ width: 16px; height: 16px; }
.rh-shell .sidebar-memos #sidebar-memo-count, .rh-shell .sidebar-memos #sidebar-memo-page{ font-size: 11.5px; }
.rh-shell .sidebar-memos .mc-toolbar{ margin: 8px 0 6px; gap: 6px; }
.rh-shell .sidebar-memos .mc-toolbar > button{
  font-size: 12px; min-height: 30px; padding: 0 10px;
}
.rh-shell .sidebar-memos #sidebar-memo-list{ min-height: 0; padding: 0; }

/* 备忘录行：还原成单行省略，不再折行滚小窗 */
.rh-shell .sidebar-memos .sidebar-memo-row{
  display: flex; align-items: center;
  height: auto; min-height: 34px;
  margin: 1px 0; padding: 0 2px; gap: 4px;
}
.rh-shell .sidebar-memos .sidebar-memo-row .mc-trigger{
  grid-column: auto;
  max-width: 62px; font-size: 10.5px; line-height: 1.3;
  min-height: 26px; padding: 0 5px; gap: 3px;
  justify-self: auto;
}
.rh-shell .sidebar-memos .sidebar-memo-row .sidebar-memo-item{
  font-size: 13px; line-height: 1.35;
  height: auto; max-height: none; min-height: 0;
  padding: 0; white-space: nowrap;
  overflow: hidden; overflow-wrap: normal;
  text-overflow: ellipsis;
}
.rh-shell .sidebar-memos .sidebar-memo-row .sidebar-memo-copy{
  grid-column: auto; grid-row: auto;
  width: 26px; height: 26px; min-height: 26px;
  padding: 0; border-radius: 9px; align-self: center;
}
.rh-shell .sidebar-memos footer button{ width: 30px; min-height: 30px; font-size: 16px; }

/* 连接状态 */
.rh-shell .sidebar .side-bottom{ padding-top: 20px; }
.rh-shell .sidebar .connection{ margin-top: 0; padding: 10px; gap: 10px; }
.rh-shell .sidebar .connection strong{ font-size: 13px; }
.rh-shell .sidebar .connection small{ font-size: 11px; }

/* Compact home: borderless surfaces, stable inline editing, swipe actions. */
.rh-shell{
  --rh-shadow-soft: 0 2px 7px rgba(58,44,26,.07);
  --shadow-card: var(--rh-shadow-soft);
  --shadow-card-hover: var(--rh-shadow-soft);
  --shadow-control: var(--rh-shadow-soft);
  --rh-line: transparent;
  --line: transparent;
  --line-strong: transparent;
}
/* All home containers share the same borderless treatment, including drawers. */
.rh-shell, .rh-shell *, body :is(.editor,.utility,.auth-card,.bulk-bar){ border: 0 !important; }
.rh-shell :is(.sidebar,.connection,.brand-mark,.new-note,.sidebar-memos,.sidebar-stock-entry a,.sidebar-tools button,.notice,.rh-icon-btn,.rh-search,.rh-sort,.filter-chip,.modern-card){
  box-shadow: var(--rh-shadow-soft);
}
.rh-shell .sidebar{ box-shadow: 3px 0 14px rgba(58,44,26,.09); }
.rh-shell .side-bottom, .rh-shell .workspace-footer{ box-shadow: 0 -3px 8px -6px rgba(58,44,26,.15); }
.rh-shell .rh-top{
  min-height: 50px;
  padding-top: calc(5px + env(safe-area-inset-top)); padding-bottom: 5px;
  margin-bottom: 10px; gap: 8px;
  background: var(--rh-canvas);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: 0 4px 10px -7px rgba(58,44,26,.18);
}
.rh-shell .rh-top-title h2{ font-size: 17px; }
.rh-shell .rh-top-title p{ font-size: 11px; line-height: 1.25; }
.rh-shell .rh-top-title #heading-count{ font-size: 11px; }
.rh-shell .rh-top .rh-icon-btn{ width: 33px; height: 33px; border-radius: 11px; }
.rh-shell .rh-top .rh-icon-btn img{ width: 16px; height: 16px; }
.rh-shell .rh-search-row{ display: grid; grid-template-columns: minmax(0,1fr) 68px 28px; gap: 6px; height: 28px; margin-bottom: 8px; }
.rh-shell :is(.rh-search,.rh-sort,#select-mode){ min-height: 0; height: 28px; border-radius: 10px; }
.rh-shell .rh-search{ padding: 0 8px; gap: 5px; }
.rh-shell .rh-search img{ width: 14px; height: 14px; }
.rh-shell .rh-search input{ width: 100%; min-height: 0; height: 24px; padding: 0; font-size: 12px; }
.rh-shell .rh-sort{ padding: 0 7px; }
.rh-shell .rh-sort select{ font-size: 11px; max-width: none; width: 100%; padding-right: 13px; min-height: 0; }
.rh-shell .rh-sort img{ width: 11px; height: 11px; right: 6px; }
.rh-shell #select-mode{ width: 28px; padding: 0; }
.rh-shell #select-mode img{ width: 15px; height: 15px; }
.rh-shell .collection-filters{ overflow: visible; margin: 0 0 8px; padding: 4px 0 8px; }
.rh-shell .filter-row{ display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 7px 5px; min-width: 0; overflow: visible; padding: 0; }
.rh-shell .filter-chip{
  justify-content: center; gap: 3px; min-width: 0; min-height: 28px; height: 28px;
  padding: 0 3px; font-size: 11px; line-height: 1; border-radius: 10px;
  overflow: hidden; box-shadow: var(--rh-shadow-soft); transform: none;
}
.rh-shell .filter-chip.active{ box-shadow: var(--rh-shadow-soft); }
.rh-shell .filter-chip .chip-count{ font-size: 10px; flex: none; }
.rh-shell .filter-chip .tag-dot{ display: none; }
.rh-shell .filter-chip:active{ transform: none; }
.rh-shell #modern-list{ gap: 7px; }
.rh-shell .modern-group-label{ margin: 8px 3px 0; font-size: 11px; line-height: 1.4; }
.rh-shell .modern-group-label i, .rh-shell .modern-category, .rh-shell .modern-card::before{ display: none; }
.rh-shell .modern-card{
  min-height: 42px; border-radius: 16px; background: var(--rh-surface);
  box-shadow: var(--rh-shadow-soft); transition: none;
  touch-action: pan-y pinch-zoom;
}
.rh-shell .modern-line{
  grid-template-columns: 96px minmax(0,1fr) minmax(0,1.25fr) minmax(0,1fr);
  min-height: 42px; height: 42px; padding: 2px 8px; gap: 6px;
  background: var(--rh-surface); position: relative; z-index: 1;
  transition: transform .16s ease-out;
}
.rh-shell .modern-number{ grid-column: 1; }
.rh-shell .modern-source{ grid-column: 2; }
.rh-shell .modern-record{ grid-column: 3; }
.rh-shell .modern-device-value{ display: inline-flex; grid-column: 4; }
.rh-shell .modern-number, .rh-shell .modern-value, .rh-shell .modern-source > [data-modern-field]{
  min-width: 0; min-height: 0; height: 38px; padding: 0; margin: 0;
  background: transparent; box-shadow: none; outline: none; transition: none;
}
.rh-shell .modern-value{ font-size: 12px; letter-spacing: -.02em; }
.rh-shell .modern-record{ font-size: 11px; }
.rh-shell .modern-number{ font-size: 14px; font-weight: 650; }
.rh-shell .modern-card:hover, .rh-shell .modern-card.modern-editing{ box-shadow: var(--rh-shadow-soft); }
.rh-shell .modern-number:hover, .rh-shell .modern-value:hover, .rh-shell .modern-source > [data-modern-field]:hover{ background: transparent; }
.rh-shell .modern-card [contenteditable="true"]{
  min-width: 0; min-height: 0; height: 38px; padding: 0; margin: 0;
  background: transparent; outline: none; box-shadow: none;
  border-radius: var(--radius-xs); white-space: nowrap; overflow: hidden;
  font-size: 12px; font-weight: inherit; color: var(--rh-text-2);
  text-overflow: ellipsis; caret-color: var(--rh-text);
}
.rh-shell .modern-card .modern-number[contenteditable="true"]{ font-size: 14px; font-weight: 650; color: var(--rh-text); overflow: visible; text-overflow: clip; }
.rh-shell .modern-card .modern-record[contenteditable="true"]{ font-size: 11px; color: var(--rh-muted); }
.rh-shell .modern-actions{
  position: absolute; inset: 0 0 0 auto; grid-column: auto;
  width: 88px; padding: 0 2px; gap: 0; justify-content: space-evenly;
  opacity: 0; pointer-events: none; background: var(--rh-surface-2);
  transition: opacity .16s ease-out;
}
.rh-shell .modern-actions button{ width: 40px; min-width: 40px; height: 42px; min-height: 42px; border-radius: 10px; box-shadow: none; }
.rh-shell .modern-swiped .modern-line{ transform: translateX(-88px); }
.rh-shell .modern-swiped .modern-actions{ opacity: 1; pointer-events: auto; }
@media (max-width:380px){
  .rh-shell .modern-line{ grid-template-columns: 92px minmax(0,1fr) minmax(0,1.25fr) minmax(0,1fr); gap: 4px; padding: 2px 6px; }
}
@media (prefers-reduced-motion:reduce){
  .rh-shell .modern-line, .rh-shell .modern-actions{ transition: none; }
}
/* Grid rows keep their compact height even when legacy card tokens are loaded. */
.rh-shell .modern-card{ height: 42px !important; min-height: 42px !important; }
@media (min-width: 700px){ .rh-shell .modern-card{ height: 42px !important; min-height: 42px !important; } }

/* Final visual pass: proportional UI type, square icon boxes, one-line category rail. */
:root{
  --rh-font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif;
  --rh-fs-body: 15px;
  --rh-fs-sub: 13px;
  --rh-fs-cap: 11px;
}
.rh-shell, .rh-shell button, .rh-shell input, .rh-shell select{
  font-family: var(--rh-font);
  font-stretch: normal;
  letter-spacing: -.012em;
}
.rh-shell :is(.rh-icon-btn,#select-mode){
  aspect-ratio: 1 / 1;
  flex: 0 0 auto;
}
.rh-shell :is(.rh-icon-btn img,#select-mode img,.rh-search img,.rh-sort img,.modern-actions img,.modern-pin-mark){
  aspect-ratio: 1 / 1;
  object-fit: contain;
  flex: 0 0 auto;
}
.rh-shell .rh-top .rh-icon-btn{ width: 34px; height: 34px; }
.rh-shell .rh-top .rh-icon-btn img{ width: 17px; height: 17px; }
.rh-shell .rh-search-row{ grid-template-columns: minmax(0,1fr) 70px 30px; }
.rh-shell #select-mode{ width: 30px; height: 30px; }
.rh-shell #select-mode img{ width: 16px; height: 16px; }
.rh-shell .collection-filters{
  height: 37px;
  overflow: hidden;
  margin-bottom: 8px;
  padding: 3px 0 6px;
}
.rh-shell .filter-row{
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  min-width: max-content;
  height: 28px;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 1px 4px;
  scrollbar-width: none;
  touch-action: pan-x;
}
.rh-shell .filter-row::-webkit-scrollbar{ display: none; }
.rh-shell .filter-chip{
  flex: 0 0 auto;
  width: auto;
  min-width: 52px;
  height: 28px;
  padding: 0 9px;
  font-size: 11px;
  border-radius: 10px;
}
.rh-shell .filter-chip.active{ min-width: 58px; }
.rh-shell .modern-number{ font-size: 13px; font-weight: 650; letter-spacing: -.025em; }
.rh-shell .modern-value{ font-size: 11px; letter-spacing: -.015em; }
.rh-shell .modern-record{ font-size: 10.5px; }
.rh-shell .modern-card .modern-number[contenteditable="true"]{ font-size: 13px; }
/* Keep the rail viewport fixed; only its chips overflow horizontally. */
.rh-shell .filter-row{ width: 100%; min-width: 0; }

/* Readability pass: calmer Chinese text metrics and a shorter category viewport. */
:root{
  --rh-font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}
.rh-shell, .rh-shell button, .rh-shell input, .rh-shell select{
  font-family: var(--rh-font);
  font-weight: 500;
  letter-spacing: -.008em;
}
.rh-shell .collection-filters{
  height: 30px;
  margin-bottom: 6px;
  padding: 1px 0 1px;
}
.rh-shell .filter-row{ height: 28px; padding: 0 1px; }
.rh-shell .modern-number{ font-size: 14px; font-weight: 650; letter-spacing: -.018em; }
.rh-shell .modern-value{ font-size: 12px; letter-spacing: -.01em; }
.rh-shell .modern-record{ font-size: 11px; }
.rh-shell .modern-card .modern-number[contenteditable="true"]{ font-size: 14px; }
/* Category chips: 30% shorter while keeping the rail swipeable. */
.rh-shell .filter-chip{ min-height: 20px; height: 20px; line-height: 20px; }
/* Beat the shared chip token on the home surface. */
body:has(.workspace) .rh-shell .filter-chip{ min-height: 20px; height: 20px; line-height: 20px; }

/* Card readability and compact navigation pass. */
.rh-shell .modern-card{
  background: color-mix(in srgb, var(--rh-surface) 84%, var(--rh-canvas));
  box-shadow: 0 2px 7px rgba(58,44,26,.045);
}
.rh-shell .modern-line{ background: transparent; }
.rh-shell .modern-number{
  font-size: 13px;
  color: color-mix(in srgb, var(--rh-text) 78%, var(--rh-surface));
}
.rh-shell .modern-value{ color: color-mix(in srgb, var(--rh-text-2) 78%, var(--rh-surface)); }
.rh-shell .modern-record{ color: color-mix(in srgb, var(--rh-muted) 85%, var(--rh-surface)); }
.rh-shell .modern-card .modern-number[contenteditable="true"]{ font-size: 13px; }
.rh-shell .rh-top .rh-icon-btn{
  width: 32px; height: 32px; aspect-ratio: 1 / 1; border-radius: 8px;
}
.rh-shell .rh-top .rh-icon-btn img{ width: 16px; height: 16px; }

/* Sidebar scaled to 65% of its former 320px desktop cap. */
.rh-shell .sidebar{
  width: min(51vw, 208px);
  padding: calc(14px + env(safe-area-inset-top)) 10px
           calc(12px + env(safe-area-inset-bottom));
  font-size: 13px;
}
.rh-shell .sidebar .brand{ padding: 2px 8px 10px; gap: 0; }
.rh-shell .sidebar .brand-mark{ display: none; }
.rh-shell .sidebar .brand > span{ font-size: 15px; }
.rh-shell .sidebar .brand .brand-en{ font-size: 8.5px; }
.rh-shell .sidebar .brand small{ font-size: 10px; }
.rh-shell .sidebar .new-note{
  min-height: 40px; margin-bottom: 12px; padding: 0 10px;
  font-size: 13px; border-radius: 12px;
}
.rh-shell .sidebar .new-note img{ width: 16px; height: 16px; }
.rh-shell .sidebar .main-nav{ gap: 1px; }
.rh-shell .sidebar .main-nav .nav-item{
  min-height: 36px; padding: 0 8px; gap: 8px;
  font-size: 13px; border-radius: 10px;
}
.rh-shell .sidebar .main-nav .nav-item img{ width: 17px; height: 17px; }
.rh-shell .sidebar .nav-item .count{ min-width: 22px; padding: 1px 6px; font-size: 10px; }
.rh-shell .sidebar-categories{ margin-top: 12px; }
.rh-shell .sidebar .nav-heading{ min-height: 24px; margin: 0 0 4px; padding: 0 8px; font-size: 10px; }
.rh-shell .sidebar .nav-heading .icon-button{ width: 24px; height: 24px; min-height: 24px; }
.rh-shell .sidebar #tag-nav .nav-item, .rh-shell .sidebar #category-settings-open{
  min-height: 34px; padding: 0 8px; gap: 8px; font-size: 12px;
}
.rh-shell .sidebar #category-settings-open img{ width: 17px; height: 17px; }
.rh-shell .sidebar #tag-nav .tag-dot{ width: 7px; height: 7px; }
.rh-shell .sidebar-memos{ margin-top: 12px; padding: 9px; border-radius: 14px; }
.rh-shell .sidebar-memos .memo-nav{ font-size: 12px; gap: 6px; }
.rh-shell .sidebar-memos .memo-nav img{ width: 14px; height: 14px; }
.rh-shell .sidebar-memos .mc-toolbar{ margin: 6px 0 4px; gap: 4px; }
.rh-shell .sidebar-memos .mc-toolbar > button{ min-height: 26px; padding: 0 7px; font-size: 10px; }
.rh-shell .sidebar-memo-row{ min-height: 29px; gap: 3px; }
.rh-shell .sidebar-memo-row .sidebar-memo-item{ font-size: 11px; }
.rh-shell .sidebar-memo-row .sidebar-memo-copy{ width: 22px; height: 22px; min-height: 22px; }
.rh-shell .sidebar-stock-entry{ margin-top: 4px; }
.rh-shell .sidebar-stock-entry a, .rh-shell .sidebar-stock-entry button{
  min-height: 38px; padding: 0 8px; gap: 8px; font-size: 12px; border-radius: 10px;
}
.rh-shell .sidebar-stock-entry img{ width: 17px; height: 17px; }
.rh-shell .sidebar-stock-entry a > span{ font-size: 12px; }
.rh-shell .sidebar-stock-entry small{ font-size: 9px; }
.rh-shell .sidebar .side-bottom{ padding-top: 14px; }
.rh-shell .sidebar .connection{ padding: 8px; gap: 8px; }
.rh-shell .sidebar .connection-icon{ width: 27px; height: 27px; }
.rh-shell .sidebar .connection-icon img{ width: 14px; height: 14px; }
.rh-shell .sidebar .connection strong{ font-size: 11px; }
.rh-shell .sidebar .connection small{ font-size: 9px; }
@media (max-width:380px){
  .rh-shell .sidebar{ width: min(51vw, 198px); }
}
/* Shared button tokens must not stretch the two square top controls. */
.rh-shell .rh-top .rh-icon-btn{ width: 32px; height: 32px; min-width: 32px; min-height: 32px !important; }

/* Sidebar text scale 80% */
.rh-shell .sidebar .brand > span{font-size:12px;}
.rh-shell .sidebar .brand .brand-en{font-size:7px;}
.rh-shell .sidebar .brand small{font-size:8px;}
.rh-shell .sidebar .new-note{font-size:10.4px;}
.rh-shell .sidebar .main-nav .nav-item{font-size:10.4px;}
.rh-shell .sidebar .nav-item .count{font-size:8px;}
.rh-shell .sidebar .nav-heading{font-size:8px;}
.rh-shell .sidebar #tag-nav .nav-item, .rh-shell .sidebar #category-settings-open{font-size:9.6px;}
.rh-shell .sidebar-memos .memo-nav{font-size:9.6px;}
.rh-shell .sidebar-memos .mc-toolbar > button{font-size:8px;}
.rh-shell .sidebar-memo-row .sidebar-memo-item{font-size:8.8px;}
.rh-shell .sidebar-stock-entry a, .rh-shell .sidebar-stock-entry button{font-size:9.6px;}
.rh-shell .sidebar-stock-entry a > span{font-size:9.6px;}
.rh-shell .sidebar-stock-entry small{font-size:7.2px;}
.rh-shell .sidebar .connection strong{font-size:8.8px;}
.rh-shell .sidebar .connection small{font-size:7.2px;}

/* Category chips width scale 80% */
.rh-shell .filter-chip{
  width: 41.6px;
  min-width: 41.6px;
  padding: 0 2px !important;
  box-sizing: border-box;
}
.rh-shell .filter-chip.active{
  width: 46.4px;
  min-width: 46.4px;
}

/* Category and sidebar text scale 70% */
.rh-shell .filter-chip{font-size:7.7px !important;}
.rh-shell .filter-chip .chip-count{font-size:7px !important;}
.rh-shell .sidebar{font-size:9.1px;}
.rh-shell .sidebar .brand > span{font-size:8.4px;}
.rh-shell .sidebar .brand .brand-en{font-size:4.9px;}
.rh-shell .sidebar .brand small{font-size:5.6px;}
.rh-shell .sidebar .new-note{font-size:7.28px;}
.rh-shell .sidebar .main-nav .nav-item{font-size:7.28px;}
.rh-shell .sidebar .nav-item .count{font-size:5.6px;}
.rh-shell .sidebar .nav-heading{font-size:5.6px;}
.rh-shell .sidebar #tag-nav .nav-item, .rh-shell .sidebar #category-settings-open{font-size:6.72px;}
.rh-shell .sidebar-memos .memo-nav{font-size:6.72px;}
.rh-shell .sidebar-memos .mc-toolbar > button{font-size:5.6px;}
.rh-shell .sidebar-memo-row .sidebar-memo-item{font-size:6.16px;}
.rh-shell .sidebar-stock-entry a, .rh-shell .sidebar-stock-entry button{font-size:6.72px;}
.rh-shell .sidebar-stock-entry a > span{font-size:6.72px;}
.rh-shell .sidebar-stock-entry small{font-size:5.04px;}
.rh-shell .sidebar .connection strong{font-size:6.16px;}
.rh-shell .sidebar .connection small{font-size:5.04px;}

/* Phone number breathing room */
.rh-shell .modern-number{
  padding-inline: 6px;
  box-sizing: border-box;
}
.rh-shell .modern-card .modern-number[contenteditable="true"]{
  padding-inline: 6px;
  box-sizing: border-box;
}

/* Unified card data, subdued heading and readable memo previews. */
.rh-shell .modern-card .modern-number, .rh-shell .modern-card .modern-number[contenteditable="true"]{
  color: color-mix(in srgb, var(--rh-text) 64%, var(--rh-surface));
}
.rh-shell .modern-card .modern-value, .rh-shell .modern-card [data-modern-field], .rh-shell .modern-card [data-modern-field][contenteditable="true"]{
  font-family: var(--rh-font);
  font-size: 10.01px;
  font-weight: 450;
  line-height: 1;
  letter-spacing: -.01em;
  color: color-mix(in srgb, var(--rh-muted) 85%, var(--rh-surface));
}
.rh-shell .rh-top-title #page-title{
  font-size: 11.9px;
  font-weight: 500;
  color: color-mix(in srgb, var(--rh-text) 64%, var(--rh-canvas));
}
.rh-shell .rh-top-title #heading-count{ font-size: 7.7px; color: inherit; }
.rh-shell .rh-top-title #page-description{
  font-size: 7.7px;
  font-weight: 400;
  letter-spacing: .01em;
  color: color-mix(in srgb, var(--rh-muted) 85%, var(--rh-canvas));
}

/* Sidebar text: 15% larger than the rendered previous sizes. */
.rh-shell #sidebar{ font-size: 10.465px; }
.rh-shell #sidebar .brand > span{ font-size: 9.66px; }
.rh-shell #sidebar .brand-en{ font-size: 5.635px; }
.rh-shell #sidebar .brand small{ font-size: 6.44px; }
.rh-shell #sidebar .new-note{ font-size: 8.372px; }
.rh-shell #sidebar .shortcut{ font-size: 12.65px; }
.rh-shell #sidebar .main-nav .nav-item{ font-size: 8.372px; }
.rh-shell #sidebar .nav-item .count{ font-size: 6.44px; }
.rh-shell #sidebar .nav-heading{ font-size: 6.44px; }
.rh-shell #sidebar #tag-nav .nav-item{ font-size: 7.728px; }
.rh-shell #sidebar #category-settings-open{ font-size: 7.728px; }
.rh-shell #sidebar .memo-nav{ font-size: 7.728px; }
.rh-shell #sidebar #sidebar-memo-count{ font-size: 13.225px; }
.rh-shell #sidebar .mc-toolbar > button{ font-size: 6.44px; }
.rh-shell #sidebar .sidebar-memo-row .mc-trigger{ font-size: 12.075px; }
.rh-shell #sidebar #sidebar-memo-page{ font-size: 13.225px; }
.rh-shell #sidebar .sidebar-memos footer button{ font-size: 18.4px; }
.rh-shell #sidebar .sidebar-stock-entry a{ font-size: 7.728px; }
.rh-shell #sidebar .sidebar-stock-entry a > span{ font-size: 7.728px; }
.rh-shell #sidebar .sidebar-stock-entry small{ font-size: 5.796px; }
.rh-shell #sidebar .sidebar-tools button{ font-size: 17.25px; }
.rh-shell #sidebar .connection strong{ font-size: 7.084px; }
.rh-shell #sidebar .connection small{ font-size: 5.796px; }
.rh-shell #sidebar .sidebar-tools span{ font-size: 16.1px; }

/* Give every memo three full lines and the full text width. */
.rh-shell #sidebar .sidebar-memos .sidebar-memo-row{
  display: grid;
  grid-template-columns: minmax(0,1fr) 22px;
  align-items: start;
  height: auto;
  min-height: 0;
  gap: 4px;
  padding: 6px 0;
  margin: 0;
}
.rh-shell #sidebar .sidebar-memos .sidebar-memo-row .mc-trigger{
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  max-width: 100%;
  min-height: 22px;
  font-size: 8.5px;
}
.rh-shell #sidebar .sidebar-memos .sidebar-memo-row .sidebar-memo-copy{
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  width: 22px;
  height: 22px;
  min-height: 22px;
}
.rh-shell #sidebar .sidebar-memos .sidebar-memo-row .sidebar-memo-item{
  grid-column: 1 / -1;
  grid-row: 2;
  display: block;
  width: 100%;
  min-width: 0;
  font-size: 7.7px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
  padding: 0;
  height: 4.8em;
  min-height: 4.8em;
  max-height: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow-x: hidden;
  overflow-y: auto;
  text-overflow: clip;
  -webkit-line-clamp: unset;
  scrollbar-width: thin;
  scrollbar-color: var(--rh-line) transparent;
}

/* Balanced spacing between phone, source, record and device. */
.rh-shell .modern-line{
  grid-template-columns: 96px minmax(0,.9fr) minmax(0,1.2fr) minmax(0,1fr);
  column-gap: 10px;
  padding-inline: 10px;
}
@media (max-width:380px){
  .rh-shell .modern-line{
    grid-template-columns: 92px minmax(0,.9fr) minmax(0,1.2fr) minmax(0,1fr);
    column-gap: 8px;
    padding-inline: 8px;
  }
}
/* Sidebar primary destinations, with a separate card-options button. */
.rh-shell #sidebar .sidebar-primary-nav{
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 16px;
  margin-bottom: 2px;
  box-shadow: 0 8px 10px -12px rgba(58,44,26,.16);
}
.rh-shell #sidebar .sidebar-card-row,
.rh-shell #sidebar .sidebar-primary-nav > .sidebar-primary-link{
  background: var(--rh-surface);
  border-radius: 12px;
  box-shadow: 0 2px 7px rgba(58,44,26,.045);
}
.rh-shell #sidebar .sidebar-card-row{ display: flex; align-items: center; }
.rh-shell #sidebar .sidebar-primary-nav .sidebar-primary-link{
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  height: 40px;
  padding: 0 12px;
  font-family: var(--rh-font);
  font-size: 8.372px;
  font-weight: 500;
  color: var(--rh-text);
  border-radius: 12px;
  text-decoration: none;
}
.rh-shell #sidebar .sidebar-primary-link > span:not(.count){ font-size: inherit; font-weight: inherit; }
.rh-shell #sidebar .sidebar-primary-link img{ width: 17px; height: 17px; flex: none; }
.rh-shell #sidebar #cards-nav-link{
  flex: 1;
  min-width: 0;
  width: auto;
  background: transparent;
  box-shadow: none;
}
.rh-shell #sidebar #cards-nav-link.active::before{
  left: 4px;
  top: 13px;
  bottom: 13px;
  width: 2px;
  border-radius: 2px;
}
.rh-shell #sidebar #cards-nav-toggle{
  flex: 0 0 30px;
  width: 30px;
  min-height: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
}
.rh-shell #sidebar #cards-nav-toggle .cards-nav-chevron{ width: 11px; height: 11px; }
.rh-shell #sidebar #cards-nav-toggle[aria-expanded="true"] .cards-nav-chevron{ transform: rotate(180deg); }
.rh-shell #sidebar .sidebar-card-options,
.rh-shell #sidebar .sidebar-memos{
  background: var(--rh-surface);
  box-shadow: 0 2px 8px rgba(58,44,26,.045);
}
.rh-shell #sidebar .sidebar-card-options{
  display: grid;
  gap: 2px;
  margin-top: 6px;
  padding: 4px;
  border-radius: 12px;
}
.rh-shell #sidebar .sidebar-card-options .nav-item{ font-size: 7.728px; }
.rh-shell #sidebar .sidebar-card-options .nav-item.active{ background: var(--rh-surface); }
.rh-shell #sidebar .sidebar-primary-link:hover,
.rh-shell #sidebar #cards-nav-toggle:hover{ background: color-mix(in srgb,var(--rh-surface) 88%,var(--rh-canvas)); }

/* Card category colors share the memo palette; keep saved color IDs unchanged. */
body:has(.rh-shell) :is(.tag-dot,.color-button).red-1{background:hsl(0 35.0% 91.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).red-2{background:hsl(0 36.5% 85.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).red-3{background:hsl(0 38.0% 79.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).red-4{background:hsl(0 39.5% 73.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).red-5{background:hsl(0 41.0% 67.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).red-6{background:hsl(0 42.5% 61.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).red-7{background:hsl(0 44.0% 55.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).red-8{background:hsl(0 45.5% 49.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).red-9{background:hsl(0 47.0% 43.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).red-10{background:hsl(0 47.0% 37.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).orange-1{background:hsl(28 42.0% 91.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).orange-2{background:hsl(28 43.5% 85.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).orange-3{background:hsl(28 45.0% 79.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).orange-4{background:hsl(28 46.5% 73.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).orange-5{background:hsl(28 48.0% 67.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).orange-6{background:hsl(28 49.5% 61.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).orange-7{background:hsl(28 51.0% 55.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).orange-8{background:hsl(28 52.5% 49.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).orange-9{background:hsl(28 54.0% 43.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).orange-10{background:hsl(28 54.0% 37.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).yellow-1{background:hsl(50 48.0% 91.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).yellow-2{background:hsl(50 49.5% 85.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).yellow-3{background:hsl(50 51.0% 79.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).yellow-4{background:hsl(50 52.5% 73.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).yellow-5{background:hsl(50 54.0% 67.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).yellow-6{background:hsl(50 55.5% 61.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).yellow-7{background:hsl(50 57.0% 55.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).yellow-8{background:hsl(50 58.5% 49.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).yellow-9{background:hsl(50 60.0% 43.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).yellow-10{background:hsl(50 60.0% 37.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).green-1{background:hsl(108 28.0% 91.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).green-2{background:hsl(108 29.5% 85.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).green-3{background:hsl(108 31.0% 79.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).green-4{background:hsl(108 32.5% 73.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).green-5{background:hsl(108 34.0% 67.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).green-6{background:hsl(108 35.5% 61.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).green-7{background:hsl(108 37.0% 55.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).green-8{background:hsl(108 38.5% 49.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).green-9{background:hsl(108 40.0% 43.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).green-10{background:hsl(108 40.0% 37.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).cyan-1{background:hsl(174 32.0% 91.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).cyan-2{background:hsl(174 33.5% 85.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).cyan-3{background:hsl(174 35.0% 79.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).cyan-4{background:hsl(174 36.5% 73.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).cyan-5{background:hsl(174 38.0% 67.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).cyan-6{background:hsl(174 39.5% 61.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).cyan-7{background:hsl(174 41.0% 55.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).cyan-8{background:hsl(174 42.5% 49.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).cyan-9{background:hsl(174 44.0% 43.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).cyan-10{background:hsl(174 44.0% 37.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).blue-1{background:hsl(219 38.0% 91.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).blue-2{background:hsl(219 39.5% 85.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).blue-3{background:hsl(219 41.0% 79.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).blue-4{background:hsl(219 42.5% 73.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).blue-5{background:hsl(219 44.0% 67.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).blue-6{background:hsl(219 45.5% 61.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).blue-7{background:hsl(219 47.0% 55.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).blue-8{background:hsl(219 48.5% 49.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).blue-9{background:hsl(219 50.0% 43.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).blue-10{background:hsl(219 50.0% 37.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).purple-1{background:hsl(285 30.0% 91.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).purple-2{background:hsl(285 31.5% 85.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).purple-3{background:hsl(285 33.0% 79.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).purple-4{background:hsl(285 34.5% 73.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).purple-5{background:hsl(285 36.0% 67.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).purple-6{background:hsl(285 37.5% 61.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).purple-7{background:hsl(285 39.0% 55.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).purple-8{background:hsl(285 40.5% 49.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).purple-9{background:hsl(285 42.0% 43.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).purple-10{background:hsl(285 42.0% 37.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).white-1{background:hsl(38 10.0% 98.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).white-2{background:hsl(38 10.0% 95.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).white-3{background:hsl(38 10.0% 92.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).white-4{background:hsl(38 10.0% 89.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).white-5{background:hsl(38 10.0% 86.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).white-6{background:hsl(38 10.0% 83.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).white-7{background:hsl(38 10.0% 80.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).white-8{background:hsl(38 10.0% 77.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).white-9{background:hsl(38 10.0% 74.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).white-10{background:hsl(38 10.0% 71.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).black-1{background:hsl(0 0% 45%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).black-2{background:hsl(0 0% 41%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).black-3{background:hsl(0 0% 37%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).black-4{background:hsl(0 0% 33%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).black-5{background:hsl(0 0% 29%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).black-6{background:hsl(0 0% 25%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).black-7{background:hsl(0 0% 21%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).black-8{background:hsl(0 0% 17%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).black-9{background:hsl(0 0% 13%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).black-10{background:hsl(0 0% 9%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).gray-1{background:hsl(220 8.0% 87.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).gray-2{background:hsl(220 8.0% 81.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).gray-3{background:hsl(220 8.0% 75.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).gray-4{background:hsl(220 8.0% 69.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).gray-5{background:hsl(220 8.0% 63.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).gray-6{background:hsl(220 8.0% 57.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).gray-7{background:hsl(220 8.0% 51.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).gray-8{background:hsl(220 8.0% 45.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).gray-9{background:hsl(220 8.0% 39.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).gray-10{background:hsl(220 8.0% 33.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).paper{background:#d7d0c6;filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).sand{background:#c7baa7;filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).rose{background:#c3a8aa;filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).sage{background:#acb6a9;filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).blue{background:#a6b4c6;filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).lavender{background:#b5aabe;filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).gold-1{background:hsl(43 40.0% 91.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).gold-2{background:hsl(43 41.5% 85.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).gold-3{background:hsl(43 43.0% 79.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).gold-4{background:hsl(43 44.5% 73.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).gold-5{background:hsl(43 46.0% 67.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).gold-6{background:hsl(43 47.5% 61.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).gold-7{background:hsl(43 49.0% 55.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).gold-8{background:hsl(43 50.5% 49.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).gold-9{background:hsl(43 52.0% 43.0%);filter:none}
body:has(.rh-shell) :is(.tag-dot,.color-button).gold-10{background:hsl(43 52.0% 37.0%);filter:none}

/* A compact category editor, isolated from the other utility dialogs. */
body:has(.rh-shell) #utility-modal.category-management{display:grid;place-items:center;padding:0;background:rgba(58,44,26,.18);backdrop-filter:blur(4px)}
body:has(.rh-shell) #utility-modal.category-management .utility{width:min(78vw,561.6px);max-width:none;height:78dvh;max-height:78dvh;margin:0;padding:12px;display:flex;flex-direction:column;overflow:hidden;background:var(--rh-surface);color:var(--rh-text);border:0;border-radius:18px;box-shadow:0 8px 32px rgba(58,44,26,.13);font-family:var(--rh-font);animation:none}
body:has(.rh-shell) .category-management .utility>header{display:flex;align-items:center;justify-content:space-between;gap:6px;margin:0 0 8px;padding:0 0 6px;flex:none;border:0;background:transparent;box-shadow:0 4px 8px -7px rgba(58,44,26,.16)}
body:has(.rh-shell) .category-management #utility-title{font-size:12px;font-weight:550;line-height:1.3;margin:0}
body:has(.rh-shell) .category-management #utility-close{width:24px;height:24px;min-height:24px;padding:4px;border-radius:8px;background:var(--rh-surface-2);flex:none}
body:has(.rh-shell) .category-management #utility-close img{width:14px;height:14px}
body:has(.rh-shell) .category-management #utility-content{display:flex;flex-direction:column;flex:1;padding:0;min-height:0;overflow:hidden;overscroll-behavior:contain;scrollbar-width:thin}
body:has(.rh-shell) .category-management #utility-content>p{flex:none;font-size:9px;font-weight:400;line-height:1.5;color:var(--rh-text-2);margin:0 0 8px}
body:has(.rh-shell) .category-management .category-switcher{flex:none;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));grid-auto-flow:row;grid-auto-rows:24px;gap:3px;margin:0 0 10px}
body:has(.rh-shell) .category-management .category-switcher button{display:flex;align-items:center;justify-content:center;gap:3px;width:100%;min-width:0;min-height:24px;height:24px;padding:0 3px;border-radius:999px;background:var(--rh-surface-2);color:var(--rh-text-2);font-size:9px;font-weight:500;line-height:1;box-shadow:0 1px 3px rgba(58,44,26,.04)}
body:has(.rh-shell) .category-management .category-switcher button>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body:has(.rh-shell) .category-management .category-switcher .tag-dot{width:4px;height:4px;min-width:4px;margin:0;box-shadow:inset 0 0 0 1px rgba(58,44,26,.10)}
body:has(.rh-shell) .category-management .category-switcher [aria-pressed="true"]{background:var(--rh-accent-soft);color:var(--rh-accent);box-shadow:0 1px 4px rgba(160,74,31,.08)}
body:has(.rh-shell) .category-management .category-settings{flex:1;min-height:0;margin:0;max-height:none;overflow:auto;padding:2px;scrollbar-width:none;-ms-overflow-style:none}
body:has(.rh-shell) .category-management .category-setting{gap:8px}
body:has(.rh-shell) .category-management .category-setting-fields{grid-template-columns:minmax(0,1fr) 40px minmax(0,1.4fr);gap:6px}
body:has(.rh-shell) .category-management .category-setting label{min-width:0;gap:4px;font-size:7.2px;font-weight:450;line-height:1.4;color:color-mix(in srgb,var(--rh-text-2) 70%,var(--rh-surface))}
body:has(.rh-shell) .category-management input{display:block;width:80%;min-width:0;height:24px;min-height:24px;padding:2px 5px;margin:0;border:0;border-radius:8px;background:var(--rh-surface-2);color:var(--rh-text);font-family:var(--rh-font);font-size:16px;font-weight:400;line-height:20px;box-shadow:none}
body:has(.rh-shell) .category-management input::placeholder{font-size:9px;color:var(--rh-muted)}
body:has(.rh-shell) .category-management .color-choices{display:block;padding:3px;margin:0}
body:has(.rh-shell) .category-management .category-palette{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:3px;width:100%;min-width:0}
body:has(.rh-shell) .category-management .palette-family{display:grid;gap:5px;min-width:0}
body:has(.rh-shell) .category-management .palette-family-name{display:block;font-size:8px;text-align:center;color:var(--rh-text-2)}
body:has(.rh-shell) .category-management .palette-shades{display:grid;gap:4px;min-width:0}
body:has(.rh-shell) .category-management .color-button{display:block;width:100%;min-width:0;height:21.84px;min-height:21.84px;padding:0;margin:0;border:0;border-radius:999px;box-shadow:inset 0 0 0 1px rgba(58,44,26,.06)}
body:has(.rh-shell) .category-management .color-button.active{outline:0;box-shadow:inset 0 0 0 1px var(--rh-accent),inset 0 0 0 2px var(--rh-surface)}
body:has(.rh-shell) .category-management #save-category-settings{position:static;flex:none;display:block;width:100%;height:28px;min-height:28px;margin:10px 0 0;padding:0 6px;border-radius:9px;background:var(--rh-accent);color:var(--rh-surface);font-size:10px;font-weight:500;box-shadow:0 -5px 8px var(--rh-surface)}
body:has(.rh-shell) .category-management button:focus-visible,body:has(.rh-shell) .category-management input:focus-visible{outline:2px solid var(--rh-accent);outline-offset:2px}

/* Keep native 16px inputs to avoid mobile focus zoom; scale the compact fields visually. */
body:has(.rh-shell) .category-management .category-small-input{display:block;position:relative;width:100%;height:24px;min-width:0;border-radius:8px;background:var(--rh-surface-2)}
body:has(.rh-shell) .category-management .category-small-input input{width:222.222222%;height:53.333333px;min-height:53.333333px;padding:12px 11px;font-size:16px;font-weight:400;line-height:28px;color:var(--rh-muted);background:transparent;transform:scale(.45);transform-origin:top left}

/* Keep color selection and keyboard focus inside the swatch, away from scroll clipping. */
body:has(.rh-shell) .category-management .color-button:focus,
body:has(.rh-shell) .category-management .color-button:focus-visible{outline:0;box-shadow:inset 0 0 0 2px var(--rh-accent),inset 0 0 0 3px var(--rh-surface)}
body:has(.rh-shell) .category-management .category-settings::-webkit-scrollbar,
body:has(.rh-shell) .category-management #utility-content::-webkit-scrollbar{display:none;width:0;height:0}

body:has(.rh-shell) .category-management .category-small-input input::placeholder{font:inherit;color:inherit;opacity:1}

/* The card category picker follows the same wrapping capsule layout. */
body:has(.rh-shell) #utility-modal:has(.category-options){z-index:95;display:grid;place-items:center;padding:0;background:rgba(58,44,26,.18);backdrop-filter:blur(4px)}
body:has(.rh-shell) #utility-modal:has(.category-options) .utility{width:min(78vw,561.6px);max-width:none;max-height:78dvh;margin:0;padding:12px;border:0;border-radius:18px;background:var(--rh-surface);color:var(--rh-text);font-family:var(--rh-font);box-shadow:0 8px 32px rgba(58,44,26,.13)}
body:has(.rh-shell) #utility-modal:has(.category-options) .utility>header{padding:0 0 6px;margin:0 0 8px;background:transparent;border:0;box-shadow:0 4px 8px -7px rgba(58,44,26,.16)}
body:has(.rh-shell) #utility-modal:has(.category-options) h2{font-size:12px;font-weight:550}
body:has(.rh-shell) #utility-modal:has(.category-options) #utility-close{width:24px;height:24px;min-height:24px;padding:4px;border-radius:8px;background:var(--rh-surface-2)}
body:has(.rh-shell) #utility-modal:has(.category-options) #utility-close img{width:14px;height:14px}
body:has(.rh-shell) #utility-modal:has(.category-options) #utility-content{padding:0}
body:has(.rh-shell) .category-options{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));grid-auto-flow:row;grid-auto-rows:24px;gap:3px}
body:has(.rh-shell) .category-options .category-option{display:flex;align-items:center;justify-content:center;gap:3px;width:100%;min-width:0;height:24px;min-height:24px;padding:0 3px;border-radius:999px;background:var(--rh-surface-2);color:var(--rh-text-2);font-size:9px;font-weight:500;box-shadow:0 1px 3px rgba(58,44,26,.04)}
body:has(.rh-shell) .category-options .category-option>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body:has(.rh-shell) .category-options .tag-dot{width:4px;height:4px;margin:0}
body:has(.rh-shell) .category-options .category-option>img{width:9px;height:9px;flex:none;margin:0}
body:has(.rh-shell) .category-options [aria-pressed=true]{background:var(--rh-accent-soft);color:var(--rh-accent)}

/* Quiet, compact home controls and six visible category capsules. */
.rh-shell .rh-search-row{grid-template-columns:minmax(0,1fr) 62px 26px;gap:5px;height:24px;margin-bottom:7px}
.rh-shell :is(.rh-search,.rh-sort,#select-mode){height:24px;min-height:0;border:0;background:transparent;box-shadow:none;border-radius:8px}
.rh-shell .rh-search{padding:0 5px;gap:5px}
.rh-shell .rh-search input{height:22px;color:var(--rh-text-2)}
.rh-shell .rh-search input::placeholder{color:color-mix(in srgb,var(--rh-muted) 75%,var(--rh-canvas))}
.rh-shell .rh-search img{width:12px;height:12px;opacity:.36}
.rh-shell .rh-sort{padding:0}
.rh-shell #sort{display:flex;align-items:center;justify-content:center;gap:5px;width:100%;height:24px;min-height:0;padding:0 4px;border:0;border-radius:8px;background:transparent;box-shadow:none;font:500 10px var(--rh-font);color:color-mix(in srgb,var(--rh-text-2) 80%,var(--rh-canvas));cursor:pointer}
.rh-shell #sort img{position:static;width:10px;height:10px;opacity:.4}
.rh-shell #select-mode{width:26px;height:24px;color:var(--rh-muted)}
.rh-shell #select-mode img{width:14px;height:14px;opacity:.45}
.rh-shell #select-mode.active{background:var(--rh-accent-soft)}
.rh-shell :is(#sort,#select-mode):focus-visible{outline:1px solid var(--rh-muted);outline-offset:1px}
.rh-shell #sort-picker{position:fixed;inset:auto;margin:0;width:126px;max-width:calc(100vw - 16px);padding:5px;border:0;border-radius:12px;background:var(--rh-surface);color:var(--rh-text-2);box-shadow:0 5px 22px rgba(58,44,26,.13)}
.rh-shell #sort-picker:not([open]){display:none}
.rh-shell #sort-picker[open]{display:grid;gap:2px}
.rh-shell #sort-picker::backdrop{background:transparent}
.rh-shell #sort-picker button{display:flex;align-items:center;justify-content:space-between;width:100%;height:28px;min-height:0;padding:0 9px;border:0;border-radius:8px;background:transparent;box-shadow:none;font:500 10px var(--rh-font);color:var(--rh-text-2);cursor:pointer}
.rh-shell #sort-picker button[aria-pressed="true"]{background:var(--rh-accent-soft);color:var(--rh-accent)}
.rh-shell #sort-picker button[aria-pressed="true"]::after{content:'✓';font-size:10px}
.rh-shell #sort-picker button:focus-visible{outline:1px solid var(--rh-muted);outline-offset:-1px}
.rh-shell .collection-filters{height:33px;padding:2px 0 5px;margin-bottom:6px;overflow:visible}
.rh-shell .filter-row{display:flex;flex-wrap:nowrap;gap:5px;width:100%;min-width:0;height:28px;padding:0;overflow-x:auto;overflow-y:hidden;align-items:flex-start}
.rh-shell .filter-chip,.rh-shell .filter-chip.active{flex:0 0 calc((100% - 25px)/6);width:calc((100% - 25px)/6);min-width:0;height:26px;min-height:26px;line-height:26px;padding:0 4px!important;border-radius:999px;font-size:9.5px!important;gap:3px;overflow:hidden;white-space:nowrap}
body:has(.workspace) .rh-shell .filter-chip{height:26px;min-height:26px;line-height:26px}
.rh-shell .filter-chip .chip-count{font-size:8px!important;flex:none}

/* Distinct, subdued icon tiles for the five primary destinations. */
.rh-shell #sidebar .sidebar-primary-nav .sidebar-primary-link{font-size:9.96268px;color:color-mix(in srgb,var(--rh-text) 80%,var(--rh-surface))}
.rh-shell #sidebar .sidebar-primary-link img{width:25px;height:25px;padding:4px;box-sizing:border-box;border-radius:8px;opacity:1}
.rh-shell #sidebar #cards-nav-link img{background:#f2dfd3}
.rh-shell #sidebar .sidebar-primary-link[href="/qq.html"] img{background:#dde6f1}
.rh-shell #sidebar .sidebar-primary-link[href="/router2.html"] img{background:#dfebdf}
.rh-shell #sidebar .sidebar-primary-link[href="/photos.html"] img{background:#efe4cb}
.rh-shell #sidebar .sidebar-primary-link[href="https://loterr.art/"] img{background:#e9def0}

.rh-shell #select-mode.active img{filter:none;opacity:.8}

/* Smaller category pills retain six visible slots; scrolling includes shadow space. */
.rh-shell .collection-filters{height:40px;padding:0;margin-bottom:6px;overflow:visible}
.rh-shell .filter-row{box-sizing:border-box;width:calc(100% + 12px);height:40px;margin-inline:-6px;padding:6px 6px 11.9px;gap:calc(3% + 4.25px);overflow-x:auto;overflow-y:hidden}
.rh-shell .filter-chip,.rh-shell .filter-chip.active{flex-basis:calc(14.166667% - 3.541667px);width:calc(14.166667% - 3.541667px);height:22.1px;min-height:22.1px;line-height:22.1px;padding-inline:2px!important}
body:has(.workspace) .rh-shell .filter-chip{height:22.1px;min-height:22.1px;line-height:22.1px}
.rh-shell .rh-search input::placeholder{font-size:9px}
.rh-shell .modern-index{display:block;position:absolute;left:3px;top:50%;width:10px;height:auto;min-height:0;margin:0;border:0;border-radius:0;background:transparent;box-shadow:none;transform:translateY(-50%);padding:0;font-size:6.5px;font-weight:400;line-height:1;letter-spacing:-.01em;text-align:right;color:color-mix(in srgb,var(--rh-muted) 45%,var(--rh-surface));font-variant-numeric:tabular-nums;pointer-events:none;user-select:none}

/* Reserve an index column and balance the four data columns. */
.rh-shell .modern-line{grid-template-columns:10px 94px minmax(0,.9fr) minmax(0,1.2fr) minmax(0,1.05fr);column-gap:10px;padding:2px 12px 2px 6px}
.rh-shell .modern-index{position:static;grid-column:1;top:auto;left:auto;width:10px;transform:none;text-align:right;align-self:center}
.rh-shell .modern-number{grid-column:2}
.rh-shell .modern-card .modern-number,.rh-shell .modern-card .modern-number[contenteditable="true"]{padding-inline:4px}
.rh-shell .modern-source{grid-column:3}
.rh-shell .modern-record{grid-column:4}
.rh-shell .modern-device-value{grid-column:5}
.rh-shell .modern-card .modern-source,.rh-shell .modern-card .modern-source [data-modern-field],.rh-shell .modern-card .modern-source [data-modern-field][contenteditable="true"]{font-size:8.64864px;color:#aaa9a7}
@media(max-width:380px){.rh-shell .modern-line{grid-template-columns:10px 90px minmax(0,.9fr) minmax(0,1.2fr) minmax(0,1.05fr);column-gap:8px;padding-inline:6px 10px}}
