/* Terminal: a shell session in a window. Monospace throughout; the colors are
   still the theme's, so light themes get a light terminal. */
body.tpl-terminal { --font: var(--mono); font-size: 14.5px; line-height: 1.65; }
.tm { max-width: 900px; margin: 0 auto; padding: 56px 20px 112px; }
.is-preview .tm { padding-top: 20px; }

.tm-win { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lg); overflow: hidden; }
.tm-bar { position: relative; display: flex; align-items: center; height: 44px; padding: 0 8px 0 16px; background: var(--raised); border-bottom: 1px solid var(--line); }
.tm-lights { display: flex; gap: 8px; }
.tm-lights i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.tm-lights i:nth-child(2) { background: #febc2e; }
.tm-lights i:nth-child(3) { background: #28c840; }
.tm-path { position: absolute; left: 50%; transform: translateX(-50%); font-size: 12.5px; color: var(--muted); white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.tm-share { margin-left: auto; width: 30px; height: 30px; border-radius: var(--r-sm); background: transparent; color: var(--muted); box-shadow: none; }
.tm-share:hover { color: var(--accent); background: var(--soft); }
.tm-share svg { width: 15px; height: 15px; }

.tm-body { padding: 22px 24px 28px; }
.tm-cmd { color: var(--text); font-weight: 600; margin-top: 22px; }
.tm-cmd:first-child { margin-top: 0; }
.tm-ps { color: var(--accent); margin-right: 4px; }
.tm-out { margin-top: 8px; padding-left: 0; }
.tm-dim { color: var(--muted); }
.tm-dim svg { vertical-align: -2px; }

.tm-id { display: flex; align-items: center; gap: 14px; }
.tm-id .avatar { border-radius: var(--r-sm); }
.tm-id h1 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
.tm .bio { max-width: 70ch; }
.tm .bio code { background: var(--soft); border-color: transparent; color: var(--accent); }
.tm-total strong { font-size: 22px; font-weight: 700; }
.tm-total .verified { vertical-align: -2px; }

.tm-ls { list-style: none; margin: 6px 0 0; padding: 0; }
.tm-row {
  display: grid; grid-template-columns: 14ch 22ch minmax(0, 1fr); column-gap: 16px; align-items: baseline;
  margin: 0 -10px; padding: 7px 10px; border-radius: var(--r-sm); color: var(--text); text-decoration: none;
}
a.tm-row:hover { background: var(--soft); }
a.tm-row:hover .tm-name { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.tm-st { font-size: 13px; }
.tm-st::before { content: '['; color: var(--muted); }
.tm-st::after { content: ']'; color: var(--muted); }
.tm-st.tone-ok { color: #22a35a; }
.tm-st.tone-warn { color: #c98a10; }
.tm-st.tone-info { color: #3b82f6; }
.tm-st.tone-bad { color: #dc4a40; }
.is-dark .tm-st.tone-ok { color: #8ee0a1; }
.is-dark .tm-st.tone-warn { color: #e6c77a; }
.is-dark .tm-st.tone-info { color: #9cc9ff; }
.is-dark .tm-st.tone-bad { color: #ff9a95; }
.tm-name { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-slash { color: var(--accent); }
.tm-rev { text-align: right; }
.tm-rev .rev { color: var(--text); font-size: 13.5px; }
.tm-desc, .tm-details { grid-column: 2 / -1; color: var(--muted); }
.tm-details { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; padding-left: 2ch; border-left: 2px solid var(--line); margin: 4px 0 2px; font-size: 13.5px; }

.tm-sub .sub-h { display: none; }
.tm-sub .sub-form { margin-top: 0; max-width: 520px; }
.tm-sub .sub-input { font-family: var(--mono); font-size: 14.5px; height: 42px; background: var(--bg); border-radius: var(--r-sm); }
.tm-sub .sub-btn { font-family: var(--mono); font-size: 14px; height: 42px; }
.tm-sub .sub-btn::before { content: '↵'; opacity: .7; }
.tm-sub.sub-link .sub-btn { margin-top: 0; }
.tm-sub .contact-form { margin-top: 0; max-width: 560px; }
.tm-sub .contact-field label, .tm-sub .contact-input { font-family: var(--mono); font-size: 14px; }
.tm-sub .contact-input:not(.contact-text) { height: 42px; }

.tm-links { list-style: none; padding: 0; display: grid; gap: 2px; }
.tm-links li { display: grid; grid-template-columns: 12ch minmax(0, 1fr); gap: 16px; }
.tm-key { color: var(--muted); }
.tm-key::after { content: ':'; }
.tm-links a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tm-last { margin-top: 22px; }
.tm-cursor { display: inline-block; width: .6em; height: 1.15em; vertical-align: -.2em; background: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .tm-cursor { animation: blink 1.1s steps(1) infinite; }
  @keyframes blink { 50% { opacity: 0; } }
}

@media (max-width: 680px) {
  body.tpl-terminal { font-size: 13.5px; }
  .tm { padding: 16px 10px 104px; }
  .tm-body { padding: 18px 16px 22px; }
  .tm-path { position: static; transform: none; margin-left: 14px; max-width: none; flex: 1; }
  .tm-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; padding: 10px; }
  .tm-st { grid-column: 1 / -1; grid-row: 1; font-size: 12px; }
  .tm-name { grid-row: 2; }
  .tm-rev { grid-row: 2; }
  .tm-desc, .tm-details { grid-column: 1 / -1; }
  .tm-links li { grid-template-columns: minmax(0, 1fr); gap: 0; margin-bottom: 6px; }
}
/* Custom links: plain rows in the shell, the highlighted one in the accent. */
.tm-lk { gap: 6px; margin-top: 4px; max-width: 560px; }
.tm-lk .lk { grid-template-columns: 22px minmax(0, 1fr) 18px; gap: 12px; min-height: 44px; padding: 8px 12px; font-family: var(--mono); font-size: 14px; font-weight: 500; letter-spacing: 0; background: transparent; border: 1px dashed var(--line); border-radius: var(--r-sm); box-shadow: none; }
.tm-lk .lk-t { text-align: left; }
.tm-lk .lk-ic { width: 22px; height: 22px; }
.tm-lk .lk:hover { background: var(--soft); border-color: var(--accent); transform: none; box-shadow: none; }
.tm-lk .lk-hi { background: var(--accent); border-style: solid; border-color: var(--accent); }
