/* calc-canvas.css — Calc canvas studio (v51): toolbar, A4 paper, regions, typeset maths, sheets, markup editor, Python. */
.cc-app { --cc-ink: #1d1d1f; --cc-mute: #6b6b6b; --cc-line: #e3dfd6; --cc-acc: #2563eb; --cc-ok: #1f7a43; --cc-ng: #b42318; --cc-paper: #ffffff; --cc-desk: #ecebe7; }
.cc-app .cc-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px 12px; border: 1px solid var(--line, #e3e3dd); border-radius: 12px; background: var(--card, #fff); position: sticky; top: 64px; z-index: 20; }
.cc-app .cc-grp { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.cc-app .cc-gl { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #6b6b6b); margin-right: 2px; }
.cc-app .cc-ck { font-size: .82rem; display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; }
.cc-app select { padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line, #ddd); background: transparent; color: inherit; font: inherit; font-size: .85rem; }
.cc-app .btn.xs { padding: 2px 8px; font-size: .78rem; }
.cc-app .cc-help { margin: 10px 0 0; border: 1px solid var(--line, #e3e3dd); border-radius: 12px; padding: 10px 14px; background: var(--card, #fff); }
.cc-app .cc-hcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.cc-app .cc-hcols h4 { margin: 6px 0 4px; font-size: .85rem; } .cc-app .cc-hcols pre { margin: 0; font-size: .78rem; white-space: pre-wrap; line-height: 1.45; background: transparent; }
.cc-app .cc-titlebar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0 8px; }
.cc-app .cc-title { flex: 1 1 260px; font-size: 1.1rem; font-weight: 700; border: 0; border-bottom: 1px dashed var(--line, #ddd); background: transparent; color: inherit; padding: 4px 2px; }
.cc-app .cc-stat { font-size: .82rem; color: var(--muted, #6b6b6b); } .cc-app .cc-stat .ok { color: var(--cc-ok); } .cc-app .cc-stat .ng { color: var(--cc-ng); }
.cc-app .cc-wrap { overflow-x: auto; background: var(--cc-desk); border-radius: 12px; padding: 18px; }
.cc-app .cc-paper { position: relative; width: 794px; margin: 0 auto; background: var(--cc-paper); box-shadow: 0 1px 6px rgba(0,0,0,.18); outline: none; color: var(--cc-ink); font-family: "Cambria Math", Cambria, "Times New Roman", serif; font-size: 15px; background-image: radial-gradient(#e9e6df 1px, transparent 1px); background-size: 16px 16px; cursor: text; }
.cc-app .cc-pg { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed #c9c4b9; pointer-events: none; }
.cc-app .cc-pg span { position: absolute; right: 6px; top: -18px; font: 11px Arial, sans-serif; color: #a39d91; }
.cc-app .cc-cur { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; pointer-events: none; }
.cc-app .cc-cur::before, .cc-app .cc-cur::after { content: ""; position: absolute; background: #d32f2f; } .cc-app .cc-cur::before { left: 6px; top: 0; width: 2px; height: 14px; } .cc-app .cc-cur::after { top: 6px; left: 0; height: 2px; width: 14px; }
.cc-app .cc-reg { position: absolute; padding: 4px 8px 4px 12px; border: 1px solid transparent; border-radius: 6px; min-width: 40px; cursor: default; }
.cc-app .cc-reg:hover { border-color: #d9d4c9; } .cc-app .cc-reg.sel { border-color: var(--cc-acc); box-shadow: 0 0 0 2px rgba(37,99,235,.15); } .cc-app .cc-reg.editing { border-color: var(--cc-acc); background: #fff; z-index: 5; }
.cc-app .cc-grip { position: absolute; left: -2px; top: 0; bottom: 0; width: 9px; cursor: grab; border-radius: 4px 0 0 4px; } .cc-app .cc-reg:hover .cc-grip, .cc-app .cc-reg.sel .cc-grip { background: repeating-linear-gradient(0deg, #c9c4b9 0 2px, transparent 2px 4px); }
.cc-app .cc-tools { position: absolute; right: 2px; top: -24px; display: none; gap: 2px; z-index: 6; } .cc-app .cc-reg:hover .cc-tools, .cc-app .cc-reg.sel .cc-tools { display: flex; }
.cc-app .cc-tools button { font: 12px Arial, sans-serif; border: 1px solid #d9d4c9; background: #fff; color: #333; border-radius: 5px; padding: 2px 6px; cursor: pointer; }
.cc-app .cc-rs { position: absolute; right: -4px; bottom: -4px; width: 12px; height: 12px; cursor: nwse-resize; border-right: 2px solid #b8b2a6; border-bottom: 2px solid #b8b2a6; }
.cc-app .cc-math .cc-body, .cc-app .cc-text .cc-body { cursor: text; }
.cc-app .cc-line { padding: 3px 0; line-height: 1.9; white-space: nowrap; } .cc-app .cc-line.cm { font: italic 13px Arial, sans-serif; color: var(--cc-mute); line-height: 1.6; } .cc-app .cc-line.err .cc-raw { color: var(--cc-ng); font-family: Consolas, monospace; font-size: 13px; }
.cc-app .cc-msg { font: 12px Arial, sans-serif; color: var(--cc-ng); background: #fdf0ef; border-radius: 4px; padding: 2px 6px; margin: 2px 0; white-space: normal; max-width: 640px; }
.cc-app .cc-empty { color: #b0aa9f; font: italic 13px Arial, sans-serif; }
.cc-app .cc-v, .cc-app .cc-fn { font-style: italic; } .cc-app .cc-u, .cc-app .cc-f, .cc-app .cc-c { font-style: normal; } .cc-app .cc-u { color: #444; } .cc-app .cc-f { color: #333; }
.cc-app .cc-n { font-style: normal; } .cc-app .cc-s { font-family: Arial, sans-serif; font-size: 13px; color: #555; } .cc-app .cc-cell { font-family: Consolas, monospace; font-size: 13px; color: #0e7490; }
.cc-app sub { font-size: .7em; vertical-align: -.35em; font-style: normal; } .cc-app sup { font-size: .7em; vertical-align: .6em; }
.cc-app .cc-pr { font-style: normal; margin-left: 1px; }
.cc-app .cc-op { margin: 0 .22em; } .cc-app .cc-def { margin: 0 .35em; font-weight: 600; } .cc-app .cc-eq { margin: 0 .4em; } .cc-app .cc-sp { display: inline-block; width: .25em; }
.cc-app .cc-r { font-style: normal; font-weight: 700; color: #0b3d91; background: #eef3fc; padding: 0 4px; border-radius: 3px; } .cc-app .cc-sv { font-style: normal; color: #5a4a00; }
.cc-app .cc-fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 .15em; line-height: 1.25; } .cc-app .cc-nu { padding: 0 .2em; border-bottom: 1px solid currentColor; } .cc-app .cc-de { padding: 0 .2em; }
.cc-app .cc-rt { display: inline-flex; align-items: stretch; } .cc-app .cc-rs { } .cc-app .cc-ro { border-top: 1px solid currentColor; padding: 0 .15em; margin-left: -.05em; } .cc-app .cc-ri { font-size: .6em; margin-right: -.4em; vertical-align: 1em; }
.cc-app span.cc-rs { font-size: 1.1em; } .cc-app .cc-p { color: #555; }
.cc-app .cc-chk-v { font: 12px Arial, sans-serif; color: var(--cc-mute); margin-left: .8em; } .cc-app .cc-chk { font: 700 12px Arial, sans-serif; margin-left: .6em; padding: 2px 7px; border-radius: 10px; } .cc-app .cc-chk.ok { color: #fff; background: var(--cc-ok); } .cc-app .cc-chk.ng { color: #fff; background: var(--cc-ng); }
.cc-app .cc-cm { font: italic 13px Arial, sans-serif; color: var(--cc-mute); }
.cc-app .cc-ed { font: 14px Consolas, "SFMono-Regular", Menlo, monospace; width: 100%; min-width: 240px; border: 0; outline: none; resize: none; background: #fbfaf7; padding: 4px; line-height: 1.6; color: #1d1d1f; }
.cc-app .cc-text .cc-ed { font-family: Arial, sans-serif; } .cc-app .cc-edhint { font: 11px Arial, sans-serif; color: var(--cc-mute); margin-top: 2px; }
.cc-app .cc-txt { font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.55; } .cc-app .cc-txt h2 { font-size: 20px; margin: 4px 0 6px; } .cc-app .cc-txt h3 { font-size: 16px; margin: 4px 0; } .cc-app .cc-txt h4 { font-size: 14px; margin: 4px 0; } .cc-app .cc-txt p { margin: 4px 0; } .cc-app .cc-txt ul { margin: 4px 0; padding-left: 20px; }
.cc-app .cc-inl { font-weight: 700; color: #0b3d91; } .cc-app .cc-inl-err { color: var(--cc-ng); text-decoration: underline dotted; }
.cc-app .cc-shbar, .cc-app .cc-pybar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font: 12px Arial, sans-serif; margin-bottom: 4px; }
.cc-app .cc-shname { width: 80px; font: 700 12px Arial, sans-serif; border: 1px solid #d9d4c9; border-radius: 4px; padding: 2px 4px; } .cc-app .cc-shhint { color: var(--cc-mute); font: 11px Arial, sans-serif; }
.cc-app .cc-grid { border-collapse: collapse; font: 13px Arial, sans-serif; background: #fff; } .cc-app .cc-grid th { background: #f1eee8; color: #6b6b6b; font-weight: 600; font-size: 11px; padding: 2px 6px; border: 1px solid #ddd8ce; }
.cc-app .cc-grid td { border: 1px solid #ddd8ce; min-width: 64px; height: 24px; padding: 2px 6px; cursor: cell; white-space: nowrap; } .cc-app .cc-grid td.num { text-align: right; } .cc-app .cc-grid td.f { color: #0b3d91; } .cc-app .cc-grid td.err { color: var(--cc-ng); background: #fdf0ef; }
.cc-app .cc-cin { width: 100%; min-width: 120px; border: 0; outline: 2px solid var(--cc-acc); font: 13px Consolas, monospace; padding: 1px 2px; }
.cc-app .cc-svg svg { display: block; width: 100%; height: auto; } .cc-app .cc-draw, .cc-app .cc-plot { padding-top: 6px; }
.cc-app .cc-meas { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 14px; } .cc-app .cc-meas span { background: #f3f7ee; padding: 1px 6px; border-radius: 4px; }
.cc-app .cc-mono { font-family: Consolas, "SFMono-Regular", Menlo, monospace; }
.cc-app .cc-code { width: 100%; box-sizing: border-box; font-size: 13px; line-height: 1.5; border: 1px solid #d9d4c9; border-radius: 6px; padding: 6px 8px; background: #1f2430; color: #e6e6e6; resize: vertical; tab-size: 4; }
.cc-app .cc-pyst { font: 12px Arial, sans-serif; color: var(--cc-mute); } .cc-app .cc-pyst.run { color: var(--cc-acc); font-weight: 700; }
.cc-app .cc-pyout { font: 12.5px Consolas, monospace; background: #f6f5f1; border-radius: 6px; padding: 6px 8px; margin: 6px 0 0; white-space: pre-wrap; max-height: 260px; overflow: auto; } .cc-app .cc-pyout.err { background: #fdf0ef; color: var(--cc-ng); }
.cc-app .cc-pyimg { display: block; max-width: 100%; margin-top: 6px; border: 1px solid #eee; }
.cc-modal { position: fixed; inset: 0; background: rgba(20,20,20,.45); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.cc-mbox { background: var(--card, #fff); color: var(--ink, #1d1d1f); border-radius: 12px; width: min(560px, 100%); max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,.3); } .cc-mbox.wide { width: min(1000px, 100%); }
.cc-mbox header, .cc-mbox footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line, #e3e3dd); } .cc-mbox footer { border-bottom: 0; border-top: 1px solid var(--line, #e3e3dd); justify-content: flex-end; }
.cc-mbody { padding: 12px 14px; overflow: auto; } .cc-mbody textarea { width: 100%; box-sizing: border-box; }
.cc-dtools { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 6px; } .cc-dtools input[type=color] { width: 34px; height: 26px; padding: 0; border: 1px solid #ddd; border-radius: 4px; }
.cc-dprops { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: .85rem; min-height: 28px; margin-bottom: 6px; } .cc-dprops input { padding: 2px 4px; border: 1px solid #ccc; border-radius: 4px; }
.cc-dcan { border: 1px solid #d9d4c9; background: #fff; touch-action: none; user-select: none; } .cc-dcan svg { display: block; width: 100%; height: auto; }
.cc-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: #1d1d1f; color: #fff; padding: 8px 14px; border-radius: 8px; font-size: .9rem; z-index: 1100; transition: all .25s; max-width: 90vw; } .cc-toast.on { opacity: 1; transform: translate(-50%, 0); } .cc-toast.bad { background: #8f1d14; }
@media (max-width: 860px) { .cc-app .cc-wrap { padding: 8px; } .cc-app .cc-bar { position: static; } }
body.cc-print .cc-reg:hover { border-color: transparent; } body.cc-print .cc-paper { background-image: none; }
@media print { body.cc-print .cc-paper { background-image: none; } }
