:root {
  --bg: #ecebe7;
  --bg-soft: #f7f5f0;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --surface-muted: rgba(250, 248, 243, 0.84);
  --surface-dark: #171615;
  --text: #161513;
  --muted: #66615b;
  --muted-strong: #2f2a24;
  --line: rgba(22, 21, 19, 0.08);
  --line-strong: rgba(22, 21, 19, 0.16);
  --primary: #191714;
  --primary-strong: #000000;
  --primary-soft: #f0ede7;
  --info: #3a352f;
  --info-soft: #efebe5;
  --warm: #534a42;
  --warm-soft: #f1ede8;
  --success: #24211d;
  --success-soft: #efebe6;
  --danger: #2b2824;
  --danger-soft: #ece8e2;
  --shadow-lg: 0 22px 56px rgba(24, 22, 18, 0.08);
  --shadow-md: 0 12px 26px rgba(24, 22, 18, 0.06);
  --shadow-sm: 0 6px 14px rgba(24, 22, 18, 0.04);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "SUIT Variable", "Pretendard Variable", "Aptos", "Noto Sans KR", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(0, 0, 0, 0.035), transparent 24%),
    linear-gradient(180deg, #f5f3ee 0%, #ebe8e1 100%);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.55;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  width: 34rem;
  height: 34rem;
  border-radius: 999px;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

body::before {
  top: -14rem;
  right: -10rem;
  background: rgba(0, 0, 0, 0.04);
}

body::after {
  bottom: -16rem;
  left: -12rem;
  background: rgba(0, 0, 0, 0.035);
}

body.page-notice::before {
  background: rgba(0, 0, 0, 0.08);
}

body.page-notice .header {
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.07), transparent 22%),
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.05), transparent 26%),
    linear-gradient(135deg, #0f0f10 0%, #171718 54%, #232325 100%);
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  background: rgba(17, 17, 17, 0.06);
  border-radius: 999px;
  padding: 2px 8px;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

.hidden {
  display: none !important;
}

.header {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 28px 30px;
  margin-bottom: 22px;
  color: #f5f1ea;
  background:
    linear-gradient(135deg, #151311 0%, #1c1916 58%, #2a261f 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow-lg);
  animation: rise-in 0.65s ease both;
}

.header::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: calc(var(--radius-xl) - 1px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.header::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 72px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent);
  pointer-events: none;
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.9fr);
  align-items: stretch;
  gap: 22px;
  position: relative;
  z-index: 1;
}

.header-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.mail-header-topline {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.header-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cfc4b5;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.header h1 {
  font-family: "Sora", "Aptos Display", "SUIT Variable", sans-serif;
  font-size: clamp(2.1rem, 3.4vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  max-width: 12ch;
}

.page-mail .header h1 {
  max-width: none;
  white-space: nowrap;
}

.page-mail .header p {
  max-width: none;
  white-space: nowrap;
}

.page-notice .header h1 {
  max-width: none;
  white-space: nowrap;
}

.page-master .header h1 {
  max-width: none;
  white-space: nowrap;
}

.page-notice .header p {
  max-width: none;
  white-space: nowrap;
}

.page-notice .section-heading p {
  max-width: none;
  white-space: nowrap;
}

.header p {
  max-width: 60ch;
  margin-top: 10px;
  font-size: 0.95rem;
  color: #c1b7aa;
}

.header-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.mail-header-nav {
  margin-top: 0;
  justify-content: flex-end;
  flex-shrink: 0;
}

.header-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 15px;
  border-radius: 12px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: #ddd1c2;
  font-size: 0.84rem;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.header-nav-link:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.26);
  color: #ffffff;
}

.header-nav-link.active {
  background: #ffffff;
  border-color: transparent;
  color: #111111;
}

.header-side {
  display: grid;
  gap: 12px;
  align-content: start;
  justify-items: end;
}

.header-status-card {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  min-width: 160px;
  max-width: 180px;
  width: 100%;
}

.header-status-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  padding: 14px 16px;
}

.header-status-label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #b6b6b2;
  text-transform: uppercase;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 100%;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: #fbfbf8;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: normal;
  transition: all 0.25s ease;
}

.header-badge.running {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
  animation: pulse 1.6s infinite;
}

.header-badge.done {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.header-badge.error {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ededed;
}

.header-badge.stopped {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #dcdcdc;
}

.section-heading {
  margin: 18px 2px 12px;
  animation: rise-in 0.6s ease both;
}

.section-eyebrow {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin-top: 6px;
  font-family: "Sora", "Aptos Display", "SUIT Variable", sans-serif;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: var(--text);
}

.section-heading p {
  margin-top: 8px;
  max-width: 72ch;
  color: var(--muted);
  font-size: 0.9rem;
}

.panel {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  animation: rise-in 0.7s ease both;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 54px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.36), transparent);
  pointer-events: none;
}

.panel > * {
  position: relative;
  z-index: 1;
}

.panel-accent {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 246, 241, 0.92) 100%);
}

