/* v0.6.97: unified subpage dock and list layout. Single stylesheet; no legacy overrides. */
#hn-action-dock[hidden]{display:none!important}
#hn-action-dock{position:fixed;bottom:0;left:0;right:0;z-index:90;display:flex;gap:12px;padding:12px max(14px,env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom));background:var(--hn-surface,#f6f9f5);border-top:1px solid #e0e8e1;box-shadow:0 -4px 20px #173b2010;box-sizing:border-box}
#hn-action-dock button{height:auto;min-height:50px;min-width:0;border:0;border-radius:16px;font-size:16px;font-weight:700;white-space:normal;overflow-wrap:anywhere;line-height:1.35;cursor:pointer}
#hn-action-dock .hn-dock-back{flex:1;background:#e5e8e9;color:#334b42;display:flex;align-items:center;justify-content:center;gap:8px}
#hn-action-dock .hn-dock-back .hn-back-arrow{display:block;width:19px;height:19px;flex:0 0 19px}
#hn-action-dock:has(.hn-dock-add) .hn-dock-back{flex:1 1 0}
#hn-action-dock .hn-dock-add{flex:1 1 0;background:#209f5e;color:white}
body.hn-on-subpage #app{padding-bottom:calc(94px + env(safe-area-inset-bottom))!important}
.hn-choice-list{display:grid;gap:12px;margin:10px 0 20px}
.hn-choice{width:100%;height:auto;border:1px solid #e8ede8;border-radius:16px;min-height:66px;background:var(--hn-card,#fff);color:inherit;padding:15px 18px;display:flex;gap:12px;justify-content:space-between;align-items:center;text-align:left;font-size:17px;font-weight:700;cursor:pointer;white-space:normal;overflow-wrap:anywhere}
.hn-choice.selected{background:#e1f8e9;color:#137b44;border-color:#8bce9e}
.hn-choice-check{color:#169a56;font-size:22px}
.hn-standalone-title{margin:4px 0 18px}
.hn-sorted-item{display:flex;align-items:center;gap:9px;min-width:0;min-height:56px}
.hn-sort-name{flex:1;min-width:0;overflow-wrap:anywhere}
.hn-sort-actions{display:flex;gap:5px;flex-shrink:0}
.hn-kind-tabs{margin-bottom:14px}
@media(max-width:390px){.hn-sort-actions .secondary{padding:8px!important}.hn-sorted-item{gap:8px}.hn-choice{font-size:16px;min-height:60px}}

/* v0.8.16 — canonical "我的" visual primitives.
   Member + its subpages share these exact geometry tokens. Individual pages only
   supply semantic content and actions; no independent card/list dimensions. */
#content.hn-profile-ui {
  --hn-profile-row-height:43px;
  --hn-profile-row-radius:11px;
  --hn-profile-row-background:#f1f8f3;
  --hn-profile-row-ink:#284537;
  --hn-profile-row-font:14px;
  --hn-profile-row-space:6px;
  --hn-profile-section-space:17px;
  --hn-profile-icon:23px;
  font-size:var(--hn-profile-row-font);
  line-height:1.55;
}
/* Household sharing uses proper A-style cards, unlike the plain option-list subpages.
   These are canonical family component rules, not appended specificity patches. */
#content.hn-profile-ui.hn-family-page > .manage-card {
  background:var(--hn-card,#fff);
  border:1px solid #e1ebe2;
  border-radius:18px;
  box-shadow:0 5px 18px rgba(32,75,47,.055);
  padding:16px;
  margin:12px 0;
  min-width:0;
}
#content.hn-profile-ui.hn-family-page .manage-card-head {
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:9px;
  margin-bottom:12px;
  text-align:left;
}
#content.hn-profile-ui.hn-family-page .manage-card-head h2 {
  flex:1 1 auto;
  min-width:0;
  text-align:left;
  font-size:16px;
  font-weight:750;
  color:#164e2e;
  line-height:1.4;
  margin:0;
}
#content.hn-profile-ui.hn-family-page .hn-family-member {
  min-height:55px;
  padding:9px 12px;
  margin-bottom:7px;
}
#content.hn-profile-ui.hn-family-page .manage-card-scope {
  margin-left:auto;
  flex:0 0 var(--hn-ledger-trigger-width);
  width:min(var(--hn-ledger-trigger-width),48%);
  max-width:48%;
  min-width:0;
}
#content.hn-profile-ui.hn-family-page .manage-card-scope .scope-wrap {max-width:100%;width:100%;}
#content.hn-profile-ui.hn-family-page .manage-card-scope .scope-trigger {
  width:100%;min-width:0;min-height:38px;
  padding:7px 10px;font-size:13px;border-radius:24px;
}
/* Keep only the member identity block boxed; every other group is a plain section. */
#content.hn-profile-ui.hn-member-clean[data-hn-main-tab] > .card,
#content.hn-profile-ui.hn-profile-subpage:not(.hn-family-page) > .card {
  background:transparent;
  border:0;
  border-radius:0;
  box-shadow:none;
  padding:0;
  margin:var(--hn-profile-section-space) 0 0;
  min-width:0;
}
#content.hn-profile-ui.hn-member-clean[data-hn-main-tab="member"] > .card:first-child {
  background:var(--hn-card,#fff);
  border:1px solid #e8eee8;
  border-radius:14px;
  padding:13px;
  margin:9px 0;
}
#content.hn-profile-ui.hn-member-clean[data-hn-main-tab] > .card > h2,
#content.hn-profile-ui.hn-profile-subpage > .card > h2,
#content.hn-profile-ui:not(.hn-family-page) .manage-card-head h2,
#content.hn-profile-ui .function-page-title {
  font-size:13px;
  font-weight:500;
  color:#597062;
  letter-spacing:normal;
  line-height:1.45;
  margin:0 0 9px 3px;
}
#content.hn-profile-ui .manage-card-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-width:0;
  margin:0 0 9px;
}
#content.hn-profile-ui:not(.hn-family-page) .manage-card-head h2 {margin:0 0 0 3px;min-width:0;flex:1 1 auto;}
#content.hn-profile-ui:not(.hn-family-page) .manage-card-scope {flex:0 1 var(--hn-ledger-trigger-width);width:min(var(--hn-ledger-trigger-width),48%);max-width:48%;min-width:0;}
#content.hn-profile-ui:not(.hn-family-page) .manage-card-scope .scope-wrap {max-width:100%;}
#content.hn-profile-ui:not(.hn-family-page) .manage-card-scope .scope-trigger {width:100%;min-width:0;max-width:100%;min-height:38px;padding:7px 11px;font-size:13px;border-radius:24px;}
#content.hn-profile-ui .manage-card-scope .scope-trigger .hn-ledger-name {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#content.hn-profile-ui .function-page-head {align-items:center;gap:10px;margin:var(--hn-profile-section-space) 0 9px;}
#content.hn-profile-ui .function-page-head .function-page-title {margin:0;}
#content.hn-profile-ui > .hn-standalone-title {margin:var(--hn-profile-section-space) 0 9px 3px;}

