/* RichHome bookmark memo: V3, STAGE ONLY. The existing order row/columns are not rebuilt.
 * Existing bookmark toggle events and all data remain unchanged.
 */
#order-rows tr.rh-bm-order-row-v3 td.rh-bm-bookmark-cell-v3 {
  box-sizing:border-box;
  white-space:nowrap !important;
  overflow:visible;
  vertical-align:middle;
}
#order-rows tr.rh-bm-order-row-v3 .rh-bm-flag-control-v3 {
  box-sizing:border-box !important;
  width:34px !important;
  min-width:34px !important;
  max-width:34px !important;
  height:34px !important;
  min-height:34px !important;
  max-height:34px !important;
  padding:6px !important;
  margin:0 !important;
  border-radius:9px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  vertical-align:middle;
  line-height:1 !important;
  font-size:19px !important;
  flex:0 0 34px !important;
}
#order-rows tr.rh-bm-order-row-v3 .rh-bm-flag-control-v3 svg,
#order-rows tr.rh-bm-order-row-v3 .rh-bm-flag-control-v3 > i,
#order-rows tr.rh-bm-order-row-v3 .rh-bm-flag-control-v3 > img {
  display:block !important;
  width:19px !important;
  height:19px !important;
  max-width:19px !important;
  max-height:19px !important;
  flex:none !important;
}
#order-rows tr.rh-bm-order-row-v3 td.rh-bm-bookmark-cell-v3 .rh-bookmark-memo-launch {
  -webkit-appearance:none;
  appearance:none;
  box-sizing:border-box;
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  vertical-align:middle;
  gap:4px;
  min-width:58px !important;
  max-width:68px !important;
  width:auto !important;
  height:32px !important;
  min-height:32px !important;
  max-height:32px !important;
  padding:5px 8px !important;
  margin:0 0 0 6px !important;
  border:1px solid #cfdae5 !important;
  border-radius:8px !important;
  font-family:inherit;
  font-size:12px !important;
  font-weight:650;
  line-height:1 !important;
  white-space:nowrap;
  background:#f6f9fb !important;
  color:#466479 !important;
  box-shadow:none !important;
  cursor:pointer;
}
#order-rows tr.rh-bm-order-row-v3 td.rh-bm-bookmark-cell-v3 .rh-bookmark-memo-launch[hidden] {display:none !important;}
#order-rows tr.rh-bm-order-row-v3 td.rh-bm-bookmark-cell-v3 .rh-bookmark-memo-launch svg {
  width:13px !important;
  height:13px !important;
  flex:none;
}
#order-rows tr.rh-bm-order-row-v3 td.rh-bm-bookmark-cell-v3 .rh-bookmark-memo-launch.has-memo {
  color:#1d5c8d !important;
  border-color:#b8d6ec !important;
  background:#eaf4fc !important;
}
#order-rows tr.rh-bm-order-row-v3 td.rh-bm-bookmark-cell-v3 .rh-bookmark-memo-launch:focus-visible {outline:2px solid #3980b0;outline-offset:2px;}
#order-rows tr.rh-bm-order-row-v3 .rh-bm-memo-dot {
  display:none;
  width:4px;
  height:4px;
  border-radius:50%;
  background:#2d79a9;
}
#order-rows tr.rh-bm-order-row-v3 .rh-bookmark-memo-launch.has-memo .rh-bm-memo-dot {display:inline-block;}

/* Wider first column on desktop, without moving the existing order fields. */
@media(min-width:1024px) {
  .rh-bm-table-scroll-v3 {
    box-sizing:border-box;
    max-width:100%;
    overflow-x:auto !important;
    overscroll-behavior-x:contain;
  }
  .rh-bm-order-table-v3 {
    box-sizing:border-box;
    width:100%;
    min-width:1740px !important;
    table-layout:auto;
  }
  .rh-bm-order-table-v3 thead th:first-child {
    box-sizing:border-box;
    width:132px !important;
    min-width:132px !important;
    white-space:nowrap;
    text-align:center;
  }
  .rh-bm-order-table-v3 thead th {white-space:nowrap;}
  #order-rows tr.rh-bm-order-row-v3 td.rh-bm-bookmark-cell-v3.rh-bm-flag-only-v3 {
    width:132px !important;
    min-width:132px !important;
    max-width:142px !important;
    padding-left:10px !important;
    padding-right:8px !important;
    text-align:center;
  }
  .rh-bm-order-table-v3 td.rh-bm-number-cell-v3 { min-width:180px; white-space:nowrap; }
}

