:root { color-scheme: light; font-family: system-ui, -apple-system, sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; background: #f5f7fa; color: #15283b; }
main { max-width: 1280px; margin: 0 auto; padding: 20px; }
h1 { margin: 0 0 6px; font-size: clamp(1.2rem, 2.5vw, 1.8rem); }
header p { margin: 0 0 14px; }
.warning { padding: 12px 16px; background: #fff4e3; border-left: 4px solid #9e5d00; font-weight: 700; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 12px 0; }
label { font-weight: 650; }
select { min-height: 44px; min-width: 175px; font: inherit; padding: 6px; }
.toolbar span { font-size: 0.91rem; color: #4f6070; }
section { background: white; border: 1px solid #cbd5e1; border-radius: 8px; padding: 12px; }
#drawing { display: flex; min-height: 400px; max-height: 69vh; align-items: center; justify-content: center; overflow: auto; }
#drawing svg { width: 100%; max-height: 65vh; min-height: 280px; }
.legend { font-size: 0.92rem; line-height: 1.55; color: #334e68; }
@media(max-width:600px) { main { padding: 12px; } #drawing { min-height: 310px; } }

[hidden] { display: none !important; }
.editor { max-width: 650px; background: white; border: 1px solid #94a3b8; border-radius: 8px;
  padding: 16px; margin: 12px 0; }
.editor h2 { font-size: 1.05rem; margin: 0 0 8px; }
.editor p { margin: 8px 0; }
.editor label { display: block; margin: 10px 0 6px; }
.editor input { display: block; width: min(100%, 260px); padding: 10px; font: inherit;
  min-height: 44px; border: 1px solid #65758c; border-radius: 6px; }
.editor-buttons { display: flex; gap: 10px; margin-top: 12px; }
.editor button { min-height: 44px; padding: 8px 16px; font: inherit; font-weight: 650;
  border: 1px solid #64748b; border-radius: 6px; background: #ecf2f8; cursor: pointer; }
.editor button:disabled { opacity: 0.45; cursor: not-allowed; }
.preview-state { font-weight: 650; padding: 6px 0; }
#edit-status[data-state="invalid"] { color: #9a3412; }
#edit-status[data-state="preview"] { color: #205c45; }
#drawing [data-select-measurement-id] { cursor: pointer; }
#drawing g[role="button"] { cursor: pointer; outline: none; }
#drawing g[data-selected="true"] text { fill: #075985; paint-order: stroke fill;
  stroke: #fff; stroke-width: 0.55px; }
#drawing g[role="button"]:focus-visible text { stroke: #f59e0b; stroke-width: 1px; paint-order: stroke fill; }

.bend-order-tools { margin: 12px 0; padding: 12px; background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; }
.bend-order-tools button { min-height: 44px; font: inherit; border-radius: 6px; padding: 8px 12px;
  border: 1px solid #64748b; background: #e6edf4; cursor: pointer; margin: 0 8px 8px 0; }
.bend-order-tools button[aria-pressed="true"] { background: #cbeafe; border-color: #0e7490; }
.bend-order-tools button:disabled { opacity: 0.45; cursor: not-allowed; }
.bend-order-tools p { margin: 6px 0; }
.bend-order-note { color: #9a3412; font-size: 0.9rem; font-weight: 600; }
#drawing g[data-bend-key][role="button"] { cursor: pointer; outline: none; }
#drawing g[data-bend-key][role="button"]:focus-visible circle { stroke: #db7c04; stroke-width: 3px; }
