/* Ferramentas de escritório: QR Code Pix, recibo, orçamento e declaração — complementa styles.css/site.css/studio.css */
.of-page { --c: var(--accent); --c-soft: var(--accent-soft); }
.of-page .tool-head { padding-bottom: 24px; }
.of-layout { display: grid; gap: 18px; align-items: start; }
.of-pix { grid-template-columns: minmax(0, 1fr) minmax(0, 400px); max-width: 980px; margin: 0 auto; }
.of-docs { grid-template-columns: minmax(0, 460px) minmax(0, 1fr); }
.of-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.of-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.of-h { font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 14px; }
.of-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 12px; }
.of-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.of-full { grid-column: 1 / -1; }
.of-page .field { gap: 6px; min-width: 0; }
.of-page .label { align-items: center; gap: 8px; }
.of-page .label .muted { font-weight: 400; }
.of-page .input { height: 42px; font-size: 15px; min-width: 0; }
.of-page textarea.input { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.5; resize: vertical; font: 400 14.5px/1.5 var(--font); }
.of-page select.input, .of-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b7884' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 32px; cursor: pointer; }
.of-page input[type=date].input, .of-page input[type=time].input, .of-page input[type=month].input { padding-right: 8px; }
.of-page .check { font-size: 14px; line-height: 1.35; }
.of-page small.muted { font-size: 12.5px; }

