:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-muted: #f9fafb;
  --ink: #111827;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e8ee;
  --line-strong: #d1d7e0;
  --blue: #1d4ed8;
  --blue-hover: #1e40af;
  --blue-soft: #eff6ff;
  --teal: #0f766e;
  --teal-soft: #ecfdf5;
  --red: #b91c1c;
  --red-soft: #fef2f2;
  --radius: 12px;
  --mono: ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', Consolas, monospace;
  font-family: 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
h1, h2 { color: var(--ink); font-weight: 600; letter-spacing: -0.02em; }

.icon { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; }

input, textarea, select {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
  min-width: 0;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}
input::placeholder, textarea::placeholder { color: #9ca3af; }
textarea { resize: vertical; min-height: 70px; max-height: 180px; line-height: 1.55; }
select { cursor: pointer; }
label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
label > span { color: var(--blue); margin-left: 2px; }

button:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 16px;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.button .icon { width: 16px; height: 16px; }
.primary { background: var(--blue); color: #fff; }
.primary:hover { background: var(--blue-hover); }
.secondary { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.secondary:hover { background: var(--surface-muted); border-color: #bfc7d4; }
.danger-button { background: var(--red); color: #fff; }
.danger-button:hover { background: #991b1b; }
.wide { width: 100%; }

.icon-button {
  border: 0;
  background: transparent;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 32px;
  min-height: 32px;
  padding: 6px;
  border-radius: 6px;
  color: var(--muted);
}
.icon-button:hover { background: #eef1f6; color: var(--ink); }
.icon-button .icon { width: 16px; height: 16px; }

.text-button {
  border: 0;
  background: none;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
  font-size: 13px;
  font-weight: 500;
}
.text-button:hover { text-decoration: underline; }
.text-button .icon { width: 14px; height: 14px; }

.muted, .subtle { color: var(--muted); }
.subtle { font-size: 12px; font-weight: 400; }
.text-blue { color: var(--blue); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0.08em; }
.danger { color: var(--red); }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { display: flex; }
.brand-type { font-size: 16px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.brand-type > span { font-size: 12px; font-weight: 400; color: var(--muted); }

/* Topbar & Admin Shell */
.admin-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar-right { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); }
.env-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.env-pill i, .status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); display: inline-block; }

.workspace-body { width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px 24px 48px; flex: 1; }

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-heading h1 { font-size: 24px; line-height: 1.25; }
.page-heading p { color: var(--muted); font-size: 13px; margin-top: 6px; }

.summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
}
.stat-pill strong {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

/* Compose Card */
.compose-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}
.card-heading > div { display: flex; align-items: center; gap: 8px; }
.card-heading h2 { font-size: 15px; }
.compose-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 28px; padding: 24px; }
.upload-column { min-width: 0; display: flex; flex-direction: column; }

.dropzone {
  border: 1.5px dashed var(--line-strong);
  background: var(--surface-muted);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 100%;
  min-height: 224px;
  flex: 1;
  padding: 24px 16px;
  transition: background 0.15s, border-color 0.15s;
}
.dropzone:hover, .dropzone.dragging { background: var(--blue-soft); border-color: var(--blue); }
.upload-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.upload-icon-wrap .icon { width: 20px; height: 20px; }
.dropzone strong { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.dropzone > span:not(.upload-icon-wrap) { font-size: 13px; color: var(--muted); }
.dropzone small { font-size: 12px; color: #9ca3af; margin-top: 14px; }

.selected-files { max-height: 170px; overflow: auto; margin-top: 8px; }
.selected-file {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  font-size: 13px;
}
.selected-file > .icon { width: 15px; height: 15px; color: var(--blue); }
.selected-file > span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-file > small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.selected-file .icon-button { min-width: 26px; min-height: 26px; padding: 4px; }
.selected-total { display: flex; justify-content: space-between; padding-top: 10px; font-size: 12px; color: var(--muted); }
.selected-total > span { color: var(--ink); font-weight: 500; }

.fields-column { min-width: 0; }
.field { margin-bottom: 14px; }
.field > input, .field > textarea, .field > select { width: 100%; }
.two-fields { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; }
.two-fields .field { margin-bottom: 0; }
.password-field { position: relative; }
.password-field > input { width: 100%; font-family: var(--mono); letter-spacing: 0.08em; padding-right: 38px; height: 40px; }
.password-field > .icon-button { position: absolute; right: 4px; top: 4px; }
.days-field { position: relative; }
.days-field > input { width: 100%; height: 40px; padding-right: 34px; font-variant-numeric: tabular-nums; }
.days-unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--muted); pointer-events: none; }
.field-help { font-size: 12px; display: block; color: var(--muted); margin: 6px 0 14px; }
.optional { font-size: 12px; font-weight: 400 !important; color: var(--muted) !important; margin-left: 4px !important; }
.note-field { margin-bottom: 16px; }
.compose-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.compose-bottom > span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.compose-bottom > span .icon { width: 14px; height: 14px; }
.form-error { font-size: 13px; color: var(--red); line-height: 1.5; margin-top: 10px; }
.form-error:empty { display: none; }
.upload-progress { margin-top: 14px; }
.upload-progress > div { display: flex; justify-content: space-between; font-size: 12px; color: var(--blue); margin-bottom: 6px; }
.upload-progress progress { display: block; width: 100%; height: 5px; border: 0; border-radius: 99px; background: var(--blue-soft); accent-color: var(--blue); }
progress::-webkit-progress-bar { background: var(--blue-soft); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--blue); border-radius: 99px; }

/* Deliveries List */
.deliveries-section { margin-top: 28px; }
.deliveries-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.deliveries-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 24px 0;
  flex-wrap: wrap;
}
.deliveries-header h2 { font-size: 15px; }
.deliveries-header h2 span { font-size: 13px; color: var(--muted); margin-left: 6px; font-weight: 400; font-variant-numeric: tabular-nums; }
.search-box { display: flex; align-items: center; position: relative; }
.search-box > .icon { position: absolute; left: 10px; pointer-events: none; width: 15px; height: 15px; color: var(--muted); }
.search-box > input { background: var(--surface-muted); font-size: 13px; padding: 7px 10px 7px 32px; width: 210px; border-color: var(--line); }

.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); padding: 14px 24px 0; }
.tabs button { border: 0; background: transparent; padding: 0 0 12px; font-size: 13px; color: var(--muted); position: relative; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected=true] { color: var(--blue); font-weight: 600; }
.tabs button[aria-selected=true]::after { content: ''; height: 2px; position: absolute; bottom: -1px; left: 0; right: 0; background: var(--blue); border-radius: 2px; }

