/* DPI Konsult reader shell — light, document-first, brand used only in identity. */
:root {
  color-scheme: light;
  --dpi-bg-page: #f4f2ed;
  --dpi-bg-surface: #ffffff;
  --dpi-bg-container: #f0eee8;
  --dpi-bg-hover: #e9e5dc;
  --dpi-bg-active: #f2e8df;
  --dpi-active-text: #39291f;
  --dpi-border-subtle: #dedbd3;
  --dpi-border-medium: #c8c3b8;
  --dpi-text-primary: #242521;
  --dpi-text-secondary: #53544f;
  --dpi-text-dim: #75766f;
  --dpi-accent: #8e4020;
  --dpi-accent-soft: #f4e8df;
  --dpi-focus: #bd6035;
  --dpi-radius-pill: 9999px;
  --dpi-radius-card: 10px;
  --dpi-radius-btn: 8px;
  --dpi-radius-sm: 6px;
  --dpi-shell-height: 120px;
  --dpi-motion-fast: 140ms;
  --dpi-motion-base: 220ms;
  --dpi-ease-state: cubic-bezier(0.4, 0, 0.2, 1);
  --dpi-shadow-sm: 0 1px 2px rgba(25, 24, 20, 0.06);
  --dpi-shadow-card: 0 1px 3px rgba(25, 24, 20, 0.05);
  --dpi-shadow-elevated: 0 14px 38px rgba(25, 24, 20, 0.16);
  --dpi-shadow-panel: 0 1px 2px rgba(25, 24, 20, 0.06);
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-data: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-code: Consolas, "Courier New", monospace;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  background: var(--dpi-bg-page);
  color: var(--dpi-text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   MINIMALIST 3-ROW WORKSTATION CHROME (106px FIXED)
   Clean, institutional, reader-accommodating.
   ========================================================================== */
.dpi-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  background: var(--dpi-bg-surface);
  box-shadow: var(--dpi-shadow-panel);
  user-select: none;
}

/* --------------------------------------------------------------------------
   ROW 1: TITLEBAR (38px, Calm Navigation & OS Controls)
   -------------------------------------------------------------------------- */
.dpi-titlebar {
  height: 48px;
  background: var(--dpi-bg-container);
  border-bottom: 1px solid var(--dpi-border-subtle);
  display: flex;
  align-items: center;
  padding: 0 0 0 14px;
  gap: 12px;
}

.dpi-app-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.dpi-app-mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  object-fit: contain;
}

.dpi-titlebar-appname {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dpi-text-secondary);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.dpi-titlebar-appname strong {
  color: var(--dpi-text-primary);
  font-weight: 600;
}

/* Gemini-Style Navigation Pills */
.dpi-titlebar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
}

.dpi-nav-pill {
  background: transparent;
  border: none;
  color: var(--dpi-text-secondary);
  font-size: 12px;
  font-weight: 500;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--dpi-radius-pill);
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.dpi-nav-pill:hover {
  background: var(--dpi-bg-hover);
  color: var(--dpi-text-primary);
}

.dpi-nav-pill.active {
  background: var(--dpi-bg-active);
  color: var(--dpi-active-text);
  font-weight: 600;
}

.dpi-titlebar-spacer {
  flex: 1;
}

.dpi-titlebar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 6px;
}

.dpi-status-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--dpi-text-dim);
  background: var(--dpi-bg-surface);
  border: 1px solid var(--dpi-border-subtle);
  padding: 3px 10px;
  border-radius: var(--dpi-radius-pill);
}

/* Window Controls (Minimize, Maximize, Close) */
.dpi-win-controls {
  display: flex;
  align-items: center;
  height: 100%;
  flex-shrink: 0;
}

.dpi-win-btn {
  width: 44px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dpi-text-dim);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  border: none;
  background: transparent;
}

.dpi-win-btn:hover {
  background: var(--dpi-bg-hover);
  color: var(--dpi-text-primary);
}

.dpi-win-btn.close:hover {
  background: #d93025;
  color: #ffffff;
}

