:root { color-scheme: light; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", Meiryo, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #fff; color: #1f2933; }
body { min-width: 280px; }
button, input, select { font: inherit; }
.pf-tool { --navy:#173b57; --blue:#17699a; --pale:#eef6fa; --line:#ccd8df; --muted:#586975; --red:#b42318; --amber:#8a4b08; width:100%; max-width:1180px; margin:0 auto; padding:16px; font-size:16px; line-height:1.6; }
.panel { border:1px solid var(--line); border-radius:10px; background:#fff; margin-bottom:16px; overflow:hidden; box-shadow:0 1px 2px rgba(23,59,87,.05); }
.panel-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; padding:16px 18px 10px; }
.section-title { flex-shrink:0; margin:0; color:var(--navy); font-size:1.1rem; font-weight:700; letter-spacing:.02em; white-space:nowrap; }
.section-note { margin:3px 0 0; color:var(--muted); font-size:.9rem; }
.method-switch { margin:0 18px 14px; padding:9px 12px; border:1px solid #d6e3e9; border-radius:7px; background:#f8fbfc; display:flex; flex-wrap:wrap; gap:7px 22px; }
.method-switch legend { padding:0 6px; color:#344a59; font-size:.88rem; font-weight:700; }
.method-switch label { cursor:pointer; }
.method-switch input { accent-color:var(--blue); }
.roughness-method-switch label { min-width:0; overflow-wrap:anywhere; }
.input-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; padding:0 18px 16px; }
.field label { display:block; margin-bottom:5px; font-weight:700; color:#283d4c; }
.symbol,.math-symbol { font-family:"Times New Roman",Times,serif; font-style:italic; }
.symbol { color:var(--blue); }
.control-row { display:grid; grid-template-columns:minmax(0,1fr) auto; }
.control-row input, .control-row select, .unit-static { min-height:44px; border:1px solid #aebec8; background:#fff; }
.control-row input { width:100%; border-radius:6px 0 0 6px; padding:8px 10px; color:#172b38; }
.control-row select { min-width:86px; border-left:0; border-radius:0 6px 6px 0; padding:7px 28px 7px 9px; color:#263d4c; }
.unit-static { display:flex; align-items:center; min-width:86px; padding:7px 10px; border-left:0; border-radius:0 6px 6px 0; color:#263d4c; white-space:nowrap; }
.direct-roughness-only .unit-static { justify-content:center; }
.control-row input:focus, .control-row select:focus { outline:3px solid rgba(23,105,154,.18); border-color:var(--blue); position:relative; z-index:1; }
.field.invalid input { border-color:var(--red); background:#fff8f7; }
.help,.error { margin:5px 0 0; font-size:.78rem; line-height:1.45; }
.help { color:#65757f; }.error { color:var(--red); font-weight:600; min-height:0; }
.notice { margin:0 20px 14px; padding:10px 12px; border-radius:6px; font-size:.9rem; }
.notice-error { border:1px solid #f3b6af; background:#fff1ef; color:#8a1c13; }
.actions { display:flex; gap:9px; padding:0 18px 18px; }
button { min-height:44px; border-radius:6px; padding:8px 22px; font-weight:700; cursor:pointer; }
button.primary { border:1px solid var(--navy); background:var(--navy); color:#fff; }
button.primary:hover { background:#0f3048; } button.secondary { border:1px solid #aebec8; background:#fff; color:#344a59; }
.result-heading { align-items:center; border-bottom:1px solid #dbe4e9; }
.flow-judgment { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:12px 0 0; padding:7px 9px; border:1px solid currentColor; border-radius:6px; font-size:.8rem; line-height:1.35; }
.flow-judgment strong { flex:0 0 auto; font-size:.95rem; }.flow-judgment.laminar { color:#17699a; background:#edf7fc; }.flow-judgment.transition { color:#8a4b08; background:#fff8e8; }.flow-judgment.turbulent { color:#216438; background:#eef8f1; }
.result-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:1px; background:#dbe4e9; border-bottom:1px solid #dbe4e9; }
.result-card { margin:0; padding:16px 18px; background:#fff; }.result-card.emphasis { background:#f2f8fb; }
.result-label { margin:0; color:#4a5f6d; font-size:.88rem; font-weight:700; }.result-label span { color:var(--blue); font-family:"Times New Roman",Times,serif; font-style:italic; }
.result-value { margin:3px 0 0; color:#132f43; font-size:1.62rem; line-height:1.3; font-weight:760; font-variant-numeric:tabular-nums; }
.result-unit { margin:2px 0 0; color:#697a84; font-size:.8rem; }
.darcy-note { margin:14px 20px 0; color:#526570; font-size:.82rem; }
.status-message { margin:16px 20px 18px; padding:11px 13px; border-left:4px solid var(--blue); background:#f5f9fb; font-size:.9rem; }
.status-message.warning { border-color:#c47716; background:#fff9ed; color:#6d420c; }
.chart-heading { align-items:flex-end; }.chart-current { display:grid; grid-template-columns:repeat(3,auto); border:1px solid #d4e0e6; border-radius:7px; overflow:hidden; color:#173b57; font-variant-numeric:tabular-nums; }
.chart-current > span { display:grid; grid-template-columns:auto auto; align-items:baseline; gap:6px; min-width:104px; padding:7px 10px; border-left:1px solid #d4e0e6; }.chart-current > span:first-child{border-left:0}.chart-current small { color:#5a6e7a; font-family:"Times New Roman",Times,serif; font-size:.78rem; font-style:italic; }.chart-current strong { font-family:"Times New Roman",Times,serif; font-size:.95rem; white-space:nowrap; }
.chart-wrap { position:relative; width:85%; max-width:1000px; min-height:0; margin:0 auto; padding:0; overflow-x:auto; overflow-y:hidden; overscroll-behavior-x:contain; }
.chart-wrap:focus-visible { outline:3px solid rgba(23,105,154,.18); outline-offset:2px; }
#moody-chart { display:block; max-width:none; touch-action:pan-y; }
.chart-tooltip { position:absolute; z-index:3; max-width:190px; padding:7px 9px; border:1px solid #78909d; border-radius:5px; background:rgba(255,255,255,.96); box-shadow:0 2px 8px rgba(0,0,0,.12); color:#243b49; font-size:.75rem; pointer-events:none; }
.chart-key { display:flex; flex-wrap:wrap; justify-content:center; gap:8px 20px; padding:5px 20px 16px; color:#4c606d; font-size:.78rem; }
.chart-key span { display:inline-flex; align-items:center; gap:6px; }.chart-key i { display:inline-block; }
.chart-key .line { width:25px; border-top:2px solid #56788d; }.chart-key .smooth { border-top-color:#c46a18;border-top-width:3px; }.chart-key .laminar { border-top-color:#0e7c86;border-top-width:3px; }.chart-key .dot { width:10px;height:10px;border-radius:50%;background:#c33228; }.chart-key .area { width:18px;height:10px;background:rgba(203,137,51,.18);border:1px solid #c68a3d; }
.chart-note { margin:-8px 20px 16px; color:#526570; text-align:center; font-size:.82rem; }
.process-panel > details { border:0; }.process-toggle { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:15px 18px; cursor:pointer; list-style:none; }.process-toggle::-webkit-details-marker{display:none}.process-toggle > span:first-child{display:block}.process-toggle .section-title,.process-toggle .section-note{display:block}.toggle-label{flex:0 0 auto;color:var(--blue);font-size:.88rem;font-weight:700}.toggle-label::after{content:'＋';display:inline-block;margin-left:8px;font-size:1.15rem}.toggle-close{display:none}.process-panel details[open] .toggle-open{display:none}.process-panel details[open] .toggle-close{display:inline}.process-panel details[open] .toggle-label::after{content:'−'}.process-content{border-top:1px solid #dbe4e9;padding-top:14px}.process-detail { padding:0 18px 18px; }
.step { margin:0 0 12px; padding:0 0 12px; border-bottom:1px dotted #c8d4db; }.step:last-child { border-bottom:0; }.step-title { margin:0 0 4px; font-weight:700; color:#29485c; }.step p { margin:2px 0; }.mono { font-family:"Times New Roman",Times,serif; color:#273f4e; font-size:.95rem; font-style:normal; overflow-wrap:anywhere; }
[hidden] { display:none!important; }
@media (max-width:760px){ .pf-tool{padding:10px}.input-grid{grid-template-columns:1fr 1fr}.panel-head{padding:14px 14px 9px}.input-grid{padding:0 14px 14px}.method-switch{margin:0 14px 12px}.actions{padding:0 14px 14px}.darcy-note,.status-message{margin-left:14px;margin-right:14px}.chart-heading{display:block}.chart-current{margin-top:9px;width:100%}.chart-current > span{min-width:0;justify-content:center}.chart-wrap{width:100%;max-width:none}.process-detail{padding:0 14px 14px}summary{padding:12px 14px}}
@media (max-width:500px){ .input-grid,.result-grid{grid-template-columns:1fr}.result-grid{gap:1px}.result-card{padding:13px 14px}.panel-head{flex-direction:column;gap:4px}.result-heading{display:block}.actions{display:grid;grid-template-columns:1fr 1fr}.section-note{font-size:.82rem}.result-value{font-size:1.4rem}.chart-current{grid-template-columns:1fr}.chart-current > span{grid-template-columns:52px 1fr;justify-content:start;border-left:0;border-top:1px solid #d4e0e6;padding:5px 9px}.chart-current > span:first-child{border-top:0}.chart-key{justify-content:flex-start;padding:5px 14px 14px;gap:6px 14px}.chart-note{text-align:left;margin-left:14px;margin-right:14px}.method-switch{display:grid}.process-toggle{padding:13px 14px}.toggle-label{font-size:.82rem}}
@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