/* One and only one functional row: menu, category, ledger, family member,
   reminder, utility record, sortable rule and language/currency/theme choices. */
#content.hn-profile-ui :is(.setting,.hn-profile-row) {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  width:100%;
  max-width:100%;
  min-width:0;
  height:auto;
  min-height:var(--hn-profile-row-height);
  padding:7px 12px;
  margin:0 0 var(--hn-profile-row-space);
  box-sizing:border-box;
  border:0;
  border-radius:var(--hn-profile-row-radius);
  box-shadow:none;
  background:var(--hn-profile-row-background);
  color:var(--hn-profile-row-ink);
  text-align:left;
  font-size:var(--hn-profile-row-font);
  line-height:1.45;
}
#content.hn-profile-ui :is(.setting,.hn-profile-row) :is(strong,.hn-sort-name,.hn-choice-check) {font-size:var(--hn-profile-row-font);line-height:1.45;}
#content.hn-profile-ui :is(.setting,.hn-profile-row) strong {font-weight:600;}
#content.hn-profile-ui :is(.setting,.hn-profile-row) small {display:block;font-size:12px;line-height:1.5;color:#819186;margin-top:2px;}
#content.hn-profile-ui .setting-left {display:flex;align-items:center;gap:10px;flex:1 1 auto;min-width:0;}
#content.hn-profile-ui .setting-icon,
#content.hn-profile-ui:not(.hn-family-page) .manage-book-mark,
#content.hn-profile-ui .manage-action-icon {
  display:grid;
  place-items:center;
  flex:0 0 var(--hn-profile-icon);
  width:var(--hn-profile-icon);
  min-width:var(--hn-profile-icon);
  height:24px;
  background:transparent;
  border:0;
  border-radius:0;
  box-shadow:none;
  color:#219c56;
  font-size:17px;
  line-height:1;
}
#content.hn-profile-ui .manage-book-details {flex:1 1 auto;min-width:0;}
#content.hn-profile-ui .manage-book-details strong {font-size:var(--hn-profile-row-font);line-height:1.45;}
#content.hn-profile-ui .hn-profile-row :is(.manage-book-details strong,.installment-item-body strong,.tx-info strong) {color:inherit;}
#content.hn-profile-ui .manage-action {min-height:var(--hn-profile-row-height);}
#content.hn-profile-ui .manage-list,
#content.hn-profile-ui .hn-sort-list,
#content.hn-profile-ui .rows.hn-card-list {display:flex;flex-direction:column;gap:0;}
#content.hn-profile-ui .hn-card-list {margin:0;gap:0;}
#content.hn-profile-ui .hn-card-list .hn-draggable-card.hn-profile-row {min-height:var(--hn-profile-row-height);}
#content.hn-profile-ui .hn-profile-row.hn-draggable-card {padding:0 12px;}
#content.hn-profile-ui .hn-profile-row .hn-drag-handle {background:transparent;border:0;border-radius:0;width:34px;min-width:34px;height:43px;font-size:19px;box-shadow:none;}
#content.hn-profile-ui .hn-profile-row .hn-drag-handle:focus-visible {outline-offset:-3px;}
#content.hn-profile-ui .hn-profile-row .manage-outline-btn,
#content.hn-profile-ui .hn-profile-row .secondary.small,
#content.hn-profile-ui .hn-profile-row .recurring-edit,
#content.hn-profile-ui .hn-profile-row .recurring-remove {
  min-height:34px;
  border-radius:9px;
  font-size:12px;
  padding:6px 9px;
}
#content.hn-profile-ui .hn-profile-row .icon-danger {min-width:34px;width:34px;height:34px;font-size:16px;}
#content.hn-profile-ui .hn-profile-row .chevron,
#content.hn-profile-ui .hn-profile-row .manage-chevron {font-size:19px;color:#98af9f;}
#content.hn-profile-ui .hn-plan-lock {position:static;flex:0 0 auto;margin-left:auto;margin-right:3px;order:2;font-size:14px;line-height:1;}
#content.hn-profile-ui .setting .chevron {flex:0 0 auto;order:3;margin-left:0;}
#content.hn-profile-ui .hn-profile-row.hn-choice.selected {background:#e1f8e9;color:#137b44;border:1px solid #8bce9e;}
#content.hn-profile-ui .hn-choice-list {display:flex;flex-direction:column;gap:0;margin:var(--hn-profile-section-space) 0 0;}
#content.hn-profile-ui .hn-profile-row.hn-choice {font-weight:600;}
#content.hn-profile-ui .hn-profile-row .installment-item-body strong {font-size:var(--hn-profile-row-font);}
#content.hn-profile-ui .hn-profile-row .installment-item-total {font-size:var(--hn-profile-row-font);}
#content.hn-profile-ui .hn-profile-row .installment-item-meta {font-size:12px;line-height:1.5;}
#content.hn-profile-ui .hn-profile-row .tx-info strong {font-size:var(--hn-profile-row-font);}
#content.hn-profile-ui .hn-profile-row.sub-detail-row {align-items:flex-start;flex-direction:column;gap:5px;}
#content.hn-profile-ui .hn-profile-row.sub-detail-row p {margin:0;font-size:13px;line-height:1.6;}
#content.hn-profile-ui .hn-profile-row .tx-info small {font-size:12px;}
#content.hn-profile-ui .hn-profile-row .utility-amount {font-size:var(--hn-profile-row-font);}
#content.hn-profile-ui .hn-profile-row.budget-rollover-choice {display:flex;align-items:center;justify-content:flex-start;}