.dpi-win-btn svg {
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   ROW 2: DOCUMENT & DELIVERABLE TOOLBAR (44px)
   -------------------------------------------------------------------------- */
.dpi-toolbar {
  height: 48px;
  background: var(--dpi-bg-surface);
  border-bottom: 1px solid var(--dpi-border-subtle);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}

.dpi-doc-badge {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--dpi-bg-container);
  color: var(--dpi-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.dpi-doc-badge.excel {
  background: #e6f4ea;
  color: #137333;
}
[data-theme="dark"] .dpi-doc-badge.excel {
  background: rgba(30, 142, 62, 0.2);
  color: #81c995;
}

.dpi-doc-badge.pdf {
  background: #fce8e6;
  color: #c5221f;
}
[data-theme="dark"] .dpi-doc-badge.pdf {
  background: rgba(217, 48, 37, 0.2);
  color: #f28b82;
}

.dpi-doc-badge.cad {
  background: var(--dpi-accent-soft);
  color: var(--dpi-accent);
}

.dpi-doc-title {
  flex: 1;
  min-width: 0;
}

.dpi-doc-title-main {
  font-size: 13px;
  font-weight: 600;
  color: var(--dpi-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.dpi-doc-title-sub {
  font-size: 11px;
  color: var(--dpi-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dpi-toolbar-sep {
  width: 1px;
  height: 20px;
  background: var(--dpi-border-subtle);
  flex-shrink: 0;
}

/* Gemini-Style Action Buttons */
.dpi-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--dpi-bg-container);
  border: 1px solid transparent;
  color: var(--dpi-text-primary);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--dpi-radius-pill);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
}

.dpi-btn:hover {
  background: var(--dpi-bg-hover);
  border-color: var(--dpi-border-subtle);
}

.dpi-btn.primary {
  background: var(--dpi-accent);
  color: #ffffff;
  font-weight: 500;
}
[data-theme="dark"] .dpi-btn.primary {
  background: #a8c7fa;
  color: #041e49;
}

.dpi-btn.primary:hover {
  opacity: 0.92;
  box-shadow: var(--dpi-shadow-sm);
}

/* --------------------------------------------------------------------------
   ROW 3: BREADCRUMB / PATH BAR (24px)
   -------------------------------------------------------------------------- */
.dpi-breadcrumb {
  height: 24px;
  background: var(--dpi-bg-container);
  border-bottom: 1px solid var(--dpi-border-subtle);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 6px;
  font-size: 11px;
  color: var(--dpi-text-dim);
  overflow-x: auto;
  white-space: nowrap;
}

.dpi-breadcrumb a {
  color: var(--dpi-text-secondary);
  text-decoration: none;
  font-weight: 500;
}

.dpi-breadcrumb a:hover {
  color: var(--dpi-accent);
  text-decoration: underline;
}

.dpi-breadcrumb span.sep {
  color: var(--dpi-border-medium);
  font-size: 9px;
}

.dpi-breadcrumb .current {
  color: var(--dpi-text-primary);
  font-weight: 500;
}

/* ==========================================================================
   VIEWPORT FRAME WRAPPER (106px FIXED PIN)
   ========================================================================== */
.dpi-frame-wrap {
  position: fixed;
  top: var(--dpi-shell-height);
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  background: var(--dpi-bg-page);
}

/* ==========================================================================
   UNIVIEW IN-BROWSER EXCEL & SPREADSHEET DRAWER
   Clean, modern table view (Google Sheets / Arup d.Hub style)
   ========================================================================== */
.uniview-drawer {
  position: fixed;
  top: var(--dpi-shell-height);
  right: 0;
  bottom: 0;
  width: 860px;
  max-width: 95vw;
  background: var(--dpi-bg-surface);
  color: var(--dpi-text-primary);
  box-shadow: var(--dpi-shadow-elevated);
  z-index: 9500;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 1px solid var(--dpi-border-subtle);
}

.uniview-drawer.open {
  transform: translateX(0);
}

.uniview-header {
  background: var(--dpi-bg-surface);
  border-bottom: 1px solid var(--dpi-border-subtle);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.uniview-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.uniview-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #e6f4ea;
  color: #137333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
[data-theme="dark"] .uniview-icon {
  background: rgba(30, 142, 62, 0.2);
  color: #81c995;
}

.uniview-icon.pdf {
  background: #fce8e6;
  color: #c5221f;
}
[data-theme="dark"] .uniview-icon.pdf {
  background: rgba(217, 48, 37, 0.2);
  color: #f28b82;
}

.uniview-doc-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--dpi-text-primary);
}

.uniview-doc-meta {
  font-size: 11px;
  color: var(--dpi-text-dim);
}

.uniview-close-btn {
  background: transparent;
  border: none;
  color: var(--dpi-text-dim);
  width: 28px;
  height: 28px;
  border-radius: var(--dpi-radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background 0.12s ease;
}

.uniview-close-btn:hover {
  background: var(--dpi-bg-hover);
  color: var(--dpi-text-primary);
}

/* Sheet Tabs (Google Sheets Clean Style) */
.uniview-sheet-bar {
  background: var(--dpi-bg-container);
  border-bottom: 1px solid var(--dpi-border-subtle);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px 0 12px;
  overflow-x: auto;
  white-space: nowrap;
}

.uniview-sheet-tab {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--dpi-text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s ease;
}

.uniview-sheet-tab:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--dpi-text-primary);
}

.uniview-sheet-tab.active {
  background: var(--dpi-bg-surface);
  border-color: var(--dpi-border-subtle);
  color: var(--dpi-accent);
  font-weight: 600;
  border-top: 2px solid var(--dpi-accent);
}

/* Spreadsheet Toolbar */
.uniview-toolbar {
  padding: 8px 14px;
  background: var(--dpi-bg-surface);
  border-bottom: 1px solid var(--dpi-border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.uniview-search {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--dpi-bg-container);
  border: 1px solid transparent;
  border-radius: var(--dpi-radius-pill);
  padding: 5px 12px;
  gap: 8px;
  transition: border-color 0.15s ease;
}

.uniview-search:focus-within {
  border-color: var(--dpi-accent);
  background: var(--dpi-bg-surface);
}

.uniview-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 12px;
  width: 100%;
  color: var(--dpi-text-primary);
  font-family: inherit;
}

.uniview-metrics {
  font-size: 11px;
  color: var(--dpi-text-dim);
  white-space: nowrap;
}

/* Spreadsheet Table Grid */
.uniview-table-wrap {
  flex: 1;
  overflow: auto;
  position: relative;
  background: var(--dpi-bg-surface);
}

.uniview-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  font-family: var(--font-data);
}