/* Mobile: bookmark and memo occupy ONE slightly wider check area.
   The order-number cell remains a separate cell; no duplicated labels. */
@media(max-width:1023px) {
  #order-rows tr.rh-bm-order-row-v3 td.rh-bm-bookmark-cell-v3.rh-bm-flag-only-v3 {
    box-sizing:border-box;
    width:124px !important;
    min-width:124px !important;
    max-width:124px !important;
    padding-left:6px !important;
    padding-right:3px !important;
    white-space:nowrap !important;
    text-align:left;
  }
  #order-rows tr.rh-bm-order-row-v3 .rh-bm-flag-control-v3 {width:33px !important;min-width:33px !important;max-width:33px !important;height:33px !important;min-height:33px !important;max-height:33px !important;}
  #order-rows tr.rh-bm-order-row-v3 td.rh-bm-bookmark-cell-v3 .rh-bookmark-memo-launch {
    height:30px !important;
    min-height:30px !important;
    max-height:30px !important;
    min-width:58px !important;
    padding:5px 7px !important;
    font-size:11px !important;
    margin-left:6px !important;
  }
  /* The number column stays readable even if the card grid is narrow. */
  #order-rows tr.rh-bm-order-row-v3 td.rh-bm-number-cell-v3 [data-order-detail] {
    display:inline-block;
    vertical-align:middle;
    max-width:100%;
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
}
@media(max-width:360px) {
  #order-rows tr.rh-bm-order-row-v3 td.rh-bm-bookmark-cell-v3.rh-bm-flag-only-v3 {
    width:113px !important;
    min-width:113px !important;
    max-width:113px !important;
    padding-left:3px !important;
  }
  #order-rows tr.rh-bm-order-row-v3 td.rh-bm-bookmark-cell-v3 .rh-bookmark-memo-launch {min-width:55px !important;padding:4px 6px !important;margin-left:4px !important;}
}

/* Clear, accessible note popover; no global admin CSS changes. */
#rh-bookmark-memo-overlay {
  position:fixed;
  inset:0;
  z-index:15040;
  background:rgba(18,38,56,.18);
  overscroll-behavior:contain;
}
#rh-bookmark-memo-panel,
#rh-bookmark-memo-panel * {box-sizing:border-box;}
#rh-bookmark-memo-panel {
  position:fixed;
  top:16px;
  left:16px;
  width:min(460px, calc(100vw - 32px));
  max-height:calc(100dvh - 32px);
  overflow-y:auto;
  padding:20px;
  border:1px solid #d8e3ec;
  border-radius:16px;
  background:#fff;
  color:#1a354b;
  font-family:inherit;
  box-shadow:0 18px 65px rgba(17,37,57,.24);
}
#rh-bookmark-memo-panel .rh-bm-grab {display:none;}
#rh-bookmark-memo-panel .rh-bm-head {
  display:flex;
  gap:16px;
  justify-content:space-between;
  align-items:flex-start;
  margin-bottom:8px;
}
#rh-bookmark-memo-panel .rh-bm-eyebrow {
  display:block;
  margin-bottom:3px;
  color:#667d8e;
  font-size:11px;
  font-weight:650;
}
#rh-bookmark-memo-panel h3 {
  margin:0;
  color:#1c3e57;
  font-size:19px;
  font-weight:750;
  line-height:1.35;
}
#rh-bookmark-memo-panel [data-rh-bm-close] {
  display:grid;
  place-items:center;
  flex:none;
  padding:0;
  height:30px;
  width:30px;
  border:1px solid #e1e8ee;
  border-radius:9px;
  font-family:inherit;
  font-size:24px;
  line-height:1;
  color:#5d7486;
  background:#f7f9fb;
  cursor:pointer;
}
#rh-bookmark-memo-panel .rh-bm-sub {
  margin:0 0 18px;
  padding-bottom:14px;
  color:#677e91;
  font-size:13px;
  line-height:1.5;
  overflow-wrap:anywhere;
  border-bottom:1px solid #edf1f5;
}
#rh-bookmark-memo-panel .rh-bm-field-label {
  display:block;
  margin-bottom:8px;
  color:#304b60;
  font-size:13px;
  font-weight:700;
}
#rh-bookmark-memo-panel textarea {
  display:block;
  width:100%;
  min-height:150px;
  padding:13px;
  resize:vertical;
  font-family:inherit;
  font-size:14px;
  line-height:1.65;
  color:#1d364b;
  background:#fff;
  border:1px solid #ccd9e4;
  border-radius:10px;
  outline:none;
}
#rh-bookmark-memo-panel textarea:focus {
  border-color:#4a88b9;
  box-shadow:0 0 0 3px rgba(74,136,185,.14);
}
#rh-bookmark-memo-panel .rh-bm-feedback {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  min-height:26px;
  margin-top:7px;
}
#rh-bookmark-memo-panel .rh-bm-error {
  margin:0;
  min-height:16px;
  color:#ba4141;
  font-size:12px;
  line-height:1.4;
}
#rh-bookmark-memo-panel .rh-bm-count {
  flex:none;
  color:#8496a5;
  font-size:11px;
  line-height:1.5;
}
#rh-bookmark-memo-panel .rh-bm-foot {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:9px;
  margin-top:13px;
}
#rh-bookmark-memo-panel .rh-bm-foot button {
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:84px;
  min-height:39px;
  padding:9px 16px;
  font-family:inherit;
  font-size:13px;
  font-weight:650;
  line-height:1.3;
  border:1px solid #d4e0e9;
  border-radius:9px;
  color:#425e73;
  background:#f7f9fb;
  cursor:pointer;
}
#rh-bookmark-memo-panel .rh-bm-foot button.rh-bm-save {
  color:#fff;
  background:#236a9e;
  border-color:#236a9e;
}
#rh-bookmark-memo-panel button:disabled {opacity:.55;cursor:wait;}