.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; min-width: 680px; }
th { color: var(--muted); font-size: 12px; font-weight: 500; padding: 12px 16px; background: var(--surface-muted); border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 24px; }
th:last-child, td:last-child { padding-right: 24px; }
td { border-bottom: 1px solid var(--line); padding: 14px 16px; font-size: 13px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbfc; }

.delivery-name { display: flex; gap: 12px; align-items: center; border: 0; background: transparent; text-align: left; padding: 0; max-width: 340px; }
.delivery-name > span:last-child { min-width: 0; }
.delivery-name strong { display: block; font-size: 14px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.delivery-name:hover strong { color: var(--blue); }
.delivery-name small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.delivery-name small b { font-weight: 400; margin: 0 4px; color: var(--line-strong); }

.file-tile {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  white-space: nowrap;
}
.badge > i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.expired { background: #f3f4f6; color: var(--muted); }
.badge.revoked { background: var(--red-soft); color: var(--red); }

.table-date { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.download-count { font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.download-count small { font-size: 12px; color: var(--muted); }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; white-space: nowrap; }
.align-right { text-align: right; }

.empty-state { min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); padding: 24px; }
.empty-state > .icon { width: 28px; height: 28px; color: #cbd5e1; }
.empty-state strong { font-size: 14px; font-weight: 500; color: var(--ink); }
.empty-state span { font-size: 13px; }

/* Login Page */
.login-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 36px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.login-card .brand { margin-bottom: 24px; }
.login-card h1 { font-size: 22px; margin-bottom: 6px; }
.login-card > p { font-size: 13px; line-height: 1.6; }
.login-card form { margin-top: 24px; }
.login-card form > input { width: 100%; margin-bottom: 14px; }
.login-card form > .form-error { margin-top: -4px; margin-bottom: 12px; }

/* Guest Delivery Page */
.guest-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.guest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.guest-header-label { font-size: 12px; display: flex; gap: 6px; align-items: center; color: var(--muted); }
.guest-header-label > .icon { width: 15px; height: 15px; color: var(--teal); }
.guest-main { flex: 1; max-width: 540px; width: 100%; margin: 48px auto; padding: 0 20px; }

.guest-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.seal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.seal-sender { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; color: var(--text); }
.seal-sender > i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.seal-days {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 600;
  color: var(--teal);
  background: var(--teal-soft);
  padding: 3px 10px;
  border-radius: 999px;
}

.guest-body { padding: 28px; }
.guest-card h1 { font-size: 22px; line-height: 1.4; overflow-wrap: anywhere; }
.guest-file-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}
.guest-file-meta > .icon { width: 15px; height: 15px; }
.verified {
  color: var(--teal);
  display: inline-flex;
  gap: 4px;
  align-items: center;
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
}
.verified > .icon { width: 14px; height: 14px; }

.guest-note {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--surface-muted);
  border-left: 2px solid var(--line-strong);
  border-radius: 0 6px 6px 0;
  line-height: 1.65;
  white-space: pre-wrap;
  font-size: 13px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.guest-url {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 20px 0;
  padding: 8px 10px 8px 12px;
}
.guest-url > span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.guest-url input {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  width: 100%;
  text-overflow: ellipsis;
  box-shadow: none;
}
.guest-url .icon-button { min-height: 28px; min-width: 28px; padding: 4px; }

.unlock-form > label { font-size: 13px; color: var(--ink); margin-bottom: 8px; }
.extraction-field { position: relative; margin-bottom: 14px; }
.extraction-field > input {
  width: 100%;
  height: 44px;
  font-family: var(--mono);
  font-size: 14px;
  padding-right: 42px;
  letter-spacing: 0.08em;
}
.extraction-field > .icon-button { position: absolute; right: 6px; top: 6px; }
.unlock-form > .button { height: 44px; justify-content: space-between; padding: 0 18px; }
.unlock-form > .form-error { margin-top: -4px; margin-bottom: 12px; }

.guest-files { margin: 4px 0 20px; border-top: 1px solid var(--line); }
.guest-file {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.guest-file > div { flex: 1; min-width: 0; }
.guest-file > div > strong { display: block; font-size: 14px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; line-height: 1.45; }
.guest-file > div > span { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.guest-file .text-button { font-size: 12px; padding: 0; }
.file-download { background: var(--blue-soft); color: var(--blue); border-radius: 8px; min-width: 36px; min-height: 36px; }
.file-download:hover { background: #dbeafe; color: var(--blue-hover); }

.file-url-panel {
  margin-top: 10px;
  position: relative;
  padding: 10px 36px 10px 12px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.file-url-panel > input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text);
  box-shadow: none;
}
.file-url-panel > .icon-button { position: absolute; right: 4px; top: 5px; }
.file-url-panel small { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.checksum { overflow-wrap: anywhere; font-family: var(--mono); }

.download-all { height: 44px; }
.download-all > span { font-size: 12px; opacity: 0.85; margin-left: auto; font-variant-numeric: tabular-nums; }
.download-tip { font-size: 12px; line-height: 1.6; color: var(--muted); text-align: center; margin-top: 12px; }

.guest-expiry {
  border-top: 1px solid var(--line);
  padding: 14px 28px;
  background: var(--surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.guest-expiry > .icon { width: 14px; height: 14px; }

.guest-error { text-align: center; padding: 48px 28px; }
.error-badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.error-badge .icon { width: 22px; height: 22px; }
.guest-error h1 { font-size: 20px; margin-bottom: 10px; }
.guest-error p { font-size: 13px; line-height: 1.65; color: var(--muted); margin-bottom: 6px; }
.guest-error .button { margin-top: 18px; }

/* Modal */
.modal {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(17, 24, 39, 0.14);
  padding: 28px;
  width: 540px;
  max-width: calc(100vw - 32px);
  max-height: 88vh;
  color: var(--text);
}
.modal::backdrop { background: rgba(17, 24, 39, 0.4); backdrop-filter: blur(2px); }
.modal-close { position: absolute; right: 14px; top: 14px; }
.modal-symbol {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--teal);
  background: var(--teal-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.modal-symbol.warning { background: var(--red-soft); color: var(--red); }
.modal h2 { font-size: 18px; line-height: 1.45; overflow-wrap: anywhere; padding-right: 28px; }
.modal > .muted { font-size: 13px; line-height: 1.6; margin-top: 6px; }
.link-box { background: var(--surface-muted); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-top: 20px; }
.link-box label { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.link-box > div { display: flex; align-items: center; gap: 6px; }
.link-box input { min-width: 0; width: 100%; padding: 0; border: none; background: transparent; font-size: 13px; font-family: var(--mono); color: var(--blue); box-shadow: none; }
.share-meta { display: flex; justify-content: space-between; gap: 20px; margin: 18px 0; }
.share-meta > div > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.share-meta > div > strong { font-size: 14px; font-weight: 600; color: var(--ink); }
.share-meta > div > small { font-size: 12px; display: block; color: var(--muted); margin-top: 2px; }
.share-modal-files { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); max-height: 150px; overflow: auto; padding: 6px 0; }
.share-modal-files > div { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 13px; }
.share-modal-files .icon { width: 15px; height: 15px; color: var(--muted); }
.share-modal-files span { flex: 1; overflow-wrap: anywhere; min-width: 0; }
.share-modal-files small { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.delivery-rule { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin: 14px 0 20px; }
.delivery-rule .icon { width: 14px; height: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.detail-tools { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }

#events-list { max-height: 200px; overflow: auto; margin-top: 12px; }
#events-list:empty { display: none; }
.event-row { font-size: 12px; border-bottom: 1px solid var(--line); padding: 9px 0; display: flex; gap: 10px; justify-content: space-between; }
.event-row > span { overflow-wrap: anywhere; min-width: 0; }
.event-row > small { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.initial-loading, .startup-error { padding: 100px 24px; text-align: center; color: var(--muted); }
.startup-error h1 { font-size: 20px; margin-bottom: 10px; }
.startup-error a { display: inline-block; margin-top: 16px; color: var(--blue); }

#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  max-width: 90vw;
}
#toast.visible { opacity: 1; transform: translate(-50%, 0); }
[hidden] { display: none !important; }

@media (max-width: 900px) {
  .compose-grid { grid-template-columns: 1fr; gap: 20px; }
  .dropzone { min-height: 170px; }
}

@media (max-width: 700px) {
  .topbar { padding: 0 16px; height: 56px; }
  .brand-type > span { display: none; }
  .workspace-body { padding: 20px 16px 36px; }
  .page-heading h1 { font-size: 20px; }
  .compose-card .card-heading, .compose-grid { padding: 16px; }
  .two-fields { grid-template-columns: 1fr; gap: 14px; }
  .compose-bottom { flex-direction: column; align-items: stretch; }
  .deliveries-header { padding: 16px 16px 0; }
  .search-box, .search-box > input { width: 100%; }
  .tabs { padding: 12px 16px 0; gap: 18px; overflow-x: auto; }
  th:first-child, td:first-child { padding-left: 16px; }
  th:last-child, td:last-child { padding-right: 16px; }
  .guest-header { padding: 14px 16px; }
  .guest-main { margin: 24px auto; padding: 0 16px; }
  .seal-bar { padding: 12px 18px; }
  .guest-body { padding: 20px 18px; }
  .guest-expiry { padding: 12px 18px; }
  .guest-card h1 { font-size: 19px; }
  .modal { padding: 22px 18px; }
  .share-meta { flex-direction: column; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