.panel-soft {
  background: linear-gradient(180deg, rgba(250, 248, 244, 0.97) 0%, rgba(255, 255, 255, 0.92) 100%);
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.results-header,
.summary-panel-head,
.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.results-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.panel-actions {
  justify-content: flex-end;
}

.drop-zone {
  position: relative;
  width: 100%;
  min-height: 232px;
  margin: 0;
  padding: 24px 20px;
  border-radius: 16px;
  border: 1px dashed rgba(22, 21, 19, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(246, 243, 237, 0.92) 100%);
  text-align: center;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.drop-zone-compact {
  min-height: 210px;
  padding: 22px 18px;
}

.drop-zone:hover,
.drop-zone.drag-over {
  transform: translateY(-1px);
  border-color: rgba(22, 21, 19, 0.28);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.06);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 241, 236, 0.98) 100%);
}

.drop-zone.drag-over {
  border-style: solid;
}

.drop-icon-wrap {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(22, 21, 19, 0.05);
  color: var(--primary);
  transition: transform 0.22s ease, background 0.22s ease;
}

.drop-zone:hover .drop-icon-wrap,
.drop-zone.drag-over .drop-icon-wrap {
  transform: translateY(-2px) scale(1.02);
  background: rgba(17, 17, 17, 0.12);
}

.drop-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.015em;
}

.drop-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.86rem;
}

.drop-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.btn-drop {
  min-width: 152px;
}

.upload-progress {
  margin-top: 18px;
}

.upload-bar-wrap,
.progress-wrap {
  background: rgba(16, 32, 51, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.upload-bar-wrap {
  height: 8px;
  margin-bottom: 10px;
}

.upload-bar,
.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #111111 0%, #3a3a3a 52%, #868686 100%);
}

.upload-bar {
  width: 0;
  transition: width 0.22s ease;
  animation: upload-glow 1.3s ease-in-out infinite;
}

.upload-text {
  color: var(--muted);
  font-size: 0.86rem;
}

.upload-done {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-top: 18px;
  width: 100%;
  color: var(--muted-strong);
  font-size: 0.94rem;
  font-weight: 700;
}

.upload-done > * {
  max-width: 100%;
}

.uploaded-list-panel {
  margin-top: 14px;
  width: 100%;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(22, 21, 19, 0.08);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.uploaded-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(22, 21, 19, 0.04);
  border-bottom: 1px solid rgba(22, 21, 19, 0.08);
}

.uploaded-list-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--muted-strong);
}

.uploaded-list-body {
  max-height: 220px;
  overflow-y: auto;
}

.uploaded-files-list {
  list-style: none;
}

.uploaded-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(22, 21, 19, 0.06);
}

.uploaded-list-item:last-child {
  border-bottom: none;
}

.uploaded-list-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.45;
  word-break: break-all;
  color: var(--text);
  font-size: 0.85rem;
}

