:root{font-family:-apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN","Yu Gothic",sans-serif;color:#263d4b;background:#f5f4f0;font-size:16px}*{box-sizing:border-box}body{margin:0}header{max-width:1320px;margin:auto;padding:30px 48px 24px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #d7dcd9}.brand{display:flex;align-items:center;gap:14px}.mark{font-size:38px;color:#31536c}h1{font-family:"Yu Mincho",serif;font-size:25px;letter-spacing:.12em;margin:0}.badge{font-size:12px;background:#e6eae9;padding:5px 9px;border-radius:4px;color:#50626a}header p{font-size:14px;color:#65747a}main{margin:0 auto}aside{padding-right:30px;border-right:1px solid #d7dcd9}.section-title{display:flex;align-items:center;gap:10px}.section-title>span{font-size:12px;color:#71838c;letter-spacing:.12em}h2{font-size:17px;font-weight:600;letter-spacing:.06em;margin:0}.hint{font-size:14px;line-height:1.8;color:#69787d;margin:12px 0 20px}.editor-wrap{padding:12px;background:#e9ece9;border:1px solid #d7dfdd;margin-bottom:20px}#editor{display:block;width:100%;aspect-ratio:1;filter:drop-shadow(0 2px 3px #21334016)}#editor polygon{cursor:pointer;stroke:#fff9;stroke-width:1.3;transition:filter .15s}#editor polygon:hover{filter:brightness(1.14)}#editor polygon:focus{outline:none;stroke:#182f43;stroke-width:4}.field{display:flex;align-items:center;justify-content:space-between;gap:8px}.field label{font-size:14px}select{max-width:170px;font:inherit;font-size:14px;color:#2b4351;padding:10px 6px;background:#fff;border:1px solid #c9d2d4;border-radius:5px}.second{margin-top:30px}.segmented{display:flex;background:#e5e9e8;padding:4px;border-radius:6px;margin:16px 0}.segmented button{flex:1;border:0;background:transparent;padding:9px;font:inherit;color:#5b6a73;cursor:pointer;border-radius:4px}.segmented button.active{background:#304e64;color:white;box-shadow:0 2px 4px #0001}.color-row{display:flex;align-items:center;gap:12px;padding:8px;margin-bottom:6px;border:1px solid transparent;border-radius:6px}.color-row.selected{background:#fff;border-color:#9aabb5}.color-row button{border:0;background:transparent;text-align:left;flex:1;cursor:pointer;font:inherit;font-size:14px;color:#304959;padding:5px 0}.color-row button span{display:block;font-size:12px;color:#7c898d;margin-top:3px;letter-spacing:.06em}.color-row input{appearance:none;-webkit-appearance:none;padding:0;width:36px;height:36px;border:0;background:none;cursor:pointer;flex-shrink:0}.color-row input::-webkit-color-swatch-wrapper{padding:0}.color-row input::-webkit-color-swatch{border-radius:50%;border:1px solid #0002}.color-row input::-moz-color-swatch{border-radius:50%;border:1px solid #0002}.color-row .selected-label{font-size:12px;color:#6c7f87}.small{font-size:12px;margin-bottom:0}.preview-heading{display:flex;align-items:center;justify-content:space-between;margin:0 0 24px}.eyebrow{font-size:11px;letter-spacing:.18em;color:#7c909b;margin-bottom:8px}.preview-heading h2{font-size:22px;font-family:"Yu Mincho",serif}.preview-heading>span{font-size:14px;color:#607580;border:1px solid #d4dcdd;border-radius:30px;padding:7px 16px}.paper{background:#e5e9e7;min-height:420px;height:clamp(420px,52vw,560px);padding:28px;display:flex;align-items:center;justify-content:center;border:1px solid #d6dedd;background-image:radial-gradient(#a6b3b430 .8px,transparent .8px);background-size:8px 8px}#preview{display:block;max-width:100%;max-height:100%;box-shadow:0 8px 24px #203a4920}.repeat-controls{display:grid;grid-template-columns:1fr 1fr;gap:20px 28px;margin-top:24px}.repeat-controls label{display:flex;justify-content:space-between;align-items:center;font-size:14px}.repeat-controls output{font-variant-numeric:tabular-nums;background:#e4eae9;border-radius:4px;min-width:28px;text-align:center;padding:3px}.repeat-controls input[type=range]{width:100%;accent-color:#365b72;margin:12px 0;cursor:pointer}.repeat-controls .check{grid-column:1/-1;justify-content:flex-start;gap:9px;color:#5b707c}.check input{width:17px;height:17px;accent-color:#365b72}.footnote{font-size:12px;color:#7c8a90;margin-top:18px}footer{max-width:1224px;border-top:1px solid #d7dcd9;margin:0 auto;padding:22px 0;display:flex;justify-content:space-between;font-size:12px;color:#829095}button:focus-visible,select:focus-visible,input:focus-visible{outline:3px solid #a77642;outline-offset:3px}@media(max-width:800px){header{padding:22px 24px}header p{display:none}aside{padding-right:20px}.paper{padding:14px;min-height:300px;height:400px}.field{align-items:flex-start;flex-direction:column}.repeat-controls{grid-template-columns:1fr;gap:8px}footer{margin:0 24px;gap:15px;flex-wrap:wrap}}@media(max-width:600px){h1{font-size:21px}.brand{gap:9px}aside{border-right:0;padding:0}.editor-wrap{max-width:280px;margin:0 auto 20px}.field{flex-direction:row;align-items:center}.paper{height:360px;min-height:0}.preview-section{border-top:1px solid #d7dcd9;padding-top:28px}.repeat-controls{grid-template-columns:1fr 1fr}.hint{margin-bottom:16px}.color-row{padding:7px}.second{margin-top:24px}}
.scope-controls{display:flex;gap:4px;padding:4px;background:#e5e9e8;border-radius:6px;margin-top:15px}.scope-controls button{flex:1;border:0;border-radius:4px;background:transparent;color:#526a78;padding:10px 7px;cursor:pointer;font:inherit;font-size:14px}.scope-controls button[aria-pressed=true]{background:#304e64;color:#fff}.scope-controls button:disabled{opacity:.4;cursor:default}.rotation-row{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:12px}.rotation-row button,.secondary-button{background:#fff;border:1px solid #aebfc7;border-radius:5px;padding:10px 12px;color:#304e64;font:inherit;font-size:14px;cursor:pointer}.rotation-row span{font-size:14px;color:#657e8b}.secondary-button{width:100%;margin-bottom:22px}.secondary-button:hover,.rotation-row button:hover{background:#e1e8e9}#scope-note{font-size:13px;margin-bottom:5px}.preset-panel{padding:18px;background:#edf0ed;border:1px solid #d6dedd;margin-bottom:18px;border-radius:6px}.preset-panel h3{margin:0 0 14px;font-size:15px;font-weight:600}#presets{display:flex;gap:14px}#presets button{display:flex;flex:1;align-items:center;gap:12px;text-align:left;font:inherit;font-size:14px;color:#304e64;background:#fff;border:1px solid #c9d4d8;border-radius:5px;padding:8px;cursor:pointer}#presets button:hover{border-color:#365b72;background:#f4f7f6}#presets svg{width:54px;height:54px;flex-shrink:0}.unit{cursor:pointer}.unit:hover .unit-outline{stroke:#cc782caa}.unit:focus{outline:none}.unit:focus-visible .unit-outline{stroke:#cc782c}.unit-outline{pointer-events:none}.paper{height:540px;min-height:0;overflow:auto}#preview{flex-shrink:0;max-height:480px;min-width:0;box-shadow:0 8px 24px #203a4920}#preview polygon{stroke-width:.4;stroke-linejoin:round;stroke:inherit}.notice{min-height:2.6em;font-size:14px;line-height:1.8;color:#496676;background:#e6eeef;padding:12px 16px;border-radius:5px}#modes{max-width:420px}.preview-heading{margin-bottom:20px}@media(max-width:1000px){#presets button{flex-direction:column;gap:7px;text-align:center}#presets{gap:8px}.paper{height:440px}}@media(max-width:600px){.paper{height:380px;padding:12px}.preset-panel{padding:14px}#presets button{flex-direction:column}.scope-controls{margin-top:14px}.preview-heading h2{font-size:21px}}
.palette-item{margin-bottom:8px}.color-row{padding:7px;gap:8px;margin-bottom:0}.color-row .paint-color{display:flex;align-items:center;gap:10px;min-width:0;padding:4px}.color-row .paint-color>span{margin:0;font-size:14px;color:#304959;letter-spacing:0}.color-row .paint-color .color-dot{display:block;width:34px;height:34px;flex-shrink:0;border:1px solid #0002;border-radius:50%}.paint-color small{display:block;font-size:12px;color:#667e8a;margin-top:4px}.color-row .edit-color{flex:0 0 auto;padding:9px 7px;font-size:13px;border:1px solid #aebfc7;border-radius:5px;background:#fff}.color-row .edit-color[aria-expanded=true]{background:#304e64;color:#fff}.paint-hint{padding:10px;background:#e4ecee;border-radius:5px;font-size:14px;line-height:1.7}.color-options{padding:12px;background:#fff;border:1px solid #bdcdd3;border-radius:5px;margin-top:6px}.color-options p{font-size:14px;margin:0 0 12px}.color-choices{display:grid;grid-template-columns:repeat(5,1fr);gap:9px;margin-bottom:15px}.color-choices button{width:100%;aspect-ratio:1;min-height:28px;border:1px solid #0003;border-radius:5px;cursor:pointer}.color-choices button[aria-pressed=true]{outline:3px solid #a77642;outline-offset:2px}.custom-color,.hex-color{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:14px;margin:12px 0}.custom-color input{width:70px;height:34px;cursor:pointer}.hex-color input{width:105px;min-width:0;padding:7px;border:1px solid #aebfc7;border-radius:4px;font:inherit;font-size:14px}.color-options .color-feedback{font-size:12px;line-height:1.7;color:#526a78;margin-bottom:0}

[hidden]{display:none!important}.split-field{margin-bottom:14px}

#preview,#presets svg{overflow:hidden}

#presets{flex-wrap:wrap}#presets button[aria-pressed=true]{border-color:#365b72;box-shadow:inset 0 0 0 1px #365b72;background:#e6eeef}

/* The workspace alone owns the columns. Mode-specific UI stays inside settings. */
main{display:block;max-width:1600px;padding:28px clamp(12px,2vw,32px)}
#design-workspace{display:grid;grid-template-columns:minmax(0,57fr) minmax(0,43fr);gap:24px;align-items:start;min-width:0}
#settings-column{grid-column:1;grid-row:1;min-width:0}
#settings-column>aside,#settings-column>#four-flow{min-width:0}
#settings-column>aside{border-right:0;padding-right:0}
#design-workspace>.preview-section{grid-column:2;grid-row:1;min-width:0;position:sticky;top:12px;max-height:calc(100dvh - 24px);overflow:auto;padding:2px 4px 2px 2px;border-top:0}
header{max-width:1600px;padding-left:clamp(12px,2vw,32px);padding-right:clamp(12px,2vw,32px)}
#four-legacy:has(.preset-panel[hidden]){display:none}
#four-legacy .preset-panel{margin:0}
#settings-column>aside>.preset-panel{margin-top:28px}
.preview-section .preview-heading{margin-bottom:12px;gap:8px}
.preview-section #mode-hint{margin:10px 0 14px}
.preview-section .paper{height:clamp(240px,calc(100dvh - 380px),560px);padding:12px;overflow:hidden}
.preview-section #preview{max-height:100%}
.preview-section .repeat-controls{grid-template-columns:1fr 1fr;margin-top:16px;gap:8px 16px}
.preview-section .footnote{margin-top:12px}
.preview-section .notice{margin-bottom:0}
#settings-column>aside .editor-wrap{max-width:280px;margin-left:auto;margin-right:auto}
.color-choices{max-width:300px}
@media(max-width:700px){
  main{padding:28px 20px}
  #design-workspace{grid-template-columns:minmax(0,1fr);gap:28px}
  #settings-column,#design-workspace>.preview-section{grid-column:1;grid-row:auto}
  #design-workspace>.preview-section{position:static;max-height:none;overflow:visible;border-top:1px solid #d7dcd9;padding:28px 0 0}
  .preview-section .paper{height:380px}
}
/* Exploratory controls are separate from the five official preset buttons. */
:is(#triangle-two-experiments,#block-size-experiments){margin-top:18px}
:is(#triangle-two-experiments,#block-size-experiments) h4{font-size:13px;font-weight:600;margin:0 0 10px;color:#526a78}
:is(#triangle-two-candidates,#block-size-candidates){display:flex;flex-wrap:wrap;gap:10px}
:is(#triangle-two-candidates,#block-size-candidates) button{flex:1;display:flex;flex-direction:column;align-items:center;gap:8px;min-width:80px;padding:10px;background:#fff;border:1px solid #c9d4d8;border-radius:5px;color:#304e64;font:inherit;font-size:14px;cursor:pointer}
:is(#triangle-two-candidates,#block-size-candidates) button[aria-pressed=true]{border-color:#365b72;box-shadow:inset 0 0 0 1px #365b72;background:#e6eeef}
:is(#triangle-two-candidates,#block-size-candidates) button:hover{border-color:#365b72}
:is(#triangle-two-candidates,#block-size-candidates) svg{width:80px;height:80px;max-width:100%;overflow:hidden}

#block-size-candidates small{font-size:11px;line-height:1.5;color:#526a78}

.exploration-panel{padding:18px;border:1px solid #d6dedd;border-radius:6px;background:#edf0ed}
.exploration-panel h3{font-size:15px;margin:0 0 16px}
.block-size-field{margin-top:16px;flex-direction:row;align-items:center}
#block-size-candidates{margin-top:12px}

#preview .set-boundary-overlay{pointer-events:none;overflow:hidden}

#preview .unit:not(:hover) .unit-outline{stroke:transparent}

#set-structure-info{margin:10px 0 14px;line-height:1.7}

#exploration-block{margin-top:22px;border-top:1px solid #c9d4d8;padding-top:16px}
#exploration-block summary{cursor:pointer;font-size:15px;font-weight:600;color:#304e64}
#exploration-block h4{margin:16px 0 8px}
#exploration-block .secondary-button{margin:12px 0 0}
#exploration-block button:disabled{opacity:.5;cursor:default}
#block-editor,#block-repeat-preview{display:block;width:100%;max-height:480px;margin-top:14px;background:#efdfc2}
.block-set-outline,.block-unit-outline{fill:none;stroke:transparent;stroke-width:5;vector-effect:non-scaling-stroke;pointer-events:none}
#block-editor .block-set{cursor:pointer;outline:none}
.block-set:hover>.block-set-outline,#block-editor .block-set:focus-visible>.block-set-outline{stroke:#557784}
.block-unit:hover>.block-unit-outline{stroke:#cc782caa}
#block-angles{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0;color:#526a78;font-size:13px}
.block-repeat-controls{display:flex;gap:16px;flex-wrap:wrap}
.block-repeat-controls label{font-size:13px}
#exploration-block .pattern-paths{margin:16px 0;padding:10px 12px;background:#e5ecec;border-radius:5px;color:#526a78;font-size:12px;line-height:1.8}
#exploration-block .pattern-paths p{margin:4px 0}
#exploration-block .block-edit-target{font-size:13px;font-weight:600;color:#304e64;margin:10px 0}
/* Exploration uses the full workspace width so both previews stay readable. */
main>#exploration-block{padding:20px;border:1px solid #c9d4d8;border-radius:6px;background:#edf0ed}
#block-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:28px;align-items:start;margin-top:24px}
#block-workspace>section{min-width:0;padding:16px;background:#f8f9f6;border:1px solid #d6dedd;border-radius:6px}
#block-editor{max-width:480px;max-height:none;aspect-ratio:1;margin:16px auto 0}
#block-repeat-preview{height:clamp(280px,35vw,480px);max-height:none;background:#e5e9e7}
#exploration-block #block-capture{max-width:440px}
@media(max-width:800px){#block-workspace{grid-template-columns:minmax(0,1fr);gap:18px}main>#exploration-block{padding:14px}#block-workspace>section{padding:12px}}
