/* opnkit desktop (V0): dock + tab strip + stage, on top of dashboard.css (colours, buttons, dots, top bar). */
html, body { height: 100%; }
body { overflow: hidden; }
.dk { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.dk .grow { flex: 1; min-width: 0; }
.dk-grow { flex: 1; }
.lnk-b { font: inherit; color: var(--teal); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.lnk-b:hover { color: var(--teal-hover); text-decoration: underline; }
.st-ok { color: var(--teal); } .st-bad { color: var(--bad); }

/* ---------- top bar */
.dk-top .brand { width: auto; }
.dk-ws { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; line-height: 34px; }
.dk-search { flex: 1 1 300px; max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px;
  font: inherit; color: #9fb8b2; text-align: left; cursor: pointer; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: 10px; }
.dk-search:hover { border-color: var(--mint); color: #d6ebe6; }
.dk-search span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-search kbd { font: inherit; font-size: 12px; color: #b9d8d1; border: 1px solid rgba(255,255,255,.2); border-radius: 6px; padding: 0 6px; }
.dk-icon-btn { position: relative; width: 36px; height: 36px; display: grid; place-items: center; color: #d6ebe6; background: none; border: 0; border-radius: 10px; cursor: pointer; }
.dk-icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.dk-badge { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--warn); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.dk-clock { color: #d6ebe6; font-weight: 500; padding: 0 6px; }
.dk-avatar { border: 0; cursor: pointer; font: inherit; font-weight: 700; }

/* ---------- body: dock + main */
.dk-body { flex: 1; min-height: 0; display: flex; }
.dk-dock { flex: none; width: 76px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; background: var(--stone-2); border-right: 1px solid var(--line); overflow-y: auto; }
.dk-dock-apps { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dk-sep { width: 32px; border-top: 1px solid var(--line); margin: 4px 0; flex: none; }
.dk-dock-i { position: relative; width: 66px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px 5px; border: 0; background: none; border-radius: 12px; cursor: pointer; font: inherit; color: var(--ink-2); }
.dk-dock-i:hover { background: var(--stone-3); }
.dk-dock-i.cur { background: #fff; box-shadow: 0 0 0 1px var(--line); }
.dk-dock-i.open::before { content: ""; position: absolute; left: 0; top: 18px; width: 3px; height: 14px; border-radius: 0 3px 3px 0; background: var(--teal); }
.dk-dock-l { font-size: 11px; line-height: 1.2; max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dk-tile { position: relative; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #fff; background: var(--teal); }
.dk-tile.lg { width: 56px; height: 56px; border-radius: 16px; }
.dk-tile.c1 { background: #14947f; } .dk-tile.c2 { background: #2f6f86; } .dk-tile.c3 { background: #0a6457; }
.dk-tile.home { background: var(--deep); }
.dk-tile.ghost { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--field); }
/* Suggested apps (not added yet): dimmed, dashed outline; full colour on hover/focus. */
.dk-tile.suggest { background: transparent; color: var(--ink-2); box-shadow: none; outline: 1.5px dashed var(--field); outline-offset: -1.5px; opacity: .7; }
.dk-dock-i.suggest:hover .dk-tile, .dk-dock-i.suggest:focus-visible .dk-tile, .dk-launch-i.suggest:hover .dk-tile, .dk-launch-i.suggest:focus-visible .dk-tile { opacity: 1; color: var(--teal); }
.dk-dock-i.suggest .dk-dock-l, .dk-launch-i.suggest b { color: var(--ink-2); }
.dk-dock-i.dashed .dk-tile.ghost, .dk-launch-i.add .dk-tile { box-shadow: none; outline: 1.5px dashed var(--field); outline-offset: -1.5px; }
.dk-tile .dot { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; box-shadow: 0 0 0 2px var(--stone-2); }
.dk-tile .dot.unknown { display: none; }

.dk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dk-tabs { flex: none; display: flex; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid var(--line); background: var(--stone); overflow-x: auto; scrollbar-width: thin; }
.dk-tab { display: flex; align-items: center; border: 1px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0; margin-bottom: -1px; color: var(--muted); flex: none; }
.dk-tab:hover { color: var(--ink); background: var(--stone-2); }
.dk-tab.on { background: #fff; border-color: var(--line); color: var(--ink); }
.dk-tab-b { display: flex; align-items: center; gap: 7px; padding: 8px 6px 8px 12px; border: 0; background: none; font: inherit; font-weight: 600; color: inherit; cursor: pointer; }
.dk-tab:first-child .dk-tab-b { padding-right: 12px; }
.dk-tab-x { width: 24px; height: 24px; margin-right: 6px; display: grid; place-items: center; border: 0; background: none; border-radius: 6px; color: var(--muted); cursor: pointer; }
.dk-tab-x:hover { background: var(--stone-3); color: var(--ink); }

.dk-stage { flex: 1; min-height: 0; position: relative; background: #fff; }
.dk-panel { position: absolute; inset: 0; overflow: auto; }
.dk-panel iframe { border: 0; width: 100%; height: 100%; display: block; background: var(--stone); }

/* ---------- home */
.dk-home { display: flex; gap: 24px; padding: 28px 32px; align-items: flex-start; background: var(--stone); }
.dk-home-main { flex: 1; min-width: 0; }
.dk-home h1 { font-family: var(--display); font-size: 26px; letter-spacing: -.02em; margin: 0 0 2px; }
.dk-launch { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; margin-top: 22px; }
.dk-launch-i { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px 12px; border: 1px solid transparent; border-radius: 16px; background: none; cursor: pointer; font: inherit; color: var(--ink); text-align: center; }
.dk-launch-i:hover { background: #fff; border-color: var(--line); }
.dk-launch-i b { font-weight: 600; }
.dk-launch-i .dk-tile .dot { box-shadow: 0 0 0 2px var(--stone); }
.dk-empty { margin-top: 24px; padding: 28px; border: 1px dashed var(--field); border-radius: 16px; background: #fff; max-width: 520px; }
.dk-empty p { margin: 6px 0 16px; }

.dk-widgets { flex: none; width: 300px; display: flex; flex-direction: column; gap: 12px; }
.dk-w { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.dk-w-h { display: flex; align-items: baseline; justify-content: space-between; }
.dk-w h2 { font-size: 13px; text-transform: none; margin: 0 0 8px; color: var(--ink-2); }
.dk-w p { margin: 0 0 6px; }
.dk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.dk-list li { display: flex; align-items: center; gap: 8px; }
.dk-bar { height: 8px; border-radius: 4px; background: var(--stone-3); overflow: hidden; margin: 4px 0 6px; }
.dk-bar span { display: block; height: 100%; background: var(--teal); }
.dk-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- settings */
.dk-settings { display: flex; overflow: hidden; }
.dk-settings-nav { flex: none; width: 200px; padding: 16px 10px; border-right: 1px solid var(--line); background: var(--stone-2); display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.dk-settings-nav h2 { font-size: 13px; color: var(--muted); margin: 0 0 8px 10px; }
.dk-settings-nav button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-weight: 500; color: var(--ink-2); cursor: pointer; text-align: left; }
.dk-settings-nav button:hover { background: var(--stone-3); }
.dk-settings-nav button[aria-current="page"] { background: #fff; color: var(--teal); box-shadow: 0 0 0 1px var(--line); }
.dk-classic { margin-top: auto; padding: 8px 10px; }
.dk-frame-wrap { flex: 1; min-width: 0; }

/* ---------- app inside the desktop */
.dk-app { display: flex; flex-direction: column; overflow: hidden; }
.dk-app-bar { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--stone); }
.dk-app iframe { flex: 1; height: auto; }
.dk-app-host { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-app-hint { flex: none; display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: var(--teal-soft); border-bottom: 1px solid var(--line); }

/* ---------- split view: the active app on the left, its partner on the right, a divider between */
.dk-stage.split > .dk-panel { right: calc(100% - var(--split, 50%)); }
.dk-stage.split > .dk-panel.dk-side { left: var(--split, 50%); right: 0; border-left: 1px solid var(--line); }
.dk-divider { position: absolute; z-index: 5; top: 0; bottom: 0; left: var(--split, 50%); width: 10px; transform: translateX(-50%); cursor: col-resize; touch-action: none; }
.dk-divider::after { content: ""; position: absolute; left: 4px; top: 50%; width: 2px; height: 36px; margin-top: -18px; border-radius: 2px; background: var(--field); }
.dk-divider:hover::after, .dk-divider:focus-visible::after, .dk-stage.dragging .dk-divider::after { background: var(--teal); }
.dk-stage.dragging iframe { pointer-events: none; }
.dk-stage.dragging { cursor: col-resize; user-select: none; }
.dk-tab.dk-tab-side { color: var(--ink-2); background: var(--stone-2); box-shadow: inset 0 -2px 0 var(--teal); }
/* narrow panes: icons only in the app bar */
.dk-stage.split .dk-bar-l, .dk-stage.split .dk-app-host { display: none; }
@media (max-width: 899px) { .dk-side-btn { display: none; } }

/* ---------- popovers, toast, palette */
.dk-pop { position: fixed; z-index: 50; min-width: 240px; max-width: 340px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(3,17,15,.18); }
.dk-pop-h { display: block; padding: 6px 8px 8px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.dk-pop-i { width: 100%; display: flex; align-items: flex-start; gap: 10px; padding: 8px; border: 0; border-radius: 8px; background: none; font: inherit; color: var(--ink); text-decoration: none; text-align: left; cursor: pointer; }
.dk-pop-i:hover { background: var(--stone-2); color: var(--ink); }
.dk-pop-i .dot { margin-top: 6px; }
.dk-toast { position: fixed; z-index: 60; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 10px 14px; max-width: calc(100vw - 32px);
  background: var(--deep); color: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(3,17,15,.3); }
.dk-pal-back { position: fixed; inset: 0; z-index: 70; background: rgba(3,17,15,.4); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.dk-pal { width: 100%; max-width: 600px; background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(3,17,15,.35); overflow: hidden; }
.dk-pal-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.dk-pal-in input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; font-size: 17px; color: var(--ink); background: none; }
.dk-pal-in kbd { font: inherit; font-size: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; }
.dk-pal-list { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow-y: auto; }
.dk-pal-list li[role="option"] { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.dk-pal-list li.on { background: var(--teal-soft); }
.dk-pal-g { padding: 8px 10px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }

/* ---------- tablet: widgets under the launcher */
@media (max-width: 1080px) {
  .dk-home { flex-direction: column; align-items: stretch; }
  .dk-widgets { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
/* ---------- phone: dock at the bottom, one thing at a time */
@media (max-width: 720px) {
  .dk-ws, .dk-clock, .dk-search kbd { display: none; }
  .dk-top .brand b { display: none; }
  .dk-top .top-in { flex-wrap: nowrap; gap: 8px; padding: 0 10px; }
  .dk-search { flex: 1 1 0; min-width: 0; }
  .dk-top .top-right { margin-left: 0; gap: 2px; }
  .dk-body { flex-direction: column-reverse; }
  .dk-dock { width: 100%; flex-direction: row; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; }
  .dk-dock-apps { flex-direction: row; }
  .dk-sep { width: 0; height: 32px; border-top: 0; border-left: 1px solid var(--line); margin: 0 2px; }
  .dk-grow { display: none; }
  .dk-dock-i { width: 60px; }
  .dk-dock-i.open::before { left: 23px; top: auto; bottom: 0; width: 14px; height: 3px; border-radius: 3px 3px 0 0; }
  .dk-home { padding: 18px 14px; }
  .dk-launch { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .dk-settings { flex-direction: column; }
  .dk-settings-nav { width: 100%; flex-direction: row; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .dk-settings-nav h2, .dk-classic { display: none; }
  .dk-settings-nav button { flex: none; }
  .dk-app-bar .mut, .dk-bar-l { display: none; }
}

/* ---------- workspace name (handle), until it is chosen */
.dk-name { margin-top: 18px; max-width: 620px; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.dk-name p { margin: 4px 0 10px; }
.dk-name-row { display: flex; gap: 8px; flex-wrap: wrap; }
.dk-name-field { flex: 1 1 260px; display: flex; align-items: center; gap: 2px; min-height: 38px; padding: 0 10px; border: 1px solid var(--field); border-radius: 10px; background: #fff; }
.dk-name-field:focus-within { border-color: var(--teal); }
.dk-name-in { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; font-weight: 600; background: none; text-align: right; }
