.sender-page .header-inner, .sender-page main, .sender-page footer { max-width: 1240px; }
.sender-page main { margin: 20px auto 24px; }
.sender-page > main > .message { margin: 0 0 16px; }
.app-install { margin-left: auto; flex-shrink: 0; font-size: 14px; white-space: nowrap; }
.app-install svg { color: #167747; }
#app-install-help p { margin-top: 16px; }
#app-install-help h3 { margin: 20px 0 8px; font-size: 16px; }
.install-steps { padding-left: 24px; }
.install-steps li + li { margin-top: 8px; }
.identity { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; max-width: 60%; }
.identity span { min-width: 0; overflow-wrap: anywhere; text-align: right; }
.identity button { flex-shrink: 0; }
.icon-button { width: 40px; min-width: 40px; min-height: 40px; height: 40px; padding: 8px; }
.login-view { max-width: 420px; margin: 30px auto 80px; }
.text-link { color: #3c6150; align-self: center; }
.workspace-toolbar, .commands, .usage { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.workspace-toolbar { justify-content: space-between; margin-bottom: 24px; }
.usage { color: #53645b; font-size: 14px; }
.tabs { display: flex; gap: 8px; border-bottom: 1px solid #cbd5ce; margin-bottom: 0; }
.tabs button { color: #536159; background: transparent; border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 10px 16px; min-height: 46px; }
.tabs button[aria-selected="true"] { color: #155f3b; border-bottom-color: #197744; font-weight: 650; }
.table-scroll { width: 100%; overflow-x: auto; background: white; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { font-weight: 600; color: #536159; text-align: left; background: #edf1ee; padding: 12px 14px; white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid #e0e5e1; vertical-align: middle; }
td:first-child { min-width: 190px; max-width: 330px; overflow-wrap: anywhere; }
td:not(:first-child) { white-space: nowrap; }
.empty-row { text-align: center; color: #708078; height: 150px; }
.row-actions { display: flex; gap: 6px; }
.actionable-row { cursor: pointer; }
.actionable-row .row-controls { cursor: default; }
.actionable-row:focus-within { background: #f1f7f3; }
@media (hover: hover) { .actionable-row:hover { background: #f1f7f3; } }
.cell-label { display: none; }
.cell-value { min-width: 0; }
.file-only-label { display: none; }
td.history-file { min-width: 190px; max-width: 330px; white-space: normal; overflow-wrap: anywhere; }
.history-pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 14px 0; }
.row-actions .icon-button { width: 34px; min-width: 34px; height: 34px; min-height: 34px; padding: 6px; }
.state { font-size: 13px; display: inline-block; padding-left: 11px; position: relative; }
.state::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #7b8a82; position: absolute; left: 0; top: 8px; }
.state.available { color: #197744; }.state.available::before { background: #197744; }
.state.working { color: #315d9b; }.state.working::before { background: #315d9b; }
.state.failed { color: #a32929; }.state.failed::before { background: #a32929; }
.jobs-section { margin-top: 34px; border-top: 1px solid #ccd5cf; padding-top: 20px; }
.job { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 18px; padding: 16px 0; border-bottom: 1px solid #dbe2dd; }
.job-title { margin: 0; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.job-info { min-width: 0; }
.job-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.job .progress-text { margin-top: 8px; color: #53645b; }
.job .message { margin: 4px 0 0; min-height: 0; font-size: 13px; }
dialog { width: 560px; max-width: calc(100% - 28px); max-height: calc(100% - 28px); padding: 24px; border: 1px solid #becac2; border-radius: 6px; color: #202925; background: #fff; }
dialog::backdrop { background: #13251b66; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dialog-heading h2 { min-width: 0; }
.dialog-heading > button { flex-shrink: 0; }
#receipt-dialog { width: 1040px; }
#result-mail-preview { margin-top: 18px; }
#result-mail-preview summary { cursor: pointer; color: #34493e; }
#result-body { width: 100%; min-height: 180px; }
.receipt-toolbar { display: flex; gap: 8px; flex-shrink: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
select, textarea { font: inherit; width: 100%; min-height: 44px; border: 1px solid #a8b7ae; border-radius: 4px; padding: 9px 12px; color: inherit; background: #fff; }
select:focus, textarea:focus { outline: 2px solid #19824e; outline-offset: 2px; }
textarea { resize: vertical; }
fieldset { margin: 20px 0 0; padding: 0; border: 0; }
legend { font-weight: 600; padding: 0; margin-bottom: 8px; }
.check-label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.check-label input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: #197744; }
.email-authentication-settings { margin-top: 20px; }
.email-authentication-settings > .check-label { margin-bottom: 0; }
.email-authentication-settings .actions { align-items: center; margin-top: 12px; }
.email-authentication-settings .form-row { margin-top: 12px; }
.email-authentication-settings + .check-label { margin-top: 18px; margin-bottom: 0; }
button:focus-visible, a:focus-visible { outline: 2px solid #315d9b; outline-offset: 2px; }
@media (max-width: 600px) {
  .login-view { margin: 24px auto 40px; }
  #login-form input { font-size: 16px; }
  #login-form .actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  #login-form .text-link { min-height: 44px; display: flex; align-items: center; justify-content: center; }
  .sender-page .header-inner { flex-wrap: wrap; gap: 8px; }
  .sender-page .header-inner > h1 { flex: 1 1 calc(100% - 46px); }
  .app-install { margin-left: auto; }
  .identity { flex-basis: 100%; max-width: 100%; justify-content: flex-end; }
  .workspace-toolbar { align-items: flex-start; gap: 16px; }
  .commands { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }.commands button { width: 100%; }
  .usage { margin-left: auto; }
  .tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; }.tabs button { padding: 10px 6px; font-size: 14px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .job { grid-template-columns: minmax(0, 1fr); }.job-actions { justify-content: flex-start; }.job-actions button { flex: 1 1 110px; }
  dialog { padding: 18px; }
}
@media (max-width: 900px) {
  .sender-page input:not([type="checkbox"]), .sender-page select, .sender-page textarea { min-width: 0; max-width: 100%; font-size: 16px; }
  .sender-page .icon-button, .row-actions .icon-button { width: 44px; min-width: 44px; height: 44px; min-height: 44px; flex-shrink: 0; }
  .sender-page dialog { max-width: calc(100% - 24px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); padding: 18px; overflow: auto; scroll-padding-block: 76px 18px; }
  .sender-page dialog .dialog-heading { position: sticky; top: 0; z-index: 1; align-items: flex-start; background: #fff; padding: 4px 0 12px; }
  .sender-page dialog .actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .selection-commands { display: grid; grid-template-columns: minmax(0, 1fr); }
  .selected-items { max-height: 180px; max-height: min(30dvh, 240px); }
  .check-label { align-items: flex-start; min-height: 44px; padding: 6px 0; }
  .check-label input { flex-shrink: 0; margin-top: 3px; }
  .table-scroll { overflow: visible; }
  .responsive-table, .responsive-table tbody { display: block; }
  /* Keep the real headings accessible while each row is displayed vertically. */
  .responsive-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .responsive-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 16px 12px; border-bottom: 1px solid #d8dfdb; }
  .responsive-table td { display: grid; grid-template-columns: 90px minmax(0, 1fr); align-items: baseline; gap: 8px; padding: 0; border: 0; min-width: 0; max-width: none; white-space: normal; }
  .responsive-table td:first-child { display: block; }
  .responsive-table .cell-label { display: block; color: #637067; font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
  .responsive-table td:first-child .cell-label { margin-bottom: 4px; }
  .responsive-table .cell-value { min-width: 0; overflow-wrap: anywhere; }
  #outgoing-rows td:first-child .cell-value, #request-rows td:first-child .cell-value, #receipt-rows td:first-child .cell-value, .history-file .cell-value { font-weight: 600; }
  .row-actions { flex-wrap: wrap; gap: 8px; }
  .responsive-table .empty-row { display: block; height: auto; min-height: 120px; }
  .responsive-table .empty-cell { display: block; padding: 30px 0; }
}
@media (pointer: coarse) {
  .sender-page input:not([type="checkbox"]), .sender-page select, .sender-page textarea { font-size: 16px; }
  .sender-page .icon-button, .row-actions .icon-button { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
}
#mail-status-dialog { width: min(1000px, calc(100vw - 32px)); }
#mail-status-dialog .dialog-heading h2 { overflow-wrap: anywhere; }
#mail-status-summary { line-height: 1.7; }
#mail-status-dialog td { overflow-wrap: anywhere; }
@media (hover: none) and (pointer: coarse) {
  .folder-capable-label, #add-folder { display: none; }
  .file-only-label { display: inline; }
}
