.vt-page {
  max-width: min(1280px, calc(100vw - 40px));
  margin: 0 auto;
}

.vt-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(120px, 0.6fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 22px;
}

.vt-search,
.vt-inline-filter,
.vt-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vt-search span,
.vt-inline-filter span,
.vt-field span,
.vt-country-label,
.vt-search-result-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text3);
  font-family: var(--font-mono);
}

.vt-search input,
.vt-inline-filter input,
.vt-inline-filter select,
.vt-field input {
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0 14px;
  font: inherit;
  outline: none;
}

.vt-search input:focus,
.vt-inline-filter input:focus,
.vt-inline-filter select:focus,
.vt-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

.vt-results {
  min-height: 220px;
}

.vt-year-group + .vt-year-group {
  margin-top: 10px;
}

.vt-tree-group {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface2) 88%, transparent), var(--surface));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.vt-tree-group + .vt-tree-group {
  margin-top: 8px;
}

.vt-tree-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}

.vt-tree-summary::-webkit-details-marker {
  display: none;
}

.vt-tree-summary::before {
  content: '▸';
  color: var(--text2);
  margin-right: 6px;
  transition: transform 0.18s ease;
}

.vt-tree-group[open] > .vt-tree-summary::before {
  transform: rotate(90deg);
}

.vt-tree-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  font-weight: 700;
}

.vt-tree-summary-year .vt-tree-title {
  font-size: 14px;
  letter-spacing: -0.01em;
}

.vt-tree-summary-month .vt-tree-title,
.vt-tree-summary-country .vt-tree-title {
  font-size: 13px;
}

.vt-tree-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 11px;
  font-weight: 700;
}

.vt-tree-body {
  padding: 0 10px 10px;
}

.vt-tree-group-month,
.vt-tree-group-country {
  border-radius: 12px;
}

.vt-tree-group-month {
  margin-top: 8px;
}

.vt-tree-group-country {
  margin-top: 6px;
}

.vt-file-list,
.vt-search-results-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vt-search-result {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface2) 90%, transparent), var(--surface));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.vt-search-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.vt-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface2) 76%, transparent);
}

.vt-file-row-name {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  text-align: left;
  text-decoration: none;
  min-width: 0;
  flex: 1;
  word-break: break-word;
}

.vt-file-row-name:hover {
  color: var(--accent);
}

.vt-file-row-meta {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--text2);
  white-space: nowrap;
}

.vt-file-country,
.vt-search-result-date {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 6px;
}

.vt-file-name {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 0;
  text-align: left;
  text-decoration: none;
  word-break: break-word;
}

.vt-file-name:hover {
  color: var(--accent);
}

.vt-file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text2);
}

.vt-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.vt-file-badge,
.vt-upload-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent2);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}

.vt-file-badge.is-error,
.vt-upload-badge.is-skipped {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.28);
}

.vt-sheet-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.vt-sheet-list span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text2);
}

.vt-search-result-section + .vt-search-result-section {
  margin-top: 12px;
}

.vt-load-more {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.vt-load-more-label {
  font-size: 12px;
  color: var(--text2);
}

.vt-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(4, 8, 18, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.vt-modal {
  width: min(760px, 100%);
  max-height: min(88vh, 880px);
  overflow: auto;
  background: linear-gradient(180deg, var(--surface2), var(--surface));
  border: 1px solid var(--border2);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.vt-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.vt-modal-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.vt-modal-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text2);
}

.vt-modal-close {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text2);
  font-size: 24px;
  cursor: pointer;
}

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

.vt-country-group {
  margin-bottom: 16px;
}

.vt-country-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.vt-country-btn {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  cursor: pointer;
}

.vt-country-btn.is-active {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 15%, var(--surface));
  color: var(--accent2);
}

.vt-upload-files {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.vt-upload-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text2);
}

.vt-upload-picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.vt-upload-queue {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vt-upload-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.vt-upload-row.is-skipped {
  opacity: 0.8;
}

.vt-upload-row-name {
  font-size: 13px;
  font-weight: 600;
  word-break: break-word;
}

.vt-upload-row-path {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text3);
  word-break: break-word;
}

.vt-upload-row-meta {
  min-width: 180px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: 12px;
  color: var(--text2);
  text-align: right;
}

.vt-upload-empty {
  padding: 18px;
  border-radius: 14px;
  border: 1px dashed var(--border2);
  color: var(--text2);
  text-align: center;
}

.vt-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.vt-btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.vt-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.vt-btn-primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent2) 84%, white));
  border-color: transparent;
  color: white;
}

.vt-btn-secondary,
.vt-btn-ghost {
  background: var(--surface);
  color: var(--text);
}

.vt-btn-sm {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 13px;
}

.vt-viewer-backdrop {
  z-index: 10020;
}

.vt-viewer-modal {
  width: min(1160px, 100%);
  max-height: min(92vh, 980px);
  display: flex;
  flex-direction: column;
}

.vt-viewer-body {
  min-height: 240px;
}

.vt-viewer-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.vt-viewer-filename {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
}

.vt-viewer-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.vt-viewer-tab {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  font: inherit;
  cursor: pointer;
}

.vt-viewer-tab.is-active {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent2);
}

.vt-viewer-sheet-label {
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text2);
}

.vt-viewer-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface2) 90%, transparent);
}

.vt-viewer-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 13px;
}

.vt-viewer-table th,
.vt-viewer-table td {
  padding: 9px 10px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  white-space: pre-wrap;
  word-break: break-word;
}

.vt-viewer-table tbody tr:last-child th,
.vt-viewer-table tbody tr:last-child td {
  border-bottom: 0;
}

.vt-viewer-table tr > *:last-child {
  border-right: 0;
}

.vt-viewer-table tbody tr:first-child th,
.vt-viewer-table tbody tr:first-child td {
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  font-weight: 700;
}

.vt-viewer-table tbody th:first-child {
  width: 56px;
  min-width: 56px;
  text-align: center;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  color: var(--text2);
  font-weight: 700;
  position: sticky;
  left: 0;
  z-index: 1;
}

.vt-viewer-loading {
  margin-top: 10px;
  color: var(--text2);
}

@media (max-width: 900px) {
  .vt-toolbar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .vt-page {
    max-width: 100%;
  }

  .vt-toolbar,
  .vt-form-grid {
    grid-template-columns: 1fr;
  }

  .vt-modal {
    padding: 18px 16px;
    border-radius: 20px;
  }

  .vt-viewer-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .vt-viewer-table {
    min-width: 560px;
  }

  .vt-upload-row {
    flex-direction: column;
  }

  .vt-upload-row-meta {
    min-width: 0;
    justify-content: flex-start;
    text-align: left;
    flex-wrap: wrap;
  }
}