/* Form controls use the same full-column frame and touch dimensions;
   16px input text on mobile deliberately prevents iOS WebKit auto-zoom. */
#content.hn-profile-ui .field {font-size:14px;font-weight:600;line-height:1.5;margin:12px 0;}
#content.hn-profile-ui :is(.field > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
 .field > select,.field > textarea,.field > .custom-date-trigger,
 .field > .huanar-select-shell,.custom-month-trigger) {
  width:100%;
  min-width:0;
  max-width:100%;
  min-height:44px;
  height:44px;
  box-sizing:border-box;
  border-radius:var(--hn-profile-row-radius);
  font-size:16px;
}
#content.hn-profile-ui .huanar-select-trigger {width:100%;max-width:100%;min-height:44px;height:auto;border-radius:24px;font-size:16px;}
#content.hn-profile-ui .field > textarea {height:auto;min-height:90px;}
#content.hn-profile-ui :is(.primary,.secondary):not(.small),
#content.hn-profile-ui .manage-primary {min-height:44px;border-radius:var(--hn-profile-row-radius);font-size:14px;}
#content.hn-profile-ui .book-tabs {border-radius:var(--hn-profile-row-radius);margin-bottom:9px;}
#content.hn-profile-ui .book-tabs button {font-size:14px;}
#content.hn-profile-ui .reminder-setting-line {min-height:var(--hn-profile-row-height);padding:7px 12px;margin-bottom:var(--hn-profile-row-space);}
#content.hn-profile-ui .reminder-setting-line strong {font-size:var(--hn-profile-row-font);font-weight:600;}

