:root {
  color-scheme: dark;
  --bg: #071015;
  --bg-layer: radial-gradient(circle at 12% 0%, rgba(32, 199, 181, 0.10), transparent 28%),
    linear-gradient(135deg, #071015 0%, #0a151c 48%, #0c1118 100%);
  --panel: #0e1a21;
  --panel-2: #12242d;
  --text: #e7f2f4;
  --muted: #8ea3aa;
  --line: #1f3b46;
  --brand: #20c7b5;
  --brand-2: #66e3ff;
  --warn: #ffb84d;
  --danger: #ff5b6b;
  --shadow: rgba(0, 0, 0, 0.32);
  --field-bg: #071319;
  --header-bg: rgba(8, 18, 24, 0.92);
  --table-head: #12242d;
  --button-secondary: #263f49;
  --button-secondary-text: #d6eef2;
  --hover-row: rgba(32, 199, 181, 0.10);
  --status-bar-bg: rgba(7, 16, 21, 0.96);
  --table-head-text: #aeeef3;
  --button-text: #041317;
  --danger-text: #23060a;
  --notice-text: #bdf9f1;
  --manual-button-text: #c9f7ff;
  --switch-bg: #314852;
  --switch-knob: #dceff2;
  --scroll-track: #0b171d;
  --radius: 6px;
  --control-height: 24px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef5f6;
  --bg-layer: linear-gradient(135deg, #f8fcfd 0%, #eef6f7 46%, #e7f0f2 100%);
  --panel: #ffffff;
  --panel-2: #eef7f8;
  --text: #10232a;
  --muted: #51666e;
  --line: #c8dce1;
  --brand: #079786;
  --brand-2: #0f7ea3;
  --warn: #b77400;
  --danger: #d8344a;
  --shadow: rgba(16, 35, 42, 0.12);
  --field-bg: #ffffff;
  --header-bg: rgba(247, 252, 253, 0.94);
  --table-head: #e6f4f6;
  --button-secondary: #d7e8ec;
  --button-secondary-text: #183038;
  --hover-row: rgba(7, 151, 134, 0.10);
  --status-bar-bg: rgba(248, 252, 253, 0.97);
  --table-head-text: #123943;
  --button-text: #ffffff;
  --danger-text: #ffffff;
  --notice-text: #123943;
  --manual-button-text: #0b5267;
  --switch-bg: #b7cbd1;
  --switch-knob: #ffffff;
  --scroll-track: #d9e8eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-layer);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  height: 100vh;
  overflow: hidden;
}

header {
  align-items: center;
  backdrop-filter: blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  left: 0;
  padding: 8px 16px;
  position: sticky;
  right: 0;
  top: 0;
  z-index: 100;
}

.logout-form {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.logout-form span {
  color: var(--muted);
  font-size: 12px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.nav-form {
  margin: 0;
}

.nav-form .nav-link {
  background: transparent;
}

.nav-form .nav-link.active,
.nav-form .nav-link:hover {
  background: var(--brand);
}

a {
  color: var(--brand);
  text-decoration: none;
}

.brand {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.nav-link {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(102, 227, 255, 0.16);
  border-radius: var(--radius);
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  min-height: var(--control-height);
  padding: 5px 8px;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(32, 199, 181, 0.18);
  border-color: var(--brand);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(102, 227, 255, 0.12);
}

main {
  height: calc(100vh - 87px);
  overflow: auto;
  padding: 14px 16px 54px;
}

h1 {
  color: var(--text);
  font-size: 20px;
  font-weight: 650;
  margin: 0 0 12px;
}

h2 {
  color: var(--text);
  font-size: 14px;
  margin: 16px 0 10px;
}

section {
  margin-bottom: 20px;
}

section:has(table) {
  max-height: calc(100vh - 260px);
  overflow: auto;
  padding-bottom: 10px;
}

table {
  background: var(--panel);
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px var(--shadow);
  min-width: 920px;
  overflow: hidden;
  width: 100%;
}

section:has(table),
.mail-main {
  scrollbar-color: var(--brand) var(--scroll-track);
  scrollbar-width: thin;
}

th,
td {
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--table-head);
  color: var(--table-head-text);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 2;
}

.dot {
  border-radius: 999px;
  display: inline-block;
  height: 9px;
  width: 9px;
}

.dot.ok { background: #27e19a; }
.dot.pending { background: var(--warn); }
.dot.overdue,
.dot.no_report { background: var(--danger); }
.dot.disabled { background: var(--muted); }

.vessel-status-link {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  font-weight: 650;
}

.vessel-status-link.overdue-text {
  color: var(--danger);
}

.title-row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.title-actions {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
}

.title-actions h1 {
  margin-bottom: 0;
}

.button,
button {
  background: var(--brand);
  border: 0;
  border-radius: var(--radius);
  color: var(--button-text);
  cursor: pointer;
  font: 600 12px/1.1 "Segoe UI", Arial, sans-serif;
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: var(--control-height);
  padding: 5px 9px;
  white-space: nowrap;
}

.compact-button {
  font-size: 11px;
  min-height: 22px;
  padding: 4px 8px;
}

.button.secondary {
  background: var(--button-secondary);
  color: var(--button-secondary-text);
  justify-content: center;
}

.status-cell {
  min-width: 118px;
  white-space: nowrap;
}

.manual-status-cell {
  text-align: center;
  white-space: nowrap;
  width: 92px;
}

.status-cell-content {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: flex-start;
  line-height: 1;
  white-space: nowrap;
}

.status-ok-form {
  display: inline-flex;
  line-height: 1;
  margin: 0;
}

button.mini-status-button {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 12px;
  font-size: 0;
  height: 12px;
  justify-content: center;
  line-height: 1;
  min-height: 12px;
  padding: 0 !important;
  width: 12px;
}

button.mini-status-button.to-ok {
  background: rgba(39, 225, 154, 0.20);
  border: 1px solid rgba(39, 225, 154, 0.70);
  color: #caffec;
}

button.mini-status-button.to-overdue {
  background: rgba(255, 91, 107, 0.20);
  border: 1px solid rgba(255, 91, 107, 0.70);
  color: #ffd7dc;
}

button.mini-status-button.to-ok:hover {
  background: rgba(39, 225, 154, 0.34);
}

button.mini-status-button.to-overdue:hover {
  background: rgba(255, 91, 107, 0.34);
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td {
  background: rgba(32, 199, 181, 0.10);
}

.clickable-row a,
.clickable-row button,
.clickable-row details {
  cursor: auto;
}

.toggle-form {
  margin: 0;
}

.reminder-actions {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  white-space: nowrap;
}

.dashboard-table {
  min-width: 860px;
  table-layout: auto;
}

.dashboard-table th,
.dashboard-table td {
  width: auto;
}

.dashboard-table th:nth-child(1),
.dashboard-table td:nth-child(1) {
  min-width: 170px;
  width: 22%;
}

.dashboard-table th:nth-child(2),
.dashboard-table td:nth-child(2) {
  min-width: 86px;
  width: 86px;
}

.dashboard-table th:nth-child(3),
.dashboard-table td:nth-child(3) {
  min-width: 74px;
  width: 74px;
}

.dashboard-table th:nth-child(4),
.dashboard-table td:nth-child(4),
.dashboard-table th:nth-child(5),
.dashboard-table td:nth-child(5) {
  min-width: 112px;
  width: 112px;
}

.dashboard-table th:nth-child(6),
.dashboard-table td:nth-child(6) {
  min-width: 138px;
  width: 138px;
}

.dashboard-table th:nth-child(7),
.dashboard-table td:nth-child(7) {
  min-width: 124px;
  width: 124px;
}

.dashboard-table th:nth-child(8),
.dashboard-table td:nth-child(8) {
  min-width: 86px;
  text-align: center;
  width: 86px;
}

.disabled-vessel-row td {
  color: var(--muted);
  opacity: 0.66;
}

.disabled-vessel-row td {
  background: rgba(142, 163, 170, 0.08);
}

.disabled-vessel-row .vessel-status-link {
  color: var(--muted);
}

button.manual-reminder-button {
  background: rgba(102, 227, 255, 0.10);
  border: 1px solid rgba(102, 227, 255, 0.44);
  color: var(--manual-button-text);
  font-size: 10px;
  line-height: 1;
  min-height: 20px;
  padding: 3px 6px;
}

button.manual-reminder-button:hover {
  background: rgba(102, 227, 255, 0.22);
}

.switch {
  display: inline-block;
  height: 15px;
  position: relative;
  width: 28px;
}

.switch input {
  height: 0;
  opacity: 0;
  width: 0;
}

.switch span {
  background: var(--switch-bg);
  cursor: pointer;
  inset: 0;
  position: absolute;
  transition: 0.2s;
}

.switch span::before {
  background: var(--switch-knob);
  content: "";
  border-radius: 999px;
  height: 11px;
  left: 2px;
  position: absolute;
  top: 2px;
  transition: 0.2s;
  width: 11px;
}

.switch input:checked + span {
  background: var(--brand);
}

.switch input:checked + span::before {
  transform: translateX(13px);
}

.login-page {
  display: grid;
  min-height: 80vh;
  place-items: center;
}

.login-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  width: min(420px, 100%);
}

.error {
  color: #b91c1c;
  font-size: 14px;
}

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

.grid-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid-form > button,
.grid-form > .button,
.stack > button,
.stack > .button {
  align-self: end;
  justify-self: start;
}

.filter-actions {
  align-items: end;
  align-self: end;
  display: inline-flex;
  gap: 6px;
  justify-self: start;
}

.stack {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

label {
  color: var(--muted);
  display: grid;
  gap: 5px;
  font-size: 12px;
}

input,
select,
textarea {
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  padding: 5px 8px;
}

input,
select {
  height: 26px;
  min-height: var(--control-height);
}

select {
  min-width: 150px;
}

input[type="file"] {
  height: auto;
  line-height: 1.2;
  min-height: 26px;
  padding: 3px 6px;
}

input[type="file"]::file-selector-button {
  background: var(--button-secondary);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 1px);
  color: var(--button-secondary-text);
  cursor: pointer;
  font: 600 11px/1 "Segoe UI", Arial, sans-serif;
  margin-right: 8px;
  min-height: 20px;
  padding: 3px 7px;
}

.file-field {
  align-self: end;
}

.file-field input[type="file"] {
  width: 100%;
}

.file-size-hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  margin: -4px 0 2px;
}

.compact-select,
.role-select {
  font-size: 11px;
  min-width: 180px;
}

input[type="checkbox"],
input[type="radio"] {
  height: auto;
  min-height: 0;
}

button:hover,
.button:hover {
  filter: brightness(1.06);
}

button:focus-visible,
.button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 1px;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  max-width: 900px;
}

.inline-form {
  align-items: center;
  display: flex;
  gap: 6px;
}

.inline-form input {
  min-width: 180px;
}

.notice {
  background: rgba(32, 199, 181, 0.12);
  border: 1px solid rgba(32, 199, 181, 0.32);
  color: var(--notice-text);
  padding: 8px 10px;
}

.theme-switcher {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  display: inline-flex;
  gap: 4px;
  padding: 4px;
}

.theme-option {
  display: inline-flex;
  gap: 0;
}

.theme-option input {
  height: 0;
  opacity: 0;
  position: absolute;
  width: 0;
}

.theme-option span {
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 650;
  border-radius: calc(var(--radius) - 1px);
  padding: 5px 10px;
}

.theme-option input:checked + span {
  background: var(--brand);
  color: var(--button-text);
}

.options-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.options-panel h3 {
  font-size: 15px;
  margin: 0 0 10px;
}

.check-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.check-line {
  align-items: center;
  color: var(--text);
  display: flex;
  gap: 8px;
}

.check-line input {
  width: auto;
}

.check-line span {
  color: var(--muted);
  font-size: 12px;
}

.vessel-recipient-row {
  align-items: center;
  border: 1px solid var(--line);
  display: grid;
  border-radius: var(--radius);
  gap: 6px;
  grid-template-columns: minmax(120px, 1fr) minmax(180px, 1.4fr);
  padding: 7px;
}

.tabs {
  margin-bottom: 14px;
}

.tab {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  min-height: var(--control-height);
  padding: 5px 8px;
}

.tab.active {
  background: rgba(32, 199, 181, 0.18);
  border-color: var(--brand);
  color: var(--text);
}

.toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar input {
  min-width: min(420px, 100%);
}

.status-panel {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  border-radius: var(--radius);
  gap: 8px;
  padding: 10px;
}

.flash {
  background: rgba(32, 199, 181, 0.12);
  border: 1px solid rgba(32, 199, 181, 0.32);
  margin: 0;
  padding: 6px 8px;
}

.flash.error {
  background: rgba(255, 91, 107, 0.12);
  border-color: rgba(255, 91, 107, 0.36);
  color: var(--text);
}

.mail-body {
  background: var(--field-bg);
  border: 1px solid var(--line);
  font: 14px/1.5 Consolas, monospace;
  max-height: 520px;
  overflow: auto;
  padding: 10px;
  white-space: pre-wrap;
}

.mail-html-frame {
  background: #ffffff;
  border: 1px solid var(--line);
  height: 680px;
  width: 100%;
}

.attachment-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.attachment-list {
  display: grid;
  gap: 6px;
  list-style: none;
  padding: 0;
}

.attachment-menu {
  display: inline-block;
  position: relative;
}

.attachment-menu summary {
  background: var(--field-bg);
  border: 1px solid var(--line);
  cursor: pointer;
  display: inline-flex;
  gap: 5px;
  min-height: var(--control-height);
  padding: 4px 7px;
  user-select: none;
}

.attachment-size {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.attachment-menu-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
  display: grid;
  gap: 8px;
  left: 0;
  min-width: 220px;
  padding: 8px;
  position: absolute;
  top: calc(100% + 4px);
  z-index: 20;
}

.attachment-menu-item {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 5px;
  padding-bottom: 8px;
}

.attachment-menu-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.mail-client {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: 235px minmax(0, 1fr);
  height: calc(100vh - 190px);
  min-height: 0;
}

.mail-client-overview {
  grid-template-columns: minmax(0, 1fr);
}

.mail-sidebar-overview {
  display: none;
}

.mail-sidebar {
  background: var(--panel);
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
  max-height: 100%;
  overflow: auto;
  padding: 8px;
}

.mail-folders {
  display: grid;
  gap: 2px;
}

.mail-folder-row {
  align-items: center;
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.mail-folder-link {
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 500;
  justify-content: space-between;
  line-height: 1.15;
  padding: 3px 6px;
}

.mail-folder-link:hover,
.mail-folder-link.active {
  background: rgba(32, 199, 181, 0.12);
  border-color: rgba(32, 199, 181, 0.35);
  color: var(--brand);
}

.mail-folder-link.has-unread {
  color: #b91c1c;
  font-weight: 700;
}

.unread-badge {
  background: #b91c1c;
  color: #ffffff;
  display: inline-flex;
  font-size: 11px;
  justify-content: center;
  line-height: 1;
  min-width: 16px;
  padding: 2px 4px;
}

.count-badge {
  color: var(--text);
  display: inline-flex;
  font-size: 11px;
  font-weight: 650;
  justify-content: center;
  line-height: 1;
  min-width: 16px;
  padding: 2px 4px;
}

.unread-message td {
  color: var(--text);
  font-weight: 700;
}

.unread-message td:first-child {
  border-left: 3px solid var(--brand);
}

.unmatched-row td {
  background: rgba(255, 91, 107, 0.08);
}

.mismatch-count {
  color: var(--danger);
  font-weight: 800;
}

.mail-main {
  max-height: 100%;
  min-width: 0;
  overflow: auto;
  padding-bottom: 18px;
}

.mail-folder-overview {
  max-height: none;
  overflow: visible;
}

.mail-folder-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.mail-folder-card {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 42px;
  padding: 10px 12px;
}

.mail-folder-card:hover,
.mail-folder-card.has-unread {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(32, 199, 181, 0.18);
}

.mail-folder-card.has-unread strong {
  color: var(--danger);
}

.mail-toolbar {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 10px;
  padding: 7px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.folder-menu {
  position: relative;
}

.folder-menu summary {
  background: var(--field-bg);
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  list-style: none;
  padding: 3px 5px;
}

.folder-menu-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
  display: grid;
  gap: 8px;
  min-width: 230px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
}

.mini-form {
  display: grid;
  gap: 6px;
}

.mail-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.report-action-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.check-column {
  text-align: center;
  width: 34px;
}

.check-column input,
.summary-check,
.report-line-check {
  cursor: pointer;
  height: 14px;
  width: 14px;
}

.sort-link {
  align-items: center;
  color: var(--table-head-text);
  display: inline-flex;
  gap: 5px;
  white-space: nowrap;
}

.sort-link.active {
  color: var(--brand);
}

.sort-link span {
  font-size: 11px;
  line-height: 1;
}

.mail-status-bar {
  align-items: center;
  background: var(--status-bar-bg);
  border-top: 1px solid var(--line);
  bottom: 0;
  box-shadow: 0 -8px 20px var(--shadow);
  color: var(--muted);
  display: flex;
  font-size: 12px;
  gap: 8px;
  left: 0;
  line-height: 1.2;
  min-height: 16px;
  padding: 1px 18px 2px;
  position: fixed;
  right: 0;
  z-index: 120;
}

.mail-status-dot {
  background: var(--brand);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(32, 199, 181, 0.58);
  flex: 0 0 7px;
  height: 7px;
  width: 7px;
}

.mail-operation-modal {
  align-items: center;
  background: rgba(0, 0, 0, 0.54);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 500;
}

.mail-operation-modal[hidden] {
  display: none;
}

.mail-operation-dialog {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 22px 50px var(--shadow);
  display: grid;
  gap: 10px;
  max-width: 430px;
  padding: 16px;
  width: min(430px, 100%);
}

.mail-operation-header {
  align-items: center;
  display: flex;
  gap: 9px;
}

.mail-operation-header h2 {
  margin: 0;
}

.mail-operation-dot {
  background: var(--brand);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(32, 199, 181, 0.65);
  height: 10px;
  width: 10px;
}

.mail-operation-dot.error {
  background: var(--danger);
  box-shadow: 0 0 12px rgba(255, 91, 107, 0.65);
}

.mail-operation-status {
  color: var(--text);
  font-weight: 600;
  margin: 0;
}

.mail-operation-detail {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
}

.mail-operation-progress {
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.mail-operation-progress-bar {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  height: 100%;
  transition: width 0.22s ease;
  width: 0;
}

.mail-operation-percent {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.mail-operation-dialog button {
  justify-self: end;
  min-width: 70px;
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  header {
    position: sticky;
  }

  main {
    height: auto;
    min-height: calc(100vh - 73px);
    overflow: visible;
    padding: 14px 14px 58px;
  }

  section:has(table) {
    max-height: calc(100vh - 240px);
  }

  .mail-client {
    grid-template-columns: 1fr;
    height: auto;
  }

  .mail-sidebar,
  .mail-main {
    max-height: none;
  }
}

@media (max-width: 640px) {
  body {
    background: var(--bg);
    font-size: 13px;
  }

  header {
    align-items: stretch;
    gap: 8px;
    padding: 8px 10px;
  }

  .brand {
    flex-basis: 100%;
    font-size: 13px;
  }

  nav {
    display: grid;
    flex: 1 1 100%;
    gap: 4px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-link {
    justify-content: center;
    padding: 7px 5px;
    text-align: center;
  }

  .logout-form {
    justify-content: space-between;
    margin-left: 0;
    width: 100%;
  }

  .logout-form span {
    display: inline;
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  main {
    min-height: auto;
    padding: 10px 10px 58px;
  }

  h1 {
    font-size: 18px;
    margin-bottom: 10px;
  }

  h2 {
    font-size: 14px;
  }

  .title-row {
    align-items: stretch;
    display: grid;
    gap: 8px;
  }

  .title-actions {
    align-items: stretch;
    display: grid;
    gap: 8px;
  }

  .title-row .inline-form,
  .title-row button {
    width: 100%;
  }

  section {
    margin-bottom: 18px;
  }

  section:has(table) {
    max-height: calc(100vh - 230px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 760px;
  }

  th,
  td {
    font-size: 11px;
    padding: 6px 7px;
  }

  .grid-form,
  .check-grid,
  .vessel-recipient-row {
    grid-template-columns: 1fr;
  }

  input,
  select,
  textarea,
  button,
  .button {
    max-width: 100%;
  }

  .inline-form {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .inline-form input {
    min-width: 0;
    width: 100%;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .toolbar input,
  .toolbar button,
  .toolbar .button {
    min-width: 0;
    width: 100%;
  }

  .grid-form > button,
  .grid-form > .button,
  .stack > button,
  .stack > .button,
  .filter-actions {
    justify-self: stretch;
    width: 100%;
  }

  .filter-actions .button,
  .filter-actions button {
    flex: 1 1 0;
  }

  .mail-client {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
  }

  .mail-sidebar {
    gap: 8px;
    max-height: 35vh;
  }

  .mail-folders {
    max-height: 24vh;
    overflow: auto;
  }

  .mail-main {
    overflow: auto;
  }

  .mail-html-frame {
    height: 62vh;
  }

  .attachment-menu-panel,
  .folder-menu-panel {
    left: auto;
    max-width: calc(100vw - 32px);
    min-width: 220px;
    right: 0;
  }

  .reminder-actions,
  .status-cell-content,
  .mail-actions,
  .attachment-actions,
  .report-action-row {
    flex-wrap: wrap;
  }
}
  border-radius: 999px;
  border-radius: var(--radius);
  border-radius: var(--radius);
  border-radius: var(--radius);
  border-radius: var(--radius);
  border-radius: var(--radius);
  border-radius: var(--radius);
  border-radius: var(--radius);
  border-radius: var(--radius);
  border-radius: 999px;
  border-radius: var(--radius);
  border-radius: var(--radius);
