.clack-fm {
  --fm-row-height: 34px;
  display: flex; min-height: 0; flex: 1; color: var(--control-text);
  background: var(--paper); font-family: 'IBM Plex Mono', monospace;
}
.clack-fm-modal {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center;
  justify-content: center; padding: 3vw; background: var(--overlay);
}
.clack-fm-modal[hidden] { display: none; }
.clack-fm-window {
  width: min(980px, 96vw); height: min(680px, 92vh); min-height: 420px;
  display: flex; flex-direction: column; overflow: hidden; background: var(--paper);
  border: 2px solid var(--window-border); border-radius: 9px;
  box-shadow: var(--shadow-distance) var(--shadow-distance) 0 color-mix(in srgb, var(--shadow) var(--shadow-alpha), transparent);
}
.clack-fm-standalone, .clack-fm-standalone .clack-fm-window { width: 100%; height: 100%; }
.clack-fm-standalone .clack-fm-window { border: 0; border-radius: 0; box-shadow: none; }
.clack-fm-titlebar {
  flex: none; display: flex; align-items: center; gap: 9px; min-height: 36px;
  padding: 7px 10px 7px 14px; background: var(--titlebar); color: var(--menu-text);
}
.clack-fm-title { font-size: 12.5px; font-weight: 600; }
.clack-fm-titlebar .clack-fm-close {
  all: unset; margin-left: auto; cursor: pointer; padding: 2px 6px; font-size: 18px;
}
.clack-fm-toolbar {
  flex: none; display: flex; align-items: center; gap: 7px; padding: 8px 10px;
  border-bottom: 1px solid var(--paper-line); background: var(--paper-deep);
}
.clack-fm-tool {
  all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; height: 30px; min-width: 30px;
  padding: 0 9px; border: 1px solid var(--ink); border-radius: 5px; background: var(--paper);
}
.clack-fm-tool:disabled { opacity: .4; cursor: default; }
.clack-fm-tool:not(:disabled):hover { background: var(--ink); color: var(--menu-text); }
.clack-fm-path {
  flex: 1; min-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px solid var(--ink); border-radius: 5px; background: var(--paper); padding: 6px 10px;
  font-size: 11.5px;
}
.clack-fm-search { width: min(230px, 30%); }
.clack-fm-search[type="text"] {
  height: 30px; min-width: 100px; background: var(--paper); font-size: 11.5px;
}
.clack-fm-body { display: grid; grid-template-columns: 190px minmax(300px, 1fr) 230px; min-height: 0; flex: 1; }
.clack-fm-drives { padding: 10px 7px; background: var(--paper-deep); border-right: 1px solid var(--paper-line); }
.clack-fm-drive {
  all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center;
  gap: 9px; width: 100%; padding: 9px 10px; border-radius: 5px; font-size: 12px;
}
.clack-fm-drive:hover, .clack-fm-drive.active { background: var(--ink); color: var(--menu-text); }
.clack-fm-drive small { display: block; opacity: .7; font-size: 9.5px; margin-top: 2px; }
.clack-fm-list-wrap { min-width: 0; min-height: 0; overflow: auto; }
.clack-fm-head, .clack-fm-row {
  display: grid; grid-template-columns: minmax(180px, 1fr) 92px 74px; align-items: center;
}
.clack-fm-head {
  position: sticky; top: 0; z-index: 1; min-height: 28px; padding: 0 10px;
  border-bottom: 1px solid var(--paper-line); background: var(--paper-deep);
  color: var(--sage); font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
}
.clack-fm-row {
  width: 100%; min-height: var(--fm-row-height); padding: 3px 10px; border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--paper-line) 65%, transparent);
  background: transparent; color: var(--control-text); text-align: left; font: inherit;
  font-size: 11.5px; cursor: pointer;
}
.clack-fm-row:hover, .clack-fm-row.selected { background: var(--ink); color: var(--menu-text); }
.clack-fm-row.incompatible { color: var(--disabled-text); }
.clack-fm-name { display: flex; min-width: 0; gap: 8px; align-items: center; }
.clack-fm-name span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.clack-fm-kind, .clack-fm-size { font-size: 10px; opacity: .7; }
.clack-fm-empty { padding: 28px 18px; color: var(--sage); font-size: 11.5px; line-height: 1.7; }
.clack-fm-preview {
  min-width: 0; overflow: auto; padding: 14px; border-left: 1px solid var(--paper-line);
  background: color-mix(in srgb, var(--paper-deep) 45%, var(--paper));
}
.clack-fm-preview-box {
  display: grid; place-items: center; min-height: 150px; max-height: 260px; overflow: hidden;
  margin-bottom: 13px; border: 1px solid var(--paper-line); background: var(--paper-deep);
}
.clack-fm-preview-box img, .clack-fm-preview-box video { max-width: 100%; max-height: 258px; }
.clack-fm-preview-box audio { width: 90%; }
.clack-fm-preview-icon { font-size: 52px; color: var(--leaf-deep); }
.clack-fm-preview h3 { overflow-wrap: anywhere; font-size: 12px; margin-bottom: 8px; }
.clack-fm-meta { overflow-wrap: anywhere; font-size: 10px; color: var(--sage); line-height: 1.7; }
.clack-fm-footer {
  flex: none; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 10px;
  border-top: 1px solid var(--paper-line); background: var(--paper-deep);
}
.clack-fm-status { flex: 1; min-width: 0; color: var(--sage); font-size: 10.5px; }
.clack-fm-action { min-width: 74px; text-align: center; }
.clack-fm-openwith-row {
  flex: none; display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; color: var(--sage);
}
.clack-fm-openwith-row[hidden] { display: none; }
.clack-fm-openwith {
  max-width: 170px; font-family: inherit; font-size: 10.5px; padding: 4px 6px;
  border: 1px solid var(--ink); border-radius: 6px;
  background: var(--paper); color: var(--control-text);
}
@media (max-width: 760px) {
  .clack-fm-body { grid-template-columns: 140px minmax(240px, 1fr); }
  .clack-fm-preview { display: none; }
  .clack-fm-search { width: 36%; }
}
@media (max-width: 520px) {
  .clack-fm-modal { padding: 0; }
  .clack-fm-window { width: 100%; height: 100%; max-height: none; border-radius: 0; }
  .clack-fm-body { grid-template-columns: 1fr; }
  .clack-fm-drives { display: flex; border-right: 0; border-bottom: 1px solid var(--paper-line); }
  .clack-fm-drive { flex: 1; }
  .clack-fm-head, .clack-fm-row { grid-template-columns: 1fr 72px; }
  .clack-fm-size { display: none; }
  /* the footer runs out of room, so the menu keeps the select and drops the words */
  .clack-fm-openwith-row { font-size: 0; gap: 0; }
  .clack-fm-openwith { font-size: 10.5px; max-width: 118px; }
}