/* All three user-selected palettes stay synchronized to the same profile tokens. */
html[data-hn-theme="light"] #content.hn-profile-ui {--hn-profile-row-background:#edf2f6;--hn-profile-row-ink:#263f4d;}
html[data-hn-theme="dark"] #content.hn-profile-ui {--hn-profile-row-background:#2c4435;--hn-profile-row-ink:#e6f4eb;}
html[data-hn-theme="light"] #content.hn-profile-ui > .card:first-child:not(.hn-profile-section) {border-color:#dce7ed;}
html[data-hn-theme="dark"] #content.hn-profile-ui > .card {color:#e6f4eb;}
html[data-hn-theme="dark"] #content.hn-profile-ui[data-hn-main-tab="member"] > .card:first-child {background:#21352b;border-color:#456752;}
html[data-hn-theme="dark"] #content.hn-profile-ui :is(.manage-card-head h2,.card>h2,.function-page-title) {color:#b4d5c1;}
html[data-hn-theme="dark"] #content.hn-profile-ui .hn-profile-row.hn-choice.selected {background:#284d35;border-color:#4cb978;color:#e6f4eb;}
html[data-hn-theme="light"] #content.hn-profile-ui .hn-profile-row.hn-choice.selected {background:#e3f0f5;border-color:#80b1c4;color:#245b78;}
@media(max-width:390px){
 #content.hn-profile-ui:not(.hn-family-page) .manage-card-scope {flex:0 1 var(--hn-ledger-trigger-width);width:min(var(--hn-ledger-trigger-width),49%);max-width:49%;}
 #content.hn-profile-ui .hn-profile-row .hn-sort-actions,
 #content.hn-profile-ui .hn-profile-row .utility-actions {min-width:0;flex-wrap:wrap;justify-content:flex-end;}
}
html[data-hn-theme="dark"] #hn-action-dock{background:#1e3327;border-color:#456752}
html[data-hn-theme="dark"] #hn-action-dock .hn-dock-back{background:#395347;color:#e2f5e8}
html[data-hn-theme="light"] #hn-action-dock{background:#f3f6f9}
html[data-hn-theme="light"] #hn-action-dock .hn-dock-add{background:#397b96}
html[data-hn-theme="dark"] .hn-choice{background:#2c4435;color:#e5f4e9;border-color:#456752}
html[data-hn-theme="light"] .hn-choice.selected{background:#e3f0f5;color:#245b78;border-color:#80b1c4}

/* v0.6.98: one-card-per-item and true touch drag rather than arrow buttons */
.hn-card-list{display:flex;flex-direction:column;gap:7px;margin:8px 0 12px}
.hn-card-list .hn-draggable-card:not(.hn-profile-row){display:flex;align-items:center;gap:9px;border:1px solid #e3ece3;background:var(--hn-card,#fff);border-radius:14px;padding:7px 10px;min-height:56px;box-sizing:border-box;box-shadow:0 2px 6px #183b1910;margin:0}
.hn-card-list .hn-draggable-card:not(.hn-profile-row):last-child{border:1px solid #e3ece3}
.hn-card-list .hn-draggable-card .hn-card-body,.hn-card-list .hn-draggable-card .tx-info,.hn-card-list .hn-draggable-card .manage-book-details{flex:1;min-width:0}
.hn-drag-handle{width:44px;min-width:44px;height:44px;border:0;border-radius:10px;background:#eef7ed;color:#267347;font-size:23px;display:grid;place-items:center;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;flex-shrink:0}
.hn-drag-handle.hn-dragging{cursor:grabbing;background:#d7f2df}
.hn-draggable-card.hn-dragging-row{border:2px solid #259e62!important;background:#f1fbf2;box-shadow:0 8px 20px #153f2330;opacity:.95}
.hn-card-list .hn-sort-name{flex:1;min-width:0}
.hn-card-list .hn-sort-actions{display:flex;gap:8px;flex-wrap:nowrap}
body.hn-on-subpage #content form.hn-docked-form .hn-inline-submit{display:none!important}
body.hn-on-subpage #content .card{margin-bottom:14px}
@media(max-width:390px){.hn-drag-handle{min-width:44px;width:44px;height:44px}.hn-card-list .utility-actions{min-width:0}}
html[data-hn-theme="dark"] .hn-card-list .hn-draggable-card{background:#2c4435;border-color:#456752;color:#e5f4e9}
html[data-hn-theme="dark"] .hn-drag-handle{background:#395347;color:#b0e3c4}
html[data-hn-theme="light"] .hn-drag-handle{background:#e4f0f5;color:#397b96}

/* v0.6.99: Desktop subpage dock follows the content column, never the viewport width.
   Mobile LIFF retains the full-width, safe-area-aware dock. */
@media (min-width: 750px) {
  #hn-action-dock {
    left: 50%;
    right: auto;
    width: min(708px, calc(100% - 52px));
    max-width: 708px;
    transform: translateX(-50%);
    padding: 10px 12px 12px;
    border: 1px solid #e0e8e1;
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    gap: 12px;
  }
  #hn-action-dock button {height: 50px;}
}

/* v0.7.16 — don't truncate translated feature actions on compact screens. */
.hn-choice > :first-child {min-width:0;}
.hn-sort-name, .hn-card-body, .hn-card-list .hn-draggable-card .tx-info{overflow-wrap:anywhere;}
@media(max-width:390px){
 .hn-card-list .hn-draggable-card{height:auto;min-height:56px;}
 .hn-card-list .hn-sort-actions{min-width:0;flex-wrap:wrap;justify-content:flex-end;}
}
