*{box-sizing:border-box}
#accountGate[hidden],#accountTools[hidden],#gateLogout[hidden],#setupLink[hidden]{display:none!important}
#accountGate{position:fixed;inset:0;z-index:99999;background:#f3f5f9;overflow:auto;font-family:system-ui,-apple-system,"PingFang SC",sans-serif;color:#24304a;display:flex;align-items:center;justify-content:center;padding:18px}
.account-card{width:min(100%,420px);background:#fff;border-radius:18px;padding:26px 22px;box-shadow:0 14px 38px #26344e15}
.account-card h1{font-size:24px;margin:0 0 8px}.account-card p{font-size:14px;color:#68748c;line-height:1.7}
.account-card form{display:grid;gap:12px;margin-top:16px}
.account-card input,.account-card select{width:100%;font:inherit;border-radius:10px;border:1px solid #d1dbe8;padding:12px;background:#fff}
.account-card button{border:0;border-radius:10px;padding:13px;font-size:15px;background:#2272df;color:#fff;cursor:pointer}
.account-card button:disabled{opacity:.6;cursor:wait}
#accountMessage{color:#9e4129;min-height:24px;margin-top:12px;font-size:13px;line-height:1.5}
#gateLogout{display:block;width:100%;margin-top:12px;background:#edf3ff;color:#245bb2}
.setup-link{display:block;margin:12px 0;padding:12px;border-radius:9px;background:#e4f3ff;color:#1469bb;text-decoration:none;text-align:center;font-size:14px}

.account-card input:focus{outline:2px solid #8bb9fc;border-color:#1b70df}

/* V35: main calculator is free of the fixed account bar and large notices. */
#menuAccountSection[hidden],#calcChangeBadge[hidden],#calcChangeDialog[hidden],#calcChangeResultRow[hidden]{display:none!important}
.menu-account-group{margin-top:12px}
.menu-account-summary{cursor:default}
.menu-account-name{font-size:16px;letter-spacing:.4px;color:#2182e5;font-weight:600;overflow-wrap:anywhere}
.menu-account-logout{color:#d24b42;font-weight:500}
.menu-logout-icon{font-size:19px;color:#d24b42}
.menu-account-explanation{margin:0;padding:12px 24px 16px;font-size:12px;line-height:1.6;color:#89909a;background:#fff;border-top:1px solid #f0f0f3}
.calc-change-badge{position:absolute;z-index:7;right:12px;bottom:calc(var(--key-height) + 56px);border:1px solid rgba(233,188,98,.75);border-radius:999px;background:rgba(63,55,30,.84);color:#ffdfa4;font-size:12px;font-weight:500;line-height:1.1;min-height:27px;padding:6px 11px;white-space:nowrap;box-shadow:0 1px 4px #0003}
.calc-change-badge:active{filter:brightness(1.25)}
.calc-change-overlay{position:fixed;inset:0;z-index:99990;display:flex;align-items:center;justify-content:center;padding:22px;background:rgba(0,0,0,.54);font-family:system-ui,-apple-system,'PingFang SC',sans-serif}
.calc-change-panel{width:min(100%,380px);background:#fff;color:#202b36;border-radius:16px;padding:22px;box-shadow:0 14px 36px #0003}
.calc-change-panel h2{font-size:21px;margin:0 0 10px;color:#182a3a}
.calc-change-description{color:#75808c;font-size:13px;line-height:1.6;margin:0 0 12px}
.calc-change-row{display:flex;justify-content:space-between;align-items:baseline;gap:15px;border-top:1px solid #eef0f2;padding:12px 0;font-size:14px}
.calc-change-row>span{flex:0 0 auto;color:#7d8791}
.calc-change-row>strong{font-size:16px;text-align:right;overflow-wrap:anywhere;font-weight:500}
.calc-change-result>strong{font-size:22px;font-weight:600}
#calcChangeClose{display:block;width:100%;border:0;border-radius:10px;background:#2480da;color:#fff;padding:12px;font-size:15px;font-weight:600;margin-top:14px}
/* Only transient errors use a toast; not remote modification messages. */
#calcRuleNotice{position:fixed;z-index:60;top:auto;bottom:calc(env(safe-area-inset-bottom, 0px) + 12px);left:50%;right:auto;transform:translateX(-50%);width:min(92vw,430px);background:#fff9e8;color:#50422a;border:1px solid #dec17f;border-radius:9px;padding:10px 12px;font-size:13px;line-height:1.5;word-break:break-word;box-shadow:0 4px 18px #0004;display:none;pointer-events:none}
@media(max-height:580px){.calc-change-badge{bottom:calc(var(--key-height) + 48px)}}

/* V36: short disclosure that never crowds the calculation history or result. */
.calc-change-badge {
  top: 8px;
  left: 43px;
  right: auto;
  bottom: auto !important;
  min-height: 22px;
  padding: 2px 6px;
  color: #aeb5b5;
  background: rgba(32,32,32,.88);
  border: 1px solid #494f4f;
  border-radius: 5px;
  box-shadow: none;
  font-size: 11px;
  font-weight: 400;
}
.history-entry {
  display:flex;
  align-items:baseline;
  justify-content:flex-end;
  gap: 6px;
}
.history-adjusted-tag {
  flex:none;
  border:1px solid #6e7775;
  border-radius:5px;
  padding: 2px 4px;
  background: #292b2b;
  color: #c2c8c6;
  font: 11px/1.3 system-ui,-apple-system,'PingFang SC',sans-serif;
  vertical-align: middle;
  white-space: nowrap;
  cursor: pointer;
}
.history-entry > span { min-width: 0; overflow-wrap:anywhere; }
.calculator.left-notes .history-entry { justify-content:flex-start; }

/* V37: compact, readable modification provenance, no long overlay label. */
.calc-change-badge {
  color: #a9b5b6;
  background: transparent;
  border-color: #50595b;
  border-radius: 8px;
  padding: 2px 5px;
  font-size: 10px;
  min-height: 20px;
}
.history-adjusted-tag {
  font-size: 10px;
  background: transparent;
  border-color: #50595b;
  color: #a9b5b6;
  padding: 1px 3px;
}

/* V38: no repeating history badges; single small provenance icon near the menu. */
.calc-change-badge {
  top: 10px !important;
  left: 46px !important;
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  font: 13px/18px system-ui, sans-serif;
  text-align: center;
  color: #a0aaaa;
  border: 1px solid #4d5557;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}
.calc-change-badge[hidden], .menu-adjustment-log[hidden] { display: none!important; }
.menu-adjustment-log { color:#2d587d; }
.menu-adjustment-log .ios-value { color:#2d78bd; }
.history-entry { display:block; text-align:right; }
.calc-change-history-list {
  display:grid;
  gap:5px;
  max-height:135px;
  overflow:auto;
  margin: 6px 0 14px;
}
.adjustment-history-row {
  background:#f5f8fb;
  color:#304254;
  text-align:left;
  border:1px solid #e4eaf0;
  border-radius:7px;
  padding:7px 9px;
  font-size:12px;
  overflow-wrap:anywhere;
}
.adjustment-history-row.selected {
  border-color:#327ac1;
  background:#edf5ff;
}

/* V39: unobtrusive decimal-point-size status dot, non-interactive.
   Adjustment details stay available through the menu's 计算来源 entry. */
.calc-change-badge {
  display: block;
  position: absolute;
  z-index: 7;
  top: 19px !important;
  left: 46px !important;
  right: auto !important;
  bottom: auto !important;
  width: 5px !important;
  height: 5px !important;
  min-width: 5px !important;
  min-height: 5px !important;
  max-width: 5px !important;
  max-height: 5px !important;
  border: 0 !important;
  border-radius: 50%;
  background: #858c8d !important;
  box-shadow: none !important;
  padding: 0 !important;
  font-size: 0 !important;
  line-height: 0 !important;
  pointer-events: none !important;
  user-select: none;
}
.calc-change-badge[hidden] { display: none !important; }

/* V40: show username in blue hero block; remove change-log block from menu home page */
.hero-login{
  min-height: 28px;
  font-size: 22px;
  font-weight: 600;
  color:#fff;
  letter-spacing: .2px;
}
.menu-adjustment-log,
.menu-account-explanation{
  display:none !important;
}

/* V41: member identity, not a fake VIP/date label */
.home-hero .hero-login{font-size:23px;font-weight:600;overflow-wrap:anywhere;padding:0 16px}
.home-hero .vip-badge{display:none!important}

/* V44: tiny provenance indicator at the top-left corner, not beside menu */
.calculator .screen .calc-change-badge{top:8px!important;left:7px!important;right:auto!important;bottom:auto!important;width:5px!important;height:5px!important;pointer-events:none!important}
.app-download-row{color:inherit;text-decoration:none;display:flex;align-items:center}
#accountGate input{font-size:16px}

/* V46: initial auth state never flashes the login card over an existing session. */
body.auth-booting{background:#202020!important;overflow:hidden}
body.auth-booting #accountGate,body.auth-booting .calculator,
body.auth-booting #calcRuleNotice,body.auth-booting #calcChangeDialog{visibility:hidden!important}
/* Tiny two-pixel status indicator outside the menu hit target. */
.calculator .screen .calc-change-badge{
 top:3px!important;left:4px!important;right:auto!important;bottom:auto!important;
 width:2px!important;height:2px!important;min-width:2px!important;min-height:2px!important;
 max-width:2px!important;max-height:2px!important;
 background:#6e7778!important;border:0!important;border-radius:100%!important;
 padding:0!important;box-shadow:none!important;pointer-events:none!important;
}
.calculator .screen .calc-change-badge[hidden]{display:none!important}
