.file-browser,.screen-workspace {
  padding: 16px 12px 180px;
  max-width: 1000px;
  margin: auto;
  overflow-wrap: anywhere;
}

.file-controls,.file-actions,.file-preview-dialog header,.drawer-chat-heading,.drawer-chat-batch,.screen-add {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.file-controls input {
  min-width: 0;
  flex: 1;
}

.file-browser button,.file-browser select,.screen-settings button,.screen-add button {
  min-height: 44px;
}

.file-list {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,260px),1fr));
  gap: 12px;
  margin: 16px 0;
}

.file-card {
  display: flex;
  min-width: 0;
  border: 1px solid var(--border,#ccc);
  border-radius: 16px;
  padding: 8px;
  background: var(--surface,#fafafa);
  color: var(--text,#202124);
}

.file-choice {
  align-self: stretch;
  min-width: 44px;
  display: flex;
  justify-content: center;
  padding-top: 12px;
}

.file-choice input {
  width: 22px;
  height: 22px;
}

.file-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 6px;
  flex: 1;
}

.file-card-body strong {
  overflow-wrap: anywhere;
}

.file-card-body small {
  font-size: calc(.8rem * var(--butler-ui-font-scale) * var(--butler-area-font-scale, 1));
  opacity: .8;
}

.file-status {
  min-height: 1.5em;
}

.file-preview-dialog {
  width: min(90vw,900px);
  max-height: 85dvh;
  overflow: auto;
  border-radius: 20px;
  padding: 16px;
}

.file-preview-dialog header {
  justify-content: space-between;
  overflow-wrap: anywhere;
}

.file-preview-dialog img,.file-preview-dialog video {
  display: block;
  max-width: 100%;
  max-height: 60dvh;
  margin: 12px auto;
  object-fit: contain;
}

.file-preview-dialog audio {
  max-width: 100%;
  margin: 16px 0;
}

.file-preview-dialog a {
  display: block;
  min-height: 44px;
  overflow-wrap: anywhere;
}

.chat-action-dialog {
  max-height: 85dvh;
  overflow: auto;
}

.chat-action-dialog form {
  max-height: none;
}

.drawer-chat-heading {
  justify-content: space-between;
}

.drawer-chat-heading button,.drawer-chat-batch button {
  min-height: 44px;
}

.drawer-chat-batch[hidden] {
  display: none;
}

.chat-selection-target::before {
  content: '☐';
  margin-right: 8px;
  flex-shrink: 0;
}

.chat-selection-checked::before {
  content: '☑';
}

.chat-selection-checked {
  outline: 2px solid var(--accent,#6548e8);
  outline-offset: -2px;
}

.screen-settings>div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--butler-line-tone-41);
}

.screen-settings label {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-wrap: anywhere;
}

.screen-settings input {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.screen-add {
  margin-top: 16px;
}

.screen-add input {
  flex: 1;
  min-width: 120px;
  min-height: 44px;
}

.transcript-dialog {
  width: min(96vw,900px);
  max-height: 88dvh;
  box-sizing: border-box;
  border-radius: 20px;
  padding: 16px;
  overflow: auto;
  color: var(--text,#202124);
  background: var(--surface,#fff);
}

.transcript-dialog::backdrop {
  background: rgb(0 0 0/.45);
}

.transcript-dialog header,.transcript-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.transcript-dialog header {
  position: sticky;
  top: 0;
  background: var(--surface,#fff);
  z-index: 1;
  padding: 8px 0;
}

.transcript-dialog strong {
  min-width: 0;
  overflow-wrap: anywhere;
  flex: 1;
}

.transcript-dialog button,.transcript-dialog a,.transcript-dialog summary,.chat-transcript-view {
  min-height: 44px;
}

.transcript-actions a {
  display: inline-flex;
  align-items: center;
}

.transcript-dialog p {
  overflow-wrap: anywhere;
}

.transcript-dialog summary {
  cursor: pointer;
  padding: 8px 0;
  box-sizing: border-box;
}

.transcript-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.65;
  font-family: inherit;
  user-select: text;
  padding: 8px 0;
}
