:root{--ink:#252c30;--muted:#77818c;--line:#e7e9ec;--surface:#fff;--panel:#fbfbfc;--accent:#297d70;--accent-soft:#e9f3f0;--radius:14px;--shadow:0 12px 40px rgba(29,41,55,.06)}
*{box-sizing:border-box}html{font-family:'Noto Sans JP',-apple-system,BlinkMacSystemFont,'Hiragino Kaku Gothic ProN',Meiryo,sans-serif;color:var(--ink);background:#fff;-webkit-text-size-adjust:100%}body{margin:0}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{opacity:.4;cursor:not-allowed}input,textarea,select{max-width:100%;outline:none}input:focus-visible,textarea:focus-visible,select:focus-visible,button:focus-visible,a:focus-visible{outline:3px solid #b1cfc9;outline-offset:2px}button{touch-action:manipulation}p{line-height:1.75}h1,h2,h3,p{margin-top:0}.app-root{min-height:100dvh;display:flex;flex-direction:column}.topbar{height:74px;display:flex;align-items:center;justify-content:space-between;padding:0 28px;border-bottom:1px solid var(--line);background:#fff;flex-shrink:0;position:relative;z-index:4}.brand{display:flex;align-items:center;gap:11px}.brand-mark{width:42px;height:42px;border:1px solid #dbebe5;border-radius:12px;display:grid;place-items:center;color:var(--accent);font-size:30px;background:#f3f8f6}.brand-words{display:flex;flex-direction:column;gap:2px}.brand-words strong{font-weight:800;letter-spacing:.01em;font-size:16px}.brand-words>span{font-size:10.5px;color:var(--muted);letter-spacing:.02em}.topbar-actions{display:flex;align-items:center;gap:8px}.icon-button,.square-button,.mini-button{background:#fff;border:1px solid var(--line);color:var(--ink);border-radius:9px}.icon-button{height:37px;width:37px;font-size:21px;line-height:1}.button{display:inline-flex;justify-content:center;align-items:center;gap:8px;border-radius:10px;min-height:42px;border:1px solid transparent;font-size:13px;font-weight:700;text-decoration:none;padding:10px 17px;white-space:nowrap;transition:background .15s,transform .15s}.button:active{transform:scale(.98)}.button-primary{background:var(--accent);color:#fff}.button-primary:hover{background:#21695e}.button-secondary{color:#fff;background:#333c40}.button-outline{background:#fff;color:var(--ink);border-color:#dce1e3}.button-outline:hover{background:#f6f8f8}.full{width:100%}.workspace{min-height:0;flex:1;display:flex;overflow:hidden;height:calc(100dvh - 74px)}.control-panel{width:377px;flex:0 0 377px;display:flex;flex-direction:column;overflow:hidden;border-right:1px solid var(--line);background:var(--surface)}.tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;flex-shrink:0;border-bottom:1px solid var(--line);padding:0 13px}.tab{display:flex;gap:6px;justify-content:center;align-items:center;padding:17px 4px 15px;background:none;border:0;border-bottom:2px solid transparent;font-size:12px;color:#90969d;font-weight:700}.tab.is-active{color:var(--accent);border-bottom-color:var(--accent)}.tab-icon{font-size:15px}.control-scroll{flex:1;overflow:auto;overscroll-behavior:contain;padding:0 25px 26px}.tab-panel{padding:25px 0 4px}.tab-panel[hidden]{display:none}.eyebrow{font-size:10px;color:var(--accent);font-weight:800;letter-spacing:.16em}.section-intro{margin-bottom:23px}.section-intro h1,.section-intro h2{font-size:20px;line-height:1.4;margin:8px 0 7px;font-weight:800}.section-intro p{font-size:11.5px;color:var(--muted);margin:0}.field-group{margin-bottom:22px}.field-group>label,.label-line>label{display:block;font-size:12px;font-weight:700;margin-bottom:9px}.field-group>label em{font-size:10px;font-style:normal;font-weight:400;color:#a1a7ad}.field-group input:not([type=range]):not([type=color]),.field-group textarea,.field-group select,.month-navigation input{display:block;width:100%;border:1px solid #dde2e4;background:white;border-radius:9px;font-size:13px;padding:11px 12px;min-height:42px;color:var(--ink)}.field-group textarea{resize:vertical;min-height:73px}.month-navigation{display:flex;gap:7px;align-items:center}.month-navigation input{flex:1;min-width:0;appearance:auto;font-weight:700}.square-button{height:42px;width:42px;flex-shrink:0;font-size:26px;display:grid;place-items:center}.text-button{background:none;border:0;color:var(--muted);font-size:11px;padding:7px 0}.text-button:hover{text-decoration:underline;color:var(--accent)}.month-navigation+.text-button{display:block;margin-top:5px}.check-row{display:flex;align-items:flex-start;gap:11px;padding:14px 12px;border:1px solid var(--line);border-radius:10px;cursor:pointer;margin-bottom:14px}.check-row input{margin:3px 0 0;accent-color:var(--accent);width:16px;height:16px;flex:0 0 16px}.check-row strong{display:block;font-size:12px;margin-bottom:3px}.check-row small{display:block;color:var(--muted);font-size:10.5px;line-height:1.6}.check-row.compact{margin:0;padding:0;border:0;font-size:12px}.notice{font-size:10px;color:#75818b;line-height:1.7;padding:0 1px;margin-bottom:21px}.notice.warning{color:#ac723c}.help-box{border-radius:11px;background:#f2f7f5;padding:17px 17px 14px}.help-box strong{font-size:12px}.help-box p{font-size:11px;color:#657572;margin:6px 0 9px}.help-box.small{margin-top:18px;background:#f6f8f8}.help-box.small p{margin-bottom:0}.link-button{border:0;background:none;color:var(--accent);padding:0;font-size:12px;font-weight:700}.link-button span{padding-left:5px}.control-footer{flex-shrink:0;display:flex;align-items:center;gap:6px;justify-content:space-between;border-top:1px solid var(--line);padding:11px 17px 10px}.privacy-indicator{font-size:9px;color:#8b9696;display:flex;align-items:center;gap:5px}.privacy-indicator i{display:inline-block;border-radius:50%;height:6px;width:6px;background:#4cae8a}.control-footer .text-button{font-size:9px;white-space:nowrap}.date-picker-strip{display:flex;align-items:center;gap:9px;border:1px solid #d8eae4;background:#f4faf7;border-radius:10px;padding:11px 12px;margin-bottom:23px}.date-picker-strip>span:first-child{font-size:10px;color:#62766f}.date-picker-strip strong{font-size:13px;color:var(--accent);white-space:nowrap}.date-strip-hint{margin-left:auto;font-size:9px;color:#859e94}.label-line{display:flex;justify-content:space-between;align-items:center;margin-bottom:9px}.label-line>label{margin:0}.label-line h3{font-size:13px;margin:0}.tiny-muted{font-size:10px;color:#9ba3ab}.stamp-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.stamp-choice{background:#fff;border:1px solid var(--line);border-radius:10px;min-width:0;height:76px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px}.stamp-choice:hover{background:#f8faf9;border-color:#b8d2c7}.stamp-sample{display:flex;align-items:center;justify-content:center;height:31px;min-width:46px;padding:0 8px;font-weight:800;font-size:13px;white-space:nowrap;letter-spacing:-.03em}.stamp-sample.pill{border-radius:8px;font-size:11px}.stamp-sample.symbol{font-size:27px;padding:0}.stamp-choice>span:last-child{font-size:9px;color:#7b848a}.custom-group{margin-top:4px}.custom-input-row{display:flex;gap:7px}.custom-input-row input{min-width:0;flex:1}.custom-input-row button{flex-shrink:0;padding:0 12px}.weekday-select{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px}.weekday-toggle{height:36px;border-radius:8px;border:1px solid var(--line);background:#fff;color:#535e63;font-size:11px;font-weight:700;padding:0}.weekday-toggle:first-child{color:#cc5457}.weekday-toggle:last-child{color:#4b83cc}.weekday-toggle.active{background:var(--accent);border-color:var(--accent);color:#fff}.field-help{color:var(--muted);font-size:10px;margin:7px 0 10px}.selected-editor .section-rule{height:1px;background:var(--line);margin:18px 0 22px}.text-danger{border:0;background:transparent;color:#c55660;font-size:11px;font-weight:700;padding:5px}.two-column-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}.two-column-fields .field-group input[type=color]{border:1px solid var(--line);border-radius:8px;width:100%;height:36px;background:#fff;padding:4px;cursor:pointer}.field-group input[type=range]{width:100%;accent-color:var(--accent)}.selected-editor .field-group{margin-bottom:16px}.theme-colors{display:flex;flex-wrap:wrap;gap:9px}.theme-swatch{width:34px;height:34px;border-radius:100%;border:3px solid white;box-shadow:0 0 0 1px #dfe4e3;position:relative}.theme-swatch.active{box-shadow:0 0 0 2px var(--ink)}.theme-swatch.active:after{content:'✓';color:#fff;position:absolute;inset:0;display:grid;place-items:center;font-size:13px;font-weight:800}.preview-panel{min-width:0;flex:1;display:flex;flex-direction:column;overflow:auto;background:#f7f8f9;padding:25px 35px 24px}.preview-heading{max-width:1040px;width:100%;margin:0 auto 21px;display:flex;justify-content:space-between;align-items:center;gap:10px}.preview-heading>div:first-child{display:flex;align-items:center;gap:14px}.preview-label{font-size:10px;color:#9ba4ad;letter-spacing:.14em;font-weight:800}.preview-heading strong{font-size:14px}.preview-actions{display:flex;align-items:center;gap:12px}.preview-actions>span{font-size:10px;color:#919ba3}.mini-button{font-size:10px;padding:7px 10px;color:#65727c}.preview-center{display:flex;align-items:center;justify-content:center;min-height:0;flex:1;width:100%}.canvas-wrap{width:min(100%,1040px);position:relative;background:#fff;box-shadow:0 16px 52px rgba(35,51,58,.09),0 0 1px rgba(35,51,58,.15);line-height:0}.canvas-wrap canvas{display:block;width:100%;height:auto;touch-action:none;cursor:crosshair;user-select:none;-webkit-user-select:none}.canvas-wrap canvas.is-moving{cursor:grabbing}.preview-bottom{max-width:1040px;margin:17px auto 0;display:flex;justify-content:space-between;align-items:center;gap:10px;width:100%}.preview-bottom p{font-size:10.5px;color:#8b969e;margin:0}.output-spec{font-size:10px;color:#959fa5;white-space:nowrap}.output-spec span{padding:0 4px}.toast{position:fixed;left:50%;bottom:24px;transform:translate(-50%,20px);z-index:50;padding:11px 18px;border-radius:10px;background:rgba(34,43,48,.94);color:#fff;font-size:12px;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;box-shadow:var(--shadow);white-space:nowrap;max-width:92vw;text-overflow:ellipsis;overflow:hidden}.toast.is-visible{opacity:1;transform:translate(-50%,0)}
@media(max-width:1070px){.control-panel{width:336px;flex-basis:336px}.control-scroll{padding-left:19px;padding-right:19px}.preview-panel{padding:22px}.preview-heading{margin-bottom:12px}.preview-bottom{margin-top:12px}}
@media(max-width:740px){.topbar{height:61px;padding:0 13px}.brand-mark{width:34px;height:34px;font-size:24px;border-radius:9px}.brand-words strong{font-size:13px}.brand-words>span{font-size:9px}.topbar-actions{gap:5px}.icon-button{width:30px;height:33px;font-size:17px}.button-export{font-size:11px;min-height:34px;padding:7px 11px;border-radius:8px}.workspace{flex-direction:column;height:calc(100dvh - 61px);min-height:0;overflow:hidden}.preview-panel{order:0;flex:0 0 auto;min-height:0;overflow:visible;padding:9px 12px 10px}.preview-heading{margin:0 0 8px}.preview-heading>div:first-child{gap:8px}.preview-label{font-size:9px}.preview-heading strong{font-size:12px}.preview-actions>span{display:none}.mini-button{font-size:9px;padding:5px 8px}.preview-center{flex:0 0 auto}.canvas-wrap{width:min(100%,620px)}.preview-bottom{margin:8px auto 0}.preview-bottom p{font-size:9px;line-height:1.4}.output-spec{display:none}.control-panel{order:1;flex:1 1 auto;min-height:0;width:100%;border-right:0;border-top:1px solid var(--line)}.tabs{padding:0 18px}.tab{padding:11px 0}.control-scroll{padding:0 18px 18px}.tab-panel{padding-top:17px}.section-intro{margin-bottom:17px}.section-intro h1,.section-intro h2{font-size:18px}.control-footer{padding:8px 14px}.stamp-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.stamp-choice{height:65px}.modal-card{padding:17px}.modal-top h2{font-size:17px}.modal-actions{flex-direction:column}.modal-actions .button{flex:auto}.tab-icon{font-size:14px}}
@media(max-width:370px){.brand-words>span{display:none}.brand-mark{width:31px;height:31px}.brand{gap:6px}.tab{font-size:11px}.preview-panel{padding:7px 8px}.preview-bottom p{font-size:8px}.control-footer{gap:3px}.privacy-indicator{font-size:8px}.control-footer .text-button{font-size:8px}}

/* v2: independent editor columns, top-aligned canvas and page-based download. */
.topbar {display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:14px}
.topbar>.brand {grid-column:2;justify-self:center;justify-content:center}
.topbar>.close-link {grid-column:1;grid-row:1;justify-self:start}
.topbar>.topbar-actions {grid-column:3;grid-row:1;justify-self:end;min-width:0}
.close-link {display:inline-flex;align-items:center;gap:5px;text-decoration:none;color:#485458;border:1px solid transparent;border-radius:9px;padding:7px 10px;font-size:12px;font-weight:700;white-space:nowrap}
.close-link>span {font-size:22px;line-height:1;font-weight:400}
.close-link:hover {background:#f4f7f6}
.preview-panel {overscroll-behavior:contain;overflow-y:auto;justify-content:flex-start}
.preview-center {flex:0 0 auto;min-height:auto;align-items:flex-start;justify-content:center}
.preview-actions .history-action {height:30px;width:30px;font-size:17px}
.ad-area {width:min(100%,1040px);min-height:112px;margin:28px auto 2px;padding:14px 0 18px;border-top:1px solid var(--line);flex-shrink:0;text-align:center}
.ad-label {font-size:10px;letter-spacing:.09em;color:#9da5ab;margin-bottom:10px}
.calendar-ad-unit {width:100%;min-height:80px;overflow:hidden}
/* The user-supplied ad slot is ready; the publisher ID is configured in js/ads.js. */
.download-page {min-height:100dvh;background:#fff;display:flex;flex-direction:column}
.download-main {width:min(100% - 40px,1080px);margin:0 auto;padding:34px 0 30px;flex:1;display:flex;flex-direction:column;align-items:center}
.download-heading {text-align:center;margin-bottom:21px}
.download-heading h1 {font-size:24px;line-height:1.4;margin:7px 0 5px}
.download-heading p {font-size:12px;color:var(--muted);margin:0}
.download-result {max-width:900px;width:100%;min-height:150px;display:grid;place-items:center}
.download-loading {font-size:12px;color:var(--muted);padding:40px 8px;text-align:center}
.download-preview {display:block;max-width:100%;width:100%;height:auto;box-shadow:0 6px 30px rgba(35,51,58,.12),0 0 0 1px #dfe4e4}
.download-preview[hidden],.download-loading[hidden],.download-button[hidden]{display:none}
.download-spec {font-size:11px;color:#929ca3;margin:18px 0 14px}
.download-actions {display:flex;justify-content:center;gap:11px;flex-wrap:wrap}
.download-actions .button {min-width:192px}
.download-tip {font-size:11px;color:#7f8a90;margin:15px 0 0;text-align:center}
.download-ad {margin-top:42px;min-height:130px}
@media(max-width:740px) {
  .topbar {gap:5px;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)}
  .topbar>.brand {gap:5px}
  .brand-mark {display:none}
  .brand-words {text-align:center}
  .brand-words strong {font-size:12px}
  .brand-words>span {display:none}
  .close-link {font-size:10px;padding:6px 2px;gap:1px}
  .close-link>span {font-size:19px}
  .button-export {font-size:10px;padding:7px 9px;min-height:34px}
  .workspace {height:calc(100dvh - 61px)}
  .preview-panel {flex:0 0 49%;max-height:49%;min-height:0;overflow-y:auto;overscroll-behavior:contain}
  .preview-center {align-items:flex-start}
  .preview-actions {gap:4px}
  .preview-actions .history-action {width:28px;height:28px}
  .ad-area {margin-top:17px;min-height:104px;padding-top:10px}
  .download-main {width:min(100% - 28px,900px);padding:25px 0 20px}
  .download-heading {margin-bottom:16px}
  .download-heading h1 {font-size:21px}
  .download-heading p {font-size:11px}
  .download-spec {margin:14px 0}
  .download-actions {flex-direction:column;width:100%;max-width:340px}
  .download-actions .button {width:100%;min-width:0}
  .download-tip {font-size:10px}
  .download-ad {margin-top:30px}
}
@media(max-width:370px) {
  .brand-words strong {font-size:11px}
  .close-link {font-size:9px}
  .button-export {font-size:9px;padding:6px 7px}
}
/* Keep both editor scroll regions inside the viewport instead of expanding the page. */
.app-root {height:100dvh;min-height:0;overflow:hidden}
.app-root .workspace {height:auto;flex:1 1 auto;min-height:0}

/* v4: text navigation in the download header (no extra action button). */
.download-header-back {color:#52616a;font-size:12px;font-weight:700;text-decoration:none;white-space:nowrap;display:inline-flex;gap:3px;align-items:center;padding:8px 1px}
.download-header-back:hover {color:var(--accent);text-decoration:underline}
.download-header-back:focus-visible {outline:2px solid var(--accent);outline-offset:3px;border-radius:4px}
@media (max-width:740px) { .download-header-back {font-size:10px;padding:7px 0} }
