:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #617083;
  --line: #d8dee7;
  --blue: #0b5cad;
  --blue-strong: #084a8d;
  --green: #147d64;
  --amber: #9a5b08;
  --red: #b42318;
  --shadow: 0 12px 30px rgba(17, 24, 39, 0.08);
  /* Tinggi kontrol menyusut sendiri di jendela pendek — satu tempat untuk
     mengatur, tanpa breakpoint yang menebak ukuran jendela. */
  --control: clamp(34px, 4.4dvh, 40px);
  --row: clamp(32px, 4dvh, 38px);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(12px, 2.4dvh, 28px) 0 clamp(20px, 4dvh, 44px);
}

.topbar,
.toolbar,
.list-meta,
.card-header,
.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
}

/* Jam acuan salam di topbar. Isinya ditulis ulang oleh satu timer, jadi
   biayanya cuma dua text node - bukan render ulang pin bar. */
.clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  margin-right: 6px;
  line-height: 1.25;
  white-space: nowrap;
}

.clock-time {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.clock-date {
  font-size: 0.74rem;
  font-weight: 600;
  color: #4a5768;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(10px, 2dvh, 22px);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: clamp(1.25rem, 2.4vw, 2.1rem);
}

h2 {
  font-size: clamp(1rem, 1.6vw, 1.35rem);
}

h2 {
  font-size: 1.1rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: calc(var(--control) - 4px);
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.status-badge.server {
  border-color: rgba(20, 125, 100, 0.32);
  color: var(--green);
}

.status-badge.local {
  border-color: rgba(154, 91, 8, 0.34);
  color: var(--amber);
}

.button,
.icon-button,
.command-button {
  border: 0;
  border-radius: 8px;
  min-height: var(--control);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-weight: 700;
}

.button .fa-solid,
.button .fa-regular,
.icon-button .fa-solid,
.icon-button .fa-regular,
.command-button .fa-solid,
.command-button .fa-regular {
  flex: 0 0 auto;
  font-size: 0.95rem;
  line-height: 1;
}

.button-primary {
  background: var(--blue);
  color: #fff;
}

.button-primary:hover {
  background: var(--blue-strong);
}

.button-secondary {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}

.button-secondary:hover {
  border-color: #a9b4c2;
}

.button-danger {
  color: var(--red);
}

.button-delete {
  background: var(--red);
  color: #fff;
}

.button-delete:hover {
  background: #8f1c13;
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.toolbar {
  gap: 8px;
  margin-bottom: clamp(8px, 1.4dvh, 14px);
  flex-wrap: wrap;
}

.input-wrap {
  display: block;
}

.search-wrap {
  flex: 1 1 360px;
}

.token-wrap {
  flex: 0 1 260px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: 0;
}

.command-field {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.command-field:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 92, 173, 0.14);
}

.command-prefix {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  border-right: 1px solid var(--line);
  background: #f1f4f8;
  color: var(--blue);
  font-weight: 800;
}

.command-field input {
  border: 0;
  border-radius: 0;
}

.command-field input:focus {
  box-shadow: none;
}

/* Checkbox dan radio tidak boleh ikut tinggi kolom teks. */
input:not([type="checkbox"], [type="radio"]) {
  min-height: var(--control);
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
}

.CodeMirror {
  height: clamp(180px, 32dvh, 280px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.45;
}

.CodeMirror * {
  font-weight: 400;
}

.CodeMirror .cm-rich-bold {
  font-weight: 700;
}

.CodeMirror .cm-rich-italic {
  font-style: italic !important;
  font-synthesis: style;
}

.CodeMirror .cm-rich-underline {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.CodeMirror-focused {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 92, 173, 0.14);
}

.CodeMirror-gutters {
  border-right: 1px solid var(--line);
  background: #f1f4f8;
}

.CodeMirror-linenumber {
  color: #738195;
}

.CodeMirror pre.CodeMirror-line,
.CodeMirror pre.CodeMirror-line-like {
  padding: 0 10px;
}

.field:has(#noteInput) .CodeMirror {
  height: clamp(90px, 17dvh, 160px);
}

input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 92, 173, 0.14);
}

.pin-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: clamp(6px, 1.2dvh, 10px) 0;
  background: var(--bg);
  box-shadow: inset 0 -1px 0 var(--line);
}