.uploaded-list-meta {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.uploaded-list-remove {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: #93a0af;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 7px;
  border-radius: 999px;
}

.uploaded-list-remove:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn-inline-danger {
  background: #efefef;
  color: #171717;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-inline-danger:hover {
  background: #e4e4e4;
}

.table-row-index {
  color: #8b8b8b;
  font-size: 0.78rem;
  text-align: center;
}

.cell-placeholder,
.status-inline-note {
  color: #8b8b8b;
  font-size: 0.82rem;
}

.error-inline {
  color: #424242;
  font-size: 0.75rem;
  margin-top: 3px;
}

.start-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(135deg, #171411 0%, #0d0b09 100%);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.14);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #2a2a2a 0%, #111111 100%);
}

.btn-danger {
  color: #ffffff;
  background: linear-gradient(135deg, #4a433a 0%, #28231d 100%);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.12);
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #4a4a4a 0%, #2a2a2a 100%);
}

.btn-outline {
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(22, 21, 19, 0.12);
  box-shadow: 0 6px 14px rgba(16, 32, 51, 0.04);
}

.btn-outline:hover:not(:disabled) {
  border-color: rgba(17, 17, 17, 0.28);
  color: #000000;
  background: rgba(245, 245, 245, 0.92);
}

.btn-download {
  color: #ffffff;
  background: linear-gradient(135deg, #1f1b16 0%, #0f0d0b 100%);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.14);
}

.btn-download:hover:not(:disabled) {
  background: linear-gradient(135deg, #2a2a2a 0%, #111111 100%);
}

.progress-header .btn-danger {
  flex-shrink: 0;
}

.btn-ghost {
  color: var(--muted-strong);
  background: rgba(242, 239, 233, 0.9);
  border: 1px solid rgba(22, 21, 19, 0.1);
  box-shadow: none;
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(236, 232, 225, 1);
  border-color: rgba(22, 21, 19, 0.18);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  flex: 1;
}

.stat-card {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(22, 21, 19, 0.08);
  background: rgba(255, 255, 255, 0.78);
  padding: 14px 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: rgba(16, 32, 51, 0.08);
}

.stat-processing {
  background: rgba(244, 244, 244, 0.86);
}

.stat-processing::before {
  background: #4a4a4a;
}

.stat-done {
  background: rgba(249, 249, 249, 0.92);
}

.stat-done::before {
  background: #181818;
}

.stat-classified {
  background: rgba(242, 242, 242, 0.94);
}

.stat-classified::before {
  background: #111111;
}

.stat-unclassified {
  background: rgba(243, 236, 223, 0.96);
}

.stat-unclassified::before {
  background: #9a6a22;
}

.stat-error {
  background: rgba(234, 234, 234, 0.92);
}

.stat-error::before {
  background: #2a2a2a;
}

.stat-value {
  display: block;
  font-family: "Sora", "Aptos Display", sans-serif;
  font-size: 1.55rem;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--text);
}

.stat-label {
  display: block;
  margin-top: 8px;
  color: var(--muted-strong);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.progress-wrap {
  height: 8px;
  margin: 16px 0 10px;
}

.progress-bar {
  width: 0;
  transition: width 0.35s ease;
}

.progress-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.actions-summary,
.info-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.info-note {
  margin-top: 16px;
}

.summary-panel-head {
  margin-bottom: 12px;
}

.save-path-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.save-path-controls {
  flex: 1 1 520px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.save-path-label {
  min-width: 110px;
  color: var(--muted-strong);
  font-size: 0.88rem;
  font-weight: 700;
}

.save-path-input {
  flex: 1 1 320px;
  min-width: 260px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(16, 32, 51, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.save-path-input::placeholder {
  color: #91a0b1;
}

.save-path-input:focus {
  outline: none;
  border-color: rgba(17, 17, 17, 0.3);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.08);
}

.save-path-btn {
  padding-inline: 14px;
}

.notice-download-actions {
  width: 100%;
  justify-content: flex-end;
}

.notice-download-actions .save-path-row {
  flex: 1 1 540px;
  justify-content: flex-end;
  margin-bottom: 0;
}

.notice-download-actions .save-path-controls {
  flex: 1 1 420px;
}

.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(22, 21, 19, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.filter-btn:hover {
  transform: translateY(-1px);
  color: #000000;
  border-color: rgba(17, 17, 17, 0.24);
}

.filter-btn.active {
  background: linear-gradient(135deg, #171411 0%, #0d0b09 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.table-wrap {
  overflow: auto;
  max-height: min(62vh, 760px);
  border-radius: 16px;
  border: 1px solid rgba(22, 21, 19, 0.08);
  background: rgba(255, 255, 255, 0.72);
  overscroll-behavior: contain;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
  font-size: 0.9rem;
}

.results-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 13px 12px;
  text-align: left;
  background: linear-gradient(180deg, #181511 0%, #0f0d0a 100%);
  color: #f2ede6;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.results-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(22, 21, 19, 0.06);
  vertical-align: top;
  color: var(--text);
}

.results-table tbody tr {
  transition: background 0.16s ease;
}

.results-table tbody tr:nth-child(even) td {
  background: rgba(248, 246, 241, 0.62);
}

.results-table tbody tr:hover td {
  background: rgba(242, 238, 231, 0.96);
}

.results-table tbody tr:last-child td {
  border-bottom: none;
}

.results-table tr.row-processing td {
  background: rgba(243, 240, 234, 0.92);
}

.results-table tr.row-processing:hover td {
  background: rgba(237, 233, 226, 0.96);
}

.results-table tr.row-stopped td {
  background: rgba(244, 246, 248, 0.72);
  opacity: 0.72;
}

.results-table tr.row-unclassified td {
  background: rgba(247, 240, 228, 0.96);
}

.results-table tr.row-unclassified:hover td {
  background: rgba(242, 232, 214, 0.98);
}

.results-table tr.row-error td {
  background: rgba(236, 232, 226, 0.92);
}

.results-table tr.row-error:hover td {
  background: rgba(224, 224, 224, 0.98);
}

.page-notice {
  background:
    radial-gradient(circle at 12% 10%, rgba(18, 59, 95, 0.08), transparent 24%),
    radial-gradient(circle at 88% 14%, rgba(9, 34, 56, 0.08), transparent 22%),
    linear-gradient(180deg, #eff3f7 0%, #e5ebf1 100%);
}

.page-notice::before {
  background: rgba(21, 63, 102, 0.12);
}

.page-notice::after {
  background: rgba(10, 35, 57, 0.08);
}

.page-notice .app {
  max-width: 1680px;
  padding-top: 28px;
}

.page-notice .header {
  padding: 34px 34px 30px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: #10263a;
  box-shadow:
    0 34px 64px rgba(12, 27, 43, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.page-notice .header::after {
  height: 96px;
  background: rgba(255, 255, 255, 0.03);
}

.page-notice .header-kicker {
  background: rgba(161, 201, 232, 0.12);
  border-color: rgba(161, 201, 232, 0.16);
  color: #d8ebf7;
}

.page-notice .header p {
  color: rgba(221, 233, 243, 0.82);
}

.page-notice .header-status-card {
  min-width: 196px;
  max-width: 212px;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(174, 204, 228, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.page-notice .header-status-label {
  color: #b7d2e8;
}

.page-notice .header-badge {
  background: rgba(10, 28, 43, 0.5);
  border-color: rgba(174, 204, 228, 0.14);
}

.page-notice .header-badge.running {
  background: rgba(34, 91, 136, 0.5);
  border-color: rgba(140, 189, 227, 0.3);
}

.page-notice .header-badge.done {
  background: rgba(28, 74, 113, 0.56);
  border-color: rgba(140, 189, 227, 0.26);
}

.page-notice .section-heading {
  position: relative;
  margin-top: 26px;
  margin-bottom: 14px;
  padding-left: 18px;
}

.page-notice .section-heading::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: #2f648d;
}

.page-notice .section-eyebrow {
  color: #234c6f;
}

.page-notice .section-heading h2 {
  color: #132739;
  letter-spacing: -0.04em;
}

.page-notice .section-heading p {
  color: #5d6f80;
  max-width: 88ch;
}

.page-notice .panel {
  border-radius: 22px;
  border: 1px solid rgba(24, 55, 82, 0.08);
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 18px 34px rgba(18, 41, 63, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
  margin-bottom: 18px;
}

.page-notice .panel::before {
  height: 70px;
  background: rgba(255, 255, 255, 0.2);
}

.page-notice .panel-accent {
  background: #fbfdff;
}

.page-notice .panel-soft {
  background: #f6fafc;
}

.page-notice .results-header,
.page-notice .summary-panel-head,
.page-notice .progress-header {
  align-items: flex-start;
  gap: 18px;
}

.page-notice .results-header + .results-header {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(24, 55, 82, 0.08);
}

.page-notice .drop-title {
  font-size: 1.02rem;
  color: #11283d;
}

.page-notice .drop-sub {
  color: #607282;
  font-size: 0.88rem;
}

.page-notice .upload-grid {
  gap: 18px;
  margin-top: 18px;
  margin-bottom: 22px;
}

.page-notice .drop-zone {
  min-height: 228px;
  padding: 26px 22px;
  border: 1px solid rgba(32, 72, 104, 0.12);
  border-style: solid;
  background: #fbfdff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.page-notice .drop-zone::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 16px;
  border: 1px dashed rgba(55, 96, 129, 0.16);
  pointer-events: none;
}

.page-notice .drop-zone:hover,
.page-notice .drop-zone.drag-over {
  transform: translateY(-2px);
  border-color: rgba(42, 89, 125, 0.22);
  background: #f4f9fc;
  box-shadow:
    0 18px 30px rgba(22, 50, 75, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.page-notice .drop-zone.drag-over::after {
  border-style: solid;
  border-color: rgba(48, 103, 146, 0.22);
}

.page-notice .drop-icon-wrap {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: rgba(20, 56, 84, 0.1);
  color: #163956;
}

.page-notice .drop-zone:hover .drop-icon-wrap,
.page-notice .drop-zone.drag-over .drop-icon-wrap {
  background: rgba(20, 56, 84, 0.16);
}

.page-notice .drop-actions {
  gap: 8px;
}

.page-notice .btn {
  border-radius: 13px;
}

.page-notice .btn-primary {
  background: #153a57;
  box-shadow: 0 16px 28px rgba(18, 42, 64, 0.2);
}

.page-notice .btn-primary:hover:not(:disabled) {
  background: #1b4b70;
}

.page-notice .btn-danger {
  background: #3d4f60;
}

.page-notice .btn-outline {
  background: #ffffff;
  border-color: rgba(31, 74, 108, 0.14);
  color: #17344c;
}

.page-notice .btn-outline:hover:not(:disabled) {
  border-color: rgba(31, 74, 108, 0.28);
  background: #f2f7fb;
}

.page-notice .btn-download {
  background: #102f48;
  box-shadow: 0 16px 28px rgba(12, 34, 53, 0.16);
}

.page-notice .btn-ghost {
  background: rgba(240, 246, 250, 0.96);
  border-color: rgba(31, 74, 108, 0.1);
  color: #29445b;
}

.page-notice .btn-inline-danger {
  background: rgba(238, 244, 248, 0.92);
  border-color: rgba(31, 74, 108, 0.12);
  color: #2b4257;
}

.page-notice .btn-inline-danger:hover {
  background: rgba(226, 236, 243, 0.98);
}

.page-notice .uploaded-list-panel {
  border-radius: 16px;
  border-color: rgba(31, 74, 108, 0.08);
  background: rgba(250, 252, 253, 0.94);
}

.page-notice .uploaded-list-head {
  background: #edf4f8;
  border-bottom-color: rgba(31, 74, 108, 0.08);
}

.page-notice .stats-row {
  gap: 12px;
}

.page-notice .stat-card {
  border-radius: 16px;
  border-color: rgba(31, 74, 108, 0.08);
  background: #ffffff;
  padding: 16px 14px;
}

.page-notice .stat-card::before {
  width: 4px;
  background: #3b719c;
}

.page-notice .stat-processing {
  background: #f2f7fb;
}

.page-notice .stat-done {
  background: #f5fafc;
}

.page-notice .stat-classified {
  background: #f2f8fc;
}

.page-notice .stat-unclassified {
  background: #f7f1e6;
}

.page-notice .stat-value {
  color: #15314a;
  font-size: 1.7rem;
}

.page-notice .stat-label {
  color: #496174;
}

.page-notice .table-wrap {
  border-radius: 18px;
  border-color: rgba(30, 72, 105, 0.1);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

.page-notice .results-table {
  min-width: 1120px;
}

.page-notice .results-table th {
  background: #153851;
  color: #edf6fb;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.page-notice .results-table tbody tr:nth-child(even) td {
  background: rgba(246, 250, 252, 0.82);
}

.page-notice .results-table tbody tr:hover td {
  background: rgba(237, 245, 250, 0.98);
}

.page-notice .results-table tr.row-unclassified td {
  background: rgba(249, 244, 231, 0.98);
}

.page-notice .cell-case {
  color: #1b4769;
}

.page-notice .cell-date,
.page-notice .cell-file {
  color: #5c7082;
}

.page-notice .cell-summary {
  color: #31485c;
}

.page-notice .info-note,
.page-notice .actions-summary {
  color: #5c7082;
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.workflow-step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(20, 20, 20, 0.08);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.66);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.workflow-step:hover {
  transform: translateY(-1px);
}

.workflow-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  flex: 0 0 auto;
}

.workflow-step-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.workflow-step-copy strong {
  font-size: 0.94rem;
  letter-spacing: -0.02em;
}

.workflow-step-copy span {
  font-size: 0.82rem;
  line-height: 1.5;
}

.ux-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 4px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(20, 20, 20, 0.08);
  background: rgba(255, 255, 255, 0.62);
}

.ux-note strong {
  min-width: 72px;
  font-size: 0.84rem;
  letter-spacing: 0.02em;
}

.ux-note span {
  font-size: 0.87rem;
  line-height: 1.6;
}

.page-mail {
  background:
    radial-gradient(circle at 12% 10%, rgba(18, 59, 95, 0.08), transparent 24%),
    radial-gradient(circle at 88% 14%, rgba(9, 34, 56, 0.08), transparent 22%),
    linear-gradient(180deg, #eff3f7 0%, #e5ebf1 100%);
}

.page-mail::before {
  background: rgba(21, 63, 102, 0.12);
}

.page-mail::after {
  background: rgba(10, 35, 57, 0.08);
}

.page-mail .app {
  max-width: 1680px;
  padding-top: 28px;
}

.page-mail .header {
  padding: 34px 34px 30px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: #10263a;
  box-shadow:
    0 34px 64px rgba(12, 27, 43, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.page-mail .header-kicker {
  background: rgba(161, 201, 232, 0.12);
  border-color: rgba(161, 201, 232, 0.16);
  color: #d8ebf7;
}

.page-mail .header p {
  color: rgba(221, 233, 243, 0.82);
}

.page-mail .header-status-card {
  min-width: 196px;
  max-width: 212px;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(174, 204, 228, 0.14);
}

.page-mail .header-status-label {
  color: #b7d2e8;
}

.page-mail .header-badge {
  background: rgba(10, 28, 43, 0.5);
  border-color: rgba(174, 204, 228, 0.14);
}

.page-mail .header-badge.running {
  background: rgba(34, 91, 136, 0.5);
  border-color: rgba(140, 189, 227, 0.3);
}

.page-mail .header-badge.done {
  background: rgba(28, 74, 113, 0.56);
  border-color: rgba(140, 189, 227, 0.26);
}

.page-mail .section-heading {
  position: relative;
  margin-top: 26px;
  margin-bottom: 14px;
  padding-left: 18px;
}

.page-mail .section-heading::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: #2f648d;
}

.page-mail .section-eyebrow {
  color: #234c6f;
}

.page-mail .section-heading h2 {
  color: #132739;
}

.page-mail .section-heading p {
  color: #5d6f80;
  max-width: 88ch;
}

.page-mail .panel {
  border-radius: 22px;
  border: 1px solid rgba(24, 55, 82, 0.08);
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 18px 34px rgba(18, 41, 63, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  margin-bottom: 18px;
}

.page-mail .panel::before {
  height: 70px;
  background: rgba(255, 255, 255, 0.18);
}

.page-mail .panel-accent {
  background: #fbfdff;
}

.page-mail .panel-soft {
  background: #f6fafc;
}

.page-mail .results-header,
.page-mail .summary-panel-head,
.page-mail .progress-header {
  align-items: flex-start;
  gap: 18px;
}

.page-mail .drop-title {
  color: #11283d;
}

.page-mail .drop-sub {
  color: #607282;
}

.page-mail .drop-zone {
  min-height: 228px;
  padding: 26px 22px;
  border: 1px solid rgba(32, 72, 104, 0.12);
  border-style: solid;
  background: #fbfdff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.page-mail .drop-zone::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 16px;
  border: 1px dashed rgba(55, 96, 129, 0.16);
  pointer-events: none;
}

.page-mail .drop-zone:hover,
.page-mail .drop-zone.drag-over {
  transform: translateY(-2px);
  border-color: rgba(42, 89, 125, 0.22);
  background: #f4f9fc;
  box-shadow:
    0 18px 30px rgba(22, 50, 75, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.page-mail .drop-zone.drag-over::after {
  border-style: solid;
  border-color: rgba(48, 103, 146, 0.22);
}

.page-mail .drop-icon-wrap {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: rgba(20, 56, 84, 0.1);
  color: #163956;
}

.page-mail .drop-zone:hover .drop-icon-wrap,
.page-mail .drop-zone.drag-over .drop-icon-wrap {
  background: rgba(20, 56, 84, 0.16);
}

.page-mail .btn {
  border-radius: 13px;
}

.page-mail .btn-primary {
  background: #6a4b2a;
  box-shadow: 0 16px 28px rgba(58, 38, 20, 0.18);
}

.page-mail .btn-primary:hover:not(:disabled) {
  background: #7a5937;
}

.page-mail .btn-danger {
  background: #5d4b39;
}

.page-mail .btn-outline {
  background: #ffffff;
  border-color: rgba(89, 66, 39, 0.12);
  color: #4a3420;
}

.page-mail .btn-outline:hover:not(:disabled) {
  border-color: rgba(89, 66, 39, 0.24);
  background: #f7f0e7;
}

.page-mail .btn-download {
  background: #4d381f;
  box-shadow: 0 16px 28px rgba(49, 32, 17, 0.16);
}

.page-mail .btn-ghost {
  background: rgba(248, 243, 237, 0.96);
  border-color: rgba(89, 66, 39, 0.08);
  color: #61452c;
}

.page-mail .btn-inline-danger {
  background: rgba(247, 242, 236, 0.96);
  border-color: rgba(89, 66, 39, 0.1);
  color: #624930;
}

.page-mail .btn-inline-danger:hover {
  background: rgba(240, 232, 222, 0.98);
}

.page-mail .filter-group {
  background: rgba(249, 244, 237, 0.88);
  border: 1px solid rgba(89, 66, 39, 0.08);
  border-radius: 14px;
  padding: 6px;
}

.page-mail .filter-btn {
  border-radius: 10px;
  border-color: transparent;
  background: transparent;
}

.page-mail .filter-btn:hover {
  background: rgba(95, 72, 45, 0.08);
}

.page-mail .filter-btn.active {
  background: #6d4e2c;
  box-shadow: 0 10px 18px rgba(64, 42, 20, 0.16);
}

.page-mail .stats-row {
  gap: 12px;
}

.page-mail .stat-card {
  border-radius: 16px;
  border-color: rgba(89, 66, 39, 0.08);
  background: #ffffff;
  padding: 16px 14px;
}

.page-mail .stat-card::before {
  width: 4px;
  background: #b78958;
}

.page-mail .stat-processing {
  background: #f8f3ed;
}

.page-mail .stat-done {
  background: #faf7f3;
}

.page-mail .stat-classified {
  background: #faf7f2;
}

.page-mail .stat-unclassified {
  background: #f7eedb;
}

.page-mail .stat-error {
  background: #f3ede8;
}

.page-mail .stat-value {
  color: #3b2a1c;
  font-size: 1.7rem;
}

.page-mail .stat-label {
  color: #6a5949;
}

.page-mail .table-wrap {
  border-radius: 18px;
  border-color: rgba(89, 66, 39, 0.08);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.page-mail .results-table th {
  background: #4b361e;
  color: #f6efe5;
}

.page-mail .results-table tbody tr:nth-child(even) td {
  background: rgba(250, 247, 243, 0.82);
}

.page-mail .results-table tbody tr:hover td {
  background: rgba(246, 240, 233, 0.96);
}

.page-mail .results-table tr.row-processing td {
  background: rgba(247, 241, 233, 0.96);
}

.page-mail .results-table tr.row-unclassified td {
  background: rgba(249, 242, 226, 0.98);
}

.page-mail .cell-case {
  color: #1b4769;
}

.page-mail .cell-date,
.page-mail .cell-file {
  color: #5c7082;
}

.page-mail .cell-summary {
  color: #31485c;
}

.page-mail .uploaded-list-panel {
  border-radius: 16px;
  border-color: rgba(31, 74, 108, 0.08);
  background: rgba(250, 252, 253, 0.94);
}

.page-mail .uploaded-list-head {
  background: #edf4f8;
  border-bottom-color: rgba(31, 74, 108, 0.08);
}

.page-mail .info-note,
.page-mail .actions-summary {
  color: #5c7082;
}

.page-mail .workflow-step {
  border-color: rgba(31, 74, 108, 0.09);
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 10px 22px rgba(20, 47, 71, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.page-mail .workflow-step-index {
  background: rgba(22, 57, 86, 0.12);
  color: #163956;
}

.page-mail .workflow-step-copy strong {
  color: #132739;
}

.page-mail .workflow-step-copy span {
  color: #5f7182;
}

.page-mail .workflow-step.active {
  border-color: rgba(31, 74, 108, 0.18);
  background: #f8fcff;
  box-shadow: 0 18px 28px rgba(19, 47, 70, 0.08);
}

.page-mail .workflow-step.done {
  border-color: rgba(31, 74, 108, 0.18);
  background: #edf5fa;
}

.page-mail .ux-note {
  border-color: rgba(31, 74, 108, 0.08);
  background: #f4f9fc;
}

.page-mail .ux-note strong {
  color: #204765;
}

.page-mail .ux-note span {
  color: #607282;
}

.page-notice .workflow-step {
  border-color: rgba(31, 74, 108, 0.09);
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 10px 22px rgba(20, 47, 71, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.page-notice .workflow-step-index {
  background: rgba(22, 57, 86, 0.12);
  color: #163956;
}

.page-notice .workflow-step-copy strong {
  color: #132739;
}

.page-notice .workflow-step-copy span {
  color: #5f7182;
}

.page-notice .workflow-step.active {
  border-color: rgba(31, 74, 108, 0.18);
  background: #f8fcff;
  box-shadow: 0 18px 28px rgba(19, 47, 70, 0.08);
}

.page-notice .workflow-step.done {
  border-color: rgba(31, 74, 108, 0.18);
  background: #edf5fa;
}

.page-notice .ux-note {
  border-color: rgba(31, 74, 108, 0.08);
  background: #f4f9fc;
}

.page-notice .ux-note strong {
  color: #204765;
}

.page-notice .ux-note span {
  color: #607282;
}

.result-row {
  animation: row-in 0.24s ease;
}

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 5px;
  border-radius: 999px;
  border: 2px solid rgba(17, 17, 17, 0.12);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

.cell-file {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.83rem;
}

.cell-case {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--info);
}

.cell-subject {
  max-width: 240px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--text);
}

.cell-date {
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.83rem;
}

.cell-category {
  color: var(--text);
  font-size: 0.85rem;
}

.cell-summary {
  max-width: 300px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-height: 1.55;
  color: var(--muted-strong);
}

.artifact-cell {
  display: grid;
  gap: 6px;
}

.artifact-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.artifact-badge-report {
  background: rgba(21, 58, 87, 0.12);
  color: #153a57;
}

.artifact-badge-estimate {
  background: rgba(96, 114, 130, 0.14);
  color: #425364;
}

.artifact-empty {
  color: var(--muted);
  font-size: 0.84rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.badge-ok {
  background: var(--success-soft);
  color: #111111;
}

.badge-unclassified {
  background: #f3dfbb;
  color: #7a4a00;
  border: 1px solid rgba(154, 106, 34, 0.18);
}

.badge-error {
  background: var(--danger-soft);
  color: #202020;
}

.badge-in {
  background: var(--info-soft);
  color: #232323;
}

.badge-out {
  background: #ececec;
  color: #2f2f2f;
}

.badge-processing {
  background: var(--primary-soft);
  color: #111111;
  animation: pulse 1.4s infinite;
}

.badge-stopped {
  background: #ededed;
  color: #5f5f5f;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(16, 32, 51, 0.18);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 32, 51, 0.3);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

@keyframes upload-glow {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.68;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes row-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.master-kpi-grid,
.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.stat-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
}

.stat-panel span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.stat-panel strong {
  margin-top: 12px;
  font-size: clamp(1.1rem, 2.2vw, 2rem);
  line-height: 1.1;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.activity-list {
  display: grid;
  gap: 10px;
}

.activity-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-muted);
}

.activity-card h4 {
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.activity-card ul {
  list-style: none;
  display: grid;
  gap: 6px;
}

.activity-card li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.84rem;
}

.activity-card time {
  color: var(--muted);
}

.audit-list {
  display: grid;
  gap: 10px;
}

.audit-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(110px, 0.65fr) minmax(220px, 1.3fr) minmax(150px, 0.7fr);
  gap: 12px;
  align-items: center;
}

.audit-left,
.audit-mid,
.audit-right {
  display: grid;
  gap: 4px;
  font-size: 0.8rem;
}

.audit-right {
  text-align: right;
}

@media (max-width: 1180px) {
  .header-inner {
    grid-template-columns: 1fr;
  }

  .mail-header-topline {
    flex-direction: column;
    align-items: flex-start;
  }

  .mail-header-nav {
    justify-content: flex-start;
  }

  .upload-grid {
    grid-template-columns: 1fr;
  }

  .master-kpi-grid,
  .admin-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .audit-item {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .audit-right {
    text-align: left;
  }
}

@media (max-width: 820px) {
  .app {
    padding: 18px 16px 56px;
  }

  .header {
    padding: 24px 20px;
    border-radius: 26px;
  }

  .header h1 {
    max-width: none;
  }

  .page-mail .header h1 {
    white-space: normal;
  }

  .page-mail .header p {
    white-space: normal;
  }

  .header-status-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .panel {
    padding: 20px;
    border-radius: 22px;
  }

  .drop-zone,
  .drop-zone-compact {
    min-height: unset;
    padding: 22px 16px;
  }

  .workflow-strip {
    grid-template-columns: 1fr;
  }

  .workflow-step {
    padding: 14px 15px;
  }

  .ux-note {
    flex-direction: column;
    gap: 8px;
  }

  .ux-note strong {
    min-width: 0;
  }

  .progress-info,
  .results-header,
  .summary-panel-head,
  .progress-header {
    align-items: flex-start;
  }

  .start-row {
    justify-content: stretch;
  }

  .start-row .btn,
  .results-right .btn,
  .summary-panel-head .btn {
    width: 100%;
  }

  .save-path-row {
    align-items: stretch;
  }

  .save-path-label,
  .save-path-controls,
  .save-path-input {
    min-width: 100%;
  }

  .notice-download-actions {
    justify-content: stretch;
  }

  .notice-download-actions .save-path-row {
    flex-basis: 100%;
    justify-content: stretch;
  }

  .notice-download-actions .save-path-controls {
    flex-basis: 100%;
  }

  .master-kpi-grid,
  .admin-kpi-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

.table-actions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.master-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 30;
}

.master-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--surface-strong);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  z-index: 31;
  padding: 20px;
}

.master-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.master-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.master-form-grid-wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.master-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: var(--muted-strong);
}

.master-form-grid input,
.master-form-grid select,
#deleteTenantModal input {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
}

.master-modal-actions {
  margin-top: 14px;
  margin-bottom: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(460px, 100%);
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 28px;
}

.auth-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 10px;
}

.auth-card h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.auth-card p {
  color: var(--muted);
  margin-bottom: 18px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted-strong);
  font-weight: 600;
}

.auth-form input {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0 12px;
}

.auth-error {
  color: #9f1a1a;
  background: #fff0f0;
  border: 1px solid #e8c9c9;
  border-radius: 10px;
  padding: 8px 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-pill.active {
  color: #14532d;
  background: #dcfce7;
}

.status-pill.inactive {
  color: #7f1d1d;
  background: #fee2e2;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  z-index: 60;
}

.toast-item {
  min-width: 240px;
  max-width: 460px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 10px 12px;
  box-shadow: var(--shadow-md);
  font-size: 0.86rem;
  animation: rise-in 0.2s ease;
}

.toast-item.info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e3a8a;
}

.toast-item.success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.toast-item.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.admin-welcome-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-welcome-row h2 {
  font-size: 1.3rem;
  margin-bottom: 2px;
}

.admin-welcome-row p {
  color: var(--muted);
  font-size: 0.92rem;
}

.admin-date-badge {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.86rem;
  box-shadow: var(--shadow-sm);
}

.admin-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  margin-bottom: 14px;
}

.admin-hero-card {
  border: 1px solid #d8ead9;
  background: linear-gradient(180deg, #ffffff 0%, #f4fbf3 100%);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-hero-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.admin-hero-chip {
  font-size: 0.74rem;
  font-weight: 700;
  color: #1f7a44;
  background: #e8f6ec;
  border: 1px solid #cce8d3;
  border-radius: 999px;
  padding: 4px 8px;
}

.admin-hero-story {
  font-size: 1.03rem;
  color: var(--muted-strong);
  line-height: 1.6;
}

.admin-hero-story strong {
  color: #1f7a44;
}

.admin-hero-value {
  margin-top: 8px;
  font-size: clamp(2.1rem, 5.5vw, 3.8rem);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 900;
  color: #1f7a44;
}

.admin-hero-sub {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

.admin-ai-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.admin-today-card {
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.admin-today-label {
  font-size: 0.83rem;
  color: var(--muted);
  font-weight: 700;
}

.admin-today-value {
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.1;
  font-weight: 900;
  margin-top: 6px;
}

.admin-today-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.8rem;
}

.admin-feed-card {
  min-height: 170px;
}

.admin-feed-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.admin-feed-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
  padding: 10px 12px;
}

.admin-feed-msg {
  font-size: 0.88rem;
  color: var(--muted-strong);
}

.admin-feed-time {
  margin-top: 3px;
  font-size: 0.78rem;
  color: var(--muted);
}

.admin-traffic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.admin-traffic-card {
  min-height: 140px;
  border-left: 5px solid transparent;
}

.admin-traffic-card.done {
  border-left-color: #1f7a44;
  background: linear-gradient(90deg, #f0fbf2 0%, #ffffff 35%);
}

.admin-traffic-card.review {
  border-left-color: #8b6d38;
  background: linear-gradient(90deg, #faf5ea 0%, #ffffff 35%);
}

.admin-traffic-card.alert {
  border-left-color: #8a3a3a;
  background: linear-gradient(90deg, #fbf0f0 0%, #ffffff 35%);
}

.admin-traffic-title {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 700;
}

.admin-traffic-value {
  margin-top: 6px;
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  font-weight: 900;
}

.admin-traffic-desc {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}

.admin-kpi-grid-ref {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.admin-visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.admin-volume-bars,
.admin-user-bars {
  display: grid;
  gap: 9px;
}

.admin-volume-row {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 8px;
  align-items: center;
}

.admin-volume-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
}

.admin-volume-track {
  height: 10px;
  border-radius: 999px;
  background: var(--info-soft);
  overflow: hidden;
}

.admin-volume-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4e453c 0%, #171615 100%);
}

.admin-volume-value {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
}

.admin-user-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
  padding: 9px 10px;
}

.admin-user-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  font-weight: 700;
}

.admin-user-track {
  margin-top: 6px;
  height: 8px;
  border-radius: 999px;
  background: var(--info-soft);
  overflow: hidden;
}

.admin-user-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #23201d 0%, #5a5147 100%);
}

.admin-user-meta {
  margin-top: 5px;
  font-size: 0.74rem;
  color: var(--muted);
}

@media (max-width: 1180px) {
  .admin-kpi-grid-ref {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-ai-grid {
    grid-template-columns: 1fr;
  }

  .admin-traffic-grid {
    grid-template-columns: 1fr;
  }

  .admin-visual-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .admin-welcome-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-kpi-grid-ref {
    grid-template-columns: 1fr;
  }
}
