:root {
  color-scheme: light;
  --ink: #1f2b38;
  --muted: #68737d;
  --paper: #fffdf8;
  --paper-deep: #f4efe6;
  --wood: #d6a46e;
  --wood-deep: #a97041;
  --red: #c95550;
  --red-soft: #f7d7d2;
  --blue: #446f98;
  --blue-soft: #d9e7f4;
  --line: #ded5c7;
  --shadow: 0 14px 32px rgba(82, 57, 31, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  background: #e6c18f;
  color: var(--ink);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; overflow-x: hidden; background: linear-gradient(145deg, #eac999 0%, #dcae76 42%, #c8935f 100%); }
button, input, select { font: inherit; }
button, label.button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid #efac48; outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: .48; }
img { max-width: 100%; display: block; }
.wrap { width: min(1240px, calc(100% - 40px)); margin-inline: auto; }
.site-header { width: min(1240px, calc(100% - 40px)); margin: 0 auto; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #342719; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px 5px 12px 5px; background: var(--red); color: #fffaf1; font-weight: 800; transform: rotate(-5deg); box-shadow: 3px 4px 0 rgba(97, 52, 31, .16); }
.brand-lockup strong { display: block; font-family: Georgia, serif; font-size: 1.14rem; letter-spacing: .02em; }
.brand-lockup small { display: block; color: #6d4e32; font-size: .73rem; }
.privacy-chip { padding: 8px 12px; border: 1px solid rgba(79, 51, 26, .2); border-radius: 999px; color: #63472d; font-size: .78rem; background: rgba(255, 249, 238, .42); }
.intro { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); gap: 52px; align-items: center; padding: 42px 0 66px; }
.eyebrow, .section-kicker { margin: 0 0 7px; color: var(--red); font-size: .69rem; font-weight: 800; letter-spacing: .16em; }
.intro h1 { margin: 0; max-width: 680px; color: #342719; font-family: Georgia, "Hiragino Mincho ProN", serif; font-size: clamp(2.3rem, 5.1vw, 4.8rem); font-weight: 500; line-height: 1.13; letter-spacing: -.04em; }
.intro h1 em { color: var(--red); font-style: normal; text-decoration: underline; text-decoration-color: rgba(201, 85, 80, .3); text-decoration-thickness: .12em; text-underline-offset: .08em; }
.intro-lead { max-width: 600px; margin: 24px 0; color: #5f4935; font-size: 1.06rem; }
.intro-notes { display: flex; flex-wrap: wrap; gap: 8px; }
.intro-notes span { padding: 6px 10px; color: #5f4935; background: rgba(255, 251, 242, .62); border: 1px solid rgba(95, 73, 53, .16); border-radius: 4px 8px 4px 8px; font-size: .8rem; }
.intro-visual { margin: 0; transform: rotate(1.2deg); }
.intro-visual img { width: 100%; max-height: 330px; object-fit: cover; border: 10px solid #f8f4e8; box-shadow: 0 18px 30px rgba(74, 48, 24, .25); }
.intro-visual figcaption { margin-top: 11px; color: #725236; text-align: right; font-family: Georgia, serif; font-size: .86rem; font-style: italic; }
.flow-app { margin-bottom: 56px; padding: clamp(18px, 3vw, 34px); background: var(--paper); border: 1px solid rgba(87, 65, 44, .18); border-radius: 22px; box-shadow: var(--shadow); }
.app-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 22px; }
.app-heading h2 { margin: 0; font-family: Georgia, "Hiragino Mincho ProN", serif; font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 600; }
.app-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.button { min-height: 44px; display: inline-flex; justify-content: center; align-items: center; gap: 6px; padding: 9px 14px; border: 1px solid transparent; border-radius: 7px; font-size: .85rem; font-weight: 700; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 12px rgba(35, 45, 56, .1); }
.button-quiet { color: #53606c; background: #f1eee8; border-color: #dfd8cd; }
.button-dark { color: #fff; background: #293b4b; }
.button-outline { color: var(--blue); background: transparent; border-color: #8aa7c1; }
.button-blue { color: #fff; background: var(--blue); }
.button-danger { color: #a74642; background: #fff5f3; border-color: #e8b4af; }
.button-text { color: #8d5e56; background: transparent; border-color: transparent; }
.button-small { min-height: 42px; padding-inline: 12px; }
.button-full { width: 100%; }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.template-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; padding: 11px; background: #f5efe5; border: 1px solid #e5dccc; border-radius: 12px; }
.strip-label { margin-right: 4px; color: #7b6552; font-family: Georgia, serif; font-size: .9rem; font-style: italic; }
.template-button { min-height: 42px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border: 1px solid #d9cdc0; border-radius: 6px; background: #fffdf8; color: #394650; font-size: .82rem; font-weight: 700; }
.template-button span { color: var(--red); font-size: .67rem; }
.template-red { border-bottom: 3px solid #d37b76; }
.template-blue { border-bottom: 3px solid #7e9fbe; }
.template-cream { border-bottom: 3px solid #cbb894; }
.template-plain { border-style: dashed; color: #69737b; }
.notice-row { min-height: 42px; display: flex; align-items: center; gap: 12px; }
.status, .error { margin: 12px 0 0; font-size: .82rem; }
.status { color: #54705f; }
.status::before { content: "●"; margin-right: 7px; color: #75a57f; font-size: .7em; }
.error { color: #a74642; }
.workspace { display: grid; grid-template-columns: minmax(260px, 310px) minmax(0, 1fr); gap: 20px; align-items: start; }
.control-panel { border: 1px solid var(--line); border-radius: 13px; background: #fcfaf5; overflow: hidden; }
.control-section { padding: 19px; border-bottom: 1px solid #e7dfd3; }
.control-section:last-child { border-bottom: 0; }
.project-section { background: #fff8f6; }
.field-label { display: block; margin: 10px 0 6px; color: #56626c; font-size: .79rem; font-weight: 700; }
.label-muted { color: #9099a0; font-weight: 400; }
.text-input { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #d6d1c9; border-radius: 6px; background: #fff; color: var(--ink); font-size: 16px; }
.text-input:focus { border-color: var(--blue); }
.field-help { margin: 7px 0 0; color: #858b8e; font-size: .72rem; line-height: 1.45; }
.inline-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.lane-list { display: grid; gap: 6px; margin-top: 12px; }
.lane-pill { display: flex; align-items: center; gap: 8px; min-height: 33px; padding: 5px 9px; border-radius: 4px 8px 4px 8px; background: #e9f0f5; color: #48627a; font-size: .78rem; }
.lane-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.add-node-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.action-card { min-height: 74px; display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid transparent; border-radius: 8px; text-align: left; }
.action-card strong, .action-card small { display: block; }
.action-card strong { font-size: .77rem; }
.action-card small { margin-top: 2px; color: #68737c; font-size: .68rem; }
.action-icon { font-size: 1.55rem; line-height: 1; }
.action-red { background: var(--red-soft); border-color: #e7b9b4; color: #944541; }
.action-blue { background: var(--blue-soft); border-color: #b7cce0; color: #3e6382; }
.selected-section { background: #f8f5eb; }
.selected-kind { margin: -2px 0 6px; color: #7e6a55; font-family: Georgia, serif; font-size: .93rem; font-style: italic; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.move-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 15px 0; color: #7c858a; font-size: .75rem; }
.move-controls span { margin-right: 4px; }
.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; border: 1px solid #d5d1c9; border-radius: 6px; background: #fff; color: #455360; font-size: 1.1rem; }
.connection-section { background: #f7fafc; }
.connection-fields { gap: 6px; }
.local-section { background: #fdfbf5; }
.local-actions { display: grid; gap: 7px; }
.storage-status { margin: 10px 0 0; color: #557060; font-size: .76rem; }
.canvas-panel { min-width: 0; border: 1px solid var(--line); border-radius: 13px; background: #f8f3e9; overflow: hidden; }
.canvas-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 18px 20px 13px; }
.canvas-heading h3 { margin: 0; font-family: Georgia, serif; font-size: 1.45rem; }
.canvas-count { color: #7a746d; font-size: .77rem; }
.canvas-scroll { max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: 0 14px 14px; }
.flow-board { position: relative; width: 1100px; min-height: 660px; background-color: #fffefa; background-image: linear-gradient(#dce5eb 1px, transparent 1px), linear-gradient(90deg, #dce5eb 1px, transparent 1px); background-size: 22px 22px; box-shadow: 0 2px 8px rgba(70, 59, 47, .12); }
.board-svg, .lane-layer, .node-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.board-svg { z-index: 2; overflow: visible; }
.lane-layer { z-index: 1; pointer-events: none; }
.node-layer { z-index: 3; pointer-events: none; }
.lane-band { position: absolute; left: 0; width: 100%; border-bottom: 1px solid rgba(105, 94, 82, .19); background: rgba(255, 251, 242, .23); }
.lane-band:nth-child(even) { background: rgba(231, 239, 246, .25); }
.lane-label { position: absolute; top: 8px; left: 18px; max-width: 160px; overflow: hidden; color: #69736c; font-family: Georgia, serif; font-size: .9rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.node-card { position: absolute; display: flex; align-items: center; justify-content: center; padding: 10px 14px; border: 2px solid #bf514d; border-radius: 9px 4px 9px 4px; background: #f7c9c3; box-shadow: 4px 5px 0 rgba(92, 70, 53, .12); color: #422f2c; text-align: center; font-size: .83rem; font-weight: 800; line-height: 1.3; overflow: hidden; pointer-events: auto; }
.node-card.process { border-color: #4e769e; border-radius: 4px 9px 4px 9px; background: #d6e5f3; color: #243f59; }
.node-card.decision { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); border: 0; border-radius: 0; background: #f4c4bf; box-shadow: none; padding: 15px 27px; }
.node-card.selected { outline: 4px solid #efac48; outline-offset: 3px; z-index: 4; }
.node-card .node-label { display: block; max-width: 100%; }
.node-card .node-owner { position: absolute; bottom: 6px; left: 0; width: 100%; color: rgba(40, 54, 66, .64); font-size: .64rem; font-weight: 600; }
.edge-hit { cursor: pointer; }
.edge-hit:focus-visible { outline: 3px solid #efac48; }
.canvas-footnote { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 0 20px 17px; color: #777873; font-size: .73rem; }
.legend-swatch { width: 13px; height: 13px; display: inline-block; margin-left: 8px; border-radius: 3px; }
.legend-process { background: #d6e5f3; border: 1px solid #4e769e; }
.legend-decision { background: #f4c4bf; border: 1px solid #bf514d; transform: rotate(45deg); }
.legend-line { width: 22px; height: 2px; display: inline-block; margin-left: 8px; background: #40556e; }
.site-footer { padding: 4px 0 50px; color: #614a35; font-size: .74rem; }
.site-footer p { margin: 5px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 930px) {
  .intro { grid-template-columns: 1fr; gap: 28px; }
  .intro-visual { max-width: 620px; }
  .workspace { grid-template-columns: 1fr; }
  .control-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .control-section { border-right: 1px solid #e7dfd3; }
  .control-section:nth-child(2n) { border-right: 0; }
  .control-section:last-child { border-bottom: 0; }
}

@media (max-width: 650px) {
  .wrap, .site-header { width: min(100% - 24px, 1240px); }
  .site-header { min-height: 68px; }
  .privacy-chip { max-width: 158px; padding: 6px 9px; font-size: .68rem; text-align: center; }
  .intro { padding: 25px 0 38px; }
  .intro h1 { font-size: clamp(2.25rem, 12vw, 3.6rem); }
  .intro-lead { font-size: .96rem; }
  .intro-visual img { border-width: 6px; }
  .flow-app { padding: 14px; border-radius: 15px; }
  .app-heading { align-items: start; flex-direction: column; gap: 14px; }
  .app-actions { justify-content: flex-start; }
  .button { min-height: 44px; }
  .template-strip { align-items: stretch; flex-direction: column; }
  .template-button { justify-content: flex-start; width: 100%; }
  .control-panel { display: block; }
  .control-section { border-right: 0; }
  .canvas-heading { padding-inline: 13px; }
  .canvas-scroll { padding-inline: 0; }
  .canvas-footnote { padding-inline: 6px; }
}

@media print {
  body { background: #fff; }
  .site-header, .intro, .app-heading, .template-strip, .notice-row, .control-panel, .canvas-footnote, .site-footer { display: none !important; }
  .wrap, .flow-app { width: 100%; margin: 0; padding: 0; border: 0; box-shadow: none; }
  .canvas-panel { border: 0; }
  .canvas-scroll { overflow: visible; padding: 0; }
  .flow-board { transform-origin: top left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
