/* print.flont.it — Nordic minimal */
:root { --ink: #1a1a1a; --mute: #8a8a85; --line: #e7e7e3; --pale: #f5f5f4; --pale2: #fafaf9; --accent: #3d6b8f; --bad: #b5402c; --ok: #3c7d55; --r: 999px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: #fff; display: flex; flex-direction: column; overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
code, kbd, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--mute); } .small { font-size: 11.5px; }
h2 { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin: 0 0 10px; }
h2 .small { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* header */
.top { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-bottom: 1px solid var(--line); min-height: 54px; flex-wrap: wrap; }
.brand { font-weight: 650; font-size: 16px; letter-spacing: -.01em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand span { color: var(--mute); font-weight: 450; }
.projbar { display: flex; align-items: center; gap: 2px; flex: 1; flex-wrap: wrap; min-width: 0; }
.projbar select, .projbar input { height: 30px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 0 8px; }
#proj { width: 150px; margin-right: 4px; } #pname { width: 150px; margin-right: 4px; } #examples { width: 118px; }
.projbar input:focus, .projbar select:focus { outline: none; border-color: #bdbdb7; }
.sep { width: 1px; height: 18px; background: var(--line); margin: 0 6px; }
.views .sep { margin: 0 3px; background: transparent; }
.right { display: flex; align-items: center; gap: 16px; margin-left: auto; white-space: nowrap; }
#engine { font-size: 11px; max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
.flont { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.flont:hover { border-color: var(--ink); }

button { cursor: pointer; }
.ghost { height: 30px; padding: 0 9px; border: 1px solid transparent; border-radius: var(--r); background: none; color: #444; }
.ghost:hover { background: var(--pale); }
.pill { height: 32px; padding: 0 16px; border: 0; border-radius: var(--r); background: var(--ink); color: #fff; font-weight: 550; display: inline-flex; align-items: center; gap: 8px; }
.pill:hover { background: #333; } .pill:disabled { background: #cfcfca; cursor: default; }
.pill.alt { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px #cfcfca; } .pill.alt:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.pill.busy { opacity: .6; }
.pill kbd { font-size: 10.5px; opacity: .6; font-family: inherit; }
.link { border: 0; background: none; color: var(--mute); padding: 0; font-size: 11.5px; } .link:hover { color: var(--ink); }
.chk { display: inline-flex; align-items: center; gap: 6px; user-select: none; cursor: pointer; }
input[type=checkbox] { accent-color: var(--ink); margin: 0; }

/* layout */
.cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(360px, 36%) minmax(0, 1fr) 300px; }
.pane { min-height: 0; min-width: 0; position: relative; }
.editor-pane { display: flex; flex-direction: column; border-right: 1px solid var(--line); }
#editor { flex: 1; min-height: 0; overflow: hidden; }
#editor .cm-editor { height: 100%; }
.bar { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-top: 1px solid var(--line); background: #fff; }
#status { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.err { margin: 0; padding: 10px 14px; background: #fbf1ee; color: #6d2416; border-top: 1px solid #f0d6cf; font-size: 12.5px; max-height: 30%; overflow: auto; }
.err b { color: var(--bad); margin-right: 6px; font-weight: 600; } .err.jump { cursor: pointer; }
.err .trace { font: 11px ui-monospace, Menlo, monospace; color: #9b5a4c; margin-top: 4px; }

.view-pane { background: var(--pale); }
#wrap { position: absolute; inset: 0; }
#view { width: 100%; height: 100%; display: block; outline: none; }
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.dim { position: absolute; left: 0; top: 0; background: rgba(255,255,255,.92); border: 1px solid #ecd3cc; color: #9a3d2b; font: 600 11px ui-monospace, Menlo, monospace; padding: 2px 6px; border-radius: 6px; white-space: nowrap; }
.views { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; pointer-events: none; }
.views > * { pointer-events: auto; }
.views button { height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r); background: rgba(255,255,255,.9); color: #444; }
.views button:hover { border-color: #bdbdb7; color: var(--ink); }
.tog { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px; border-radius: var(--r); background: rgba(255,255,255,.9); border: 1px solid var(--line); color: #444; cursor: pointer; user-select: none; }
#busy { position: absolute; top: 52px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 4px 6px 4px 14px; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.spin { width: 12px; height: 12px; border: 2px solid #ddd; border-top-color: var(--ink); border-radius: 50%; animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.hint { position: absolute; bottom: 10px; left: 14px; font-size: 11px; pointer-events: none; }

.side { border-left: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; background: #fff; }
.side section { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.side section.grow { flex: 1; min-height: 140px; display: flex; flex-direction: column; border-bottom: 0; }
.h { display: flex; justify-content: space-between; align-items: baseline; }
.param { margin-bottom: 12px; }
.param > label { display: block; color: #555; margin-bottom: 4px; font-size: 12px; }
.param.checkbox { margin-bottom: 10px; }
.sl { display: flex; gap: 10px; align-items: center; }
input[type=range] { flex: 1; accent-color: var(--ink); min-width: 0; }
.num, .param select, .param input[type=text] { height: 28px; border: 1px solid var(--line); border-radius: 7px; padding: 0 7px; background: #fff; width: 100%; }
.sl .num { width: 64px; flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.param input[type=color] { width: 44px; height: 26px; border: 1px solid var(--line); border-radius: 7px; padding: 2px; background: #fff; }
.num:focus, .param select:focus, .param input[type=text]:focus { outline: none; border-color: #bdbdb7; }
.stats .obj { margin-bottom: 9px; }
.stats .on { display: flex; align-items: center; gap: 6px; }
.stats .on i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.stats .on b { font-weight: 550; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ok { color: var(--ok); font-size: 11px; } .bad { color: var(--bad); font-size: 11px; }
.tot { border-top: 1px solid var(--line); padding-top: 7px; }
.row { display: flex; gap: 8px; }
.fonts { list-style: none; margin: 0 0 10px; padding: 0; }
.fonts li { display: flex; gap: 8px; align-items: baseline; padding: 2px 0; }
.fonts code { font-size: 12px; } .fonts .link { margin-left: auto; }
.file { display: block; color: var(--accent); cursor: pointer; font-size: 12px; margin-top: 4px; } .file:hover { text-decoration: underline; }
.file input { display: none; }
.logs { flex: 1; font: 11.5px/1.5 ui-monospace, Menlo, monospace; background: var(--pale2); border-radius: 8px; padding: 8px 10px; overflow: auto; min-height: 80px; white-space: pre-wrap; word-break: break-word; }
.log.warn { color: #93651a; } .log.error { color: var(--bad); }

#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 16px; border-radius: var(--r); font-size: 12.5px; z-index: 10; }
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; box-shadow: 0 10px 40px rgba(0,0,0,.12); max-width: min(92vw, 560px); }
dialog::backdrop { background: rgba(250,250,249,.7); }
dialog h2 { font-size: 13px; color: var(--ink); letter-spacing: .04em; }
#shareUrl { width: 100%; height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; margin: 6px 0 14px; font: 11.5px ui-monospace, Menlo, monospace; }
dialog.api { max-width: min(94vw, 1040px); }
.api .close { position: absolute; top: 12px; right: 12px; font-size: 18px; }
.apigrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.api h3 { font-size: 12px; margin: 14px 0 6px; font-weight: 600; }
.api pre { background: var(--pale2); border-radius: 8px; padding: 10px 12px; margin: 0; font-size: 11.5px; line-height: 1.55; overflow-x: auto; }
@media (max-width: 1100px) { .cols { grid-template-columns: minmax(320px, 42%) 1fr; } .side { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); max-height: 38vh; } .cols { grid-template-rows: 1fr auto; } }
