/* Folio specialised surfaces. Deliberately scoped to module boards. */
.desk-panel-tools { display: flex; align-items: center; gap: 4px; flex-shrink: 0; margin-left: auto; }
.desk-panel-button { border: 1px solid #d7dfcf; border-radius: 5px; background: #fffefa; color: #35533f; padding: 4px 7px; min-height: 27px; font: 11px 'Segoe UI',sans-serif; white-space: nowrap; cursor: pointer; }
.desk-panel-button:hover { background: #edf2e7; border-color: #9ab098; }
.desk-panel-button.is-editing { background: #244f41; color: white; border-color: #244f41; }
.desk-panel-button:focus-visible { outline: 2px solid #387369; outline-offset: 2px; }
.desk-row-tools { display: flex; align-items: center; gap: 3px; flex: 0 0 auto; }
.desk-row-tools .icon-button { width: 25px; min-width: 25px; height: 25px; min-height: 25px; color: #974c3d; }
.desk-edit-link { justify-content: space-between; }
.desk-edit-link .launch-copy { flex: 1; min-width: 0; }
.desk-edit-link .desk-row-tools { flex-direction: row; }
.module-header .module-controls[hidden] { display: none; }
.module-board[data-columns="2"] {
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
}
.module-board[data-columns="2"].is-four-module-page {
  grid-template-rows: minmax(0, .85fr) minmax(0, 1.15fr);
}
.module-panel {
  --module-ink: #35533f;
  --module-tone: #eef3e8;
  --module-line: #dfe6d6;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-color: #d9e1d0;
  border-radius: 9px;
  box-shadow: 0 1px 3px #253e2305;
}
.module-keymap { --module-ink: #655c77; --module-tone: #f0edf5; --module-line: #e3dfeb; }
.module-reference { --module-ink: #526b75; --module-tone: #edf2f4; --module-line: #dce5e8; }
.module-prompt { --module-ink: #876248; --module-tone: #f6efe6; --module-line: #e9dece; }
.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 45px;
  padding: 10px 15px 8px;
  flex: 0 0 auto;
}
.module-label { display: flex; align-items: center; gap: 9px; min-width: 0; }
.module-label h2, .module-header h2 {
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #30452f;
  font: 400 22px/1.1 Georgia, "Times New Roman", serif;
  letter-spacing: -.45px;
}
.module-label .eyebrow { display: none; }
.module-header .panel-glyph, .module-header .module-glyph {
  display: grid;
  place-items: center;
  width: 25px;
  height: 27px;
  flex: 0 0 auto;
  border-radius: 4px;
  border: 1px solid var(--module-line);
  color: var(--module-ink);
  background: var(--module-tone);
  font: 18px/1 Georgia, serif;
}
.module-controls { display: flex; align-items: center; gap: 4px; min-width: 0; }
.module-controls .icon-button { width: 25px; min-width: 25px; height: 25px; min-height: 25px; }
.module-controls .badge, .module-kind {
  background: transparent;
  border: none;
  color: var(--module-ink);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.module-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 2px 15px 10px;
}
.module-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 29px;
  padding: 3px 15px;
  flex: 0 0 auto;
  border-top: 1px solid #e7ecdf;
  background: #fafbf6;
  color: #718164;
  font-size: 11px;
}
.module-footer > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module-footer .text-button, .module-more { min-height: 22px; padding: 2px 0; font-size: 11px; }
.module-more { background: none; border: 0; color: var(--module-ink); cursor: pointer; white-space: nowrap; }
.module-more:hover { text-decoration: underline; text-underline-offset: 3px; }
.module-panel .arrange-control { display: none; }
.is-arranging .module-panel { border-color: #95a984; box-shadow: 0 0 0 1px #c9d7bc; }
.is-arranging .module-panel .arrange-control { display: inline-flex; }
.is-arranging .module-header { background: #f1f5e9; border-bottom: 1px solid #dce6d0; }
.module-panel .empty-state { padding: 16px; }
.module-panel .empty-state h3 { font-size: 22px; }
.module-panel .module-hint { font-size: 11px; color: #6f805f; line-height: 1.45; }

/* Launchpad: destinations are buttons, not descriptions of destinations. */
.launch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  align-content: start;
  min-width: 0;
}
.launch-link {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 49px;
  padding: 9px 10px;
  border: 1px solid #dce5d2;
  border-radius: 5px;
  background: #f5f8ef;
  color: #3f5b32;
  text-decoration: none;
  transition: border-color .15s, background-color .15s;
}
.launch-link:hover { background: #eaf2e0; border-color: #a4b994; }
.launch-link > svg, .launch-link > .resource-icon { flex: 0 0 auto; width: 16px; height: 16px; color: #718c5c; }
.launch-link > .resource-icon { min-width: 16px; border: 0; background: none; margin: 0; }
.launch-link > span, .launch-link > div { min-width: 0; }
.launch-link strong, .launch-link .launch-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; line-height: 17px; }
.launch-link small, .launch-link .launch-host { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #7b8c6e; font-size: 11px; line-height: 15px; }
.launch-group + .launch-group { margin-top: 11px; }
.launch-group-label { margin: 0 0 6px; font-size: 11px; color: #78906a; }

/* Keymap: aligned actions and keycaps are the information. */
.keymap-table { width: 100%; min-width: 0; border-collapse: collapse; }
.keymap-row { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 34px; padding: 5px 0; border-bottom: 1px solid #ebe8ef; }
.keymap-row:last-child { border-bottom: 0; }
.keymap-name { min-width: 0; flex: 1 1 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #50495b; font-size: 12px; line-height: 18px; }
button.keymap-name { border: 0; padding: 0; text-align: left; background: none; cursor: pointer; }
.keymap-keys { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; flex: 0 1 auto; max-width: 52%; color: #72667e; white-space: nowrap; font-size: 11px; overflow: hidden; }
.keymap-keys kbd { background: #f6f3fa; border-color: #dcd5e6; color: #635372; padding: 2px 6px; font-size: 11px; line-height: 16px; border-radius: 4px; }
.keymap-row .resource-direct, .keymap-row .button { border-color: #e2dbea; background: #f7f4fa; color: #6b5d7c; min-height: 25px; min-width: 42px; padding: 4px 7px; font-size: 11px; }
.keymap-row .resource-direct:hover, .keymap-row .button:hover { background: #ece5f4; border-color: #c6b8d6; }
.keymap-row .icon-button { width: 24px; min-width: 24px; height: 25px; min-height: 25px; color: #80708e; }
.keymap-caption { color: #887b95; font-size: 11px; line-height: 1.4; margin-bottom: 5px; }

/* Reference: real values on a ruled sheet with a named preset above. */
.module-reference .module-body { display: flex; flex-direction: column; gap: 8px; }
.preset-select { width: 100%; min-width: 0; min-height: 30px; padding: 5px 8px; border: 1px solid #d6e0e4; border-radius: 4px; background: #f4f7f8; color: #506a75; font-size: 12px; }
.module-reference .field { gap: 4px; }
.module-reference .field-label { font-size: 11px; color: #617a84; }
.reference-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.reference-table tr { border-bottom: 1px solid #e3e9ec; }
.reference-table tr:last-child { border-bottom: 0; }
.reference-table th, .reference-table td { text-align: left; vertical-align: middle; padding: 7px 9px; line-height: 17px; overflow: hidden; text-overflow: ellipsis; }
.reference-table th { width: 34%; padding-left: 0; color: #70848c; font-size: 11px; font-weight: 500; }
.reference-table td { color: #354f5b; font-weight: 500; }
.reference-table td:last-child:has(button) { width: 47px; padding-right: 0; padding-left: 2px; text-align: right; }
.reference-table .reference-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.reference-table .resource-direct, .reference-table .button { min-height: 24px; min-width: 39px; padding: 3px 6px; font-size: 11px; background: #f3f7f8; border-color: #dce5e8; color: #536e7a; }
.reference-table .icon-button { width: 23px; min-width: 23px; height: 23px; min-height: 23px; }
.reference-toolbar { display: flex; align-items: center; gap: 8px; }
.reference-toolbar .preset-select { flex: 1; }

/* Prompt pad: small labelled fields and an honest, copy-ready preview. */
.prompt-pad { display: flex; flex-direction: column; height: 100%; min-height: 0; min-width: 0; gap: 8px; }
.prompt-select { width: 100%; min-height: 29px; padding: 5px 8px; border: 1px solid #e6dacb; border-radius: 4px; background: #fbf7f0; color: #745c43; font-size: 12px; }
.prompt-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 9px; min-width: 0; }
.prompt-fields .field, .prompt-pad > .field { gap: 3px; margin: 0; min-width: 0; }
.prompt-fields .field-label { color: #877057; font-size: 11px; line-height: 14px; }
.prompt-fields .input, .prompt-fields .select, .prompt-fields input, .prompt-fields select {
  min-height: 28px; height: 28px; padding: 4px 7px; border-color: #e5dbcd; background: #fffefa; font-size: 12px; line-height: 18px;
}
.prompt-fields textarea, .prompt-fields .textarea { min-height: 43px; max-height: 43px; resize: none; padding: 5px 7px; font-size: 12px; line-height: 17px; border-color: #e5dbcd; }
.prompt-fields .field.is-wide, .prompt-fields .field-wide { grid-column: 1 / -1; }
.prompt-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  flex: 1 1 auto;
  min-height: 32px;
  max-height: 79px;
  margin: 0;
  padding: 8px 10px;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  background: #f7f1e7;
  border-left: 2px solid #cab693;
  color: #79634a;
  font-size: 11px;
  line-height: 17px;
}
.prompt-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: 0 0 auto; margin-top: auto; }
.prompt-actions .button { min-height: 28px; padding: 5px 10px; font-size: 11px; }
.prompt-actions .text-button { min-height: 26px; padding: 3px 0; font-size: 11px; color: #8b6d4d; }
.prompt-status { min-width: 0; color: #8a785d; font-size: 11px; line-height: 15px; }
.prompt-status.is-ready { color: #587445; }
.prompt-pad .validation { margin: 0; padding: 5px 8px; font-size: 11px; line-height: 15px; }
.module-panel :focus-visible { outline-color: #718b5a; outline-offset: 2px; }
.module-item-select { display: block; min-width: 0; flex: 0 0 auto; }
.module-item-select > .field-label { display: none; }
.module-item-select > .select { width: 100%; min-width: 0; min-height: 29px; height: 29px; padding: 4px 7px; font-size: 12px; border-color: var(--module-line); background: #fffefa; color: var(--module-ink); }
.module-preset-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: 0 0 auto; min-width: 0; }
.preset-label { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; color: var(--module-ink); font-size: 11px; }
.preset-label > span { flex: 0 0 auto; }
.preset-label > .preset-select { flex: 1; width: 0; min-height: 27px; height: 27px; padding: 3px 7px; font-size: 11px; border-color: var(--module-line); background: var(--module-tone); }
.module-preset-bar > .text-button { min-height: 25px; padding: 4px 0; color: var(--module-ink); font-size: 11px; }
.module-reference .reference-table thead th { font-size: 11px; color: #7b8b91; padding-top: 4px; padding-bottom: 4px; }
.reference-table thead th:last-child { width: 45px; }
.reference-table thead th:nth-child(2) { width: auto; }
.reference-table tbody input { display: block; width: 100%; min-width: 0; padding: 2px 0; border: 1px solid transparent; border-radius: 2px; color: #395765; background: transparent; font-size: 12px; line-height: 18px; text-overflow: ellipsis; }
.reference-table tbody th input { color: #70838d; font-size: 11px; }
.reference-table tbody th, .reference-table tbody td { padding-top: 4px; padding-bottom: 4px; }
.reference-table tbody input:hover { border-bottom-color: #bdccd3; }
.reference-table tbody input:focus { background: #fffefa; border-color: #9eb2bd; outline: 2px solid #e1ebef; }
.reference-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex: 0 0 auto; min-height: 24px; }
.reference-actions .text-button { padding: 2px 0; min-height: 23px; color: #526f7c; font-size: 11px; }
.prompt-fields .prompt-field-wide { grid-column: 1 / -1; }
.prompt-fields .prompt-field-wide { order: 2; }
.prompt-fields:has(.prompt-field-wide) { flex: 1 1 auto; min-height: 0; grid-template-rows: auto minmax(0, 1fr); }
.prompt-fields .prompt-field-wide { min-height: 0; }
.module-panel .prompt-fields .field input, .module-panel .prompt-fields .field select { height: 28px; min-height: 28px; padding: 4px 7px; font-size: 12px; line-height: 18px; }
.module-panel .prompt-fields .field textarea { flex: 1 1 auto; min-height: 43px; height: auto; max-height: none; padding: 5px 7px; font-size: 12px; line-height: 17px; }
.module-prompt-status { font-size: 11px; line-height: 15px; color: #87704f; min-width: 0; }
.launch-copy { flex: 1; }
.launch-icon { display: grid; place-items: center; flex: 0 0 auto; color: #768d65; }
.launch-arrow { flex: 0 0 auto; color: #8ba078; font-size: 16px; line-height: 1; }
.module-panel .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; }
.module-selection { padding: 13px; border: 1px solid #dfe6d5; border-radius: 6px; margin-top: 16px; background: #f7f9f2; }
.module-selection-row { display: flex; align-items: center; gap: 4px; min-width: 0; padding: 6px 0; border-bottom: 1px solid #e4eadc; }
.module-selection-row:last-child { border-bottom: 0; }
.module-selection-row > span { flex: 1; min-width: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module-selection-row .icon-button { flex: 0 0 auto; }
.module-content-options { border: 1px solid #dfe6d5; border-radius: 6px; padding: 12px; margin: 16px 0 0; }
.module-content-options legend { padding: 0 6px; color: #6a805a; font-size: 11px; }
.module-content-options > label { display: flex; align-items: flex-start; gap: 7px; padding: 7px 0; font-size: 12px; line-height: 1.5; }
.module-content-options input { accent-color: var(--forest); margin-top: 3px; }
.module-content-options small { display: block; color: #7a8a6c; font-size: 11px; }
.reference-editor-rows { display: flex; flex-direction: column; gap: 10px; }
.reference-editor-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 27px; align-items: start; gap: 10px; padding: 12px; border: 1px solid #dce5e8; border-radius: 6px; background: #f5f8f9; }
.reference-editor-row .field { margin: 0; }
.reference-editor-row .textarea { min-height: 55px; max-height: 180px; }
.reference-editor-row > .icon-button { margin-top: 18px; }

@media (min-width: 1600px) {
  .module-header { padding-left: 19px; padding-right: 19px; min-height: 50px; }
  .module-body { padding: 4px 19px 15px; }
  .module-footer { padding-left: 19px; padding-right: 19px; min-height: 32px; }
  .launch-grid { gap: 10px; }
  .launch-link { min-height: 58px; padding: 11px 13px; }
  .launch-link strong, .launch-link .launch-label { font-size: 13px; }
  .keymap-row { min-height: 39px; }
  .keymap-name { font-size: 13px; }
  .reference-table th, .reference-table td { padding-top: 10px; padding-bottom: 10px; }
  .prompt-pad { gap: 11px; }
  .prompt-preview { max-height: 125px; -webkit-line-clamp: 5; font-size: 12px; line-height: 19px; }
}
@media (max-width: 1100px) {
  .module-header { padding-left: 12px; padding-right: 12px; }
  .module-body { padding-left: 12px; padding-right: 12px; }
  .module-footer { padding-left: 12px; padding-right: 12px; }
  .module-header h2 { font-size: 21px; }
  .launch-grid { gap: 6px; }
  .launch-link { padding-left: 8px; padding-right: 8px; gap: 7px; }
  .keymap-row { gap: 7px; }
  .keymap-keys kbd { padding-left: 4px; padding-right: 4px; }
  .reference-table th { width: 35%; }
}
@media (max-width: 600px) {
  .module-board[data-columns="1"] { grid-template-columns: minmax(0, 1fr); }
  .module-header { min-height: 45px; padding: 10px 12px 8px; }
  .module-header h2 { font-size: 23px; }
  .module-body { padding-top: 3px; padding-bottom: 12px; }
  .module-footer { min-height: 29px; }
  .launch-grid { gap: 7px; }
  .launch-link { position: relative; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 75px; padding: 10px; }
  .launch-arrow { position: absolute; right: 10px; top: 10px; }
  .launch-link > span, .launch-link > div { max-width: 100%; }
  .launch-link strong, .launch-link .launch-label { font-size: 12px; }
  .launch-link small, .launch-link .launch-host { font-size: 11px; }
  .keymap-row { gap: 5px; min-height: 40px; }
  .keymap-name { flex-basis: 90px; font-size: 12px; }
  .keymap-keys { gap: 2px; max-width: 50%; }
  .keymap-keys kbd { padding-left: 3px; padding-right: 3px; }
  .keymap-row .resource-direct, .keymap-row .button { min-width: 38px; padding-left: 5px; padding-right: 5px; }
  .reference-table th, .reference-table td { padding-top: 9px; padding-bottom: 9px; }
  .reference-table th { width: 31%; }
  .reference-table td { font-size: 12px; }
  .prompt-fields { gap: 9px; }
  .prompt-fields .input, .prompt-fields .select, .prompt-fields input, .prompt-fields select { min-height: 31px; height: 31px; }
  .prompt-preview { max-height: 130px; -webkit-line-clamp: 6; }
  .prompt-actions { gap: 6px; }
  .reference-editor-row { position: relative; grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .reference-editor-row > .field:first-child { padding-right: 30px; }
  .reference-editor-row > .icon-button { position: absolute; top: 10px; right: 10px; margin: 0; }
}
@media (max-width: 360px) {
  .module-header h2 { font-size: 21px; }
  .module-label { gap: 6px; }
  .module-header .panel-glyph, .module-header .module-glyph { width: 23px; height: 25px; }
  .keymap-name { font-size: 11px; }
  .keymap-row .resource-direct, .keymap-row .button { min-width: 35px; padding-left: 4px; padding-right: 4px; }
  .reference-table th, .reference-table td { padding-left: 5px; padding-right: 5px; }
  .reference-table th { padding-left: 0; }
}
@media (max-height: 500px) and (min-width: 601px) {
  .module-header { min-height: 39px; padding-top: 7px; padding-bottom: 5px; }
  .module-header h2 { font-size: 21px; }
  .module-body { padding-top: 1px; padding-bottom: 6px; }
  .module-footer { min-height: 26px; }
  .launch-link { min-height: 42px; padding-top: 5px; padding-bottom: 5px; }
  .keymap-row { min-height: 30px; padding-top: 3px; padding-bottom: 3px; }
  .reference-table th, .reference-table td { padding-top: 4px; padding-bottom: 4px; }
  .prompt-pad { gap: 4px; }
  .prompt-preview { display: none; }
  .prompt-fields { gap: 3px 8px; }
  .prompt-fields .field { gap: 2px; }
  .prompt-fields .field-label { line-height: 12px; }
  .module-panel .prompt-fields .field input, .module-panel .prompt-fields .field select { min-height: 23px; height: 23px; padding-top: 2px; padding-bottom: 2px; }
  .module-panel .prompt-fields .field textarea { min-height: 26px; height: 26px; max-height: 26px; padding-top: 3px; padding-bottom: 3px; }
  .module-prompt .module-item-select > .select { min-height: 24px; height: 24px; padding-top: 2px; padding-bottom: 2px; }
  .module-prompt .preset-label > .preset-select { min-height: 24px; height: 24px; }
  .module-prompt .module-preset-bar > .text-button { min-height: 24px; }
  .prompt-actions .button { min-height: 25px; padding-top: 4px; padding-bottom: 4px; }
}
@media (prefers-reduced-motion: reduce) { .launch-link { transition: none; } }
.module-board.has-compact-actions{grid-template-rows:minmax(180px,.7fr) minmax(0,1.3fr)}
