/* 글꼴은 static/vendor/fonts에 직접 둔다(Google Fonts 요청 없음). 라이선스: vendor/licenses/*_OFL.txt */
@font-face {
  font-family: "DM Sans"; font-style: normal; font-weight: 100 1000; font-display: swap;
  src: url("vendor/fonts/dm-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Sans"; font-style: normal; font-weight: 100 1000; font-display: swap;
  src: url("vendor/fonts/dm-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("vendor/fonts/instrument-serif-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("vendor/fonts/instrument-serif-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("vendor/fonts/instrument-serif-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("vendor/fonts/instrument-serif-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  color: #202823;
  background: #f7f2e8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #202823;
  --muted: #858c84;
  --line: #e7e5de;
  --green: #37735c;
  --green-dark: #285b47;
  --part: #e36a5c;
  --common: #2d9a9b;
  --paper: #fffdf7;
  --wine: #5b304a;
  --wine-dark: #412236;
  --display: "Instrument Serif", Georgia, serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
/* While a score is open the editor fills the window: the page scrolls inside the canvas panel, not the window. */
body.editing { height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
body.editing .workspace { flex: 1; min-height: 0; box-sizing: border-box; }
body.editing .editor { height: 100%; min-height: 0; grid-template-rows: minmax(0, 1fr); }
body.editing .sidebar { max-height: 100%; }
body.editing .canvas-panel { min-height: 0; }
button, input, select { font: inherit; }
[hidden] { display: none !important; }

.topbar {
  min-height: 68px; padding: 12px max(22px, calc((100% - 1200px) / 2));
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--paper); border-bottom: 1px solid #ded5c6;
}
/* 로고: "utilbee / 도구 이름". utilbee는 utilbee.app, 도구 이름은 이 사이트 홈으로 간다. (UtilBee 공통) */
.brand {
  display: inline-flex; align-items: center; gap: 8px; color: var(--ink);
  font-size: 17px; font-weight: 700; white-space: nowrap;
}
.brand a { color: inherit; text-decoration: none; text-underline-offset: 4px; }
.brand-home { display: inline-flex; align-items: center; gap: 8px; }
.brand-home img { flex: none; }
.brand a:hover { text-decoration: underline; }
.brand-sep { color: #b3a99d; font-weight: 400; }
.landing-nav { display: flex; align-items: center; gap: 26px; }
.landing-nav a, .guide-link, .privacy-note a, .landing-footer a { color: var(--wine); text-underline-offset: 4px; }
.landing-nav a { font-size: 14px; font-weight: 600; text-decoration: none; }
.landing-nav a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 3px; }
.top-actions { display: flex; align-items: center; gap: 7px; margin-left: auto; margin-right: 18px; }
.edit-actions { display: flex; align-items: center; gap: inherit; flex-shrink: 0; white-space: nowrap; }
.top-button { height: 34px; padding: 0 12px; border: 1px solid #e3e5dd; border-radius: 8px; color: #526057; background: white; cursor: pointer; font-size: 11px; }
.top-button:hover { background: #f6f7f2; }
.top-button-primary { border-color: var(--wine); color: white; background: var(--wine); }
.top-button-primary:hover { background: var(--wine-dark); }
.top-button-export { border-color: #e8d7b7; color: #795826; background: #fbf4e6; font-weight: 600; }
.top-button-export:hover { background: #f7ecd7; }
.top-button:disabled { opacity: .6; cursor: wait; }
#undo-edit:disabled, #redo-edit:disabled { cursor: default; }
.workspace { min-height: calc(100vh - 68px); padding: 22px; }

.landing { max-width: 1200px; margin: 0 auto; color: #292329; }
.hero {
  min-height: 505px; display: grid; grid-template-columns: 1.12fr 1fr;
  align-items: center; gap: clamp(26px, 6vw, 90px); padding: 44px 0 58px;
}
.section-kicker {
  color: var(--wine); font-size: .76rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
}
.hero h1 {
  margin: 14px 0 18px; font: 400 clamp(64px, 6.65vw, 105px) / .94 var(--display);
  letter-spacing: -.018em;
}
.hero em { color: var(--wine); }
.welcome-copy, .practice p:not(.section-kicker) { max-width: 51ch; color: #5d555a; font-size: 1.04rem; line-height: 1.65; }
.guide-link { display: inline-flex; gap: 12px; align-items: center; font-size: .92rem; font-weight: 700; margin-top: 10px; }
.welcome-card {
  padding: clamp(22px, 3.4vw, 42px); border: 1px solid #dcd1c3;
  border-radius: 18px; background: var(--paper); box-shadow: 0 12px 32px #49302412;
}
.welcome-card h2 { margin: 0; font: 400 38px / 1.1 var(--display); }
.card-intro { margin: 8px 0 22px; color: #5d555a; font-size: .92rem; }
.dropzone {
  min-height: 175px; padding: 16px 10px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; border: 1px dashed #ab829d; border-radius: 10px;
  background: #f7eef4; cursor: pointer; transition: background .18s ease;
}
.dropzone:hover, .dropzone.dragging { border-color: var(--wine); background: #f0e1eb; }
.dropzone:focus-within { outline: 2px solid var(--wine); outline-offset: 3px; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-icon {
  width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 13px;
  border: 1px solid #ded0db; border-radius: 50%; color: var(--wine); background: white; font-size: 23px;
}
.drop-title { color: #3b2838; font-size: .95rem; font-weight: 700; }
.drop-subtitle { margin-top: 6px; color: #64545f; font-size: .8rem; }
.selected-file { max-width: 85%; overflow: hidden; margin-top: 10px; color: var(--wine); font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.primary-button {
  width: 100%; min-height: 48px; margin-top: 14px; display: flex; align-items: center; justify-content: center;
  gap: 12px; border: 0; border-radius: 8px; color: white; background: var(--wine); cursor: pointer;
  font-size: .94rem; font-weight: 700;
}
.primary-button:hover { background: var(--wine-dark); }
.primary-button:disabled { opacity: .65; cursor: wait; }
.status { min-height: 17px; margin: 11px 0 0; color: #a1453e; text-align: center; font-size: 12px; }
.status:empty { display: none; }
.privacy-note { margin: 15px 0 0; color: #61565e; text-align: center; font-size: .78rem; }
a.primary-button { text-decoration: none; }
.local-note { margin: 16px 0 0; padding: 11px 13px; border-radius: 8px; color: #33463a; background: #eef4ec; font-size: .82rem; line-height: 1.5; }
.rights-note { margin: 10px 0 0; color: #6d656a; font-size: .76rem; line-height: 1.5; }
.open-score { max-width: 560px; margin: clamp(10px, 5vh, 56px) auto; }
.open-score h1 { margin: 0; font: 400 38px / 1.1 var(--display); }
/* Placeholder for a display ad. Only on /, never on /editor. */
.ad-slot { min-height: 120px; margin: 28px 0; border: 1px dashed #d9cfbf; border-radius: 10px; }
.ad-slot:empty { display: none; }
.footer-links { display: flex; gap: 18px; }
.policy-footer { max-width: 760px; margin: 0 auto; }
.open-score .section-kicker { margin: 0 0 8px; }
.rights-note a { color: var(--wine); }
.policy { max-width: 760px; margin: 0 auto; padding: 18px 0 60px; color: #3a3238; line-height: 1.65; }
.policy h1 { margin: 0; font: 400 clamp(38px, 5vw, 52px) / 1.1 var(--display); }
.policy h2 { margin: 30px 0 6px; font-size: 1.02rem; }
.policy p, .policy li { font-size: .95rem; }
.policy ul { padding-left: 1.2em; }
.policy a { color: var(--wine); }
.policy-meta { color: #6d656a; font-size: .85rem !important; }
.workflow { padding: clamp(24px, 4vw, 52px); border-radius: 14px; background: #382534; color: #fff7ed; }
.workflow h2, .practice h2, .faq h2 { margin: 0 0 18px; font: 400 clamp(34px, 4.2vw, 57px) / 1 var(--display); }
.workflow ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 4vw, 56px); margin: 26px 0 0; padding: 0; list-style: none; counter-reset: steps; }
.workflow li { padding-top: 15px; border-top: 1px solid #8b6f83; counter-increment: steps; }
.workflow li::before { content: counter(steps, decimal-leading-zero); color: #f0afbf; font-size: .78rem; letter-spacing: .08em; }
.workflow h3 { margin: 9px 0 5px; font-size: 1rem; }
.workflow p { margin: 0; color: #eadbe3; font-size: .92rem; line-height: 1.55; }
.practice { display: grid; grid-template-columns: 1.12fr 1fr; align-items: center; gap: clamp(24px, 6vw, 85px); padding: clamp(40px, 7vw, 92px) 0; }
.practice .section-kicker { margin: 0 0 12px; }
.notation-example { margin: 0; padding: clamp(18px, 3vw, 32px); border: 1px solid #dcd1c3; border-radius: 12px; background: var(--paper); }
.notation-label { margin-bottom: 10px; color: #5d555a; font-size: .77rem; font-weight: 700; }
.notation-row { padding: 9px 13px; margin-bottom: 14px; border: 1px solid #d9b8cb; border-radius: 6px; background: #f8eef2; }
.example-staff { display: grid; grid-template-columns: 3.3em minmax(0, 1fr); align-items: end; font-size: .8rem; }
.example-staff > span { line-height: 27px; }
.source-notation .example-staff + .example-staff { margin-top: 9px; }
.part-notation { border-color: #d6c8a8; background: #f9f3e3; }
.rehearsal-letter { display: inline-grid; place-items: center; width: 21px; height: 21px; margin-left: 19%; margin-bottom: 3px; border: 1px solid var(--wine); color: var(--wine); font: 700 .72rem "DM Sans", sans-serif; }
.staff-motif { height: 27px; overflow: hidden; padding-left: 19%; background: repeating-linear-gradient(to bottom, #6b6268 0 1px, transparent 1px 6.5px); color: #382534; font: 25px / 26px Georgia, serif; white-space: nowrap; }
.notation-example figcaption { color: #5d555a; font-size: .78rem; line-height: 1.5; }
.faq { max-width: 780px; margin: 0 auto; padding: 6px 0 62px; }
.faq h2 { text-align: center; margin-bottom: 28px; }
.faq details { padding: 14px 0; border-top: 1px solid #d9cfbf; scroll-margin-top: 24px; }
.faq details:last-child { border-bottom: 1px solid #d9cfbf; }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; color: #382534; cursor: pointer; font-weight: 700; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; width: 26px; height: 26px; display: grid; place-items: center;
  border: 1px solid #d9cfbf; border-radius: 50%; color: var(--wine); font-weight: 400; font-size: 1.1rem; line-height: 1;
  transition: transform .18s ease, background .18s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); background: #f7eef4; }
.faq summary:hover::after { border-color: var(--wine); }
.faq p { margin: 10px 0 0; color: #5d555a; line-height: 1.6; }
.landing-footer { display: flex; justify-content: space-between; gap: 14px; padding: 20px 0; border-top: 1px solid #d9cfbf; color: #5d555a; font-size: .86rem; }


/* Guide (/guide): a long article with editor screenshots. */
.guide { max-width: 860px; margin: 0 auto; padding: 22px 0 40px; color: #3a3238; line-height: 1.7; }
.guide-intro { padding-bottom: 26px; border-bottom: 1px solid #d9cfbf; }
.guide-intro .section-kicker { margin: 0 0 10px; }
.guide h1 { margin: 0 0 16px; font: 400 clamp(40px, 5.4vw, 64px) / 1.02 var(--display); letter-spacing: -.01em; color: #292329; }
.guide-lede { max-width: 62ch; margin: 0; color: #5d555a; font-size: 1.06rem; }
.guide-toc ol { margin: 22px 0 0; padding: 16px 20px 16px 2.4em; border: 1px solid #e4dacb; border-radius: 12px; background: var(--paper); columns: 2; column-gap: 32px; font-size: .92rem; }
.guide-toc li { break-inside: avoid; }
.guide a { color: var(--wine); text-underline-offset: 3px; }
.guide section { padding: 34px 0 6px; scroll-margin-top: 16px; }
.guide h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font: 400 clamp(28px, 3.4vw, 38px) / 1.15 var(--display); color: #292329; }
.step-number { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--wine); color: #fff; font: 700 .95rem / 1 "DM Sans", "Segoe UI", sans-serif; }
.guide p, .guide li, .guide dd { font-size: 1rem; }
.guide ul { padding-left: 1.2em; }
.guide li + li { margin-top: 6px; }
.guide kbd { padding: 1px 6px; border: 1px solid #d6cbbb; border-bottom-width: 2px; border-radius: 5px; background: #fffdf7; font: 600 .82em "DM Sans", "Segoe UI", sans-serif; }
.guide code { padding: 1px 5px; border-radius: 4px; background: #efe7da; font-size: .9em; }
.guide-shot { margin: 22px 0; }
.guide-shot img { display: block; width: 100%; height: auto; border: 1px solid #ddd2c2; border-radius: 10px; box-shadow: 0 10px 28px #49302418; background: #fff; }
.guide-shot-narrow img { max-width: 340px; }
.guide-shot figcaption { margin-top: 9px; color: #6d656a; font-size: .86rem; line-height: 1.5; }
.guide-problems dt { margin-top: 16px; color: #382534; font-weight: 700; }
.guide-problems dd { margin: 4px 0 0; color: #5d555a; }
.guide-next { margin: 40px 0 10px; padding: clamp(22px, 4vw, 36px); border-radius: 14px; background: #382534; color: #fff7ed; }
.guide-next h2 { margin: 0 0 8px; font: 400 clamp(28px, 3.4vw, 38px) / 1.1 var(--display); }
.guide-next p { margin: 0 0 18px; color: #eadbe3; }
.guide-next .primary-button { display: inline-flex; width: auto; padding: 0 22px; }
.guide-footer { max-width: 860px; }
@media (max-width: 700px) {
  .guide { padding-top: 10px; }
  .guide-toc ol { columns: 1; }
  .guide h2 { align-items: flex-start; }
  .step-number { width: 30px; height: 30px; margin-top: 2px; }
}
.workflow-guide { display: inline-flex; gap: 10px; margin-top: 26px; color: #f6c9d5; font-size: .92rem; font-weight: 700; text-underline-offset: 4px; }
.guide h3 { margin: 28px 0 8px; color: #292329; font-size: 1.08rem; }
.guide section ol { padding-left: 1.4em; }
/* 어두운 박스 안: 본문용 .guide h2 / .guide a 색을 덮어쓴다. */
.guide .guide-next h2 { color: #fff7ed; }
.guide .guide-next .primary-button { color: var(--wine); background: #fff7ed; text-decoration: none; }
.guide .guide-next .primary-button:hover { background: #f3e3ea; }

/* ---------- Score Edit editor ---------- */
.editor { width: min(100%, 1800px); margin: 0 auto; display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 14px; }
.sidebar, .canvas-panel { border: 1px solid #e7e5de; border-radius: 13px; background: #fffefa; }
.sidebar { align-self: start; overflow-y: auto; }
.side-section { padding: 13px 14px; border-bottom: 1px solid #efeee8; }
.side-section:last-child { border-bottom: 0; }
.section-heading { margin-bottom: 9px; color: #59665d; font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.mode-help { margin: 6px 0 0; color: #5d555a; font-size: 12.5px; line-height: 1.5; }
.mode-help:empty { display: none; }
.key-help { margin: 10px 0 0; color: #8a8288; font-size: 11px; line-height: 1.55; }
.pages-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0; }
.subtle-count { color: #999e96; font-weight: 400; letter-spacing: 0; text-transform: none; }
.page-list { display: flex; flex-wrap: wrap; gap: 5px; max-height: 112px; margin-top: 9px; overflow-y: auto; }
.page-choice { flex: 0 0 auto; min-width: 32px; height: 31px; padding: 0 7px; border: 1px solid #e3e5dd; border-radius: 7px; color: #6d656a; background: white; cursor: pointer; font-size: 11px; }
.page-choice:hover { background: #f8f2f6; }
.page-choice[aria-current="page"] { border-color: var(--wine); color: var(--wine); background: #f4e7ef; font-weight: 650; }
.page-navigation { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.page-label { min-width: 44px; text-align: center; font-size: 12.5px; font-weight: 650; color: #3b2838; }
.icon-button { width: 32px; height: 32px; border: 1px solid #e3e5dd; border-radius: 8px; color: #3b2838; background: white; cursor: pointer; font-size: 17px; line-height: 1; }
.icon-button:hover { background: #f6f7f2; }
.icon-button:disabled { opacity: .4; cursor: default; }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tool-button { min-height: 34px; padding: 0 9px; display: flex; align-items: center; justify-content: space-between; gap: 6px; border: 1px solid #e3e5dd; border-radius: 8px; color: #3b2838; background: white; cursor: pointer; font-size: 12.5px; font-weight: 600; text-align: left; }
.tool-button:hover { background: #f8f2f6; }
.tool-button[aria-pressed="true"] { border-color: var(--wine); color: white; background: var(--wine); }
.tool-button kbd, .check kbd { padding: 0 4px; border: 1px solid #ddd3dc; border-radius: 4px; color: #8a7a86; background: #fbf8fa; font: 600 10px "DM Sans", sans-serif; }
.tool-button[aria-pressed="true"] kbd { border-color: #8d6a82; color: #f6dfeb; background: transparent; }
.symbol-row { display: flex; flex-wrap: wrap; gap: 5px; }
.symbol-button { width: 40px; padding: 3px 0 2px; display: flex; flex-direction: column; align-items: center; gap: 1px; border: 1px solid #e3e5dd; border-radius: 8px; background: white; cursor: pointer; }
.symbol-button canvas { width: 34px; height: 44px; }
.symbol-button span { color: #8a7a86; font-size: 10px; }
.symbol-button.wide { width: 78px; }
#acc-row .symbol-button, #slur-row .symbol-button, #expression-row .symbol-button { width: 62px; }
#hairpin-row .symbol-button { width: 94px; }
.mark-row:not(:first-child) { margin-top: 7px; }
.mark-row .symbol-button { display: block; width: auto; min-width: 36px; min-height: 30px; padding: 4px 7px; color: #3b2838; font: italic 600 13px Georgia, "Times New Roman", serif; }
#dynamic-marks .symbol-button { font-size: 16px; }
.symbol-button:hover { background: #f8f2f6; }
.symbol-button[aria-pressed="true"] { border-color: var(--wine); background: #f4e7ef; box-shadow: inset 0 0 0 1px var(--wine); }
.check { display: flex; align-items: center; gap: 7px; margin-top: 9px; color: #3a3238; font-size: 13px; cursor: pointer; }
.check input { accent-color: var(--wine); }
.view-check { margin-top: 0; }
.time-row label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.time-inputs { display: inline-flex; align-items: center; gap: 5px; }
.time-inputs select { padding: 3px 4px; border: 1px solid #ddd5cb; border-radius: 6px; background: white; }
.file-name { max-width: 220px; overflow: hidden; margin-right: 6px; color: #6d656a; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.canvas-panel { min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.canvas-toolbar { min-height: 46px; padding: 6px 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; border-bottom: 1px solid #efeee8; }
.hint { flex: 1 1 200px; min-width: 0; color: #5d555a; font-size: 12.5px; }
.zoom { display: flex; align-items: center; gap: 6px; }
.zoom-label { min-width: 44px; text-align: center; font-size: 12px; color: #5d555a; }
.stage { flex: 1; min-height: 0; overflow: auto; padding: 12px; background: #ece8df; }
.canvas-wrap { position: relative; margin: 0 auto; background: white; box-shadow: 0 2px 10px #0000001f; }
.canvas-wrap canvas { position: absolute; left: 0; top: 0; display: block; }
#overlay-canvas { cursor: crosshair; touch-action: none; }
.status.error { color: #a1453e; }
.status:not(.error) { color: #5d555a; }
.top-button:disabled { cursor: default; }

body.editing { height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
body.editing .workspace { flex: 1; min-height: 0; padding: 14px; }
body.editing .editor { height: 100%; min-height: 0; grid-template-rows: minmax(0, 1fr); }
body.editing .sidebar { max-height: 100%; }

/* Ad slot: home and guide only, never in the editor. */
.ad-label { display: block; margin-bottom: 4px; color: #8a8288; font-size: 11px; text-align: center; }

@media (max-width: 1100px) {
  .file-name { display: none; }
}
@media (max-width: 920px) {
  .workspace { padding: 12px; }
  .editor { grid-template-columns: 228px minmax(0, 1fr); gap: 9px; }
}
@media (max-width: 700px) {
  .topbar { min-height: 56px; padding: 10px 12px; flex-wrap: wrap; }
  .brand { gap: 6px; font-size: 15px; }
  .top-actions { gap: 5px; margin: 0; flex-wrap: wrap; }
  .top-button { height: 31px; padding: 0 8px; font-size: 10px; }
  .landing-nav { gap: 12px; }
  .landing-nav a { font-size: .78rem; }
  .workspace { min-height: calc(100vh - 56px); padding: 10px; }
  .landing { padding: 0 8px; }
  .hero, .practice { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding: 20px 0 34px; gap: 0; }
  .hero-copy { display: contents; }
  .hero .section-kicker { margin: 0; }
  .hero h1 { font-size: clamp(51px, 10vw, 76px); margin-bottom: 16px; }
  .hero .welcome-copy { margin: 0 0 24px; }
  .hero .guide-link { display: none; }
  .landing-footer { flex-direction: column; }
  .footer-links { flex-wrap: wrap; }
  .welcome-card { padding: 23px; }
  .workflow ol { grid-template-columns: 1fr; gap: 17px; }
  .faq { padding-bottom: 34px; }
  .guide { padding-top: 10px; }
  .guide-toc ol { columns: 1; }
  .guide h2 { align-items: flex-start; }
  body.editing { height: auto; display: block; overflow: visible; }
  body.editing .editor { height: auto; grid-template-columns: 1fr; grid-template-rows: none; }
  body.editing .sidebar { max-height: none; }
  body.editing .canvas-panel { height: 80vh; height: 80dvh; }
}

/* Home: second feature block */
.practice-flip { padding-top: 0; }
.practice p + p { margin-top: 12px; }
.feature-list { padding: clamp(18px, 3vw, 30px); border: 1px solid #dcd1c3; border-radius: 12px; background: var(--paper); }
.feature-list h3 { margin: 0 0 10px; font-size: 1rem; }
.feature-list ul { margin: 0; padding-left: 1.2em; color: #3a3238; line-height: 1.7; }
.feature-list p { margin: 12px 0 0; color: #5d555a; font-size: .92rem; line-height: 1.55; }

/* Select tool: actions on the selection */
.sel-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
