/* UnixDroid online terminal (/terminal) */
.term-lab { --t-bg: #0b1020; --t-bar: #121a33; --t-fg: #e6e9f2; --t-dim: #8a93ad; --t-user: #4ade80; --t-dir: #60a5fa; --t-exe: #4ade80; --t-err: #f87171; --t-hit: #fbbf24; --t-ok: #34d399; --t-sel: rgba(96,165,250,.3);
  display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .term-lab { grid-template-columns: 320px minmax(0, 1fr); } }
.term-lab[data-theme="green"] { --t-bg: #020a04; --t-bar: #06150a; --t-fg: #4ade80; --t-dim: #2f8f55; --t-user: #86efac; --t-dir: #bbf7d0; --t-exe: #86efac; --t-hit: #fef08a; }
.term-lab[data-theme="amber"] { --t-bg: #120c02; --t-bar: #1c1405; --t-fg: #fbbf24; --t-dim: #a16207; --t-user: #fde68a; --t-dir: #fcd34d; --t-exe: #fde68a; --t-hit: #fff7ed; }
.term-lab[data-theme="dracula"] { --t-bg: #282a36; --t-bar: #21222c; --t-fg: #f8f8f2; --t-dim: #6272a4; --t-user: #50fa7b; --t-dir: #bd93f9; --t-exe: #50fa7b; --t-err: #ff5555; --t-hit: #f1fa8c; --t-ok: #50fa7b; }
.term-lab[data-theme="light"] { --t-bg: #fbfbf8; --t-bar: #eceee8; --t-fg: #1f2430; --t-dim: #7b8194; --t-user: #15803d; --t-dir: #1d4ed8; --t-exe: #15803d; --t-err: #b91c1c; --t-hit: #b45309; --t-ok: #047857; --t-sel: rgba(29,78,216,.2); }

.term-win { position: relative; min-width: 0; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: var(--t-bg); color: var(--t-fg);
  box-shadow: 0 30px 60px -30px rgba(16,28,61,.55), 0 0 0 1px rgba(255,255,255,.06) inset; }
.term-bar { display: flex; align-items: center; gap: .5rem; padding: .6rem .9rem; background: var(--t-bar); font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--t-dim); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.term-bar [data-term-title] { flex: 1; min-width: 0; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.term-bar button { border: 1px solid rgba(138,147,173,.35); color: var(--t-fg); background: transparent; border-radius: 8px; padding: .3rem .55rem; font: inherit; cursor: pointer; }
.term-bar button:hover { border-color: var(--t-dir); }
.term-box { height: min(62vh, 560px); min-height: 320px; overflow-y: auto; padding: .9rem 1rem 1.2rem; font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; cursor: text; overscroll-behavior: contain; }
.term-box ::selection { background: var(--t-sel); }
.t-line { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.55em; }
.t-dir { color: var(--t-dir); font-weight: 700; } .t-exe { color: var(--t-exe); font-weight: 700; } .t-user { color: var(--t-user); font-weight: 700; }
.t-err { color: var(--t-err); } .t-dim { color: var(--t-dim); } .t-hit { color: var(--t-hit); font-weight: 700; } .t-ok { color: var(--t-ok); font-weight: 700; }
.term-inline { display: flex; align-items: baseline; }
.term-inline [data-term-prompt] { white-space: pre; flex-shrink: 0; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.term-inline input { flex: 1; min-width: 2ch; background: transparent; border: 0; outline: 0; color: var(--t-fg); font: inherit; caret-color: var(--t-user); padding: 0; }
.term-keys { display: flex; gap: .35rem; overflow-x: auto; padding: .5rem .6rem; background: var(--t-bar); scrollbar-width: none; }
.term-keys::-webkit-scrollbar { display: none; }
.term-keys button { flex-shrink: 0; min-width: 2.4rem; padding: .45rem .6rem; border-radius: 8px; border: 1px solid rgba(138,147,173,.3); background: rgba(255,255,255,.04); color: var(--t-fg); font: 600 13px/1 ui-monospace, monospace; }
@media (pointer: fine) and (min-width: 1024px) { .term-keys { display: none; } }

.term-lab.is-full { position: fixed; inset: 0; z-index: 80; padding: .75rem; background: rgba(7,10,20,.92); }
.term-lab.is-full .term-win { height: 100%; }
.term-lab.is-full .term-box { height: auto; flex: 1; }
@media (max-width: 1023px) { .term-lab.is-full .term-panel { display: none; } }

/* editor */
.term-editor { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; background: var(--t-bg); font: 14px/1.5 ui-monospace, Menlo, Consolas, monospace; }
.term-editor[hidden] { display: none; }
.term-editor header { padding: .45rem .9rem; background: var(--t-fg); color: var(--t-bg); font-weight: 700; text-align: center; }
.term-editor textarea { flex: 1; resize: none; border: 0; outline: 0; padding: .8rem 1rem; background: transparent; color: var(--t-fg); font: inherit; tab-size: 4; }
.term-editor footer { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .5rem .9rem; background: var(--t-bar); color: var(--t-dim); font-size: 12px; }
.term-editor footer input { flex: 1; min-width: 8rem; background: transparent; border: 0; outline: 0; color: var(--t-fg); font: inherit; }
.term-editor footer button { border: 1px solid rgba(138,147,173,.35); background: transparent; color: var(--t-fg); border-radius: 6px; padding: .25rem .6rem; font: inherit; cursor: pointer; }

/* mission panel */
@media (max-width: 1023px) { .term-panel { order: 2; } }
.term-panel { min-width: 0; border: 1px solid var(--color-line, #e5e7eb); background: #fff; border-radius: 18px; padding: 1rem; font-size: .9rem; color: #33405e; align-self: start; }
@media (min-width: 1024px) { .term-panel { position: sticky; top: 6rem; max-height: calc(100vh - 7rem); overflow-y: auto; } }
.term-panel code { font: 600 .82em ui-monospace, Menlo, Consolas, monospace; background: #f1f3f8; color: #101c3d; border-radius: 5px; padding: .1em .35em; overflow-wrap: anywhere; }
.tp-progress > div { display: flex; justify-content: space-between; font-weight: 700; font-size: .78rem; color: #101c3d; }
.tp-progress { margin-bottom: .9rem; }
.tp-bar { display: block; height: 6px; margin-top: .35rem; border-radius: 99px; background: #eef1f6; overflow: hidden; }
.tp-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg,#16a34a,#4ade80); min-width: 6px; transition: width .5s; }
.tp-label { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #8a93ad; margin-bottom: .3rem; }
.tp-select { width: 100%; border: 1px solid #dfe3ec; border-radius: 10px; padding: .55rem .6rem; background: #fff; color: #101c3d; font-weight: 600; }
.tp-free { margin: .9rem 0 .6rem; line-height: 1.6; }
.tp-tracks { display: grid; gap: .45rem; }
.tp-tracks button { text-align: left; border: 1px solid #e5e8ef; border-radius: 12px; padding: .6rem .75rem; background: #fafbfd; cursor: pointer; }
.tp-tracks button:hover { border-color: #e11d2e; }
.tp-tracks b { display: block; color: #101c3d; } .tp-tracks span { font-size: .75rem; color: #8a93ad; }
.tp-card { margin-top: .9rem; border-radius: 14px; padding: .9rem; background: #f6f8fc; border: 1px solid #e7ebf3; line-height: 1.55; }
.tp-card.is-done { background: #ecfdf3; border-color: #bbf7d0; }
.tp-card.is-flash { animation: tp-pop .6s ease; }
@keyframes tp-pop { 0% { transform: scale(.97); box-shadow: 0 0 0 0 rgba(22,163,74,.5); } 60% { transform: scale(1.01); box-shadow: 0 0 0 10px rgba(22,163,74,0); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .tp-card.is-flash { animation: none; } }
.tp-card h3 { font-size: 1.05rem; font-weight: 800; color: #101c3d; margin: .15rem 0 .35rem; }
.tp-step { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #e11d2e; }
.tp-hi { margin-top: .5rem; font-size: .84rem; color: #5b6580; } .tp-note { margin-top: .5rem; font-size: .8rem; color: #8a93ad; }
.tp-why { margin-top: .6rem; padding-top: .6rem; border-top: 1px dashed #bbf7d0; font-size: .85rem; color: #166534; }
.tp-btns { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.tp-btns button { border-radius: 99px; padding: .35rem .8rem; font-size: .78rem; font-weight: 700; background: #101c3d; color: #fff; cursor: pointer; }
.tp-btns button[data-tp-type] { background: #e11d2e; }
.tp-hint { margin-top: .5rem; }
.tp-steps { margin-top: .8rem; display: grid; gap: .2rem; }
.tp-steps button { width: 100%; display: flex; align-items: center; gap: .55rem; text-align: left; border-radius: 10px; padding: .4rem .5rem; font-size: .84rem; color: #33405e; cursor: pointer; }
.tp-steps button:hover { background: #f4f6fa; }
.tp-steps button.is-cur { background: #fff1f2; color: #101c3d; font-weight: 700; }
.tp-steps span { width: 1.45rem; height: 1.45rem; flex-shrink: 0; display: grid; place-items: center; border-radius: 99px; border: 1.5px solid #d5dae5; font-size: .72rem; font-weight: 800; }
.tp-steps .is-done span { background: #16a34a; border-color: #16a34a; color: #fff; }
.tp-save { margin-top: .9rem; font-size: .75rem; color: #8a93ad; } .tp-save a { color: #e11d2e; font-weight: 700; }

html.dark .term-panel { background: #121a2e; border-color: #24304d; color: #c4cbe0; }
html.dark .term-panel code { background: #1c2742; color: #e6e9f2; }
html.dark .tp-progress > div, html.dark .tp-card h3, html.dark .tp-tracks b, html.dark .tp-select { color: #e6e9f2; }
html.dark .tp-select { background: #0f1628; border-color: #2a3656; }
html.dark .tp-card { background: #172036; border-color: #24304d; }
html.dark .tp-card.is-done { background: #0f2a1d; border-color: #166534; } html.dark .tp-why { color: #86efac; border-color: #166534; }
html.dark .tp-tracks button { background: #0f1628; border-color: #24304d; }
html.dark .tp-steps button { color: #c4cbe0; } html.dark .tp-steps button:hover { background: #172036; } html.dark .tp-steps button.is-cur { background: #2a1520; color: #fff; }
html.dark .tp-steps span { border-color: #3a4766; } html.dark .tp-bar { background: #1c2742; }

/* command reference */
.cmd-doc pre { overflow-x: auto; }
