:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
  --black: #050505;
  --ink: #171717;
  --muted: #777772;
  --line: #e9e8e4;
  --gold: #ffe39c;
  --gold-deep: #b89547;
  --zone-yellow: var(--gold);
}

* { box-sizing: border-box; }
html, body { width: 100%; min-width: 320px; min-height: 100%; margin: 0; }
body { color: var(--ink); background: #fff; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible { outline: 3px solid var(--gold-deep); outline-offset: 3px; }
svg.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }

.app-shell { display: flex; flex-direction: column; width: 100%; height: 100vh; height: 100dvh; min-height: 520px; }
.app-header { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 80px; flex: none; padding: 0 31px 0 19px; color: #fff; background: var(--black); }
.brand { display: flex; align-items: center; min-width: 0; height: 100%; flex: none; }
.brand-logo { display: block; width: 160px; height: auto; object-fit: contain; mix-blend-mode: screen; }
.brand-separator { display: block; width: 1px; height: 29px; margin: 0 22px 0 17px; background: #454545; }
.brand-section { display: flex; flex-direction: column; justify-content: center; gap: 5px; white-space: nowrap; }
.brand-section > span { font-size: 12px; font-weight: 700; letter-spacing: 0.22em; }
.brand-section small { color: #a9a9a9; font-size: 9px; font-weight: 600; letter-spacing: 0.16em; }
.editor-actions { display: flex; align-items: center; gap: 6px; min-width: 0; height: 100%; flex: 1 1 auto; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: #625942 transparent; overscroll-behavior-inline: contain; }
.editor-actions::-webkit-scrollbar { height: 5px; }
.editor-actions::-webkit-scrollbar-thumb { border-radius: 5px; background: #625942; }
.editor-action { display: grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 0; border: 1px solid #373737; border-radius: 6px; color: var(--gold); background: #151515; transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease; }
.editor-action:hover:not(:disabled) { border-color: var(--gold); color: #101010; background: var(--gold); transform: translateY(-1px); }
.editor-action:active:not(:disabled) { transform: translateY(0); }
.editor-action.is-active, .editor-action[aria-pressed="true"], .editor-action[aria-expanded="true"] { border-color: var(--gold); color: #101010; background: var(--gold); }
.editor-action:disabled { border-color: #242424; color: #65615a; background: #111; }
.editor-action .icon { width: 21px; height: 21px; }
#neutralButton { color: #d2d2d2; }
#neutralButton:hover:not(:disabled) { border-color: #777; color: #fff; background: #242424; }
#neutralButton[aria-pressed="true"] { border-color: #737373; color: #f2f2f2; background: #303030; }
.header-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.open-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; padding: 0 18px; border: 1px solid var(--gold); border-radius: 5px; color: #101010; background: var(--gold); font-size: 13px; font-weight: 700; white-space: nowrap; transition: background .16s ease, transform .16s ease; }
.open-button:hover { background: #ffedbc; transform: translateY(-1px); }
.open-button .icon { width: 18px; height: 18px; }
.cloud-link-form { display: flex; align-items: stretch; gap: 6px; min-width: 0; }
.cloud-link-form input { min-width: 0; height: 42px; padding: 0 11px; border: 1px solid #cfc9ba; border-radius: 5px; color: #24231f; background: #fff; font: inherit; font-size: 12px; }
.cloud-link-form input:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 1px; }
.header-cloud-form button { min-height: 42px; padding: 0 12px; border: 1px solid var(--gold); border-radius: 5px; color: #17140e; background: var(--gold); font-size: 12px; font-weight: 700; white-space: nowrap; }
.header-cloud-form button:hover:not(:disabled) { background: #ffedbc; }
.cloud-link-form button:disabled { opacity: .55; }
.header-cloud-form input { width: clamp(180px, 15vw, 250px); }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr); flex: 1; min-height: 0; }
.workspace.has-layers { grid-template-columns: minmax(0, 1fr) 322px; }
.viewer { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #fff; }
.viewer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 78px; flex: none; padding: 13px 28px; border-bottom: 1px solid var(--line); background: #fff; }
.document-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.document-mark { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 1px solid #eee9db; border-radius: 8px; color: #9a7b3e; background: #fff9eb; }
.document-mark .icon { width: 20px; height: 20px; }
.document-text { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.document-text strong { overflow: hidden; color: #292929; font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.document-text span { color: #92918d; font-size: 11px; white-space: nowrap; }
.view-controls { display: flex; align-items: center; gap: 15px; flex: none; }
.control-group { display: flex; align-items: center; gap: 4px; }
.icon-button { display: grid; place-items: center; width: 31px; height: 31px; padding: 0; border: 0; border-radius: 5px; color: #3f3f3d; background: transparent; transition: color .15s ease, background .15s ease; }
.icon-button:hover:not(:disabled) { color: #111; background: #f3f1eb; }
.icon-button:disabled { color: #c5c5c1; }
.icon-button .icon { width: 17px; height: 17px; }
.zoom-value { min-width: 47px; color: #44443f; font-size: 12px; font-weight: 700; text-align: center; white-space: nowrap; }
.fit-button { margin-left: 2px; }
.icon-button.is-active { color: #7e6230; background: #fff4d7; }

.viewer-viewport { position: relative; display: flex; flex: 1; align-items: flex-start; justify-content: flex-start; min-height: 0; overflow: auto; background: #fff; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; max-width: 510px; min-height: 420px; margin: auto; padding: 35px 24px 49px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 74px; height: 74px; margin-bottom: 29px; border: 1px solid #eee6d3; border-radius: 20px; color: #ae8940; background: #fffaf0; box-shadow: 0 15px 38px rgba(153, 119, 46, .07); transform: rotate(-5deg); }
.empty-icon .icon { width: 37px; height: 37px; transform: rotate(5deg); stroke-width: 1.25; }
.eyebrow { color: #ad9154; font-size: 10px; font-weight: 700; letter-spacing: .19em; }
.empty-state h1 { margin: 12px 0 12px; font-size: clamp(27px, 3vw, 38px); font-weight: 600; letter-spacing: -.05em; line-height: 1.12; }
.empty-state p { max-width: 410px; margin: 0; color: #83827d; font-size: 14px; line-height: 1.65; }
.empty-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 28px; }
.empty-open-button { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 20px; border: 1px solid #111; border-radius: 5px; color: #fff; background: #111; font-size: 13px; font-weight: 700; transition: background .15s ease, transform .15s ease; }
.empty-open-button:hover { background: #343434; transform: translateY(-1px); }
.empty-open-button .icon { width: 17px; height: 17px; }
.empty-image-button { border-color: #c8af72; color: #503b18; background: #fff8e8; }
.empty-image-button:hover:not(:disabled) { background: #ffedbd; }
.empty-cloud-form { width: min(100%, 440px); margin-top: 13px; }
.empty-cloud-form input { flex: 1; }
.drop-hint { margin-top: 14px; color: #aaa9a4; font-size: 11px; }
.page-surface { position: relative; flex: none; margin: auto; padding: 44px; }
.page-surface canvas { display: block; background: #fff; }
.board-frame { position: absolute; z-index: 1; pointer-events: none; }
.board-frame-source { border: 0; outline: 0; box-shadow: none; }
.board-frame-result { border: 3px dashed var(--zone-yellow); }
.page-surface.is-placing canvas { cursor: crosshair; }
.page-surface.is-dragging canvas { cursor: grabbing; }
.page-surface.is-painting canvas, .page-surface.is-erasing canvas { cursor: crosshair; }
.page-surface.has-brush-cursor canvas { cursor: none; }
.brush-cursor { position: absolute; z-index: 6; border: 1px solid #222; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,255,255,.9); transform: translate(-50%, -50%); pointer-events: none; }
.brush-cursor[data-tool="eraser"] { border-style: dashed; }
.page-surface .selection-outline { position: absolute; z-index: 2; border: 1px solid #b89547; box-shadow: 0 0 0 1px rgba(255,255,255,.9), 0 0 0 3px rgba(184,149,71,.45); pointer-events: none; }
.page-surface.is-cropping .selection-outline, .page-surface .selection-outline.is-crop-mode, .page-surface .selection-outline[data-mode="crop"] { border-style: dashed; }
.page-surface .selection-handle { position: absolute; z-index: 3; width: 24px; height: 24px; pointer-events: auto; touch-action: none; }
.page-surface .selection-handle::before { content: ""; position: absolute; inset: 5px; border: 2px solid #8c6b2e; border-radius: 2px; background: #fff9e9; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.page-surface .selection-handle:hover::before, .page-surface .selection-handle:focus-visible::before { background: var(--gold); box-shadow: 0 0 0 3px rgba(255,227,156,.55), 0 1px 4px rgba(0,0,0,.25); }
.page-surface .selection-handle[data-corner="nw"] { top: -12px; left: -12px; cursor: nwse-resize; }
.page-surface .selection-handle[data-corner="ne"] { top: -12px; right: -12px; cursor: nesw-resize; }
.page-surface .selection-handle[data-corner="sw"] { bottom: -12px; left: -12px; cursor: nesw-resize; }
.page-surface .selection-handle[data-corner="se"] { bottom: -12px; right: -12px; cursor: nwse-resize; }
.drop-overlay { position: absolute; z-index: 5; inset: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px; border: 2px dashed #c59b50; border-radius: 9px; color: #6b5225; background: rgba(255, 249, 234, .96); font-size: 17px; font-weight: 700; pointer-events: none; }
.drop-overlay .icon { width: 39px; height: 39px; stroke-width: 1.3; }
.loading-indicator { position: absolute; z-index: 4; top: 16px; left: 50%; display: flex; align-items: center; gap: 10px; padding: 10px 15px; border: 1px solid #eceae5; border-radius: 5px; color: #373734; background: rgba(255,255,255,.94); box-shadow: 0 4px 18px rgba(0,0,0,.08); font-size: 12px; transform: translateX(-50%); }
.spinner { width: 16px; height: 16px; border: 2px solid #eee9dd; border-top-color: #b99246; border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.viewer-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 37px; flex: none; padding: 0 29px; border-top: 1px solid var(--line); color: #a2a19c; background: #fff; font-size: 11px; }
#viewerHint { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.layers-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid #e5e3de; background: #fcfbf8; }
.layers-heading { flex: none; padding: 26px 24px 21px; border-bottom: 1px solid #edeae3; }
.layers-title-row { display: flex; align-items: center; gap: 10px; }
.layers-heading-icon { display: grid; place-items: center; width: 30px; height: 30px; color: #795c2d; }
.layers-heading-icon .icon { width: 20px; height: 20px; }
.layers-heading h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.layer-count { display: grid; place-items: center; min-width: 22px; height: 22px; margin-left: auto; padding: 0 6px; border-radius: 6px; color: #715c37; background: #f7edcf; font-size: 11px; font-weight: 700; }
.layers-heading p { margin: 9px 0 0 40px; color: #a09e97; font-size: 11px; line-height: 1.45; }
.layers-content { flex: 1; min-height: 0; overflow: auto; padding: 13px 13px 20px; }
.layers-empty { display: flex; flex-direction: column; align-items: center; max-width: 230px; margin: min(21vh, 150px) auto 20px; text-align: center; }
.layers-empty-icon { display: grid; place-items: center; width: 51px; height: 51px; margin-bottom: 16px; border: 1px solid #ece8dc; border-radius: 13px; color: #b5a57e; background: #fff; }
.layers-empty-icon .icon { width: 25px; height: 25px; stroke-width: 1.3; }
.layers-empty strong { color: #595751; font-size: 13px; }
.layers-empty p { margin: 8px 0 0; color: #a3a199; font-size: 11px; line-height: 1.6; }
.layers-footnote { display: flex; align-items: flex-start; gap: 8px; flex: none; padding: 15px 23px 18px; border-top: 1px solid #edeae3; color: #a09e98; font-size: 10px; line-height: 1.45; }
.footnote-dot { width: 5px; height: 5px; margin-top: 4px; flex: none; border-radius: 50%; background: #c9ad6d; }
.layer-tree { display: flex; flex-direction: column; gap: 3px; }
.layer-group-label { margin: 14px 10px 5px; color: #a18a59; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.layer-row { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 3px 6px 3px 11px; border: 1px solid transparent; border-radius: 5px; background: transparent; }
.layer-row:hover { border-color: #eee8db; background: #fff; }
.layer-row.is-selected, .layer-row[aria-selected="true"] { border-color: #ddc17d; background: #fff6df; }
.layer-row.is-selected:hover, .layer-row[aria-selected="true"]:hover { border-color: #c6a659; background: #fff3d2; }
.layer-row[draggable="true"] { cursor: grab; }
.layer-row.is-dragging { opacity: .46; cursor: grabbing; }
.layer-row.drop-before { box-shadow: inset 0 3px 0 #b89547; }
.layer-row.drop-after { box-shadow: inset 0 -3px 0 #b89547; }
.layer-row.is-drop-target { border-color: #b89547; background: #fff6df; }
.layer-color { width: 7px; height: 7px; flex: none; border-radius: 2px; background: #d1b97e; }
.layer-name { min-width: 0; flex: 1; overflow: hidden; color: #33322f; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.layer-row.is-hidden .layer-color { background: #d0cfcb; }
.layer-row.is-hidden .layer-name { color: #a5a39d; }
.layer-row.is-group .layer-name { font-weight: 700; }
.layer-row.is-group .layer-color { width: 9px; height: 9px; border: 1px solid #c6aa6b; border-radius: 2px; background: #fff9e8; }
.layer-row.is-inherited-hidden .layer-visibility { opacity: .5; }
.layer-visibility { display: grid; place-items: center; width: 29px; height: 29px; padding: 0; border: 0; border-radius: 4px; color: #595852; background: transparent; }
.layer-visibility:hover { color: #141414; background: #f3efdf; }
.layer-visibility .icon { width: 17px; height: 17px; }
.layer-row.is-hidden .layer-visibility { color: #b3b1aa; }

.tool-popover { position: fixed; z-index: 30; top: 72px; left: max(10px, calc(50vw - 140px)); width: min(280px, calc(100vw - 20px)); padding: 15px; border: 1px solid #ddd4bf; border-radius: 8px; color: #29251e; background: #fffdf9; box-shadow: 0 12px 34px rgba(0,0,0,.2); }
.tool-popover-title { display: block; margin-bottom: 16px; font-size: 13px; }
.brush-hint { margin: 14px 0 12px; color: #756d5e; font-size: 11px; line-height: 1.45; }
.brush-done { width: 100%; }
.tool-setting { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; color: #4a453b; font-size: 12px; font-weight: 600; }
.tool-setting > span { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tool-setting output { color: #8b6d34; font-variant-numeric: tabular-nums; }
.tool-setting input[type="color"] { width: 100%; height: 34px; padding: 3px; border: 1px solid #d8d3c8; border-radius: 5px; background: #fff; cursor: pointer; }
.tool-setting input[type="range"] { width: 100%; accent-color: #b89547; cursor: pointer; }
.tool-menu { width: min(242px, calc(100vw - 20px)); padding: 6px; }
.tool-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 6px 10px; border: 0; border-radius: 5px; color: #37332b; background: transparent; font-size: 12px; text-align: left; }
.tool-menu button:hover:enabled, .tool-menu button:focus-visible, .tool-menu button[aria-pressed="true"] { color: #2f2411; background: #fff0c8; }
.tool-menu button:disabled { opacity: .4; cursor: default; }
.tool-menu .icon { width: 17px; height: 17px; }

.utility-dialog { width: min(420px, calc(100vw - 28px)); max-height: min(90vh, 720px); overflow: auto; padding: 0; border: 1px solid #e8e4dc; border-radius: 12px; color: var(--ink); background: #fff; box-shadow: 0 24px 70px rgba(0,0,0,.22); }
.utility-dialog::backdrop { background: rgba(10,10,10,.46); }
#rotateDialog, #colorDialog { margin-inline: auto clamp(18px, 4vw, 64px); }
#rotateDialog::backdrop, #colorDialog::backdrop { background: rgba(10,10,10,.2); }
.note-editor { position: fixed; z-index: 35; inset: auto; width: min(282px, calc(100vw - 24px)); max-height: min(55vh, 380px); margin: 0; border: 1px solid #cfa94f; border-radius: 7px; background: #fff1bd; box-shadow: 0 9px 30px rgba(64,47,12,.25); }
.note-editor::backdrop { background: transparent; }
.note-editor .utility-dialog-body { padding: 14px; }
.note-editor .utility-dialog-heading h2 { margin: 0; font-size: 14px; }
.note-editor .dialog-field { gap: 6px; margin-top: 11px; color: #5a471a; font-size: 11px; }
.note-editor .dialog-field textarea { min-height: 88px; max-height: 28vh; border-color: #d9bd79; background: #fffdf5; }
.note-editor .color-dialog-actions { margin-top: 13px; padding-top: 11px; border-top-color: #dfc47f; }
.note-editor .dialog-secondary, .note-editor .dialog-primary { min-height: 34px; padding-inline: 12px; }
.utility-dialog-body { padding: 24px; }
.utility-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.utility-dialog-heading h2 { margin: 7px 0 0; font-size: 19px; line-height: 1.25; }
.utility-dialog-hint { margin: 9px 0 22px; color: #85827c; font-size: 12px; line-height: 1.45; }
.dialog-field { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; color: #3d3931; font-size: 12px; font-weight: 600; }
.dialog-field input, .dialog-field textarea, .dialog-field select { width: 100%; min-height: 39px; padding: 9px 10px; border: 1px solid #dcd7ca; border-radius: 5px; color: #29251e; background: #fff; font: inherit; font-size: 13px; }
.dialog-field textarea { min-height: 100px; resize: vertical; line-height: 1.45; }
.dialog-field input:focus-visible, .dialog-field textarea:focus-visible, .dialog-field select:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.help-dialog { width: min(500px, calc(100vw - 28px)); }
.help-dialog .utility-dialog-body { padding: 20px; }
.help-content { color: #5c5952; font-size: 12px; line-height: 1.45; }
.help-content p { margin: 12px 0 9px; }
.help-content ul { margin: 0; padding-left: 19px; }
.help-content li + li { margin-top: 6px; }
.help-content strong { color: #28251f; }

.color-dialog { width: min(420px, calc(100vw - 28px)); max-height: min(90vh, 720px); overflow: auto; padding: 0; border: 1px solid #e8e4dc; border-radius: 12px; color: var(--ink); background: #fff; box-shadow: 0 24px 70px rgba(0,0,0,.22); }
.color-dialog::backdrop { background: rgba(10,10,10,.46); }
.color-dialog-form { padding: 24px; }
.color-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-eyebrow { color: #a0803d; font-size: 10px; font-weight: 700; letter-spacing: .15em; }
.color-dialog h2 { margin: 7px 0 0; font-size: 19px; line-height: 1.25; }
.dialog-close { display: grid; place-items: center; width: 30px; height: 30px; flex: none; padding: 0; border: 0; border-radius: 5px; color: #777; background: transparent; }
.dialog-close:hover { color: #111; background: #f3f1eb; }
.dialog-close .icon { width: 17px; height: 17px; }
.color-dialog-hint { margin: 9px 0 26px; color: #85827c; font-size: 12px; line-height: 1.45; }
.color-controls { display: flex; flex-direction: column; gap: 23px; }
.color-control { display: flex; flex-direction: column; gap: 11px; }
.color-control-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: #35332e; font-size: 13px; font-weight: 600; }
.color-control output { min-width: 42px; color: #896b31; font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.color-control input[type="range"] { width: 100%; height: 7px; margin: 0; border-radius: 99px; appearance: none; cursor: pointer; }
#hueSlider { background: linear-gradient(90deg, #db6868, #dabb69, #8bc879, #72b9b9, #8580d0, #cf81bd, #db6868); }
#saturationSlider { background: linear-gradient(90deg, #a5a5a5, #c7ae83, #db884d); }
#valueSlider { border: 1px solid #d8d8d8; background: linear-gradient(90deg, #141414, #919191, #fff); }
.color-control input[type="range"]::-webkit-slider-thumb { width: 18px; height: 18px; border: 3px solid #fff; border-radius: 50%; appearance: none; background: #181818; box-shadow: 0 0 0 1px #666, 0 2px 5px rgba(0,0,0,.25); }
.color-control input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 3px solid #fff; border-radius: 50%; background: #181818; box-shadow: 0 0 0 1px #666, 0 2px 5px rgba(0,0,0,.25); }
.color-control input[type="range"]:focus-visible { outline: 3px solid var(--gold-deep); outline-offset: 5px; }
.color-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 33px; padding-top: 20px; border-top: 1px solid var(--line); }
.dialog-secondary, .dialog-primary { min-height: 38px; padding: 0 16px; border-radius: 5px; font-size: 12px; font-weight: 700; }
.dialog-secondary { border: 1px solid #e2dfd8; color: #4f4e48; background: #fff; }
.dialog-secondary:hover { background: #f7f6f2; }
.dialog-primary { border: 1px solid #151515; color: #fff; background: #151515; }
.dialog-primary:hover { background: #383838; }
.layer-context-menu { position: fixed; z-index: 30; width: 245px; padding: 5px; border: 1px solid #e4e0d7; border-radius: 7px; background: #fff; box-shadow: 0 12px 30px rgba(0,0,0,.17); }
.layer-context-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 5px 9px; border: 0; border-radius: 4px; color: #34322d; background: transparent; font-size: 12px; text-align: left; }
.layer-context-menu button:hover:enabled, .layer-context-menu button:focus-visible { background: #fff3d6; }
.layer-context-menu button:disabled { opacity: .4; cursor: default; }
.layer-context-menu button.context-delete { color: #8a382f; }
.layer-context-menu .icon { width: 17px; height: 17px; }

.toast { position: fixed; z-index: 20; right: 23px; bottom: 23px; display: flex; align-items: center; gap: 14px; max-width: min(420px, calc(100vw - 32px)); padding: 13px 12px 13px 17px; border: 1px solid #e6c4b9; border-radius: 6px; color: #65372c; background: #fff9f6; box-shadow: 0 12px 34px rgba(0,0,0,.14); font-size: 12px; line-height: 1.5; }
.toast-close { display: grid; place-items: center; width: 25px; height: 25px; flex: none; padding: 0; border: 0; border-radius: 3px; color: inherit; background: transparent; }
.toast-close:hover { background: rgba(101,55,44,.08); }
.toast-close .icon { width: 15px; height: 15px; }

@media (max-width: 1500px) {
  .app-header { height: auto; min-height: 80px; flex-wrap: wrap; row-gap: 8px; padding-block: 9px; }
  .brand, .editor-actions { height: 44px; }
  .header-actions { width: 100%; }
  .header-cloud-form { flex: 1; }
  .header-cloud-form input { width: auto; flex: 1; }
}
@media (max-width: 970px) {
  .workspace.has-layers { grid-template-columns: minmax(0, 1fr) 270px; }
  .viewer-toolbar { padding-inline: 18px; }
  .app-header { gap: 13px; }
}
@media (max-width: 730px) {
  .app-shell { min-height: 620px; }
  .app-header { min-height: 65px; padding: 8px 14px 8px 8px; }
  .brand-logo { width: 133px; }
  .brand-separator { height: 24px; margin: 0 12px 0 6px; }
  .brand-section > span { font-size: 10px; }
  .brand-section small { font-size: 7px; }
  .editor-actions { gap: 4px; }
  .editor-action { width: 37px; height: 39px; }
  .editor-action .icon { width: 19px; height: 19px; }
  .tool-popover { top: 58px; }
  #rotateDialog, #colorDialog { margin-inline: auto; }
  .open-button { width: 39px; min-height: 39px; padding: 0; }
  .open-button span { display: none; }
  .workspace { display: flex; flex-direction: column; }
  .viewer { flex: 1; min-height: 340px; }
  .viewer-toolbar { min-height: 70px; }
  .layers-panel { height: 217px; flex: none; border-top: 1px solid #e5e3de; border-left: 0; }
  .layers-heading { padding: 12px 18px 10px; }
  .layers-heading p { display: none; }
  .layers-content { padding-top: 5px; }
  .layers-empty { margin: 16px auto; }
  .layers-footnote { display: none; }
}
@media (max-width: 530px) {
  .note-editor { width: min(282px, calc(100vw - 20px)); max-height: min(60dvh, 340px); }
  .brand-section { display: none; }
  .brand-separator { display: none; }
  .app-header { gap: 8px; }
  .editor-actions { gap: 3px; }
  .editor-action { width: 34px; height: 36px; }
  .editor-action .icon { width: 17px; height: 17px; }
  .header-actions { gap: 6px; }
  .header-cloud-form button { padding-inline: 8px; font-size: 10px; }
  .cloud-link-form input { padding-inline: 8px; font-size: 11px; }
  .viewer-toolbar { gap: 8px; padding: 9px 11px; }
  .document-mark { width: 32px; height: 32px; }
  .document-text strong { max-width: 125px; font-size: 11px; }
  .document-text span { display: none; }
  .view-controls { gap: 3px; }
  .control-group { gap: 0; }
  .icon-button { width: 26px; height: 27px; }
  .icon-button .icon { width: 14px; height: 14px; }
  .zoom-value { min-width: 33px; }
  .zoom-value { font-size: 10px; }
  .empty-state { min-height: 300px; padding: 15px; }
  .empty-icon { width: 58px; height: 58px; margin-bottom: 17px; }
  .empty-icon .icon { width: 30px; height: 30px; }
  .empty-state h1 { font-size: 26px; }
  .empty-state p { font-size: 12px; }
  .page-surface { padding: 20px; }
  .viewer-footer { padding-inline: 13px; font-size: 10px; }
}
@media (max-width: 390px) {
  .app-header { gap: 5px; padding-inline: 8px; }
  .brand-logo { width: 100px; }
  .editor-action { width: 31px; height: 34px; }
  .open-button { width: 34px; min-height: 34px; }
  .header-cloud-form button { white-space: normal; line-height: 1.15; max-width: 126px; }
  .empty-cloud-form { flex-direction: column; }
}

.share-dialog { width: min(530px, calc(100vw - 28px)); }
.share-version-hint { color: #85827c; font-size: 12px; line-height: 1.5; margin-top: 16px; }
.sharing-notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; background: #fff5db; color: #554421; font-size: 12px; line-height: 1.45; }
.sharing-notice button { flex: none; background: transparent; }
.share-dialog .color-dialog-actions { flex-wrap: wrap; }
