/* Apps. */

.toolbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  min-width: 0;
}
.tb-title {
  padding-left: 6px;
  color: var(--text-2);
  font: 600 11px var(--sans);
}
.statusbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 24px;
  padding: 0 10px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text-2);
  font: 11px var(--sans);
  white-space: nowrap;
  overflow: hidden;
}
.empty {
  padding: 28px 16px !important;
  color: var(--dim);
  text-align: center !important;
  font-family: var(--sans);
}
.empty.is-err {
  color: var(--red);
}

/* ---------------------------------------------------------------- terminal */
.term-wrap {
  position: absolute;
  inset: 0;
  background: var(--surface-sunk);
}
.term-host {
  position: absolute;
  inset: 6px 4px 4px 8px;
}
.term-host .xterm {
  height: 100%;
}
.term-host .xterm-viewport,
.term-host .xterm-scrollable-element {
  background-color: var(--surface-sunk) !important;
}
.term-size {
  position: absolute;
  right: 18px;
  bottom: 6px;
  padding: 1px 6px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: rgba(9, 11, 10, 0.9);
  color: var(--faint);
  font: 11px var(--sans);
  pointer-events: auto;
  cursor: help;
}

.mock-term {
  position: absolute;
  inset: 0;
  padding: 8px 10px;
  overflow: auto;
  color: #d4ddd6;
  font: 13px/1.35 var(--mono);
  white-space: pre-wrap;
  word-break: break-all;
  cursor: text;
  outline: none;
}
.mt-out {
  display: inline;
}
.mt-input {
  display: inline;
}
.mt-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: var(--acc);
  opacity: 0.4;
}
.mock-term:focus-within .mt-cursor {
  opacity: 1;
  animation: pulse 1s steps(1) infinite;
}
.mt-sink {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ---------------------------------------------------------------- files */
.files,
.editor,
.viewer,
.jobs {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}
.crumbs {
  display: flex;
  align-items: center;
  min-width: 0;
  margin-left: 4px;
  padding: 0 4px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-2);
  overflow: hidden;
  flex: 0 1 auto;
}
.crumb {
  flex: none;
  padding: 1px 5px;
  border: 0;
  border-radius: 3px;
  background: none;
  color: var(--dim);
  font: 12px var(--mono);
  cursor: pointer;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crumb:hover {
  color: var(--text);
  background: var(--panel-3);
}
.crumb.is-last {
  color: var(--text);
}
.crumb-sep {
  color: var(--faint);
  font: 12px var(--sans);
}
.fscroll,
.jscroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  outline: none;
}
.ftable,
.jtable {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.ftable th,
.jtable th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 26px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  color: var(--faint);
  font: 500 11px var(--sans);
  text-align: left;
  user-select: none;
  white-space: nowrap;
}
.ftable th[data-key]:not([data-key=""]) {
  cursor: pointer;
}
.ftable th[data-key]:hover {
  color: var(--text-2);
}
.ftable th.is-sorted {
  color: var(--text-2);
}
.ftable th.is-sorted[data-dir="asc"]::after {
  content: " ↑";
  color: var(--acc);
}
.ftable th.is-sorted[data-dir="desc"]::after {
  content: " ↓";
  color: var(--acc);
}
.ftable td,
.jtable td {
  height: 27px;
  padding: 0 10px;
  border-bottom: 1px solid rgba(28, 36, 39, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ftable tbody tr {
  cursor: default;
}
.ftable tbody tr:hover td,
.jtable tbody tr:hover td {
  background: rgba(255, 255, 255, 0.022);
}
.ftable tr.is-sel td {
  background: rgba(217, 191, 134, 0.07) !important;
}
.ftable tr.is-sel td:first-child {
  box-shadow: inset 2px 0 0 var(--acc);
}
.c-name {
  width: auto;
}
.ftable .c-size {
  width: 84px;
  text-align: right;
  font: 11.5px var(--sans);
  color: var(--text-2);
}
.ftable th.c-size {
  text-align: right;
}
.ftable .c-time {
  width: 116px;
  font: 11.5px var(--sans);
  color: var(--dim);
}
.ftable .c-act {
  width: 92px;
  text-align: right;
  padding-right: 6px;
}
.cell-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.fi {
  display: grid;
  color: var(--dim);
}
.fi-dir {
  color: var(--acc-2);
}
.fname {
  overflow: hidden;
  text-overflow: ellipsis;
}
tr[data-type="dir"] .fname {
  color: var(--text);
  font-weight: 500;
}
.row-act {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 22px;
  border: 0;
  border-radius: 3px;
  background: none;
  color: var(--faint);
  cursor: pointer;
  opacity: 0;
}
tr:hover .row-act,
tr.is-sel .row-act {
  opacity: 1;
}
.row-act:hover {
  color: var(--text);
  background: var(--panel-3);
}
.dropzone {
  position: absolute;
  inset: 40px 8px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed var(--acc);
  border-radius: var(--r-lg);
  background: rgba(7, 9, 10, 0.88);
  color: var(--acc);
  font: 12px var(--sans);
  pointer-events: none;
}

/* ---------------------------------------------------------------- editor */
.ed-path {
  padding-left: 6px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.ed-main {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  background: var(--bg-2);
}
.ed-gutter {
  flex: none;
  width: 48px;
  padding: 10px 8px 10px 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
  color: var(--faint);
  font: 12.5px/1.55 var(--mono);
  text-align: right;
  white-space: pre;
  user-select: none;
}
.ed-text {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--text);
  font: 12.5px/1.55 var(--mono);
  tab-size: 2;
  white-space: pre;
  overflow: auto;
  caret-color: var(--acc);
}
.ed-text.is-wrap {
  white-space: pre-wrap;
  padding-left: 16px;
}
.ed-state {
  color: var(--dim);
}
.ed-state.is-dirty {
  color: var(--amber);
}
.ed-state.is-flash {
  color: var(--acc);
}

/* ---------------------------------------------------------------- viewer */
.view-content {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.view-content.is-frame {
  overflow: hidden;
  background: #fff;
}
.view-content.is-frame iframe,
.app-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #0a0c0b;
}
.view-content.is-image {
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    repeating-conic-gradient(#121617 0% 25%, #0d1011 0% 50%) 0 0 / 16px 16px;
}
.view-content.is-image img {
  max-width: 100%;
  max-height: 100%;
  cursor: zoom-in;
  box-shadow: 0 0 0 1px var(--line-2);
}
.view-content.is-image.is-actual {
  place-items: start;
}
.view-content.is-image.is-actual img {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}
.view-content.is-text {
  background: var(--bg-2);
}
.view-pre {
  margin: 0;
  padding: 10px 12px;
  color: var(--text);
  font: 12px/1.55 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.view-content.is-doc {
  background: var(--panel);
}

/* markdown */
.md {
  max-width: 760px;
  padding: 18px 26px 40px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.6;
}
.md > :first-child {
  margin-top: 0;
}
.md h1,
.md h2,
.md h3,
.md h4,
.md h5,
.md h6 {
  margin: 1.4em 0 0.5em;
  line-height: 1.25;
  font-weight: 650;
}
.md h1 {
  font-size: 22px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.md h2 {
  font-size: 17px;
}
.md h3 {
  font-size: 14.5px;
}
.md h4,
.md h5,
.md h6 {
  font-size: 13px;
  color: var(--text-2);
}
.md p {
  margin: 0.6em 0;
}
.md ul,
.md ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}
.md li {
  margin: 0.2em 0;
}
.md li::marker {
  color: var(--dim);
}
.md-task {
  list-style: none;
  margin-left: -1.3em !important;
}
.md-task input {
  accent-color: var(--acc);
  margin: 0 4px 0 0;
  vertical-align: -1px;
}
.md code {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg-2);
  color: #b6f7c8;
  font-size: 12px;
}
.md-code {
  margin: 0.8em 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
  overflow: auto;
}
.md-code code {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  white-space: pre;
}
.md blockquote {
  margin: 0.8em 0;
  padding: 2px 14px;
  border-left: 2px solid var(--amber);
  color: var(--text-2);
  background: rgba(230, 187, 69, 0.04);
}
.md hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.4em 0;
}
.md a {
  color: var(--acc);
  text-decoration: underline;
  text-decoration-color: var(--acc-dim);
  text-underline-offset: 2px;
}
.md-table {
  overflow: auto;
  margin: 0.8em 0;
}
.md table {
  border-collapse: collapse;
  font-size: 12.5px;
}
.md th,
.md td {
  padding: 5px 12px;
  border: 1px solid var(--line);
  text-align: left;
}
.md th {
  background: var(--panel-2);
  font-weight: 600;
}
.md del {
  color: var(--dim);
}

/* ---------------------------------------------------------------- jobs */
.job-form {
  flex: none;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.jf-title {
  grid-column: 1 / -1;
  color: var(--acc);
  font: 600 11px var(--sans);
}
.jf-keep {
  grid-column: 1 / 2;
  align-self: center;
}
.jf-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.jtable td {
  height: 38px;
}
.jtable th.c-name {
  width: 30%;
}
.jtable .cell-name {
  gap: 10px;
}
.jtable th:nth-child(3) {
  width: 150px;
}
.jtable th:nth-child(4) {
  width: 76px;
}
.jtable th:nth-child(5) {
  width: 88px;
}
.jtable .c-act {
  width: 100px;
  text-align: right;
  padding-right: 6px;
}
.jtable .num {
  text-align: right;
  color: var(--text-2);
}
.jname {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.jname .mono {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
}
.jdesc {
  color: var(--faint);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jcmd {
  color: var(--text-2);
}
.jexit {
  font: 11px var(--sans);
}
.jkeep {
  margin-left: 6px;
  color: var(--faint);
}
.sdot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
}
.sdot.s-running {
  background: var(--acc);
  animation: pulse 2s ease-in-out infinite;
}
.sdot.s-starting {
  background: var(--amber);
}
.sdot.s-failed {
  background: var(--red);
}

/* ---------------------------------------------------------------- wallet */
.wallet {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.wallet-main {
  flex: 1;
  padding: 18px 20px;
}
.w-label {
  color: var(--dim);
  font-size: 11px;
}
.w-addr {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 18px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--bg-2);
}
.w-addr code {
  flex: 1;
  min-width: 0;
  color: var(--acc);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.w-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.w-bal {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.w-bal-v {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
}
.w-links {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}
.w-hint {
  margin-top: 16px;
  color: var(--dim);
  font-size: 12px;
}
.w-hint code,
.connect p code,
.cx-sec p code {
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 11.5px;
}
.wallet-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 20px;
}
.wallet-empty h3 {
  margin: 12px 0 4px;
  font-size: 15px;
}
.wallet-empty p {
  max-width: 340px;
  margin: 0 0 16px;
  color: var(--text-2);
}
.w-glyph {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  color: var(--acc);
  background: var(--bg-2);
}
.notice {
  flex: none;
  display: flex;
  gap: 10px;
  margin: 0 14px 14px;
  padding: 10px 12px;
  border: 1px solid var(--amber-dim);
  border-left: 2px solid var(--amber);
  border-radius: var(--r);
  background: rgba(230, 187, 69, 0.04);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.5;
}
.notice .ico {
  color: var(--amber);
  margin-top: 1px;
}
.notice strong {
  color: var(--amber);
}

/* ---------------------------------------------------------------- connect */
.connect {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 6px 0 20px;
}
.cx-sec {
  padding: 14px 18px 16px;
  border-bottom: 1px solid var(--line);
}
.cx-sec:last-child {
  border-bottom: 0;
}
.cx-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.cx-n {
  color: var(--acc);
  font-size: 11px;
}
.cx-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.cx-sub {
  color: var(--faint);
  font-size: 12px;
}
.cx-sec p {
  margin: 6px 0 8px;
  color: var(--text-2);
}
.cmd {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0;
  padding: 0 4px 0 10px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
}
.cmd code {
  flex: 1;
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
  padding: 6px 0;
}
.cmd code::before {
  content: "$ ";
  color: var(--acc);
}
.cx-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.cx-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-2);
}
.cx-form .cx-actions {
  grid-column: 1 / -1;
  margin-top: 0;
}
.cx-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin: 8px 0;
}
.cx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 4px 0 10px;
  border-bottom: 1px solid var(--line);
}
.cx-item:last-child {
  border-bottom: 0;
}
.cx-item .ico {
  color: var(--dim);
}
.cx-empty {
  padding: 10px 12px;
  color: var(--dim);
  font-size: 12px;
}
.cx-add {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.kv {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px 12px;
  align-items: center;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-2);
  font-size: 12px;
}
.kv > span:nth-child(odd) {
  color: var(--dim);
}
.kv > span:nth-child(even) {
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- about */
.about {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 20px 22px 24px;
  color: var(--text-2);
}
.about-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.about p {
  margin: 8px 0;
}
.about h3 {
  margin: 20px 0 8px;
  color: var(--text);
  font: 600 11px var(--sans);
}
.credit-about {
  font-size: 13px;
  color: var(--text);
}
.keys {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 6px 16px;
  align-items: center;
  font-size: 12px;
}
.keys-k {
  display: flex;
  gap: 3px;
}

/* ---- Network: the companion and the user's own proxy ---- */
.cx-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0;
  font-size: 12px;
}
.cx-status[hidden],
.cx-pair[hidden] {
  display: none;
}
.cx-status .ico {
  flex: none;
  color: var(--dim);
}
.cx-status[data-tone="warn"] {
  color: var(--amber);
}
