/* 写真取り込み固有の入力・輪郭編集。色と基本レイアウトは共通UIを使用。 */
h1 { font-size:22px; margin:0 0 10px; }
h2 { font-size:18px; margin:0 0 12px; }
.import-guide { width:100%; margin-top:14px; padding:0; border:1px solid #d7a76e; border-radius:14px; color:#5c4736; background:#fffdf8; overflow:hidden; }
.import-guide[data-guide-mounted="false"] { display:none; }
.guide-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px 14px; border-bottom:1px solid #ead0aa; background:#fff7dc; }
.guide-kicker { font-size:13px; font-weight:700; }
.guide-page { display:grid; gap:16px; padding:24px; }
.guide-page h2,.guide-page p { margin:0; }
.guide-page h2 { font-size:22px; line-height:1.45; text-align:center; }
.guide-page p { line-height:1.75; }
.guide-lead { font-size:16px; font-weight:700; text-align:center; }
.guide-left { text-align:left; }
.guide-note { color:#705846; font-size:13px; }
.guide-progress { padding:6px 10px; border-radius:999px; background:#fff2d4; font-size:13px; font-weight:700; text-align:center; }
.guide-calibration-warning { padding:10px 12px; border:1px solid #c88b47; border-radius:8px; color:#70421b; background:#fff0da; font-size:13px; }
.guide-piece-list { display:grid; gap:10px; max-height:46vh; padding-right:4px; overflow:auto; }
.guide-piece-row { display:grid; grid-template-columns:minmax(0,1fr) 94px auto; gap:8px 10px; align-items:end; padding:12px; border:1px solid #ead0aa; border-radius:10px; background:#fffaf0; }
.guide-piece-row.selected { border:2px solid #957e63; background:#fff2d4; }
.guide-piece-row > strong { grid-column:1 / -1; font-size:14px; }
.guide-piece-row label { display:grid; gap:5px; min-width:0; font-size:13px; font-weight:700; }
.guide-piece-row input[type="text"],.guide-piece-row input[type="number"] { width:100%; min-width:0; padding:8px; border:1px solid #d7a76e; border-radius:7px; background:#fffdf8; font:inherit; }
.guide-piece-row .guide-piece-mirror { display:flex; flex-direction:row; align-items:center; gap:6px; min-height:39px; white-space:nowrap; }
.guide-piece-row .guide-piece-mirror input { width:20px; height:20px; accent-color:#957e63; }
.guide-piece-preview { display:block; width:100%; height:130px; border:1px solid #ead0aa; border-radius:9px; background:#fffaf0; }
.guide-region-mobile,.guide-return-button { display:none; }
.guide-piece-preview path { fill:#fff2d4; stroke:#957e63; stroke-width:2; vector-effect:non-scaling-stroke; }
.guide-field { display:grid; gap:6px; font-weight:700; }
.guide-field input { width:100%; min-width:0; padding:9px; border:1px solid #d7a76e; border-radius:7px; color:inherit; background:#fffdf8; font:inherit; }
.guide-field .guide-name-input { width:85%; justify-self:center; }
.guide-check { display:flex; align-items:center; justify-content:center; gap:9px; font-weight:700; }
.guide-check input { width:20px; height:20px; accent-color:#957e63; }
.guide-choice-row { display:flex; justify-content:center; gap:24px; margin-top:4px; }
.guide-additional-choices { flex-wrap:wrap; }
.guide-miss-choice { gap:3em; }
.guide-stack { display:grid; gap:10px; }
.guide-page button,.guide-button { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:9px 16px; border:1px solid #957e63; border-radius:8px; color:#5c4736; background:#fffdf8; box-shadow:0 2px 0 #5e483733; font:inherit; font-weight:700; text-decoration:none; cursor:pointer; }
.guide-page .auto-pattern-primary,.guide-button.auto-pattern-primary { color:#fff; background:#957e63; }
.guide-page button[aria-pressed="true"] { color:#fff; border-color:#a33c32; background:#a33c32; }
.guide-wide { width:100%; }
.guide-nav { display:flex; align-items:center; justify-content:space-between; gap:10px; padding-top:5px; border-top:1px solid #ead0aa; }
.guide-nav:has(> :only-child) { justify-content:flex-start; }
.guide-spaced { justify-content:center; gap:3em; }
.guide-common-footer { display:grid; gap:12px; padding:16px 24px 20px; border-top:1px solid #ead0aa; background:#fff7dc; }
.guide-common-footer .auto-pattern-resource-links { margin:0; }
.guide-common-footer .auto-pattern-copyright { display:grid; justify-items:center; gap:5px; margin:0; text-align:center; }
.guide-common-footer .auto-pattern-copyright a { overflow-wrap:anywhere; }
.auto-pattern-form-panel > .auto-pattern-line-length-option { display:none!important; }
.auto-pattern-canvas-area .auto-pattern-actions [data-action="photo"],
.auto-pattern-canvas-area .auto-pattern-actions [data-action="pieces"],
.auto-pattern-canvas-area .auto-pattern-actions [data-action="fabric"],
.auto-pattern-canvas-area .auto-pattern-actions .desktop-help-link[data-common-link="usageHelpUrl"] { display:none!important; }
body:not(.workflow-acquired) .legacy-workflow { display:none!important; }
body.workflow-acquired .legacy-workflow { display:revert; }
fieldset { min-width:0; margin:0; padding:13px; border:1px solid #e4be8a; border-radius:9px; }
legend { padding:0 5px; font-weight:700; }
.auto-pattern-form { display:grid; gap:12px; margin-top:18px; }
.auto-pattern-form fieldset,.import-section,.import-section fieldset,.step-content { display:grid; gap:10px; }
.auto-pattern-form label,.import-section > label,.step-content > label,.import-section fieldset > label,.dimension-row label { display:grid; gap:6px; font-weight:700; }
.auto-pattern-form label { margin:0; }
input[type="text"],input[type="number"],select,textarea { width:100%; min-width:0; padding:8px; border:1px solid #d7a76e; border-radius:7px; color:inherit; background:#fffdf8; }
input[type="range"] { width:100%; accent-color:#957e63; }
input[type="file"] { width:100%; font-size:13px; font-weight:400; }
button,.sheet-link { cursor:pointer; }
.auto-pattern-form button,.import-section button,.sheet-link { display:inline-flex; align-items:center; justify-content:center; min-height:38px; padding:7px 10px; border:1px solid #957e63; border-radius:8px; color:#5c4736; background:#fffdf8; box-shadow:0 2px 0 #5e483733; font:inherit; font-size:14px; font-weight:700; text-decoration:none; }
button:disabled,fieldset:disabled { opacity:.65; }
button:disabled { cursor:default; }
.auto-pattern-form .auto-pattern-primary,.import-section .auto-pattern-primary { color:#fff; background:#957e63; }
#selectAdditional[aria-pressed="true"] { color:#fff; border-color:#315f91; background:#315f91; box-shadow:0 0 0 3px #315f9133; }
#deleteCandidate:not(:disabled) { color:#8a2525; border-color:#b96b6b; }
.help { margin:0; color:#705846; font-size:12px; line-height:1.65; }
.file-label { padding:10px; border:1px dashed #d7a76e; border-radius:8px; background:#fffaf0; }
.source-browser { display:grid; gap:6px; font-weight:700; }
.source-thumbs { display:grid; grid-template-columns:repeat(auto-fill,minmax(88px,1fr)); gap:7px; max-height:180px; padding:7px; border:1px solid #e4be8a; border-radius:8px; overflow-y:auto; background:#fffaf0; }
.source-thumbs .empty-note { grid-column:1 / -1; margin:0; padding:5px; }
.source-thumb { display:grid; gap:4px; min-width:0; padding:4px; border:1px solid #d7a76e; border-radius:7px; color:#5c4736; background:#fffdf8; box-shadow:none; font:inherit; font-size:11px; font-weight:700; text-align:left; }
.source-thumb[aria-pressed="true"] { border:2px solid #957e63; background:#fff2d4; }
.source-thumb img { display:block; width:100%; aspect-ratio:4 / 3; border-radius:4px; object-fit:cover; background:#eee4d7; }
.source-thumb span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.button-row,.dimension-row,.group-create { display:flex; align-items:start; gap:7px; }
.button-row > * { flex:1 1 0; }
.dimension-row > label { flex:1 1 0; min-width:0; }
.group-create input { flex:1 1 0; }
.group-create button { flex:0 0 auto; }
.unit-input { display:flex; align-items:center; gap:7px; }
.unit-input input { width:7em; }
.status-box { margin:0; padding:9px; border:1px solid #e4be8a; border-radius:7px; background:#fffaf0; font-size:13px; line-height:1.6; white-space:pre-line; }
.status-box.success { border-color:#81aa8a; color:#176b3a; }
.import-section { margin-top:12px; padding-top:12px; border-top:1px solid #e4be8a; }
.piece-list { display:grid; gap:7px; max-height:320px; margin:0; padding:0; list-style:none; overflow-y:auto; }
.piece-list li { display:flex; align-items:center; gap:7px; padding:8px; border:1px solid #e4be8a; border-radius:8px; }
.piece-list li.selected { border:2px solid #957e63; background:#fff7dc; }
.piece-list li > input { flex:0 0 auto; accent-color:#957e63; }
.piece-list .piece-select { display:block; flex:1; min-height:0; padding:0; text-align:left; border:0; background:none; box-shadow:none; overflow-wrap:anywhere; }
.piece-select small { display:block; margin-top:4px; color:#705846; font-weight:400; font-size:11px; }
.empty-note { color:#705846; font-size:13px; }
.check-label { display:flex !important; align-items:start; gap:8px; font-size:13px; line-height:1.55; }
.check-label input { flex:0 0 auto; width:18px; height:18px; margin:0; accent-color:#957e63; }
.size-readout { margin:0; font-size:13px; line-height:1.6; font-weight:700; }
details { font-size:13px; line-height:1.6; }
details[open] { display:grid; gap:8px; }
summary { cursor:pointer; }
.import-step { margin:0; border:1px solid #e4be8a; border-radius:9px; overflow:hidden; background:#fffdf8; }
.import-step > summary { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 13px; color:#5c4736; font-weight:700; list-style:none; }
.import-step > summary::-webkit-details-marker { display:none; }
.import-step > summary::after { content:"＋"; flex:0 0 auto; font-size:18px; line-height:1; }
.import-step[open] > summary { border-bottom:1px solid #ead0aa; background:#fff7dc; }
.import-step[open] > summary::after { content:"－"; }
.import-step > summary small { color:#705846; font-size:11px; font-weight:400; text-align:right; }
.import-step[open] { display:block; }
.import-step > fieldset { border:0; border-radius:0; }
.import-step > .step-content { padding:13px; }
.import-step[aria-disabled="true"] { opacity:.58; }
.import-step[aria-disabled="true"] > summary { cursor:not-allowed; }
.internal-calibration { display:none !important; }
.auto-pattern-canvas-area { position:sticky; top:0; height:100vh; grid-template-rows:auto auto auto minmax(0,1fr); }
.auto-pattern-drawing-panel { min-height:0; }
.auto-pattern-canvas { min-height:480px; height:100%; }
.auto-pattern-canvas.region-selecting { cursor:crosshair; }
.auto-pattern-canvas.erasing-selection { cursor:not-allowed; }
.tool-status { padding:9px 18px; border-bottom:1px solid #e4be8a; color:#705846; background:#fffdf8; font-size:13px; line-height:1.5; }
.tool-status.active { background:#fff0dc; font-weight:700; }
.drawing-tool-actions { padding:7px 12px; border-bottom:1px solid #e4be8a; background:#fffaf0; }
.photo-outline { fill:#28ab601f; stroke:#168c48; stroke-width:2; vector-effect:non-scaling-stroke; }
.photo-outline.selected { fill:#28ab6033; stroke-width:3; }
.candidate-outline { cursor:pointer; }
.auto-pattern-canvas.erasing-selection .candidate-outline:hover { stroke:#c33b32; stroke-width:7; }
.outline-handle { fill:#fff; stroke:#168c48; stroke-width:2; vector-effect:non-scaling-stroke; cursor:move; }
.marker-outline { fill:#315f910d; stroke:#315f91; stroke-width:1.5; vector-effect:non-scaling-stroke; pointer-events:none; }
.marker-label { fill:#315f91; font-size:14px; paint-order:stroke; stroke:#fff; stroke-width:3px; }
.calibration-dot { fill:#315f91; stroke:#fff; stroke-width:2; vector-effect:non-scaling-stroke; }
.import-piece { cursor:pointer; }
.import-piece .cut-line { fill:#fffdf8; stroke:#202020; stroke-width:1.3; vector-effect:non-scaling-stroke; }
.import-piece.selected .cut-line { fill:#fff5d8; stroke:#957e63; stroke-width:2; }
.grain-line { fill:none; stroke:#315f91; stroke-width:1.6; vector-effect:non-scaling-stroke; }
.grain-arrow { fill:#315f91; }
.photo-line-tag { fill:#315f91; font-weight:700; paint-order:stroke; stroke:#fff; stroke-width:3px; stroke-linejoin:round; pointer-events:none; }
.trace-line { fill:none; stroke:#168c48; stroke-width:2; stroke-dasharray:5 4; vector-effect:non-scaling-stroke; }
.selection-box { fill:#315f9122; stroke:#315f91; stroke-width:2; stroke-dasharray:7 4; vector-effect:non-scaling-stroke; pointer-events:none; }
.import-piece text { fill:#4c3929; }
body.is-busy #toolBar::before { content:"処理中… "; font-weight:700; }
[hidden] { display:none !important; }
:focus-visible { outline:3px solid #315f91; outline-offset:2px; }
.fabric-consent-modal { position:fixed; inset:0; z-index:10000; display:grid; place-items:center; padding:clamp(10px,3vw,28px); }
.fabric-consent-backdrop { position:absolute; inset:0; background:#2b211899; backdrop-filter:blur(2px); }
.fabric-consent-dialog { position:relative; width:min(760px,100%); height:min(88vh,760px); overflow:hidden; border:2px solid #957e63; border-radius:14px; background:#fffdf8; box-shadow:0 18px 60px #2b211955; }
.fabric-consent-dialog iframe { display:block; width:100%; height:100%; border:0; background:#fffdf8; }
@media(max-width:720px) {
  .guide-page { padding:20px 16px; }
  .guide-common-footer { padding:14px 16px 18px; }
  .guide-choice-row { gap:14px; }
  .guide-miss-choice { gap:3em; }
  .guide-choice-row > * { flex:1 1 0; }
  .guide-piece-row { grid-template-columns:minmax(0,1fr) 82px; }
  .guide-piece-row .guide-piece-mirror { grid-column:1 / -1; }
  .auto-pattern-canvas-area { position:static; height:auto; grid-template-rows:auto auto auto auto auto auto; }
  .auto-pattern-drawing-panel { height:65dvh; min-height:360px; }
  .auto-pattern-canvas { min-height:360px; }
  body.fabric-import-app .auto-pattern-canvas { touch-action:none; }
  .guide-region-desktop { display:none; }
  .guide-region-mobile { display:inline; }
  .guide-return-button { display:block; width:100%; min-height:38px; margin-top:5px; border:1px solid #957e63; border-radius:8px; color:#fff; background:#957e63; font:inherit; font-weight:700; }
  body.fabric-import-app .auto-pattern-mobile-links { grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; }
  body.fabric-import-app .auto-pattern-mobile-links a { min-height:34px; padding:5px 3px; font-size:clamp(8px,2.8vw,11px); }
  .auto-pattern-form-panel { padding-bottom:24px; }
  .auto-pattern-actions [data-action="fabric"] { flex-basis:100%; }
  .tool-status { padding:8px 12px; }
}
