:root { color-scheme:light; --ink:#000; --muted:#5f6368; --line:#d8d8d8; --line-strong:#000; --surface:#fff; --wash:#fff; --accent:#2e6fb3; --accent-dark:#22578d; --accent-soft:#eaf1f8; --support:#61bc6d; --attention:#edbd01; --danger:#b52d2d; font-family:Inter,"Noto Sans JP","Hiragino Kaku Gothic ProN","Yu Gothic",system-ui,sans-serif; }
* { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body { margin:0; min-width:300px; color:var(--ink); background:var(--wash); }
button,input,select { font:inherit; }
button,label,select,input { -webkit-tap-highlight-color:transparent; }
button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,.drop-zone:focus-within { outline:3px solid var(--attention); outline-offset:2px; }
.site-header { position:sticky; z-index:10; top:0; height:73px; padding:0 max(20px,4vw); display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid #e6e6e6; background:rgba(255,255,255,.97); }
.brand { display:inline-flex; align-items:center; color:var(--ink); text-decoration:none; font-size:1.25rem; font-weight:800; letter-spacing:-.03em; }
.privacy { color:var(--muted); font-size:.78rem; }
.privacy span { color:var(--support); font-size:.55rem; vertical-align:.08rem; }
.shell { width:min(1163px,calc(100% - 8vw)); margin:0 auto; padding:64px 0 82px; }
.upload-section,.process-section,.result-section { padding:0 0 72px; }
.process-section,.result-section { padding-top:70px; border-top:1px solid var(--line); }
.section-heading { margin-bottom:28px; display:flex; align-items:flex-start; gap:30px; }
.section-heading .step { flex:0 0 auto; min-width:44px; padding-top:10px; color:var(--accent); font-size:.7rem; font-weight:750; letter-spacing:.04em; }
.section-heading h1,.section-heading h2 { margin:0; font-size:clamp(2.25rem,5vw,3.6rem); line-height:1.05; font-weight:700; letter-spacing:-.045em; }
.section-heading p { margin:5px 0 0; color:var(--muted); font-size:.78rem; }
.drop-zone { min-height:250px; padding:30px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; border:1px solid var(--line-strong); background:var(--surface); cursor:pointer; }
.drop-zone:hover,.drop-zone.is-over { border-color:var(--accent); background:#f7faff; box-shadow:inset 0 5px 0 var(--accent); }
.drop-zone input { position:absolute; inline-size:1px; block-size:1px; opacity:0; }
.drop-zone strong { margin-top:5px; font-size:1rem; }
.drop-zone>span:last-child { color:var(--muted); font-size:.8rem; }
.drop-symbol { position:relative; width:42px; height:42px; border:1px solid var(--line-strong); border-radius:0; }
.drop-symbol::before,.drop-symbol::after { content:""; position:absolute; inset:50% auto auto 50%; width:14px; height:1.5px; background:var(--accent); transform:translate(-50%,-50%); }
.drop-symbol::after { transform:translate(-50%,-50%) rotate(90deg); }
.file-area { margin-top:12px; border:1px solid var(--line); background:var(--surface); }
.file-bar { min-height:42px; padding:8px 12px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--line); color:var(--muted); font-size:.78rem; }
.file-list { max-height:272px; margin:0; padding:0; overflow:auto; list-style:none; }
.file-item { min-height:66px; padding:9px 12px; display:grid; grid-template-columns:46px minmax(0,1fr) auto; align-items:center; gap:12px; border-bottom:1px solid #e8ecea; }
.file-item:last-child { border-bottom:0; }
.thumb { width:46px; height:46px; display:block; object-fit:contain; background-color:#eef1ef; background-image:linear-gradient(45deg,#e1e5e3 25%,transparent 25%),linear-gradient(-45deg,#e1e5e3 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e1e5e3 75%),linear-gradient(-45deg,transparent 75%,#e1e5e3 75%); background-position:0 0,0 6px,6px -6px,-6px 0; background-size:12px 12px; }
.file-copy { min-width:0; }
.file-name { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.88rem; font-weight:650; }
.file-meta { display:block; margin-top:4px; color:var(--muted); font-size:.72rem; }
.icon-button,.text-button { border:0; color:var(--muted); background:none; cursor:pointer; }
.icon-button { width:36px; height:36px; font-size:1.2rem; }
.text-button { padding:5px; font-size:.76rem; text-decoration:underline; text-underline-offset:3px; }
.message { min-height:20px; margin:10px 0 0; color:var(--danger); font-size:.8rem; }
.process-layout { display:grid; grid-template-columns:240px minmax(0,1fr); align-items:stretch; border:1px solid var(--line-strong); background:var(--surface); }
.mode-tabs { display:flex; flex-direction:column; border-right:1px solid var(--line-strong); background:#fff; }
.mode-tabs button { position:relative; min-height:76px; padding:13px 14px; display:grid; grid-template-columns:28px minmax(0,1fr); align-items:center; gap:10px; border:0; border-bottom:1px solid var(--line); color:var(--muted); background:transparent; text-align:left; cursor:pointer; }
.mode-tabs button:last-child { border-bottom:0; }
.mode-tabs button:hover { color:var(--accent); background:#f7faff; }
.mode-tabs button.active { color:var(--accent); background:#f7faff; box-shadow:inset 5px 0 0 var(--accent); }
.mode-index { width:24px; height:24px; display:grid; place-items:center; border:1px solid var(--line-strong); border-radius:0; font-size:.68rem; font-weight:800; }
.mode-tabs button.active .mode-index { border-color:var(--accent); color:#fff; background:var(--accent); }
.mode-copy { min-width:0; display:grid; gap:3px; }
.mode-copy strong { font-size:.9rem; font-weight:760; }
.mode-copy small { color:var(--muted); font-size:.67rem; font-weight:500; white-space:nowrap; }
.settings { min-width:0; padding:32px 36px 28px; background:var(--surface); }
.settings-panel { min-height:260px; }
.settings-panel:not(.active) { display:none; }
.tool-heading { margin:0 0 28px; padding:0 0 22px; display:flex; align-items:flex-start; gap:18px; border-bottom:1px solid var(--line); }
.tool-heading>span { width:auto; height:auto; padding-top:7px; display:block; color:var(--accent); background:transparent; font-size:.7rem; font-weight:750; }
.tool-heading h3 { margin:0; font-size:clamp(1.6rem,3vw,2.15rem); line-height:1.05; letter-spacing:-.04em; }
.tool-heading p { margin:3px 0 0; color:var(--muted); font-size:.72rem; }
.field-grid { display:grid; grid-template-columns:minmax(180px,280px) minmax(240px,1fr); gap:20px; align-items:end; }
.resize-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.field { display:grid; gap:8px; min-width:0; }
.field>span,.field-label { color:var(--muted); font-size:.74rem; font-weight:650; }
.field select,.field input[type="number"] { width:100%; height:46px; border:1px solid var(--line-strong); border-radius:0; color:var(--ink); background:white; }
.field select { padding:0 36px 0 11px; }
.field input[type="number"] { padding:0 38px 0 11px; }
.quality-field input { width:100%; accent-color:var(--accent); }
.quality-field output { color:var(--ink); font-variant-numeric:tabular-nums; }
.panel-quality { max-width:360px; margin-top:18px; }
.unit-input { position:relative; }
.unit-input span { position:absolute; top:50%; right:10px; color:var(--muted); font-size:.75rem; transform:translateY(-50%); }
.check-line { margin-top:18px; display:flex; align-items:center; gap:8px; font-size:.83rem; cursor:pointer; }
.check-line input { width:17px; height:17px; accent-color:var(--accent); }
.note { margin:14px 0 0; color:var(--muted); font-size:.76rem; line-height:1.6; }
.inline-settings { display:grid; grid-template-columns:1fr 1fr 1fr; gap:30px; align-items:end; }
.inline-settings>div { display:grid; gap:8px; }
.fixed-size { height:46px; display:flex; align-items:center; font-variant-numeric:tabular-nums; }
.segmented { height:46px; display:grid; grid-template-columns:1fr 1fr; border:1px solid var(--line-strong); }
.segmented label { cursor:pointer; }
.segmented input { position:absolute; opacity:0; }
.segmented span { height:100%; display:grid; place-items:center; color:var(--muted); font-size:.82rem; }
.segmented label:first-child span { border-right:1px solid var(--line-strong); }
.segmented input:checked+span { color:#fff; background:var(--accent); font-weight:700; }
.size-checks { margin-top:8px; display:grid; grid-template-columns:repeat(6,minmax(54px,1fr)); border:1px solid var(--line-strong); }
.size-checks label { min-height:46px; cursor:pointer; }
.size-checks input { position:absolute; opacity:0; }
.size-checks span { height:100%; display:grid; place-items:center; border-right:1px solid var(--line); color:var(--muted); font-size:.82rem; }
.size-checks label:last-child span { border-right:0; }
.size-checks input:checked+span { color:#fff; background:var(--accent); font-weight:750; }
.manual-controls { display:grid; grid-template-columns:minmax(150px,.8fr) minmax(220px,1.2fr) auto; gap:20px; align-items:end; }
.manual-controls>div:first-child { display:grid; gap:8px; }
.manual-actions { display:flex; gap:8px; }
.manual-actions .secondary-button { min-height:46px; white-space:nowrap; }
.manual-editor-stage { min-height:280px; margin-top:18px; display:grid; place-items:center; overflow:auto; border:1px solid var(--line-strong); background-color:#fff; background-image:linear-gradient(45deg,#e5e5e5 25%,transparent 25%),linear-gradient(-45deg,#e5e5e5 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e5e5e5 75%),linear-gradient(-45deg,transparent 75%,#e5e5e5 75%); background-position:0 0,0 12px,12px -12px,-12px 0; background-size:24px 24px; }
.manual-editor-stage[hidden] { display:none; }
.manual-editor-stage canvas { display:block; max-width:100%; height:auto; cursor:crosshair; touch-action:none; user-select:none; }
.action-row { margin-top:26px; padding-top:20px; display:flex; align-items:center; gap:14px; border-top:1px solid var(--line); }
.primary-button,.secondary-button,.download-button { min-height:48px; border:1px solid var(--line-strong); border-radius:0; cursor:pointer; }
.primary-button { min-width:220px; padding:10px 24px; color:white; border-color:var(--accent); background:var(--accent); font-weight:750; }
.primary-button:hover:not(:disabled) { background:var(--accent-dark); }
.primary-button:disabled { border-color:#aeb8b4; background:#aeb8b4; cursor:not-allowed; }
.secondary-button { padding:9px 18px; color:var(--ink); background:white; font-size:.82rem; font-weight:700; }
.secondary-button:hover,.download-button:hover { color:#fff; border-color:var(--accent); background:var(--accent); }
.run-status { color:var(--muted); font-size:.78rem; }
.result-heading { align-items:center; }
.result-heading>div { flex:1; }
.result-table-wrap,.format-table-wrap { overflow-x:auto; border:1px solid var(--line); background:white; }
table { width:100%; border-collapse:collapse; }
.result-table th,.result-table td,.format-table th,.format-table td { padding:12px; border-bottom:1px solid #e7ebe9; text-align:left; font-size:.78rem; white-space:nowrap; }
.result-table th,.format-table th { color:var(--ink); background:#fff; font-size:.68rem; font-weight:700; }
.result-table tr:last-child td,.format-table tr:last-child td { border-bottom:0; }
.result-table td:first-child { max-width:330px; overflow:hidden; text-overflow:ellipsis; font-weight:650; }
.result-table td:last-child { text-align:right; }
.download-button { min-height:34px; padding:6px 11px; display:inline-flex; align-items:center; color:var(--ink); background:white; font-size:.73rem; font-weight:700; text-decoration:none; }
.error-row td { color:var(--danger); }
.format-details { margin-top:8px; border-top:1px solid var(--line); }
.format-details summary { padding:18px 0; color:var(--muted); font-size:.8rem; cursor:pointer; }
.format-details[open] summary { color:var(--ink); }
.format-table td:nth-child(2),.format-table td:nth-child(3) { font-weight:650; }
footer { min-height:79px; padding:0 max(20px,4vw); display:flex; align-items:center; justify-content:space-between; border-top:1px solid var(--line); color:var(--muted); background:white; font-size:.72rem; }
footer a { color:var(--muted); text-underline-offset:3px; }
@media (max-width:720px) {
  .shell { width:min(100% - 28px,1163px); padding-top:38px; }
  .privacy { max-width:160px; text-align:right; font-size:.68rem; }
  .drop-zone { min-height:190px; }
  .process-layout { display:block; }
  .mode-tabs { display:grid; grid-template-columns:repeat(2,1fr); border-right:0; border-bottom:1px solid var(--line); }
  .mode-tabs button { min-height:72px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); }
  .mode-tabs button:nth-child(even) { border-right:0; }
  .mode-tabs button:last-child { grid-column:1/-1; border-right:0; border-bottom:0; }
  .mode-tabs button.active { box-shadow:inset 0 5px 0 var(--accent); }
  .settings { padding:20px 18px 18px; }
  .settings-panel { min-height:0; }
  .field-grid,.resize-grid,.inline-settings { grid-template-columns:1fr; gap:16px; }
  .size-checks { grid-template-columns:repeat(3,1fr); }
  .manual-controls { grid-template-columns:1fr; gap:16px; }
  .manual-actions { display:grid; grid-template-columns:1fr 1fr; }
  .manual-editor-stage { min-height:220px; }
  .size-checks label:nth-child(3) span { border-right:0; }
  .size-checks label:nth-child(-n+3) span { border-bottom:1px solid var(--line); }
  .action-row { align-items:stretch; flex-direction:column; }
  .primary-button { width:100%; }
  .result-heading { flex-wrap:wrap; }
  .result-heading .secondary-button { margin-left:35px; }
}
@media (max-width:420px) {
  .site-header { padding:0 14px; }
  .privacy { max-width:128px; }
  .mode-tabs button { min-height:68px; padding:11px 10px; grid-template-columns:24px minmax(0,1fr); gap:8px; }
  .mode-index { width:22px; height:22px; }
  .mode-copy strong { font-size:.82rem; }
  .mode-copy small { font-size:.61rem; }
  .file-item { grid-template-columns:40px minmax(0,1fr) auto; gap:9px; }
  .thumb { width:40px; height:40px; }
}
@media (prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } }
