.tempering-overlay {
    position:fixed; inset:0; z-index:1000000; display:flex; align-items:center; justify-content:center;
    padding:20px; box-sizing:border-box; background:rgba(0,0,0,.78);
}
.tempering-panel {
    width:min(960px,100%); max-height:calc(100dvh - 40px); overflow:auto; box-sizing:border-box;
    color:var(--sect-text,#e9dfbd); background:linear-gradient(140deg,#183329,#0b2019);
    border:1px solid #b59a5c; border-radius:8px; box-shadow:0 20px 70px #0009;
}
.tempering-panel *, .tempering-panel *::before, .tempering-panel *::after { box-sizing:border-box; }
.tempering-header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:22px 28px; border-bottom:1px solid #9b885166; }
.tempering-header h2 { margin:0; color:#ebd59a; font:700 clamp(24px,3vw,34px)/1.2 Georgia,serif; }
.tempering-header p { margin:6px 0 0; color:#b8ad89; font:17px/1.4 Georgia,serif; }
.tempering-close { flex:none; width:44px; height:44px; border:1px solid #a58e56; border-radius:4px; background:#10271e; color:#ebd59a; font:30px/1 Georgia,serif; cursor:pointer; }
.tempering-body { display:grid; grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr); gap:22px; padding:24px 28px; }
.tempering-portrait { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:16px; min-height:330px; overflow:hidden; border:1px solid #9b885177; border-radius:4px; background:radial-gradient(ellipse at 50% 65%,color-mix(in srgb,var(--tempering-accent) 13%,transparent),transparent 65%),#0e251e; }
.tempering-portrait::before { content:''; position:absolute; width:230px; height:230px; border:1px solid color-mix(in srgb,var(--tempering-accent) 20%,transparent); border-radius:50%; pointer-events:none; }
.tempering-symbol { position:relative; display:grid; place-items:center; width:50px; height:50px; border:1px solid var(--tempering-accent); border-radius:50%; color:var(--tempering-accent); font:32px/1 Georgia,serif; }
.tempering-cultivator { position:relative; height:180px; display:grid; place-items:center; }
.tempering-cultivator svg,.tempering-cultivator img { max-width:100%; image-rendering:pixelated; }
.tempering-status { position:relative; color:#d8cba0; font:17px/1.4 Georgia,serif; }
.tempering-stats { display:flex; flex-direction:column; justify-content:center; gap:16px; min-width:0; }
.tempering-card { padding:18px; border:1px solid #71836a77; border-radius:6px; background:#091c1677; min-width:0; }
.tempering-row { display:flex; align-items:baseline; justify-content:space-between; gap:12px; font-size:14px; color:#cec6a7; flex-wrap:wrap; }
.tempering-row h3 { margin:0; font:18px/1.35 Georgia,serif; color:#eee1b7; }
.tempering-tier { margin-bottom:22px; }
.tempering-resistance { color:var(--tempering-accent); white-space:nowrap; }
.tempering-progress-label { margin-bottom:8px; }
.tempering-meter { height:13px; border:1px solid color-mix(in srgb,var(--tempering-accent) 60%,transparent); border-radius:4px; background:#061711; overflow:hidden; }
.tempering-meter > span { display:block; height:100%; background:var(--tempering-accent); }
.tempering-hp { margin-top:10px; height:10px; border:0; }
.tempering-rates { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.tempering-rates span { display:block; font-size:14px; }
.tempering-rates strong { display:block; margin-top:7px; font:700 27px/1.1 Georgia,serif; overflow-wrap:anywhere; }
.tempering-damage { color:#ed9982; }.tempering-qi { color:var(--tempering-accent); }
.tempering-footer[data-speed-session] { display:flex; align-items:flex-end; gap:20px; margin:0 28px; padding:20px 0 24px; border-top:1px solid #9b885188; overflow:visible!important; max-height:none; }
.tempering-footer > .action-speed-toolbar { position:static; flex:1; min-width:0; width:auto; padding:0; border:0; background:none; display:flex; flex-direction:column; align-items:flex-start; gap:10px; }
.tempering-footer .action-speed-toolbar__buttons { flex-wrap:nowrap; gap:4px; width:100%; }
.tempering-footer .action-speed-toolbar button { flex:1; min-width:0; min-height:44px; padding:6px 3px; border-color:#74856566; background:#10271e; color:#eadfb9; }
.tempering-footer .action-speed-toolbar button[aria-pressed="true"] { background:#d8b662; color:#15271c; border-color:#eed390; }
.tempering-stop { flex:none; min-height:44px; padding:10px 20px; border:1px solid #b99a59; border-radius:4px; background:linear-gradient(#773727,#54251d); color:#f2e3bd; font:17px/1.3 Georgia,serif; cursor:pointer; }
.tempering-panel button:focus-visible { outline:2px solid #f1d698; outline-offset:3px; }
.tempering-close:hover,.tempering-stop:hover { filter:brightness(1.16); }
#elementalTemperingResultModal > .sect-card { width:min(520px,calc(100% - 24px)); max-width:520px!important; max-height:calc(100dvh - 24px); overflow:auto; padding:24px; background:linear-gradient(140deg,#183329,#0b2019); border:1px solid #b59a5c!important; border-radius:8px; color:#e9dfbd; }
#elementalTemperingResultModal h2 { color:#ebd59a!important; font-family:Georgia,serif; }
#elementalTemperingResultModal .sect-panel { padding:16px; background:#091c1677; border:1px solid #71836a77; border-radius:6px; }
#elementalTemperingResultModal .sect-stat__label { color:#c8bfa0!important; }
#elementalTemperingResultModal .sect-btn--primary { background:#284b38!important; border-color:#b59a5c!important; color:#f2e3bd; min-height:44px; }
@media(max-width:700px) {
    .tempering-overlay { padding:10px; }
    .tempering-panel { max-height:calc(100dvh - 20px); }
    .tempering-header { padding:16px; }
    .tempering-body { grid-template-columns:1fr; gap:16px; padding:16px; }
    .tempering-portrait { min-height:245px; gap:4px; }
    .tempering-symbol { width:36px; height:36px; font-size:24px; }
    .tempering-cultivator { height:160px; }
    .tempering-cultivator svg,.tempering-cultivator img { max-height:160px; }
    .tempering-card { padding:14px; }
    .tempering-footer[data-speed-session] { margin:0 16px; flex-wrap:wrap; padding:16px 0; }
    .tempering-footer > .action-speed-toolbar { flex-basis:100%; }
    .tempering-footer .action-speed-toolbar__buttons { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); }
    .tempering-stop { width:100%; }
}
