*{box-sizing:border-box} :root{--bg:#eef4f9;--surface:#fff;--ink:#1e3347;--muted:#607385;--primary:#315f8f;--border:#c7d7e5;--focus:#7b3ff2;--shadow:0 10px 28px #2b4c6c1f}
body{margin:0;min-height:100vh;color:var(--ink);background:radial-gradient(circle at top left,#fff,transparent 34rem),var(--bg);font-family:"BIZ UDPGothic","Yu Gothic UI","Yu Gothic",system-ui,sans-serif;line-height:1.6}
button,input,select{font:inherit}button{min-height:46px;padding:.6rem .9rem;border:2px solid var(--primary);border-radius:11px;color:#24496e;background:#fff;font-weight:800;cursor:pointer}button:hover{background:#e8f1f8}button:focus-visible,input:focus-visible,select:focus-visible{outline:4px solid var(--focus);outline-offset:3px}
header{position:sticky;top:0;z-index:5;display:flex;justify-content:space-between;align-items:center;gap:1rem;min-height:78px;padding:.7rem max(1rem,env(safe-area-inset-left));border-bottom:1px solid #315f8f2d;background:#fffffff0;backdrop-filter:blur(10px)}
header h1{margin:0;font-size:clamp(1.1rem,3vw,1.65rem)}header small,.panel small{color:var(--primary);font-weight:900;letter-spacing:.08em}.top-actions{display:flex;gap:.45rem}
main{width:min(calc(100% - 2rem),1360px);margin:auto;padding:2rem 0 4rem}.hero{display:flex;justify-content:space-between;align-items:center;gap:2rem;padding:clamp(1.4rem,4vw,2.6rem);border:1px solid #315f8f2b;border-radius:25px;background:linear-gradient(135deg,#fff,#e7f0f8);box-shadow:var(--shadow)}
.hero h2{max-width:29ch;margin:.35rem 0;font-size:clamp(1.7rem,4vw,3rem);line-height:1.3}.hero b{color:var(--primary)}.hero p{margin-bottom:0;color:var(--muted);font-weight:700}.hero>span{font-size:clamp(4rem,10vw,7rem)}
.panel{margin-top:1.2rem;padding:1.2rem;border:1px solid var(--border);border-radius:21px;background:var(--surface);box-shadow:0 7px 20px #2b4c6c14}.panel h2{margin:.1rem 0;line-height:1.3}
.controls{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:1.2rem;align-items:center}.inputs{display:grid;grid-template-columns:repeat(3,minmax(120px,1fr));gap:.8rem}.inputs label{display:grid;gap:.25rem;font-weight:900}.inputs label span{display:flex;align-items:center;gap:.4rem}.inputs input{width:100%;min-height:56px;padding:.5rem;border:3px solid var(--border);border-radius:11px;background:#fafdff;font-size:1.3rem;font-weight:900;text-align:center}.buttons{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.45rem}.primary{color:#fff;background:var(--primary)}.primary:hover{background:#24496e}.error{grid-column:1/-1;margin:0;padding:.7rem;border-left:6px solid #b84343;color:#b84343;background:#fff0f0;font-weight:800}
.summary{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-top:1rem}.summary div{padding:1rem 1.2rem;border-radius:15px;background:#dfeaf4}.summary small{display:block;color:var(--muted);font-weight:800}.summary strong{display:block;margin-top:.2rem}
.outputs{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:1.2rem}.heading{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:.8rem}.heading label{font-weight:800}.heading select{min-height:43px;padding:.4rem;border:2px solid var(--border);border-radius:9px;background:#fff}
.canvas{display:grid;min-height:430px;place-items:center;overflow:auto;border:2px solid var(--border);border-radius:17px;background:#fbfdff}.canvas svg{display:block;max-width:100%;height:auto}.toggles{display:flex;flex-wrap:wrap;gap:.8rem;margin-bottom:.7rem}.toggles label{display:flex;align-items:center;gap:.4rem;font-weight:800}.toggles input{width:21px;height:21px}.note{margin:.8rem 0 0;padding:.75rem .9rem;border-left:6px solid #f2a900;border-radius:9px;background:#fff8e7;font-weight:700}
.face-panel{display:grid;grid-template-columns:auto 1fr;gap:1.2rem;align-items:center}.face-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:.7rem}.face-card{padding:.9rem;border:3px solid var(--c);border-radius:14px;background:color-mix(in srgb,var(--c) 10%,white);text-align:center}.face-card strong{display:block;font-size:1.15rem}.face-card span{color:var(--muted);font-weight:800}.hide-ruby rt{display:none}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
@media(max-width:1000px){.controls,.outputs,.face-panel{grid-template-columns:1fr}.buttons{justify-content:flex-start}}
@media(max-width:680px){header small{display:none}.top-actions button{padding:.45rem;font-size:.8rem}main{width:min(calc(100% - 1rem),1360px);padding-top:1rem}.hero>span{display:none}.inputs,.summary,.face-cards{grid-template-columns:1fr}.heading{align-items:flex-start}.canvas{min-height:340px}}
@media print{header,.hero,.controls,.summary,.toggles,.note,.face-panel,#rotate{display:none!important}.outputs{display:block}.panel{box-shadow:none;background:#fff}.canvas{border:0}}
