:root { color-scheme: light; font: 14px/1.45 system-ui, sans-serif; background: #e9eef0; color: #20313a; }
* { box-sizing: border-box; }
body { margin: 0; }
header { background: #18343e; color: white; min-height: 75px; padding: 13px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
header h1 { font-size: 21px; margin: 0; letter-spacing: -.02em; }
header p { margin: 2px 0 0; color: #c8d9dc; font-size: 13px; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
button, .upload, select { font: inherit; border: 1px solid #b2c1c5; border-radius: 7px; background: white; color: #20313a; }
button, .upload { padding: 7px 11px; cursor: pointer; }
button:hover:not(:disabled), .upload:hover { background: #e8f4f4; }
button:disabled { opacity: .5; cursor: default; }
button.active, button.primary { background: #176b79; border-color: #176b79; color: white; }
button.danger { color: #aa2b38; border-color: #d9afb4; }
.upload { white-space: nowrap; } .upload input { display: none; }
main { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 11px; height: calc(100vh - 75px); min-height: 550px; padding: 11px; }
.workspace { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: white; border: 1px solid #d2dfe2; border-radius: 10px; }
.toolbar, .view-controls, .layers { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 8px 10px; }
.toolbar { border-bottom: 1px solid #d9e3e6; }
.view-controls { border-bottom: 1px solid #d9e3e6; background: #f6f9f9; }
.layers { border-top: 1px solid #d9e3e6; font-size: 13px; }
.layers label { white-space: nowrap; } .spacer { flex: 1; }
#page-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 38%; }
#zoom-value { min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; }
.hint, .muted { color: #667b82; font-size: 12px; }
.hint { margin-left: auto; }
.canvas-shell { flex: 1; min-height: 0; overflow: auto; background: #38484c; padding: 14px; text-align: center; }
#page-canvas { display: inline-block; max-width: none; height: auto; background: white; box-shadow: 0 2px 14px #1c2b30aa; touch-action: none; cursor: crosshair; }
aside { display: flex; flex-direction: column; gap: 9px; min-height: 0; overflow: auto; }
.panel { background: white; border: 1px solid #d2dfe2; border-radius: 10px; padding: 11px 13px; }
.panel.grow { display: flex; flex-direction: column; flex: 1; min-height: 140px; }
h2 { font-size: 15px; margin: 0 0 9px; }
.detect-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 8px; align-items: end; }
.detect-settings label { display: flex; justify-content: space-between; gap: 5px; align-items: center; font-size: 12px; }
.detect-settings input { width: 55px; padding: 5px; border: 1px solid #b8c8cd; border-radius: 5px; }
.detect-settings select { min-width: 110px; padding: 5px; }
.detect-settings #detect { grid-column: 1 / -1; }
.panel p { margin: 8px 0 0; }
.coords { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 9px; }
.coords label { display: flex; justify-content: space-between; align-items: center; gap: 5px; font-size: 12px; }
.coords input { width: 78px; padding: 5px; border: 1px solid #b8c8cd; border-radius: 5px; }
.preview-heading { margin-top: 10px; margin-bottom: 5px; color: #425d65; font-size: 12px; font-weight: 650; }
.preview-shell { height: 110px; overflow: auto; background: #e9eceb; border: 1px solid #d4dee0; border-radius: 6px; padding: 5px; }
#line-preview { max-width: none; background: white; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0; }
.actions button { font-size: 12px; }
.block { display: block; margin: 9px 0 0; font-weight: 650; font-size: 12px; }
textarea { display: block; width: 100%; margin-top: 5px; padding: 8px; resize: vertical; font: 18px/1.5 serif; border: 1px solid #b8c8cd; border-radius: 6px; }
.line-list { overflow: auto; flex: 1; }
.line-list button { display: block; width: 100%; margin-bottom: 5px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line-list button.selected { background: #e4f3e9; border-color: #56a879; }
.primary-actions button { flex: 1; min-width: 120px; }
#status { color: #38555e; font-size: 12px; }
@media (max-width: 1000px) { main { grid-template-columns: 1fr; height: auto; } .workspace { height: 70vh; } aside { overflow: visible; } }
@media (max-width: 700px) { header { flex-direction: column; align-items: flex-start; } #page-name { max-width: none; } }
