/* Inside app windows: toolbars, lists, cards, editor, terminal, icon picker. */

.toolbar { display: flex; gap: 6px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line);
  background: var(--surface); position: sticky; top: 0; z-index: 3; flex-wrap: wrap; min-height: 48px; }
.toolbar .sep { width: 1px; height: 20px; background: var(--line-strong); margin: 0 4px; }
.pane { padding: 16px 18px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 20px; text-align: center; color: var(--text-3); animation: fade-in .3s; }
.empty .i { width: 34px; height: 34px; stroke-width: 1.4; }
.empty p { margin: 0; max-width: 340px; }

/* breadcrumbs */
.crumbs { flex: 1; min-width: 120px; display: flex; align-items: center; gap: 1px; height: 32px; padding: 0 4px; overflow-x: auto;
  border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); scrollbar-width: none; cursor: text; }
.crumbs::-webkit-scrollbar { display: none; }
.crumbs button { flex: none; height: 24px; padding: 0 7px; border: 0; border-radius: 6px; background: transparent; cursor: pointer;
  color: var(--text-2); font-weight: 500; white-space: nowrap; }
.crumbs button:hover { background: var(--surface-3); color: var(--text); }
.crumbs button:last-of-type { color: var(--text); font-weight: 600; }
.crumbs .slash { color: var(--text-3); flex: none; }
.crumbs .slash .i { width: 13px; height: 13px; }
.crumbs-input { flex: 1; min-width: 120px; height: 32px; font: 12.5px var(--mono); }

/* list rows */
.list { list-style: none; margin: 0; padding: 4px 6px 10px; }
.row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; min-height: 42px; border-radius: 9px;
  transition: background var(--t-fast); animation: rise-in .25s var(--ease) both; }
.row:hover { background: var(--surface-2); }
.row.sel { background: var(--accent-soft); }
.row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; }
.row .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.row .s { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .acts { display: flex; gap: 2px; flex: none; }
@media (hover: hover) { .row .acts.hover { opacity: 0; transition: opacity var(--t-fast); } .row:hover .acts.hover, .row:focus-within .acts.hover { opacity: 1; } }
.ficon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; color: var(--fc, var(--text-2));
  background: color-mix(in srgb, var(--fc, var(--text-2)) 12%, transparent); }
.ficon .i { width: 17px; height: 17px; }

/* file table */
.ftable-head { display: grid; grid-template-columns: 1fr 90px 150px 100px; gap: 10px; padding: 6px 14px 6px 56px;
  font-size: 11.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.frow { display: grid; grid-template-columns: 32px 1fr 90px 150px 100px; }
.frow .size, .frow .date { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frow .size { text-align: right; }
.frow .acts { justify-content: flex-end; }
.drop-hint { position: absolute; inset: 8px; border: 2px dashed var(--accent); border-radius: var(--r); background: var(--accent-soft);
  display: grid; place-items: center; color: var(--accent); font-weight: 600; z-index: 10; pointer-events: none; animation: fade-in .15s; }
.statusbar { display: flex; gap: 12px; align-items: center; padding: 6px 14px; font-size: 12px; color: var(--text-3);
  border-top: 1px solid var(--line); background: var(--surface); position: sticky; bottom: 0; }
.col { display: flex; flex-direction: column; height: 100%; }
.col > .grow { flex: 1; min-height: 0; overflow: auto; position: relative; }

/* editor with line numbers */
.editor-wrap { display: flex; height: 100%; font: 13px/1.6 var(--mono); background: var(--surface); }
.gutter { flex: none; padding: 12px 10px 12px 14px; text-align: right; color: var(--text-3); user-select: none; overflow: hidden;
  background: var(--surface-2); border-right: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: pre; }
.editor { flex: 1; border: 0; border-radius: 0; resize: none; padding: 12px 14px; margin: 0; font: inherit; tab-size: 4;
  background: transparent; white-space: pre; overflow: auto; min-height: 0; box-shadow: none !important; }
.save-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); animation: fade-in .2s; }