/* "Seus dados" recolhível */
.of-me { padding: 0; }
.of-me > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 16px 18px; cursor: pointer; border-radius: var(--radius); }
.of-me > summary::-webkit-details-marker { display: none; }
.of-me > summary:hover { background: var(--bg-2); }
.of-sum { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.of-sum b { font-family: var(--display); font-size: 19px; letter-spacing: -.02em; }
.of-sum-sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.of-chev { color: var(--muted); transition: transform .2s; }
.of-me[open] .of-chev { transform: rotate(180deg); }
.of-me > .of-grid, .of-me > .of-save { padding: 0 18px; }
.of-me > .of-grid { padding-top: 4px; }
.of-me > .of-save { padding-bottom: 16px; }
.of-save { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.of-hint { margin: 0; font-size: 13px; color: var(--muted); }
.of-hint a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.of-valid { font-size: 12px; color: var(--muted); min-height: 0; }
.of-valid:empty { display: none; }
.of-valid[data-ok="1"] { color: var(--img); }
.of-valid[data-ok="0"] { color: var(--pdf); }

/* Logo */
.of-logo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.of-logo-box { width: 96px; height: 56px; border-radius: 10px; border: 1px dashed var(--line-2); display: grid; place-items: center; overflow: hidden; flex: none;
  background: repeating-conic-gradient(var(--bg-2) 0 25%, var(--surface) 0 50%) 0 0 / 12px 12px; }
.of-logo-box img { max-width: 92%; max-height: 88%; object-fit: contain; display: block; }
.of-logo-box span { font-size: 11.5px; color: var(--muted); background: var(--surface); padding: 1px 6px; border-radius: 6px; }
.of-logo-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }

/* Pix */
.of-badge { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--biz-soft); color: var(--biz); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70%; }
.of-badge:empty { display: none; }
.of-badge[data-ok="1"] { background: var(--img-soft); color: var(--img); }
.of-count { font-weight: 500; color: var(--muted); font-size: 12px; }
.of-count[data-over="1"] { color: var(--biz); }
.of-count[data-over="1"]::after { content: " · será cortado"; }
.of-keyrow { display: flex; gap: 8px; }
.of-keyrow .input:first-child { flex: 1; font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.of-keyrow .of-select { width: 128px; flex: none; }
.of-money { position: relative; display: block; }
.of-money > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; font-size: 14px; pointer-events: none; }
.of-money .input { padding-left: 38px; font-variant-numeric: tabular-nums; }
.of-more { border-top: 1px solid var(--line); padding-top: 10px; }
.of-more > summary { cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: 14px; padding: 4px 0; }
.of-more > .of-grid { margin-top: 10px; }
.of-note { margin: 16px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--biz-soft); color: var(--ink); font-size: 13.5px; line-height: 1.45; }
.of-qr { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 80px; }
.of-qr-frame { width: 100%; max-width: 300px; aspect-ratio: 1; margin: 0 auto; background: #fff; border-radius: 16px; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.of-qr-frame canvas { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.of-qr-empty { margin: 0; padding: 24px; text-align: center; color: #7a7690; font-size: 14px; }
.of-qr-meta { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; min-height: 20px; }
.of-qr-meta b { font-size: 15px; overflow-wrap: anywhere; }
.of-qr-meta span { color: var(--accent); font-weight: 600; font-size: 14px; }
.of-copy { font-family: ui-monospace, Menlo, monospace !important; font-size: 12px !important; min-height: 72px !important; resize: none !important; word-break: break-all; color: var(--ink-2); }
.of-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.of-actions .btn { flex: 1 1 auto; }
.of-local { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 22px auto 0; color: var(--muted); font-size: 13.5px; text-align: center; }
.of-local .ic { width: 16px; height: 16px; color: var(--img); }

/* Documentos */
.of-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.of-chips .chip { padding: 6px 12px; font-size: 13px; }
.of-chips .chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.of-inline { display: grid; gap: 10px; padding: 12px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.of-inline .of-row-btns { display: flex; gap: 8px; justify-content: flex-end; }
.of-warn { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--biz-soft); color: var(--ink); font-size: 13.5px; line-height: 1.45; display: flex; gap: 8px; }
.of-warn b { color: var(--biz); }
.of-color { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.of-color input[type=color] { width: 44px; height: 36px; border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; background: var(--bg); cursor: pointer; flex: none; }
.of-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; padding: 0; }
.of-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.of-section-t { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 6px 0 -2px; }

/* Itens do orçamento */
.of-items { display: flex; flex-direction: column; gap: 10px; }
.of-item { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px 10px; padding: 12px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.of-item-n { width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.of-item-body { display: grid; gap: 8px; min-width: 0; }
.of-item-nums { display: grid; grid-template-columns: 70px 76px minmax(0, 1fr); gap: 8px; }
.of-item .input { height: 38px; font-size: 14px; background: var(--surface); }
.of-item textarea.input { min-height: 38px; height: 38px; padding: 8px 10px; resize: vertical; }
.of-item-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.of-item-total { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
.of-item-total small { color: var(--muted); font-weight: 500; margin-right: 4px; }
.of-item-btns { display: flex; gap: 2px; }
.of-item-btns .icon-btn { width: 34px; height: 34px; }
.of-item-btns .danger:hover:not(:disabled) { background: var(--pdf-soft); color: var(--pdf); }
.of-sumbox { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.of-sumbox div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.of-sumbox .tot { font-weight: 800; font-size: 17px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; }
.of-sumbox .tot span:last-child { color: var(--accent); }
.of-disc { display: flex; gap: 6px; }
.of-disc .seg { flex: none; padding: 3px; }
.of-disc .seg button { padding: 5px 10px; }
.of-disc .of-money, .of-disc > .input { flex: 1; min-width: 0; }

/* Prévia e ações */
.of-preview-col { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.of-preview { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; max-height: calc(100vh - 210px); overflow: auto; overscroll-behavior: contain; }
.of-pages { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.of-pages canvas { width: 100%; max-width: 640px; height: auto; background: #fff; box-shadow: 0 2px 12px rgba(0, 0, 0, .16); border-radius: 2px; display: block; }
.of-pages .of-pg-label { font-size: 12px; color: var(--muted); margin-top: -8px; }
.of-busy { color: var(--muted); font-size: 13px; text-align: center; padding: 40px 0; }
.of-dl { display: flex; flex-direction: column; gap: 10px; }
.of-dl .btn-lg { width: 100%; }
.of-next { padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); animation: pop .25s ease; }
.of-next-title { margin: 0 0 8px; font-weight: 700; font-size: 14px; }
.of-next-list { display: flex; flex-wrap: wrap; gap: 6px; }
.of-next-list .chip { font-size: 13.5px; padding: 7px 12px; }

@media (max-width: 920px) {
  .of-pix, .of-docs { grid-template-columns: minmax(0, 1fr); }
  .of-qr, .of-preview-col { position: static; }
  .of-preview { max-height: none; padding: 10px; }
}
@media (max-width: 520px) {
  .of-card { padding: 14px; }
  .of-me > summary { padding: 14px; }
  .of-me > .of-grid, .of-me > .of-save { padding-left: 14px; padding-right: 14px; }
  .of-grid, .of-grid.three { grid-template-columns: minmax(0, 1fr); }
  .of-grid.keep { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .of-keyrow .of-select { width: 118px; font-size: 14px; padding-left: 10px; }
  .of-actions .btn { width: 100%; }
  .of-item-nums { grid-template-columns: 62px 70px minmax(0, 1fr); }
}