.uniview-table th {
  background: var(--dpi-bg-container);
  border: 1px solid var(--dpi-border-subtle);
  color: var(--dpi-text-secondary);
  font-weight: 600;
  padding: 6px 10px;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
}

.uniview-table td {
  border: 1px solid var(--dpi-border-subtle);
  padding: 6px 10px;
  color: var(--dpi-text-primary);
  background: var(--dpi-bg-surface);
  white-space: nowrap;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uniview-table tr:hover td {
  background: var(--dpi-bg-hover);
}

.uniview-table tr.highlight td {
  background: #fef08a !important;
  color: #1f1f1f !important;
}

.uniview-table td.row-num {
  background: var(--dpi-bg-container);
  color: var(--dpi-text-dim);
  text-align: center;
  user-select: none;
  font-size: 10px;
  position: sticky;
  left: 0;
  z-index: 5;
  width: 38px;
}

.uniview-pdf-frame {
  width: 100%;
  height: 100%;
  border: none;
}

/* Loading */
.uniview-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 240px;
  gap: 12px;
  color: var(--dpi-text-dim);
  font-size: 13px;
}

.uniview-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--dpi-border-subtle);
  border-top-color: var(--dpi-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   RESPONSIVE & PRINT BEHAVIOR
   ========================================================================== */
@media (max-width: 720px) {
  :root { --dpi-shell-height: 96px; }
  .dpi-doc-title-sub,
  .dpi-titlebar-status { display: none; }
  .dpi-titlebar { gap: 6px; padding-right: 8px; }
  .dpi-titlebar-nav { margin-left: 0; gap: 0; }
  .dpi-titlebar-nav .dpi-nav-pill:not([data-mockup="0"]):not(.active) { display: none; }
  .dpi-nav-pill { min-height: 40px; padding-inline: 8px; font-size: 10.5px; }
  .dpi-breadcrumb { display: none; }
  .uniview-drawer { top: var(--dpi-shell-height); width: 100vw; }
}

@media print {
  .dpi-panel {
    display: none !important;
  }
  .dpi-frame-wrap {
    top: 0 !important;
  }
}

:focus-visible { outline: 3px solid var(--dpi-focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}




