/* Data analysis: scripts and the console (centre), Environment, Plots and Files (right) */
#main { display: flex; flex-direction: row; flex: 1; min-width: 0; min-height: 0; background: var(--panel); }
#da-side { min-height: 0; }
.da-pane { display: flex; flex-direction: column; min-height: 0; border-bottom: 1px solid var(--line); }
.da-pane.grow { flex: 1; border-bottom: 0; }
#da-env, #da-plots, #da-files { flex: 1; min-height: 0; overflow: auto; }
#da-pkgs { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#da-centre { position: relative; flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface); }
#da-assist-pane { display: flex; flex-direction: column; min-height: 0; }

/* tabs: scripts and data being looked at */
#da-tabs { display: flex; align-items: stretch; gap: 2px; height: 32px; padding: 0 8px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; }
.da-tab { display: flex; align-items: center; gap: 6px; padding: 0 6px 0 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.da-tab .material-symbols-outlined { font-size: 16px; }
.da-tab:hover { color: var(--text); }
.da-tab.on { color: var(--text); border-bottom-color: var(--prog); font-weight: 600; }
.da-tab:focus-visible { outline: 2px solid var(--prog); outline-offset: -2px; }
.da-tab.add { padding: 0 8px; }
/* content: the person's own colour (set on the element) with a white letter */
.da-peer { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 700; margin-left: -2px; }
.da-tab > span:not(.material-symbols-outlined) { padding-right: 6px; }
.da-tab-x { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border: 0; border-radius: var(--radius-xs); background: none; color: var(--text-2); cursor: pointer; padding: 0; }
.da-tab-x:hover { background: var(--hover); color: var(--text); }
.da-tab-x .material-symbols-outlined { font-size: 14px; }

/* the script editor, and the Data viewer in its place */
#da-editor { flex: 1 1 55%; min-height: 80px; position: relative; display: flex; flex-direction: column; }
.da-ed { flex: 1; min-height: 0; }
.da-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.da-view[hidden], .da-ed[hidden], .da-help-host[hidden] { display: none; }
.da-view-info { flex: none; padding: 6px 12px; font-size: 12px; color: var(--text-2); border-bottom: 1px solid var(--line-soft, var(--line)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.da-view-grid { flex: 1; min-height: 0; }
/* the line between the script and the console: OfficeSplit's (shared/kit.js) */
#da-split:hover, #da-split.dragging { background: var(--prog); }

/* the console */
#da-console { flex: 1 1 45%; min-height: 120px; display: flex; flex-direction: column; }
.da-con-head { flex: none; display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 12px; font-size: 12.5px; color: var(--text-2); border-bottom: 1px solid var(--line-soft, var(--line)); }
.da-con-head > .material-symbols-outlined { font-size: 16px; }
.da-con-title { font-weight: 600; color: var(--text); }
.da-con-state { flex: 1; color: var(--prog-strong, var(--prog)); }
.da-con-stop { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; font-size: var(--fs-s); color: var(--danger); border-color: var(--danger); }
.da-con-stop .material-symbols-outlined { font-size: 16px; }
.da-con-stop[hidden] { display: none; }
.da-con-out { flex: 1; min-height: 0; overflow: auto; padding: 6px 12px; font: 13px/1.45 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.da-line { min-height: 1.45em; }
.da-line.input { color: var(--prog-strong); }
.da-line.message { color: var(--muted); }
.da-line.warning { color: var(--warn); }
.da-line.error, .da-line.stderr { color: var(--danger); }
.da-line.note { color: var(--text-2); font-style: italic; font-family: var(--font); font-size: var(--fs-m); }
/* Find (and replace): the matches in a script (the one found brighter) and in the console */
.da-findhl { background: var(--find-hl); border-radius: var(--radius-xs); }
.da-findhl.cur { background: var(--find-cur); }
::highlight(da-find) { background-color: var(--find-hl); }
::highlight(da-find-cur) { background-color: var(--find-cur); color: var(--text); }
.da-con-in { flex: none; display: flex; align-items: flex-start; gap: 6px; padding: 4px 12px 8px; border-top: 1px solid var(--line-soft, var(--line)); font: 13px/1.45 var(--font-mono); }
.da-con-prompt { color: var(--prog-strong); padding-top: 3px; user-select: none; }
.da-con-input { flex: 1; resize: none; border: 0; outline: none; background: transparent; color: var(--text); font: inherit; padding: 3px 0; min-height: 22px; }
.da-console.busy .da-con-prompt { opacity: .4; }

/* Environment */
.da-empty { margin: 14px 12px; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.da-env-group { padding: 8px 12px 2px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.da-env-row { display: grid; grid-template-columns: minmax(60px, auto) auto 1fr; gap: 8px; align-items: baseline; width: 100%; padding: 4px 12px; border: 0; background: none; color: var(--text); text-align: left; font: inherit; font-size: 12.5px; cursor: pointer; }
.da-env-row:hover { background: var(--hover); }
.da-env-name { font-weight: 600; font-family: var(--font-mono); }
.da-env-dims { color: var(--text-2); white-space: nowrap; }
.da-env-prev { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-mono); font-size: var(--fs-s); }

/* Plots */
.da-plots { display: flex; flex-direction: column; }
.da-plot-bar { flex: none; display: flex; align-items: center; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--line-soft, var(--line)); }
.da-plot-n { font-size: 12px; color: var(--text-2); padding: 0 4px; }
.da-grow { flex: 1; }
/* content: a plot is drawn on white, as R draws it */
.da-plot-img { flex: 1; min-height: 0; width: 100%; object-fit: contain; background: #fff; cursor: zoom-in; }
/* content */ .da-plot-zoom img { display: block; max-width: 100%; max-height: 75vh; margin: 0 auto; background: #fff; }

/* Files */
.da-files-bar { padding: 8px 12px 4px; }
.da-files-up { display: inline-flex; align-items: center; gap: 6px; height: 28px; font-size: 12.5px; }
.da-files-up .material-symbols-outlined { font-size: 17px; }
.da-file { display: flex; align-items: center; gap: 8px; padding: 3px 6px 3px 12px; font-size: 12.5px; }
.da-file:hover { background: var(--hover); }
.da-file > .material-symbols-outlined { font-size: 17px; color: var(--text-2); }
.da-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.da-file-size { color: var(--text-2); white-space: nowrap; font-size: 11.5px; }
.da-file-acts { display: flex; opacity: 0; }
.da-file:hover .da-file-acts, .da-file:focus-within .da-file-acts { opacity: 1; }
.da-file-acts .icon-btn { width: 26px; height: 26px; }

/* Packages */
.da-pkgs-bar { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px 4px; }
.da-pkgs-filter { flex: 1; min-width: 0; height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; }
.da-pkgs-list { flex: 1; min-height: 0; overflow: auto; padding-bottom: 6px; }
.da-pkg { display: grid; grid-template-columns: auto auto auto 1fr; gap: 6px; align-items: center; padding: 2px 12px 2px 10px; font-size: 12.5px; }
.da-pkg:hover { background: var(--hover); }
.da-pkg input { margin: 0; accent-color: var(--prog); }
.da-pkg-name { border: 0; background: none; padding: 0; color: var(--prog-strong, var(--prog)); font: inherit; font-weight: 600; font-family: var(--font-mono); cursor: pointer; text-align: left; }
.da-pkg-name:hover { text-decoration: underline; }
.da-pkg-ver { color: var(--text-2); font-size: 11.5px; white-space: nowrap; }
.da-pkg-title { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.da-inst-sug { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; margin: 10px 0 4px; }
.da-inst-chip { height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); color: var(--text); font: var(--fs-m) var(--font-mono); cursor: pointer; }
.da-inst-chip:hover { border-color: var(--prog); color: var(--prog-strong, var(--prog)); }
.da-inst-none { font-size: 12.5px; color: var(--text-2); align-self: center; }
.da-inst-note { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--text-2); }

/* Help (a tab beside the scripts) */
.da-help-host { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.da-help { background: var(--surface); }
.da-help-bar { flex: none; display: flex; align-items: center; gap: 2px; padding: 4px 8px; border-bottom: 1px solid var(--line-soft, var(--line)); }
.da-help-search { flex: 1; max-width: 420px; display: flex; align-items: center; gap: 6px; height: 28px; margin-left: 8px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel); color: var(--text-2); }
.da-help-search:focus-within { border-color: var(--prog); }
.da-help-search .material-symbols-outlined { font-size: 17px; }
.da-help-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; }
.da-help-body { flex: 1; min-height: 0; overflow: auto; padding: 8px 24px 40px; outline: none; }
.da-help-page { max-width: 860px; font-size: 14px; line-height: 1.55; color: var(--text); }
.da-help-page h2 { font-size: 21px; line-height: 1.3; margin: 14px 0 10px; text-wrap: balance; }
.da-help-page h3 { font-size: 15px; margin: 22px 0 6px; padding-bottom: 3px; border-bottom: 1px solid var(--line-soft, var(--line)); }
.da-help-page h4 { font-size: 14px; margin: 16px 0 4px; }
.da-help-page p { margin: 6px 0; }
.da-help-page a { color: var(--prog-strong, var(--prog)); text-decoration: none; }
.da-help-page a:hover { text-decoration: underline; }
.da-help-page code, .da-help-page pre { font-family: var(--font-mono); font-size: 13px; }
.da-help-page pre { margin: 6px 0 10px; padding: 10px 12px; background: var(--code-bg); border: 1px solid var(--line-soft, var(--line)); border-radius: var(--radius-s); overflow-x: auto; white-space: pre; }
.da-help-page table { border-collapse: collapse; margin: 6px 0; }
.da-help-page td { padding: 4px 12px 4px 0; vertical-align: top; }
.da-help-page td:first-child > code { white-space: nowrap; font-weight: 600; }
.da-help-page > table:first-child { width: 100%; color: var(--text-2); font-size: 12.5px; border-bottom: 1px solid var(--line-soft, var(--line)); }
.da-help-page dl dt { font-weight: 600; margin-top: 6px; }
.da-help-page dl dd { margin: 2px 0 6px 18px; }
.da-help-code-bar { display: flex; gap: 6px; margin: 10px 0 -4px; }
.da-help-code-bar .btn { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; font-size: 12.5px; }
.da-help-code-bar .material-symbols-outlined { font-size: 16px; }
.da-help-lead { color: var(--text-2); margin-top: -4px; }
.da-help-tips { margin: 6px 0 4px; padding-left: 20px; color: var(--text-2); font-size: 13.5px; }
.da-help-list { display: flex; flex-direction: column; margin: 6px 0; }
.da-help-item { display: grid; grid-template-columns: minmax(120px, max-content) minmax(60px, max-content) 1fr; gap: 12px; align-items: baseline; padding: 5px 8px; border-radius: var(--radius-s); color: var(--text) !important; text-decoration: none !important; }
.da-help-item:hover { background: var(--hover); }
.da-help-item-name { font-family: var(--font-mono); font-weight: 600; color: var(--prog-strong, var(--prog)); }
.da-help-item-pkg { color: var(--text-2); font-size: 12px; }
.da-help-item-title { color: var(--text-2); font-size: 13px; }
.da-help-none { margin: 24px 0; color: var(--text-2); }

/* the console's completion list (Tab) */
.da-pop { position: fixed; z-index: 1000; max-height: 260px; min-width: 220px; max-width: 480px; overflow: auto; padding: 4px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--pop-shadow); font: 13px var(--font-mono); }
.da-pop-row { display: flex; justify-content: space-between; gap: 16px; padding: 3px 10px; cursor: pointer; white-space: nowrap; }
.da-pop-row.on, .da-pop-row:hover { background: var(--prog-soft); }
.da-pop-kind { color: var(--text-2); font-family: var(--font); font-size: 11.5px; }


