  /* ===== MESSAGE LINE ===== */
  #message-line {
    min-height: 22px;
    max-height: 22px;
    background: var(--gutter-bg);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-dim);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: color 0.2s;
  }
  #message-line.log-success { color: var(--green); }
  #message-line.log-error   { color: var(--red); }
  #message-line.log-warn    { color: var(--yellow); }
  #message-line.log-info    { color: var(--text-dim); }
  #message-line.log-cmd     { color: var(--accent); }

  /* ===== POWERLINE STATUS BAR =====
     --sb-accent is set per mode by updateStatus() in js/core/render.js. */
  #status-bar {
    --sb-accent: var(--accent);
    height: 26px;
    background: var(--gutter-bg);
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 500;
    overflow: hidden;
  }

  #status-bar > div {
    display: flex;
    align-items: center;
    white-space: nowrap;
  }

  #mode-indicator {
    font-weight: 700;
    padding: 0 12px;
    min-width: 96px;
    justify-content: center;
    font-size: 11px;
    letter-spacing: 1.2px;
    background: var(--sb-accent);
    color: var(--on-accent);
  }

  /* The powerline chevron between the mode block and the rest. */
  .sb-arrow {
    width: 0;
    flex-shrink: 0;
    border-top: 13px solid transparent;
    border-bottom: 13px solid transparent;
  }
  .sb-arrow-mode  { border-left: 11px solid var(--sb-accent); }
  .sb-arrow-right { border-right: 11px solid var(--sb-accent); }

  #status-file {
    padding: 0 10px;
    color: var(--text);
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block !important;
    line-height: 26px;
  }
  #status-modified { color: var(--yellow); font-weight: 700; padding-right: 6px; }

  .sb-seg {
    padding: 0 9px;
    border-left: 1px solid var(--border);
    color: var(--text-dim);
  }
  .sb-dim { color: var(--line-num); }
  .sb-search  { color: var(--yellow); }
  .sb-sel     { color: var(--magenta); }
  .sb-pending { color: var(--orange); font-weight: 700; letter-spacing: 1px; min-width: 36px; justify-content: flex-end; }
  .sb-macro   { color: var(--red); font-weight: 700; animation: recPulse 1.4s ease-in-out infinite; }
  @keyframes recPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

  .sb-spacer { flex: 1; }

  #status-pos {
    padding: 0 10px;
    background: var(--sb-accent);
    color: var(--on-accent);
    font-weight: 600;
  }
  #status-pct {
    padding: 0 9px;
    background: var(--sb-accent);
    color: var(--on-accent);
    border-left: 1px solid color-mix(in srgb, var(--bg-normal) 25%, transparent);
    font-weight: 600;
    min-width: 44px;
    justify-content: center;
  }

  /* ===== COMMAND LINE ===== */
  /* The completion popup is positioned against this, so it opens upwards
     from the command line rather than against the viewport. */
  #cmd-container { position: relative; flex-shrink: 0; }

  #cmdline-bar {
    height: 26px;
    background: var(--gutter-bg);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    flex-shrink: 0;
    font-size: 13px;
  }
  #cmdline-prompt { color: var(--text); font-weight: 700; margin-right: 4px; }

  /* The ghost sits underneath the input so the completion hint lines up
     with the typed text character for character. */
  #cmdline-field { position: relative; flex: 1; display: flex; align-items: center; }
  #cmdline-input {
    position: relative;
    z-index: 2;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
    flex: 1;
    caret-color: var(--text);
  }
  #cmdline-ghost {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    color: var(--line-num);
    font-family: var(--font);
    font-size: 13px;
    pointer-events: none;
    white-space: pre;
  }
  #cmdline-msg { color: var(--text-dim); font-size: 12px; margin-left: auto; padding-left: 14px; }

  /* ===== COMMAND-LINE HINT =====
     What the command under the caret does, shown while it is typed. */
  #cmdline-hint {
    font-size: 11.5px;
    padding-left: 16px;
    margin-left: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 46%;
  }
  #cmdline-hint.cmd-hint-ok    { color: var(--text-dim); }
  #cmdline-hint.cmd-hint-user  { color: var(--cyan); }
  #cmdline-hint.cmd-hint-guess { color: var(--yellow); }
  #cmdline-hint.cmd-hint-bad   { color: var(--red); opacity: 0.8; }
  /* The hint already claims the free space, so the message line stops
     doing so or the two fight over the same gap. */
  #cmdline-hint:not(:empty) ~ #cmdline-msg { margin-left: 0; }

  /* ===== COMPLETION POPUP =====
     Vim's wildmenu is one crowded row; there is room here for a real
     list, so each candidate gets its description beside it. */
  #cmd-popup {
    display: none;
    position: absolute;
    bottom: 26px;
    left: 0;
    right: 0;
    z-index: 60;
    max-height: min(46vh, 420px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--gutter-bg);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    font-size: 12.5px;
  }
  .cmd-opt {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 3px 14px;
    cursor: pointer;
    border-left: 2px solid transparent;
  }
  .cmd-opt:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
  .cmd-opt.active {
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    border-left-color: var(--accent);
  }
  .cmd-opt-name {
    color: var(--text-bright);
    font-weight: 500;
    min-width: 168px;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .cmd-opt-name::before { content: ':'; color: var(--text-dim); }
  /* The characters that actually matched, so a fuzzy hit explains itself. */
  .cmd-opt-name b { color: var(--accent); font-weight: 700; }
  .cmd-opt-desc {
    color: var(--text-dim);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cmd-opt-group, .cmd-opt-tag {
    flex-shrink: 0;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
  }
  .cmd-opt-group { color: var(--text-dim); background: color-mix(in srgb, var(--text-dim) 14%, transparent); }
  .cmd-opt-tag   { color: var(--on-accent); background: var(--cyan); font-weight: 700; }
  .cmd-opt-more  { padding: 5px 14px; color: var(--text-dim); font-style: italic; }

  @media (prefers-reduced-motion: reduce) {
    #cmd-popup { scroll-behavior: auto; }
  }

  @media (max-width: 768px) {
    #status-bar { height: 24px; font-size: 10px; }
    #mode-indicator { min-width: 74px; font-size: 9px; padding: 0 8px; }
    .sb-arrow { border-top-width: 12px; border-bottom-width: 12px; }
    #status-file { max-width: 110px; }
    #status-buf, #status-enc, #status-lines, #status-sel { display: none !important; }
  }