/* split (tasks) */
.split { display: flex; height: 100%; }
.split > .side { width: 340px; flex: none; border-right: 1px solid var(--line); display: flex; flex-direction: column; background: var(--surface); }
.split > .side > .list { flex: 1; overflow: auto; }
.split > .detail { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.detail-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.detail-head .cmd { font: 13px/1.5 var(--mono); padding: 8px 10px; margin: 10px 0 8px; border-radius: var(--r-sm); background: var(--surface-2);
  border: 1px solid var(--line); overflow-wrap: anywhere; white-space: pre-wrap; max-height: 96px; overflow: auto; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta .i { width: 13px; height: 13px; color: var(--text-3); }
pre.out { margin: 0; flex: 1; overflow: auto; padding: 12px 16px; font: 12.5px/1.55 var(--mono); white-space: pre-wrap; word-break: break-word;
  background: var(--term-bg); color: #c9d1d9; }

/* cards (servers, AI clients, apps) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; padding: 16px; }
.card2 { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--sh-1); transition: box-shadow var(--t), transform var(--t) var(--ease), border-color var(--t);
  animation: rise-in .3s var(--ease) both; min-width: 0; }
.card2:hover { box-shadow: var(--sh-2); border-color: var(--line-strong); }
.card2 .top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.card2 .name { font-weight: 650; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card2 .sub { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card2 .foot { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.card2.add { align-items: center; justify-content: center; min-height: 170px; border: 1.5px dashed var(--line-strong); box-shadow: none;
  background: transparent; color: var(--text-2); cursor: pointer; font: inherit; font-weight: 550; }
.card2.add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.card2.add .i { width: 26px; height: 26px; }
.meters { display: grid; grid-template-columns: 36px 1fr auto; gap: 8px 10px; align-items: center; font-size: 12px; color: var(--text-2); }
.meters > .sub { grid-column: 1 / -1; }
.meter { display: contents; }
.meter .bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.meter .bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent-2), var(--accent));
  width: 0; transition: width .6s var(--ease); }
.meter .bar i.hi { background: linear-gradient(90deg, #fb923c, var(--danger)); }
.meter .v { font-variant-numeric: tabular-nums; min-width: 72px; text-align: right; }
.section { margin: 4px 0 26px; }
.section h3 { margin: 0 0 10px; font-size: 13px; font-weight: 650; }
.section > p { margin: 4px 0 10px; color: var(--text-2); }
.copy-row { display: flex; gap: 6px; align-items: stretch; }
.code-box { flex: 1; min-width: 0; font: 12.5px/1.5 var(--mono); padding: 8px 11px; border-radius: var(--r-sm); background: var(--surface-2);
  border: 1px solid var(--line); overflow-wrap: anywhere; white-space: pre-wrap; user-select: all; }
.settings { max-width: 520px; }

/* terminal */
.term-wrap { height: 100%; display: flex; flex-direction: column; background: var(--term-bg); }
.term-host { flex: 1; min-height: 0; padding: 8px 4px 2px 12px; }
.term-host .xterm-viewport { scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.term-state { position: absolute; top: 10px; right: 14px; z-index: 5; }
.keybar { display: none; gap: 6px; padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); background: #161b22; overflow-x: auto; flex: none;
  border-top: 1px solid rgba(255, 255, 255, .06); scrollbar-width: none; }
.keybar button { flex: none; height: 36px; min-width: 44px; padding: 0 10px; border: 0; border-radius: 9px; background: #262c36; color: #e6edf3;
  font: 13px var(--mono); box-shadow: 0 1px 0 rgba(0, 0, 0, .4); }
.keybar button:active { background: #30363d; transform: scale(.95); }
.keybar button[aria-pressed=true] { background: var(--accent); }

/* app frame */
.app-frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }

/* icon picker */
.icon-field { display: flex; gap: 12px; align-items: center; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; max-height: 300px; overflow: auto;
  margin-top: 10px; padding: 2px; }
.icon-grid button { aspect-ratio: 1; border: 1px solid transparent; border-radius: 10px; background: transparent; cursor: pointer;
  display: grid; place-items: center; color: var(--text-2); transition: background var(--t-fast), color var(--t-fast); }
.icon-grid button:hover { background: var(--surface-2); color: var(--text); }
.icon-grid button[aria-pressed=true] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.icon-grid .i { width: 20px; height: 20px; }
.tints { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.tints button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); cursor: pointer; box-shadow: 0 0 0 1px var(--line-strong);
  background: linear-gradient(145deg, var(--t1), var(--t2)); transition: transform var(--t-fast) var(--ease-spring); }
.tints button:hover { transform: scale(1.12); }
.tints button[aria-pressed=true] { box-shadow: 0 0 0 2px var(--accent); }

@media (max-width: 760px), (pointer: coarse) and (max-width: 1024px) {
  .toolbar { padding: 8px; }
  .toolbar .crumbs, .toolbar .crumbs-input { order: -1; flex-basis: 100%; height: 38px; }
  .ftable-head { display: none; }
  .frow { grid-template-columns: 36px 1fr auto; }
  .frow .size, .frow .date { display: none; }
  .row { min-height: 56px; padding: 8px 10px; }
  .ficon { width: 36px; height: 36px; border-radius: 10px; }
  .split > .side { width: 100%; border-right: 0; }
  .split.show-detail > .side, .split:not(.show-detail) > .detail { display: none; }
  .keybar { display: flex; }
  .cards { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
  .editor-wrap { font-size: 13.5px; }
  .gutter { padding-left: 8px; padding-right: 6px; }
}