@media(max-width:767px) {
  #rh-bookmark-memo-overlay {background:rgba(12,27,42,.35);}
  #rh-bookmark-memo-panel {
    top:auto !important;
    left:0 !important;
    right:0;
    bottom:0;
    width:100%;
    max-width:none;
    max-height:88dvh;
    padding:12px 18px max(22px, env(safe-area-inset-bottom));
    border-radius:20px 20px 0 0;
    border-left:0;
    border-right:0;
    border-bottom:0;
    box-shadow:0 -16px 48px rgba(12,27,42,.18);
  }
  #rh-bookmark-memo-panel .rh-bm-grab {
    display:block;
    width:40px;
    height:4px;
    margin:0 auto 20px;
    background:#d4dfe7;
    border-radius:8px;
  }
  #rh-bookmark-memo-panel h3 {font-size:18px;}
  #rh-bookmark-memo-panel textarea {font-size:16px;min-height:172px;}
  #rh-bookmark-memo-panel .rh-bm-foot button {min-width:95px;min-height:44px;font-size:14px;}
}

/* RH_BOOKMARK_HISTORY_V1: keep existing first-column width and mobile layout. */
#order-rows tr.rh-bm-order-row-v3 td.rh-bm-bookmark-cell-v3 .rh-bookmark-memo-launch.rh-bm-past {color:#596775 !important;background:#f1f3f5 !important;border-color:#cbd2d9 !important;}
#order-rows .rh-bookmark-memo-launch.rh-bm-past .rh-bm-memo-dot {background:#788592;}
#order-management-page .order-toolbar-compact .rh-past-memo-filter.is-active {color:#354d65;background:#e5edf5;border-color:#91a7bd;}
#order-management-page .order-toolbar-compact .order-search-buttons {flex-wrap:wrap;}
.rh-bm-history {margin-top:12px;border:1px solid #d6dfe7;border-radius:9px;padding:10px;min-width:0;color:#243a4c;}
.rh-bm-history summary {cursor:pointer;font-weight:700;font-size:13px;}
.rh-bm-history-list article {padding:9px 0;border-bottom:1px solid #e1e7ed;}
.rh-bm-history-list strong,.rh-bm-history-list time,.rh-bm-history-list small {display:block;font-size:12px;}
.rh-bm-history-list time,.rh-bm-history-list small {color:#627485;margin-top:4px;}
.rh-bm-history-text {white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;margin:4px 0;}
.rh-bm-history p {font-size:12px;overflow-wrap:anywhere;margin:5px 0;}
.rh-bm-history button {font-size:12px;margin-top:8px;}
.rh-bm-history button[hidden] {display:none !important;}
