/* Commands page: a look of its own. A module sidebar and one list panel,
   flat and quiet, instead of the glass buttons the homepage and dashboard use.
   Loaded last on commands.html only. Icons are Solar (assets/solar.js). */

:root {
  --cx-accent: #cfcfd4;
  --cx-accent-soft: rgba(207, 207, 212, .12);
  --cx-panel: rgba(15, 15, 16, .78);
  --cx-hair: rgba(255, 255, 255, .07);
}

.cmd-hero { padding: 150px 0 6px; }
.cmd-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 30px; margin-top: 30px; align-items: start; }

/* ------------------------------------------------------------ module sidebar */
.cmd-side { position: sticky; top: 104px; }
.cmd-side-title { font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--dim); padding: 0 12px 10px; }
.mods { display: grid; gap: 2px; }
.mod-btn {
  appearance: none; border: 0; background: none; font: inherit; text-align: left; cursor: pointer;
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 8px 12px 8px 8px; border-radius: 12px;
  color: var(--muted); font-size: 15px; font-weight: 600;
  transition: background-color .15s, color .15s;
}
.mod-btn .mi { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--cx-accent-soft); color: var(--cx-accent); transition: background-color .15s, color .15s; }
.mod-btn .mi .si { width: 19px; height: 19px; }
.mod-btn .mc { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--dim); font-variant-numeric: tabular-nums; }
.mod-btn:hover { background: rgba(255, 255, 255, .035); color: #fff; }
.mod-btn.on { color: #fff; background: linear-gradient(90deg, rgba(207, 207, 212, .15), rgba(207, 207, 212, 0) 85%); }
.mod-btn.on::before { content: ''; position: absolute; left: -10px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--cx-accent); }
.mod-btn.on .mi { background: var(--cx-accent); color: #1b1b1e; }
.mod-btn.on .mc { color: var(--cx-accent); }
.mod-btn:focus-visible { outline: 2px solid var(--cx-accent); outline-offset: 2px; }

/* ------------------------------------------------------------ search */
.cmd-main .toolbar { position: sticky; top: 84px; z-index: 20; padding: 0 0 12px; margin: 0; }
.cmd-main .search.cmd-search {
  display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 14px 0 18px; border-radius: 16px;
  background: #101011 !important; border: 1px solid var(--cx-hair) !important; box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .8);
  transition: border-color .15s, box-shadow .15s;
}
.cmd-search:focus-within { border-color: rgba(207, 207, 212, .5) !important; box-shadow: 0 0 0 4px rgba(207, 207, 212, .12), 0 18px 40px -24px rgba(0, 0, 0, .8); }
.cmd-search [data-solar] { color: var(--cx-accent); font-size: 20px; }
.cmd-search input { font-size: 16px; color-scheme: dark; }
.cmd-meta { font-size: 13px; color: var(--dim); padding: 10px 4px 0; min-height: 1.5em; }

/* ------------------------------------------------------------ command list: one panel, hairline rows */
.cmd-rows { border: 1px solid var(--cx-hair); border-radius: 18px; background: var(--cx-panel); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); overflow: hidden; }
.row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; padding: 16px 16px 16px 18px; border-top: 1px solid var(--cx-hair); animation: row-in .35s ease both; transition: background-color .15s; }
.row:first-child { border-top: 0; }
.row:hover { background: rgba(255, 255, 255, .022); }
.row-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--cx-accent-soft); color: var(--cx-accent); }
.row-ic .si { width: 22px; height: 22px; }
.row-top { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; min-height: 24px; }
.row .name { font-family: var(--mono); font-size: 15px; font-weight: 600; color: #fff; }
.row-mod { font-size: 12px; font-weight: 600; color: var(--dim); }
.row .perm { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: #e9c77f; background: rgba(233, 199, 127, .08); border: 1px solid rgba(233, 199, 127, .2); padding: 2px 9px 2px 7px; border-radius: 999px; }
.row .perm .si { width: 13px; height: 13px; }
.row p { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.row .usage { margin-top: 9px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 12px; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.row .usage code { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: #e8e8ea; background: rgba(255, 255, 255, .05); padding: 2px 8px; border-radius: 7px; overflow-wrap: anywhere; }
.row .alias { margin-top: 7px; font-size: 12.5px; color: var(--dim); }
.row .alias code { font-family: var(--mono); color: #c9c9ce; }
.copy {
  appearance: none; border: 0; background: none; cursor: pointer; align-self: start;
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--dim);
  transition: color .15s, background-color .15s;
}
.copy .si { width: 18px; height: 18px; }
.copy:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.copy:focus-visible { outline: 2px solid var(--cx-accent); outline-offset: 1px; }
.copy.done { color: #7fe0a6; }
.cmd-rows .empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 64px 20px; color: var(--dim); }
.cmd-rows .empty .si { width: 34px; height: 34px; color: var(--cx-accent); }
@keyframes row-in { from { opacity: 0; transform: translateY(6px); } }

.cmd-main .more { margin-top: 18px; }
.more-link {
  appearance: none; border: 0; background: none; font: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px;
  color: var(--cx-accent); font-weight: 700; font-size: 15px; transition: background-color .15s, color .15s;
}
.more-link:hover { color: #fff; background: var(--cx-accent-soft); }
.more-link [data-solar] { font-size: 18px; }

/* ------------------------------------------------------------ phones and tablets: the sidebar becomes a swipeable strip */
@media (max-width: 900px) {
  .cmd-hero { padding-top: 130px; }
  /* minmax(0, …) and min-width: 0 let the strip scroll inside itself instead of widening the page. */
  .cmd-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 20px; }
  .cmd-side { position: static; min-width: 0; }
  .cmd-side-title { display: none; }
  .mods {
    display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
    margin: 0 -16px; padding: 2px 16px 6px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 24px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 24px), transparent);
  }
  .mods::-webkit-scrollbar { display: none; }
  .mod-btn { width: auto; flex: none; padding: 6px 12px 6px 6px; border-radius: 999px; background: rgba(255, 255, 255, .03); font-size: 14px; gap: 8px; }
  .mod-btn .mi { width: 28px; height: 28px; border-radius: 999px; }
  .mod-btn .mi .si { width: 16px; height: 16px; }
  .mod-btn .mc { margin-left: 2px; }
  .mod-btn.on::before { display: none; }
  .mod-btn.on { background: rgba(207, 207, 212, .16); }
  .cmd-main .toolbar { top: 76px; }
  .row { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; padding: 14px 10px 14px 14px; }
  .row-ic { width: 34px; height: 34px; border-radius: 10px; }
  .row-ic .si { width: 19px; height: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .row { animation: none; }
}