.pin-list {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.pin-settings {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: var(--control);
  min-height: var(--control);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

.pin-settings:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.pin-group {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}

.pin-label {
  font-family: Consolas, "Courier New", monospace;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pin-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 auto;
  justify-content: center;
  min-height: var(--control);
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

.pin-button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.pin-group .pin-button {
  border-radius: 8px 0 0 8px;
}

.pin-warn-icon {
  color: var(--amber);
}

/* Salam yang dipilih manual dan tidak cocok dengan jam sekarang. */
.pin-button.is-offslot {
  border-color: var(--amber);
  color: var(--amber);
}

.pin-offslot-icon {
  color: var(--amber);
  font-size: 0.78rem;
}

.pin-now {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: #eaf2fb;
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 700;
}

.pin-menu {
  position: relative;
  flex: 0 0 auto;
}

.pin-menu > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-height: var(--control);
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: var(--panel);
  color: var(--muted);
  list-style: none;
  cursor: pointer;
}

.pin-menu > summary::-webkit-details-marker {
  display: none;
}

.pin-menu[open] > summary {
  color: var(--blue);
  border-color: var(--blue);
}

.pin-menu-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 10;
  display: grid;
  gap: 2px;
  min-width: 160px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.pin-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.pin-menu-item:hover {
  background: #eef3f9;
  color: var(--blue);
}

.pin-dialog {
  width: min(540px, calc(100% - 20px));
  max-height: calc(100dvh - 24px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.pin-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.pin-form {
  max-height: calc(100dvh - 24px);
  padding: clamp(14px, 2.2dvh, 18px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.pin-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.pin-group-list {
  display: grid;
  gap: 7px;
}

.pin-group-row {
  display: grid;
  gap: 6px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.pin-group-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.pin-group-name {
  font-weight: 700;
  font-size: 0.83rem;
  white-space: nowrap;
}

.pin-auto {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: auto;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
  cursor: pointer;
}

.pin-auto input {
  width: 14px;
  height: 14px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--blue);
}

.pin-group-head .icon-button {
  width: 26px;
  min-height: 26px;
  border-radius: 6px;
  font-size: 0.78rem;
}

.pin-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.pin-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  overflow: hidden;
}

.pin-chip.is-primary {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.pin-chip.is-missing .pin-chip-name {
  color: var(--red);
  text-decoration: line-through;
}

.pin-chip-name {
  padding: 4px 3px 4px 9px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.78rem;
}

.pin-chip.is-primary .pin-chip-name {
  color: var(--blue);
  font-weight: 700;
}

.pin-chip-warn,
.pin-chip-remove {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border: 0;
  background: transparent;
  color: #c3cbd6;
  font-size: 0.7rem;
}

.pin-chip-warn.is-on {
  color: var(--amber);
}

.pin-chip-warn:hover {
  color: var(--amber);
}

.pin-chip-remove {
  padding-right: 8px;
}

.pin-chip-remove:hover {
  color: var(--red);
}

.pin-picker {
  justify-self: start;
  max-width: 100%;
  padding: 3px 6px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.78rem;
}

.pin-empty {
  color: var(--muted);
  font-size: 0.78rem;
}

.pin-add-group {
  margin-top: 8px;
  min-height: 30px;
  padding: 0 11px;
  font-size: 0.82rem;
}

.list-meta {
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.86rem;
  margin: clamp(6px, 1.1dvh, 10px) 0 clamp(7px, 1.2dvh, 12px);
}

.density-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.87rem;
}

.density-toggle:hover {
  border-color: var(--blue);
  color: var(--blue);
}

/* Jumlah kolom dihitung browser dari lebar yang tersedia — tidak ada
   breakpoint yang mengasumsikan ukuran jendela tertentu. */
.canned-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
  align-items: start;
}

.canned-list.is-compact {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.canned-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.02);
  overflow: hidden;
}

.card-header {
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.command-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 800;
  text-align: left;
  overflow-wrap: anywhere;
}

.command-button:hover {
  text-decoration: underline;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control);
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.icon-button:hover {
  border-color: #a9b4c2;
}

.icon-button.danger {
  color: var(--red);
}

.editor-preview {
  margin: 0;
  overflow: hidden;
  background: #fff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.91rem;
  font-weight: 400;
  line-height: 1.45;
}

.canned-content {
  padding: 10px 0;
}

.editor-preview-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
}

.editor-preview-number {
  align-self: stretch;
  padding: 0 10px 0 6px;
  border-right: 1px solid var(--line);
  background: #f1f4f8;
  color: #738195;
  text-align: right;
  user-select: none;
}

.editor-preview-text {
  min-width: 0;
  padding: 0 14px 0 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.canned-row {
  --row-bg: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--row-bg);
  overflow: hidden;
}

.canned-row:hover {
  --row-bg: #eef3f9;
}

.canned-row.is-expanded {
  grid-column: 1 / -1;
  border-color: var(--blue);
}

.row-main {
  position: relative;
  display: flex;
  align-items: center;
}

.row-copy {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: var(--row);
  padding: 0 11px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
}

.row-copy .fa-copy {
  flex: 0 0 auto;
  color: var(--muted);
}

.row-command {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tombol menumpang di ujung baris supaya nama command mendapat lebar penuh
   selama kursor tidak lewat. */
.row-tools {
  position: absolute;
  inset: 0 0 0 auto;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 6px 0 24px;
  background: linear-gradient(to right, transparent, var(--row-bg) 24%);
  opacity: 0;
  pointer-events: none;
}

.canned-row:hover .row-tools,
.canned-row:focus-within .row-tools,
.canned-row.is-expanded .row-tools {
  opacity: 1;
  pointer-events: auto;
}

.row-tools .icon-button {
  width: calc(var(--row) - 6px);
  min-height: calc(var(--row) - 6px);
  border-radius: 6px;
}

.row-body {
  border-top: 1px solid var(--line);
}

/* Layar sentuh tidak punya hover — tombolnya ditampilkan permanen. */
@media (pointer: coarse) {
  .row-tools {
    position: static;
    padding: 0 6px;
    background: none;
    opacity: 1;
    pointer-events: auto;
  }
}

.private-note {
  border-top: 1px solid var(--line);
  padding: 0 14px 14px;
}

.private-note summary {
  width: max-content;
  margin: 10px 0;
  color: var(--amber);
  font-weight: 700;
  cursor: pointer;
}

.note-body {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #3d4754;
}

.empty-state {
  border: 1px dashed #a9b4c2;
  border-radius: 8px;
  padding: 28px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.editor-dialog {
  width: min(760px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.editor-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.confirm-dialog {
  width: min(440px, calc(100% - 24px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.confirm-dialog::backdrop {
  background: rgba(15, 23, 42, 0.52);
}

.confirm-form {
  display: grid;
  grid-template-columns: calc(var(--control) + 4px) minmax(0, 1fr);
  gap: 14px;
  padding: 22px;
}

.confirm-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--control) + 4px);
  height: calc(var(--control) + 4px);
  border-radius: 50%;
  background: #fee4e2;
  color: var(--red);
  font-size: 1rem;
}

.confirm-content h2 {
  margin: 2px 0 8px;
}

.confirm-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.confirm-content strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.editor-form {
  max-height: calc(100dvh - 24px);
  padding: clamp(14px, 2.2dvh, 18px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dialog-header {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: clamp(9px, 1.6dvh, 16px);
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: clamp(10px, 1.8dvh, 14px);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.field input,
.field textarea {
  color: var(--text);
  font-weight: 400;
}

.dialog-actions {
  justify-content: space-between;
  gap: 10px;
  margin-top: clamp(12px, 2.2dvh, 18px);
  flex-wrap: wrap;
}

.format-toolbar,
.save-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.format-toolbar .icon-button {
  width: 38px;
  min-height: 38px;
  background: var(--surface-soft);
}

.format-toolbar .icon-button:hover,
.format-toolbar .icon-button:focus-visible {
  border-color: var(--blue);
  color: var(--blue);
}

.toast {
  position: fixed;
  top: 22px;
  left: 50%;
  z-index: 20;
  min-width: 230px;
  max-width: calc(100% - 32px);
  transform: translate(-50%, -12px);
  border-radius: 8px;
  padding: 13px 18px;
  background: #17202a;
  color: #fff;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-warn {
  background: #7a3b06;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .search-wrap {
    flex-basis: 100%;
  }

  .token-wrap {
    flex: 1 1 220px;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .topbar {
    margin-bottom: 16px;
  }

  .toolbar {
    align-items: stretch;
  }

  .search-wrap {
    flex-basis: 100%;
  }

  .toolbar > .button {
    margin-left: auto;
  }

  .card-header {
    align-items: center;
    padding: 10px;
  }

  .card-actions {
    gap: 6px;
  }

  .editor-preview-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .editor-preview-number {
    padding-right: 7px;
  }

  .editor-preview-text {
    padding-right: 10px;
    padding-left: 8px;
  }

  .editor-form {
    padding: 14px;
  }

  .confirm-form {
    padding: 18px;
  }
}

@media (max-width: 480px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  /* Jam jadi item paling kiri di baris aksi, jadi ratanya ikut ke kiri. */
  .clock {
    align-items: flex-start;
    margin-right: 0;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .toolbar > .button {
    width: 100%;
    margin-left: 0;
  }

  .dialog-actions {
    align-items: flex-end;
  }

  .save-actions {
    margin-left: auto;
  }
}

@media (max-width: 360px) {
  .app-shell {
    width: min(100% - 16px, 1180px);
  }

  .card-header {
    gap: 8px;
  }

  .dialog-actions {
    align-items: stretch;
  }

  .save-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .confirm-form {
    gap: 12px;
    padding: 16px;
  }
}

/* Panel copy-paste: kendali tetap di atas, satu kategori, baris padat. */
:root { --control: 28px; --row: 28px; }
html, body { height: 100%; overflow: hidden; }
.app-shell { width: calc(100% - 16px); max-width: none; height: 100dvh; min-height: 0; padding: 6px 0; display: flex; flex-direction: column; gap: 5px; }
.app-shell > * { flex-shrink: 0; }
.topbar { flex-direction: row; align-items: center; gap: 6px; margin: 0; }
.eyebrow, .clock-date { display: none; }
h1 { font-size: 14px; line-height: 1.2; }
.topbar-actions { width: auto; flex-wrap: nowrap; justify-content: flex-end; gap: 6px; }
.clock { align-items: flex-end; margin: 0; }
.clock-time { font-size: 11px; }
.status-badge { min-height: 22px; padding: 0 6px; font-size: 10px; }
#adminToggle { min-height: 24px; padding: 0 7px; gap: 4px; font-size: 11px; }
.toolbar { flex-wrap: nowrap; gap: 5px; margin: 0; }
.search-wrap { min-width: 0; flex: 1 1 0 !important; }
#searchInput { height: 28px; min-height: 28px; padding: 0 8px; font-size: 12px; }
.category-picker { flex: 0 1 235px; min-width: 0; }
.category-picker select { width: 100%; min-width: 0; height: 28px; border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; background: var(--panel); color: var(--text); font-size: 12px; }
.admin-controls { display: flex; align-items: center; gap: 5px; padding: 5px; background: #eaf0f6; border-radius: 6px; }
.admin-controls[hidden] { display: none; }
.admin-controls .token-wrap { flex: 1 1 0; min-width: 0; }
.admin-controls input { min-height: 28px; height: 28px; font-size: 12px; }
.admin-controls .button { min-height: 28px; padding: 0 8px; font-size: 11px; }
.pin-bar { margin: 0; padding: 0 0 4px; gap: 4px; }
.pin-list { flex-wrap: nowrap; gap: 4px; }
.pin-group { min-width: 0; }
.pin-title-stack { display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; }
.pin-title-stack .pin-label { overflow: hidden; text-overflow: ellipsis; font: 600 11px Arial, sans-serif; white-space: nowrap; }
.pin-command { display: none; font: 10px Consolas, monospace; color: var(--muted); }
.pin-group:first-child .pin-command { display: inline; }
.pin-group .pin-button { min-width: 0; min-height: 27px; padding: 0 5px; gap: 3px; }
.pin-group .pin-caret { min-height: 27px; width: 21px; }
.pin-settings { min-height: 27px; width: 27px; font-size: 11px; }
.pin-choice { display: grid; gap: 3px; text-align: left; white-space: normal; }
.pin-choice small { color: var(--muted); font-size: 10px; }
.pin-menu-list { min-width: 230px; max-width: min(300px, calc(100vw - 24px)); max-height: max(90px, calc(100dvh - 130px)); overflow-y: auto; }
.pin-group:nth-last-child(-n+2) .pin-menu-list { left: auto; right: 0; }
.pin-menu-item { padding: 6px 9px; font-size: 12px; }
.list-meta { margin: 0; gap: 5px; min-height: 20px; font-size: 10px; }
.copy-hint { margin-left: auto; color: var(--muted); }
.density-toggle { min-height: 20px; padding: 1px 6px; font-size: 10px; }
.canned-list, .canned-list.is-compact { flex: 1 1 0; min-height: 0; overflow-y: auto; overflow-x: hidden; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); grid-auto-rows: max-content; align-content: start; align-items: start; gap: 4px; padding: 0 2px 2px 0; scrollbar-gutter: stable; }
.canned-list:not(.is-compact) { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.canned-list.is-grouped { display: block; }
.canned-groups-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 8px; align-items: start; }
.canned-list:not(.is-compact) .canned-groups-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.canned-list.is-compact .canned-groups-grid { grid-auto-rows: 1px; grid-auto-flow: row dense; row-gap: 0; }
.canned-list.is-compact .canned-group { padding: 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.canned-list.is-compact .canned-group-heading { justify-content: center; color: var(--text); padding-bottom: 5px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.workflow-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.workflow-tab { min-height: 24px; padding: 2px 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--text); font-size: 11px; font-weight: 600; }
.workflow-tab[aria-pressed="true"] { border-color: var(--blue); background: var(--blue); color: #fff; }
.workflow-tab:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.canned-group { width: 100%; min-width: 0; margin: 0; }
.canned-group-heading { display: flex; align-items: center; gap: 5px; margin: 0 0 3px; color: var(--muted); font-size: 11px; line-height: 16px; font-weight: 600; }
.canned-group-heading span { font-weight: 400; font-size: 10px; }
.canned-group-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; align-items: start; }
.canned-list:not(.is-compact) .canned-group-items { grid-template-columns: minmax(0, 1fr); }
.canned-row { border-radius: 5px; }
.row-copy { min-height: 28px; padding: 0 6px; gap: 5px; font-size: 12px; }
.canned-title-stack { display: block; min-width: 0; text-align: left; }
.canned-title { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-copy .has-description { display: flex; align-items: baseline; gap: 6px; flex: 1; }
.row-copy .has-description .canned-title { flex: 0 0 auto; max-width: 65%; }
.canned-description { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; font-weight: 400; }
.canned-description-full { margin: 8px 12px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
#descriptionHelp { color: var(--muted); font-size: 11px; }
.canned-command { display: none; }
.canned-card .canned-title { white-space: normal; }
.canned-card .canned-command { display: block; color: var(--muted); font: 10px Consolas, monospace; margin-top: 3px; }
.internal-badge { display: inline; color: #815800; background: #fff3d8; padding: 1px 3px; border-radius: 3px; font: 600 9px Arial, sans-serif; }
.row-tools { padding: 0 2px 0 12px; gap: 1px; }
.row-tools .icon-button { width: 22px; min-height: 22px; font-size: 10px; }
.pin-title-field { min-width: 0; flex: 1; }
.pin-title-field input { width: 100%; min-width: 0; padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; font: 600 12px Arial, sans-serif; }
.empty-state { margin: 0; padding: 10px; font-size: 12px; }
@media (max-width: 600px) {
 .pin-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
 .pin-settings { align-self: flex-start; }
 .canned-list.is-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .canned-list.is-compact .canned-group-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .category-picker { flex-basis: 145px; }
 .pin-group .pin-caret { width: 17px; }
 .pin-group .pin-button { padding: 0 3px; }
 .pin-title-stack .pin-label { font-size: 10px; }
 .pin-group:first-child .pin-command { display: none; }
 .copy-hint { display: none; }
 .list-meta { justify-content: space-between; }
 .pin-group-head { flex-wrap: wrap; }
 .pin-title-field { flex-basis: 100%; }
}
@media (max-width: 380px) {
 .clock-time { font-size: 10px; }
 .category-picker { flex-basis: 125px; }
 .status-badge { display: none; }
}

/* Critical compact controls do not depend on downloading an icon font. */
#adminToggle i, #densityIcon { display: none; }
.row-copy > .fa-copy { position: relative; width: 9px; height: 10px; margin: 0 2px; border: 1px solid currentColor; border-radius: 1px; font-size: 0; flex: 0 0 9px; }
.row-copy > .fa-copy::before { content: ""; position: absolute; top: 2px; left: 2px; width: 7px; height: 8px; border: 1px solid currentColor; border-radius: 1px; background: var(--panel); }
.pin-caret i { display: inline-block; width: 6px; height: 6px; margin-top: -3px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); font-size: 0; }
.pin-caret i::before { content: none; }
.pin-settings i { display: inline-block; width: 11px; height: 1px; background: currentColor; box-shadow: 0 -4px currentColor, 0 4px currentColor; font-size: 0; }
.pin-settings i::before { content: none; }
