/* ============================================================
   PixOffice — application styles
   ============================================================ */

/* ============================================================
   PixWord
   ============================================================ */
.word-scroll { flex: 1; overflow: auto; background: #dfe3e9; padding: 26px 0 60px; }
.word-page {
  width: 794px; min-height: 1123px; margin: 0 auto 26px; background: #fff; padding: 96px;
  box-shadow: 0 2px 10px rgba(16,24,40,.14); color: #1f2430; outline: none;
  font-family: var(--font); font-size: 16px; line-height: 1.7; caret-color: var(--accent);
}
.word-page.a5 { width: 559px; min-height: 794px; }
.word-page.letter { width: 816px; min-height: 1056px; }
.word-page[data-page="a4"] { padding: 96px; }
.word-page[data-page="a5"] { padding: 64px; }
.word-page[data-page="letter"] { padding: 90px; }
.word-page.focus { box-shadow: 0 2px 10px rgba(16,24,40,.14), 0 0 0 2px var(--accent); }
.word-page h1 { font-size: 2em; margin: .6em 0 .4em; line-height: 1.25; }
.word-page h2 { font-size: 1.5em; margin: .7em 0 .35em; }
.word-page h3 { font-size: 1.2em; margin: .7em 0 .3em; }
.word-page h1:first-child, .word-page h2:first-child { margin-top: 0; }
.word-page p { margin: 0 0 1em; }
.word-page ul, .word-page ol { margin: 0 0 1em; padding-left: 2em; }
.word-page li { margin-bottom: .3em; }
.word-page blockquote { margin: 0 0 1em; padding: .4em 0 .4em 1.1em; border-left: 3px solid var(--accent);
  color: var(--text-2); font-style: italic; }
.word-page table { border-collapse: collapse; width: 100%; margin: 0 0 1em; }
.word-page td, .word-page th { border: 1px solid #c9cfd8; padding: 7px 10px; vertical-align: top; }
.word-page th { background: var(--surface-3); font-weight: 650; }
.word-page img { max-width: 100%; height: auto; border-radius: 4px; }
.word-page a { color: var(--accent); text-decoration: underline; }
.word-page hr { border: 0; border-top: 1px solid #c9cfd8; margin: 1.6em 0; }
.word-page .pagebreak { border-top: 2px dashed #b9c0cc; margin: 30px 0; position: relative; }
.word-page .pagebreak::after { content: "Page break"; position: absolute; top: -9px; left: 10px;
  background: #fff; padding: 0 8px; font-size: 11px; color: var(--muted); }
.word-page::selection, .word-page *::selection { background: #c7d2fe; }
.word-head { background: #fff; border-bottom: 1px solid var(--border); padding: 7px 12px; display: flex;
  align-items: center; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.word-head input { border: 0; border-bottom: 1px dashed var(--border-strong); background: transparent; padding: 3px 4px; width: 150px; }
.word-head input:focus { border-bottom-color: var(--accent); outline: 0; }
.word-status { position: absolute; }

@media print {
  .topbar, .toolbar, .statusbar, .sidebar, .no-print { display: none !important; }
  .word-scroll { background: #fff; padding: 0; overflow: visible; }
  .word-page { box-shadow: none; margin: 0; width: auto; min-height: 0; }
}

/* ============================================================
   PixSheet (Excel)
   ============================================================ */
.formula-bar { flex: none; display: flex; align-items: center; gap: 0; background: var(--surface);
  border-bottom: 1px solid var(--border); padding: 5px 10px; }
.fb-name { width: 110px; font-family: var(--mono); font-size: 12px; color: var(--text-2);
  border-right: 1px solid var(--border); padding: 4px 8px; font-weight: 600; }
.fb-fx { padding: 0 9px; color: var(--muted); border-right: 1px solid var(--border); display: grid; place-items: center; }
.fb-input { flex: 1; border: 0; outline: 0; padding: 5px 8px; font-family: var(--mono); font-size: 12.5px; }
.fb-input:focus { background: #fbfcfe; }

.sheet-area { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.sheet-scroll { flex: 1; overflow: auto; background: var(--surface); position: relative; }
table.sheet { border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 12.5px; user-select: none; }
table.sheet th, table.sheet td { border-right: 1px solid #d5dae1; border-bottom: 1px solid #d5dae1; height: 22px; padding: 0; }
table.sheet th.corner { position: sticky; top: 0; left: 0; z-index: 6; background: var(--surface-3);
  width: 44px; min-width: 44px; border-right: 1px solid #c3cad4; }
table.sheet th.colh { position: sticky; top: 0; z-index: 4; background: var(--surface-3); color: var(--text-2);
  font-weight: 600; font-size: 11px; text-align: center; cursor: pointer; }
table.sheet th.rowh { position: sticky; left: 0; z-index: 3; background: var(--surface-3); color: var(--text-2);
  font-weight: 600; font-size: 11px; text-align: center; cursor: pointer; width: 44px; min-width: 44px; }
table.sheet th.colh:hover, table.sheet th.rowh:hover { background: #e2e6ec; }
table.sheet th.colh.hl { background: #dfe3ff; color: var(--accent-ink); }
table.sheet th.rowh.hl { background: #dfe3ff; color: var(--accent-ink); }
table.sheet th.sel { background: var(--accent); color: #fff; }
table.sheet td.cell { background: #fff; cursor: cell; overflow: hidden; white-space: pre; }
table.sheet td.cell.num { text-align: right; font-variant-numeric: tabular-nums; }
table.sheet td.cell.sel { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 2; position: relative; }
table.sheet td.cell.inrange { background: #eef0ff; }
table.sheet td.cell.active { box-shadow: inset 0 0 0 2px var(--accent); }
table.sheet td.cell input {
  width: 100%; height: 100%; border: 0; outline: 0; padding: 1px 4px; font: inherit; background: #fff; }
table.sheet td.cell input.num { text-align: right; }
table.sheet td.cell .err { color: var(--danger); }
.sheet-resizer { position: absolute; width: 6px; cursor: col-resize; z-index: 8; }

.sheet-tabs { flex: none; display: flex; align-items: center; gap: 2px; background: var(--surface-2);
  border-top: 1px solid var(--border); padding: 4px 8px; overflow-x: auto; }
.sheet-tab { padding: 5px 12px; border-radius: 6px 6px 0 0; font-size: 12.5px; cursor: pointer; color: var(--text-2);
  border: 1px solid transparent; border-bottom: 0; white-space: nowrap; }
.sheet-tab:hover { background: var(--surface-3); }
.sheet-tab.active { background: #fff; border-color: var(--border); color: var(--text); font-weight: 600; }
.sheet-tab .x { opacity: 0; margin-left: 6px; color: var(--muted); }
.sheet-tab:hover .x { opacity: 1; }
.sheet-tab .x:hover { color: var(--danger); }

.chart-box { position: absolute; right: 18px; bottom: 18px; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-2); padding: 8px; z-index: 10; }
.chart-box canvas { display: block; }
.chart-box .ch-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600;
  padding: 0 2px 6px; }
.fx-list { max-height: 300px; overflow: auto; }
.fx-item { display: flex; gap: 10px; padding: 7px 9px; border-radius: 6px; cursor: pointer; }
.fx-item:hover { background: var(--surface-3); }
.fx-item b { font-family: var(--mono); font-size: 12px; min-width: 92px; }
.fx-item span { font-size: 11.5px; color: var(--muted); }

/* ============================================================
   PixBase (Access)
   ============================================================ */
.db-view { flex: 1; overflow: auto; padding: 16px; }
.db-views { display: flex; gap: 2px; padding: 0 10px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.db-view-tab { padding: 8px 14px; font-size: 12.5px; cursor: pointer; border-radius: 7px 7px 0 0; color: var(--text-2);
  border: 1px solid transparent; border-bottom: 0; }
.db-view-tab:hover { background: var(--surface-3); }
.db-view-tab.active { background: #fff; border-color: var(--border); color: var(--text); font-weight: 600; }
.db-grid td { white-space: nowrap; }
.db-grid td.wrap { white-space: normal; min-width: 160px; }
.db-grid tbody td { cursor: default; }
.db-grid tr.rec-sel td { background: var(--accent-soft); }
.field-row { display: grid; grid-template-columns: 34px 1fr 150px 34px; gap: 8px; align-items: center; padding: 5px 0; }
.field-row .fname { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; width: 100%; }
.field-row .ftype { padding: 5px 6px; border: 1px solid var(--border); border-radius: 6px; width: 100%; background: var(--surface-2); }
.form-card { max-width: 620px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 22px; box-shadow: var(--shadow-1); }
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.form-field .input, .form-field .select { width: 100%; }
.query-editor { font-family: var(--mono); font-size: 12.5px; min-height: 90px; }
.query-result { margin-top: 14px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 4px 12px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 550; }

/* ============================================================
   PixPoint (PowerPoint)
   ============================================================ */
.deck-side { width: 190px; flex: none; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; }
.deck-thumbs { flex: 1; overflow: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.thumb { position: relative; border: 2px solid transparent; border-radius: 6px; overflow: hidden; cursor: pointer;
  background: #fff; box-shadow: var(--shadow-1); aspect-ratio: 16/9; }
.thumb.active { border-color: var(--accent); }
.thumb canvas, .thumb .thumb-inner { display: block; width: 100%; height: 100%; }
.thumb .n { position: absolute; left: 4px; bottom: 3px; background: rgba(0,0,0,.55); color: #fff;
  font-size: 10px; padding: 0 5px; border-radius: 4px; }
.thumb .del { position: absolute; right: 3px; top: 3px; background: rgba(255,255,255,.9); color: var(--danger);
  border: 0; border-radius: 4px; width: 18px; height: 18px; display: none; place-items: center; cursor: pointer; }
.thumb:hover .del { display: grid; }

.stage-wrap { flex: 1; display: grid; place-items: center; background: #dfe3e9; overflow: auto; padding: 24px; }
.slide-canvas { position: relative; background: #fff; box-shadow: 0 6px 24px rgba(16,24,40,.22); overflow: hidden; }
.slide-canvas .obj { position: absolute; box-sizing: border-box; cursor: move; }
.slide-canvas .obj.text { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.slide-canvas .obj img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-canvas .obj.sel { outline: 1.5px solid var(--accent); }
.slide-canvas .handle { position: absolute; width: 10px; height: 10px; background: #fff; border: 1.5px solid var(--accent);
  border-radius: 2px; }
.slide-canvas .handle.nw { left: -5px; top: -5px; cursor: nwse-resize; }
.slide-canvas .handle.ne { right: -5px; top: -5px; cursor: nesw-resize; }
.slide-canvas .handle.sw { left: -5px; bottom: -5px; cursor: nesw-resize; }
.slide-canvas .handle.se { right: -5px; bottom: -5px; cursor: nwse-resize; }
.slide-canvas .obj.sel .handle { display: block; }
.slide-canvas .handle { display: none; }
.slide-canvas textarea { position: absolute; inset: 0; border: 0; outline: 0; resize: none; background: transparent;
  font: inherit; color: inherit; padding: 0; overflow: hidden; }
.slide-canvas textarea::selection { background: #c7d2fe; }
.layouts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.layout-card { border: 1px solid var(--border); border-radius: 8px; padding: 7px; cursor: pointer; background: #fff; }
.layout-card:hover { border-color: var(--accent); }
.layout-card b { display: block; font-size: 11.5px; margin-bottom: 5px; }
.layout-mini { height: 52px; background: #f3f5f8; border-radius: 4px; position: relative; }
.layout-mini i { position: absolute; background: #c3cad4; border-radius: 2px; display: block; }
.deck-theme-row { display: flex; gap: 8px; flex-wrap: wrap; }
.theme-chip { width: 42px; height: 42px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.theme-chip.active { border-color: var(--accent); }

/* ============================================================
   PixSlide (presenter + sketch)
   ============================================================ */
.present-stage { flex: 1; background: #0b0f18; display: grid; place-items: center; overflow: hidden; position: relative; }
.present-slide { position: relative; background: #fff; box-shadow: 0 20px 70px rgba(0,0,0,.5); overflow: hidden; }
.present-slide .obj { position: absolute; box-sizing: border-box; }
.present-slide .obj.text { white-space: pre-wrap; word-break: break-word; }
.present-slide .obj img { width: 100%; height: 100%; object-fit: cover; }
.present-ctrl { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #111827;
  color: #e5e7eb; border-top: 1px solid #1f2937; }
.present-ctrl .btn { background: #1f2937; border-color: #374151; color: #e5e7eb; }
.present-ctrl .btn:hover { background: #293548; }
.present-ctrl .pnum { font-variant-numeric: tabular-nums; font-size: 12.5px; color: #9ca3af; min-width: 56px; text-align: center; }
.notes-panel { width: 300px; flex: none; background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; }
.notes-panel textarea { flex: 1; border: 0; outline: 0; resize: none; padding: 12px; font-size: 12.5px; line-height: 1.55; }
.notes-head { padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted); font-weight: 650; display: flex; align-items: center; justify-content: space-between; }
.notes-head .timer { font-family: var(--mono); color: var(--text-2); text-transform: none; letter-spacing: 0; }
.sketch-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.sketch-toolbar { flex: none; display: flex; align-items: center; gap: 6px; padding: 7px 10px; background: var(--surface);
  border-bottom: 1px solid var(--border); }
.sketch-canvas-wrap { flex: 1; overflow: auto; background: #cfd6e0; padding: 20px; }
.sketch-canvas { background: #fff; box-shadow: var(--shadow-2); display: block; cursor: crosshair; touch-action: none; }
.deck-card { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface); margin-bottom: 8px; cursor: pointer; }
.deck-card:hover { border-color: var(--accent); }
.deck-card canvas { border-radius: 4px; border: 1px solid var(--border); }
.deck-card .grow { flex: 1; min-width: 0; }
.deck-card b { display: block; font-size: 13px; }
.deck-card small { color: var(--muted); font-size: 11.5px; }
