/* ToolnoNiwa Pro members: keep the complete original interface hidden until Supabase confirms an authenticated user and finishes loading their records. */
body:not(.cloud-ready)>.app{display:none!important}
body.cloud-ready #pro-loading{display:none!important}
#pro-loading{min-height:100vh;display:grid;place-items:center;background:radial-gradient(circle at 85% 5%,#e5f2e0,transparent 43%),#f6faf4;padding:20px;font-family:-apple-system,BlinkMacSystemFont,'Hiragino Sans','Yu Gothic',Meiryo,sans-serif;color:#293d2d}
.pro-loading-card{width:100%;max-width:440px;border:1px solid #dce8dc;background:white;border-radius:23px;padding:34px;box-shadow:0 14px 46px rgba(34,65,34,.06)}
.pro-loading-card strong{display:block;font-size:22px;letter-spacing:-.04em;color:#357b49}
.pro-loading-card p{font-size:14px;line-height:1.7;color:#556959;margin:16px 0}
.pro-loading-card a{color:#357c4b;font-size:13px;font-weight:700}
#pro-loading-message[data-error="true"]{color:#ac4436}
#pro-save-status{display:inline-block;font-size:12px;font-weight:750;color:#4f7c55;white-space:nowrap}
#pro-save-status[data-failed="true"]{color:#ad4435}
#save-local{pointer-events:none}
#clear-local{display:none!important}
#save-local:disabled{opacity:1}
#pro-cloud-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
#pro-cloud-actions button{padding:7px 11px;font-size:12px}
@media(max-width:640px){#pro-save-status{font-size:11px;max-width:115px;overflow:hidden;text-overflow:ellipsis}}

.pro-loading-card .pro-logout{display:block;width:100%;margin-top:16px;padding:11px 14px;border:1px solid #a8c9ab;border-radius:10px;background:#eaf5e8;color:#2e6f43;font-weight:750;cursor:pointer}
.pro-loading-card .pro-logout:focus-visible{outline:3px solid #aecfac;outline-offset:2px}
.pro-loading-card .pro-logout:disabled{opacity:.55}

/* Subscription details: wrap Japanese dates/statuses gracefully on narrow screens. */
#tab-plan .plan-help .plan-row{align-items:flex-start;flex-wrap:wrap;row-gap:4px}
#tab-plan .plan-help .plan-row span{flex:0 0 94px}
#tab-plan .plan-help .plan-row strong{flex:1 1 170px;text-align:right;overflow-wrap:anywhere;line-height:1.6}
#tab-plan .plan-help [data-pro-billing-action]{max-width:100%;white-space:normal;line-height:1.5}
#tab-plan .plan-price{font-size:clamp(26px,3vw,37px)}
@media(max-width:550px){
  #tab-plan .plan-help .plan-row span,
  #tab-plan .plan-help .plan-row strong{flex:1 1 100%;text-align:left}
  #tab-plan .plan-current,#tab-plan .plan-help{padding:19px}
  #tab-plan .plan-help [data-pro-billing-action]{width:100%;margin-top:10px}
}

/* ToolnoNiwa Pro | production-shaped sandbox billing center */
.pro-billing-console{display:grid;gap:18px;margin:0 0 26px;color:#263b2a}
.pro-billing-test-note{display:flex;gap:13px;align-items:flex-start;padding:16px 20px;background:#f0f6ec;border:1px solid #d9e7d3;border-radius:15px}
.pro-billing-test-note>span{color:#49844d;font-size:24px;line-height:1}
.pro-billing-test-note strong{font-size:13px;font-weight:800;display:block}
.pro-billing-test-note p{font-size:12px;color:#55715b;line-height:1.75;margin:4px 0 0}
.pro-billing-main{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(280px,.8fr);gap:16px;align-items:stretch}
.pro-billing-card{background:#fff;border:1px solid #e2e9df;border-radius:18px;box-shadow:0 3px 12px rgba(18,48,22,.025);padding:25px;min-width:0}
.pro-billing-eyebrow{font-size:12px;color:#64806c;font-weight:800;margin-bottom:12px}
.pro-billing-plan-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap}
.pro-billing-plan-head h2{font-size:23px;line-height:1.3;margin:0;letter-spacing:-.045em}
.pro-billing-price{font-weight:850;font-size:30px;margin:10px 0 0;line-height:1.25;letter-spacing:-.035em}
.pro-billing-price span{font-size:12px;font-weight:550;color:#6c8172;letter-spacing:0}
.pro-billing-pill{display:inline-flex;max-width:100%;border:1px solid #dde8dc;background:#f3f6f2;border-radius:99px;padding:6px 11px;font-size:12px;font-weight:750;color:#536457;line-height:1.45}
.pro-billing-pill[data-state="good"]{background:#eaf6e9;color:#2e7142;border-color:#cde5cb}
.pro-billing-pill[data-state="end"]{background:#f5f2e6;color:#806d35;border-color:#e8dfc4}
.pro-billing-pill[data-state="warning"]{background:#fff2ed;color:#a14c33;border-color:#f0d5c8}
.pro-billing-description{color:#576a5b;font-size:13px;line-height:1.8;margin:16px 0 19px;min-height:2.1em}
.pro-billing-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0;border-top:1px solid #e8eee6;border-left:1px solid #e8eee6;border-radius:10px;overflow:hidden}
.pro-billing-facts>div{padding:15px 14px;border-right:1px solid #e8eee6;border-bottom:1px solid #e8eee6;min-width:0}
.pro-billing-facts span{display:block;color:#748078;font-size:11px;font-weight:700;margin-bottom:7px}
.pro-billing-facts strong{display:block;color:#263a2b;font-size:13px;line-height:1.65;font-weight:800;overflow-wrap:anywhere}
.pro-billing-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:20px}
.pro-billing-actions .btn{min-height:41px;padding:9px 16px;max-width:100%;white-space:normal;line-height:1.45}
.pro-billing-actions [data-pro-billing-action="portal"]{background:#376d44;color:#fff;border-color:#376d44}
.pro-billing-actions [data-pro-billing-action="portal"]:hover{background:#2e5e39;color:#fff}
.pro-billing-actions-feedback:empty{display:none}
.pro-billing-actions-feedback{font-size:12px;color:#8e5139;line-height:1.6;margin:9px 0 0}
.pro-billing-help-card h3,.pro-billing-history-card h3{margin:0;font-size:17px;letter-spacing:-.02em}
.pro-billing-help-card>p{font-size:13px;color:#596c5f;line-height:1.85;margin:15px 0}
.pro-billing-help-list{background:#f8faf6;border-radius:12px;padding:10px 14px}
.pro-billing-help-list p{font-size:12px;line-height:1.8;margin:8px 0;color:#4c6654}
.pro-billing-help-card .pro-billing-help-caption{font-size:11px;color:#7d8a80;margin-top:14px}
.pro-billing-history-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.pro-billing-history-head p{margin:7px 0 0;color:#708075;font-size:12px;line-height:1.6}
.pro-billing-history-head button{min-height:36px}
.pro-billing-table-scroll{overflow-x:auto;max-width:100%}
.pro-billing-history-table{border-collapse:collapse;width:100%;min-width:550px;text-align:left;font-size:13px}
.pro-billing-history-table th{font-size:11px;font-weight:800;color:#6f8073;background:#f6f9f5;white-space:nowrap;padding:12px 14px}
.pro-billing-history-table td{padding:15px 14px;border-bottom:1px solid #e9efe8;color:#314534;vertical-align:middle}
.pro-billing-history-table tbody tr:last-child td{border-bottom:0}
.pro-billing-invoice-status{display:inline-flex;align-items:center;padding:5px 10px;border-radius:9px;background:#f2f4f2;color:#6d7770;font-weight:700;font-size:11px;white-space:nowrap}
.pro-billing-invoice-status[data-status="paid"]{background:#eaf5eb;color:#367a49}
.pro-billing-invoice-status[data-status="open"]{background:#fff0e9;color:#a5533b}
.pro-billing-invoice-link{color:#337b43!important;font-weight:800;text-decoration:underline;text-underline-offset:3px;white-space:nowrap}
.pro-billing-history-note{font-size:11px;color:#7b887e;line-height:1.6;margin:13px 0 0}
.pro-overdue-invoice{border:1px solid #efcdbd;background:#fff8f3;padding:13px;border-radius:12px;margin:14px 0}
.pro-overdue-invoice p{font-weight:800;font-size:13px;color:#92482e;margin:0 0 10px}
.pro-loading-card [data-pro-billing-action],.pro-billing-direct-pay{display:inline-flex;align-items:center;justify-content:center;max-width:100%;line-height:1.4;white-space:normal;margin:8px 8px 0 0;padding:9px 12px;border-radius:10px}
.pro-loading-card [data-pro-billing-action="portal"]{background:#e9f4e8;border-color:#b6d3b8;color:#2e7542}
@media(max-width:960px){.pro-billing-main{grid-template-columns:1fr}}
@media(max-width:640px){
 .pro-billing-console{gap:13px}
 .pro-billing-card{padding:17px;border-radius:14px}
 .pro-billing-test-note{padding:14px}
 .pro-billing-plan-head h2{font-size:20px}
 .pro-billing-price{font-size:27px}
 .pro-billing-facts{grid-template-columns:1fr}
 .pro-billing-facts>div{padding:12px 13px}
 .pro-billing-actions .btn{flex:1 1 100%}
 .pro-billing-history-head button{width:100%}
 .pro-loading-card [data-pro-billing-action],.pro-billing-direct-pay{width:100%;margin:8px 0 0}
}
@media(prefers-reduced-motion:reduce){.pro-billing-console *{scroll-behavior:auto}}

.pro-billing-pdf-link{display:inline-block;margin-left:12px;color:#61766a!important;text-decoration:none!important;border:1px solid #d9e7da;border-radius:7px;padding:4px 8px;font-size:11px}
.pro-billing-pdf-link:hover{border-color:#679a6e;color:#287641!important}


/* Account profile: real Supabase user identity and accessible actions. */
#dashboard .pro-account{position:relative;min-width:0}
#dashboard .pro-account .avatar{flex:0 0 35px}
#dashboard .pro-account-identity{flex:1;min-width:0}
#dashboard .pro-account-identity strong,#dashboard .pro-account-identity small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#dashboard .pro-account .account-dots{flex:0 0 35px;min-height:35px;margin-left:auto;border:0;border-radius:10px;background:transparent;color:#647a66;font-size:14px;font-weight:800;letter-spacing:1px;cursor:pointer}
#dashboard .pro-account .account-dots:hover,#dashboard .pro-account .account-dots[aria-expanded="true"]{background:#eff5ea;color:#2a6d3c}
#dashboard .pro-account-menu{position:absolute;z-index:85;right:0;bottom:calc(100% + 8px);width:200px;padding:7px;background:white;border:1px solid #dce7d9;border-radius:12px;box-shadow:0 14px 34px rgba(28,48,31,.14)}
#dashboard .pro-account-menu[hidden],#pro-profile-overlay[hidden]{display:none!important}
#dashboard .pro-account-menu button{display:block;width:100%;padding:11px;border:0;border-radius:8px;background:white;color:#2f4835;text-align:left;font-size:12px;font-weight:750;cursor:pointer}
#dashboard .pro-account-menu button:hover,#dashboard .pro-account-menu button:focus-visible{background:#edf6e9}
#dashboard .pro-account-menu [data-profile-action="logout"]{color:#9b4b3f}
#pro-profile-overlay{position:fixed;inset:0;z-index:110;display:grid;place-items:center;padding:18px;background:rgba(20,37,25,.55);overflow-y:auto}
#pro-profile-overlay .pro-profile-dialog{width:min(100%,480px);max-height:min(90vh,850px);overflow-y:auto;padding:25px;background:#fff;border-radius:18px;box-shadow:0 18px 58px rgba(0,0,0,.18);font-family:-apple-system,BlinkMacSystemFont,'Hiragino Sans','Yu Gothic',Meiryo,sans-serif;color:#26392b}
#pro-profile-overlay .pro-profile-head{display:flex;gap:15px;align-items:start;justify-content:space-between;margin-bottom:16px}
#pro-profile-overlay h2{font-size:20px;margin:0 0 5px}
#pro-profile-overlay p{font-size:12px;color:#647669;line-height:1.7;margin:0}
#pro-profile-overlay .pro-profile-close{font-size:24px;font-weight:400;border:0;background:#f4f7f2;border-radius:8px;width:37px;height:37px;cursor:pointer}
#pro-profile-overlay label{display:block;margin:15px 0 6px;font-size:12px;font-weight:800;color:#415948}
#pro-profile-overlay label .pro-profile-optional{font-weight:500;color:#77857a}
#pro-profile-overlay input{display:block;width:100%;height:45px;min-width:0;border:1px solid #d5e1d3;border-radius:10px;padding:9px 12px;background:#fff;color:#26392b;font-size:14px}
#pro-profile-overlay input[readonly]{background:#f4f6f3;color:#66736a}
#pro-profile-overlay .pro-profile-hint{margin-top:5px;font-size:11px}
#pro-profile-overlay .pro-profile-feedback{min-height:20px;margin-top:12px;color:#347848;font-weight:700}
#pro-profile-overlay .pro-profile-feedback[data-error="true"]{color:#af443d}
#pro-profile-overlay .pro-profile-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:12px}
#pro-profile-overlay button:disabled{opacity:.55;cursor:wait}
#pro-profile-overlay .pro-profile-security{border-top:1px solid #e7ede5;margin-top:22px;padding-top:17px}
#pro-profile-overlay .pro-profile-security strong{font-size:13px}
#pro-profile-overlay .pro-profile-security p{margin-top:6px}
#pro-profile-overlay .pro-profile-reset{border:0;padding:10px 0;background:none;color:#317944;font-size:12px;font-weight:800;text-align:left;cursor:pointer}
@media(max-width:760px){
 #dashboard .sidebar .pro-account{display:flex;margin-top:8px;border-top:1px solid #edf0eb;padding:10px 4px 0}
 #dashboard .pro-account-menu{top:calc(100% + 6px);bottom:auto;left:auto;right:0}
 #pro-profile-overlay .pro-profile-dialog{padding:19px;border-radius:15px}
 #pro-profile-overlay .pro-profile-actions .btn{flex:1}
}

.pro-refund-guarantee{width:100%;margin-top:13px;padding:16px;border:1px solid #d9e9d9;border-radius:13px;background:#f5faf3;color:#35523d}
.pro-refund-guarantee strong{display:block;font-size:14px}
.pro-refund-guarantee p{margin:8px 0;font-size:12px;line-height:1.7}
.pro-refund-guarantee .pro-refund-guarantee-status{font-weight:750}
.pro-refund-guarantee button{background:#fff!important;color:#307047!important;border:1px solid #abd2b2!important}

/* Refund UX - server eligibility is authoritative, modal requires informed consent. */
#dashboard .pro-refund-guarantee{flex:1 1 100%;min-width:0;width:100%;border-radius:15px;background:#f7faf6;border:1px solid #d9e9d9;padding:19px}
#dashboard .pro-refund-guarantee strong{font-size:14px;color:#2e7143;line-height:1.5}
#dashboard .pro-refund-guarantee p{font-size:12px;line-height:1.8;margin:9px 0}
#dashboard .pro-refund-guarantee .pro-refund-guarantee-status{background:#fff;padding:10px;border:1px solid #e1eee0;border-radius:10px;overflow-wrap:anywhere}
#dashboard .pro-refund-guarantee .pro-refund-guarantee-status[data-state="eligible"]{background:#eaf7ed;color:#277445;border-color:#cae6ce}
#dashboard .pro-refund-guarantee .pro-refund-guarantee-status[data-state="warning"]{background:#fffaef;color:#8a622c;border-color:#ebddc0}
#dashboard .pro-refund-guarantee button{width:100%;min-height:44px;margin-top:12px;background:#fff!important;color:#286f43!important;border:1px solid #b1d2b8!important;border-radius:11px;font-size:13px;font-weight:850;cursor:pointer}
.pro-refund-dialog{width:min(510px,calc(100% - 24px));max-height:calc(100dvh - 24px);padding:23px 25px;border:1px solid #deebd8;border-radius:19px;background:#fff;color:#293e2c;box-shadow:0 24px 85px #1027194d;overflow-y:auto;font-family:-apple-system,BlinkMacSystemFont,'Hiragino Sans','Yu Gothic',Meiryo,sans-serif}
.pro-refund-dialog::backdrop{background:#142719aa}
.pro-refund-dialog *{box-sizing:border-box}
.pro-refund-dialog header{display:flex;align-items:center;justify-content:space-between;gap:10px}
.pro-refund-dialog header span{font-size:12px;font-weight:850;color:#34824c}
.pro-refund-dialog .pro-refund-close{border:0;border-radius:8px;background:#f1f5ef;color:#526957;font-size:22px;width:36px;height:36px;cursor:pointer}
.pro-refund-dialog h2{font-size:23px;line-height:1.4;margin:10px 0}
.pro-refund-dialog #pro-refund-dialog-description{font-size:13px;color:#677969;line-height:1.7;margin:0 0 17px}
.pro-refund-dialog-facts{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:14px}
.pro-refund-dialog-facts div{padding:13px;border:1px solid #dfeadd;border-radius:11px;background:#f5f9f3}
.pro-refund-dialog-facts small{display:block;color:#6a806e;font-size:11px;margin-bottom:7px}
.pro-refund-dialog-facts strong{font-size:17px;color:#2e6943}
.pro-refund-dialog-warning{border:1px solid #eedcc1;background:#fff8ef;border-radius:12px;padding:14px 16px;font-size:12px;color:#674f32;line-height:1.8}
.pro-refund-dialog-warning strong{color:#855526}
.pro-refund-dialog-warning ul{margin:8px 0;padding-left:19px}
.pro-refund-dialog-warning p{margin:8px 0 0;font-weight:750}
.pro-refund-dialog-consent{display:flex;align-items:flex-start;gap:10px;margin:15px 0;font-size:12px;line-height:1.8;font-weight:750;cursor:pointer}
.pro-refund-dialog-consent input{accent-color:#358850;flex:0 0 18px;width:18px;height:18px;margin:2px 0}
.pro-refund-dialog-actions{display:grid;grid-template-columns:118px 1fr;gap:10px}
.pro-refund-dialog-actions button{border-radius:11px;min-height:45px;padding:10px 13px;font-size:12px;font-weight:800;line-height:1.4;cursor:pointer}
.pro-refund-dialog-cancel{border:1px solid #d8e7d8;background:#fff;color:#526656}
.pro-refund-dialog-submit{border:1px solid #387e50;background:#387e50;color:#fff}
.pro-refund-dialog-submit:disabled{opacity:.38;cursor:not-allowed}
.pro-refund-dialog-foot{color:#7a8a7d;font-size:11px;line-height:1.7;margin:14px 0 0}
.pro-refund-dialog-foot a{color:#267b47;text-decoration:underline}
.pro-refund-dialog button:focus-visible,.pro-refund-dialog input:focus-visible{outline:3px solid #e5b360;outline-offset:2px}
@media(max-width:550px){.pro-refund-dialog{padding:17px;border-radius:14px}.pro-refund-dialog h2{font-size:20px}.pro-refund-dialog-facts{grid-template-columns:1fr}.pro-refund-dialog-actions{grid-template-columns:1fr}.pro-refund-dialog-submit{order:1}.pro-refund-dialog-cancel{order:2}}
