/* ==========================================================================
   QR File Dump - Designed with the Unslop Craft System
   Mobile-First Responsive | Graphite Ramp | Inter + Tabular Mono
   ========================================================================== */

:root {
  /* Graphite Neutral Ramp (Dark) */
  --bg-deep: #0c0c0d;
  --bg-page: #121214;
  --bg-surface: #18181b;
  --bg-surface-hover: #1f1f23;
  --bg-raised: #232327;
  --bg-input: #1b1b1e;

  /* Quiet Hairlines */
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-hover: rgba(255, 255, 255, 0.14);
  --hairline-focus: rgba(255, 255, 255, 0.28);
  --top-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.06);

  /* Typography Roles (Graphite) */
  --text-primary: #ededed;
  --text-secondary: #a1a1a6;
  --text-muted: #717178;

  /* Purposeful Accent */
  --accent-base: #ededed;
  --accent-text: #0f0f10;
  --accent-amber: #f59e0b;
  --accent-amber-subtle: rgba(245, 158, 11, 0.1);

  /* Semantic Tones */
  --semantic-positive: #4cc38a;
  --semantic-positive-subtle: rgba(76, 195, 138, 0.1);
  --semantic-negative: #e5484d;
  --semantic-negative-subtle: rgba(229, 72, 77, 0.1);

  /* Typography Families */
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Geist Mono", Menlo, Monaco, Consolas, monospace;

  /* Radius (Strict Nested Math) */
  --radius-card: 12px;
  --radius-control: 8px;
  --radius-tag: 6px;
  --radius-keycap: 4px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 140ms;
  --duration-normal: 220ms;
}

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

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* SVG Line Icon Helper */
.icon {
  width: 16px;
  height: 16px;
  stroke-width: 1.5;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.icon-lg {
  width: 20px;
  height: 20px;
}

.icon-xl {
  width: 28px;
  height: 28px;
}

/* Top Navigation Header */
header.app-header {
  height: 56px;
  background-color: var(--bg-deep);
  border-bottom: 1px solid var(--hairline);
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  flex-shrink: 0;
}

.brand-glyph {
  width: 28px;
  height: 28px;
  background-color: var(--bg-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-tag);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  box-shadow: var(--top-highlight);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text h1 {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-text p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.2;
  font-family: var(--font-mono);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.session-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-surface);
  border: 1px solid var(--hairline);
  padding: 4px 10px;
  border-radius: var(--radius-control);
  font-size: 12px;
  color: var(--text-secondary);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--semantic-positive);
  flex-shrink: 0;
}

.session-timer {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--text-primary);
}

.keycap {
  font-family: var(--font-mono);
  font-size: 10px;
  background-color: var(--bg-raised);
  border: 1px solid var(--hairline);
  padding: 1px 5px;
  border-radius: var(--radius-keycap);
  color: var(--text-muted);
}

/* Main Container */
main.container {
  flex: 1;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

/* Surface Cards */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--top-highlight);
  width: 100%;
}

.view-hidden {
  display: none !important;
}

/* Privacy Shield Overlay */
.privacy-blurred {
  filter: blur(14px) grayscale(40%);
  user-select: none;
  pointer-events: none;
}

.privacy-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 12, 13, 0.94);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  padding: 20px;
}

.privacy-overlay-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  max-width: 360px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: var(--top-highlight);
}

.privacy-overlay h2 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

.privacy-overlay p {
  font-size: 13px;
  color: var(--text-muted);
}

/* Navigation Tabs */
.app-tabs {
  display: flex;
  gap: 4px;
  background-color: var(--bg-deep);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-control);
  padding: 3px;
  margin-bottom: 20px;
  width: fit-content;
}

.tab-btn {
  background: none;
  border: none;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: calc(var(--radius-control) - 3px);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--text-primary);
  background-color: var(--bg-raised);
  box-shadow: var(--top-highlight);
}

.tab-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background-color: var(--bg-surface);
  border: 1px solid var(--hairline);
  padding: 0 5px;
  border-radius: var(--radius-tag);
}

/* QR Authentication View (PC State 1) */
.qr-view-container {
  max-width: 400px;
  margin: 24px auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.qr-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.qr-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 20px;
  max-width: 320px;
  line-height: 1.4;
}

.qr-tile-frame {
  background-color: #ffffff;
  padding: 14px;
  border-radius: var(--radius-control);
  border: 1px solid var(--hairline);
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
}

.qr-tile-frame canvas,
.qr-tile-frame img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

.qr-countdown-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.countdown-bar-outer {
  width: 160px;
  height: 4px;
  background-color: var(--bg-raised);
  border-radius: 2px;
  overflow: hidden;
}

.countdown-bar-inner {
  height: 100%;
  width: 100%;
  background-color: var(--text-primary);
  transition: width 1s linear;
}

.countdown-text {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  text-align: left;
}

.qr-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  background-color: var(--bg-raised);
  border: 1px solid var(--hairline);
  padding: 5px 12px;
  border-radius: var(--radius-control);
  margin-bottom: 16px;
}

/* Mobile Login & Approve Forms */
.mobile-card-container {
  max-width: 380px;
  margin: 24px auto;
  width: 100%;
}

.audit-card {
  background-color: var(--bg-deep);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-control);
  padding: 12px 14px;
  margin: 14px 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  gap: 8px;
}

.audit-label {
  color: var(--text-muted);
  flex-shrink: 0;
}

.audit-value {
  font-weight: 500;
  color: var(--text-primary);
  font-family: var(--font-mono);
  word-break: break-all;
  text-align: right;
}

.form-group {
  margin-bottom: 14px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  background-color: var(--bg-input);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-control);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.form-input:focus {
  border-color: var(--hairline-focus);
}

/* Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--accent-base);
  color: var(--accent-text);
  border-color: var(--accent-base);
}

.btn-primary:hover {
  background-color: #ffffff;
  border-color: #ffffff;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background-color: var(--bg-raised);
  border-color: var(--hairline);
  color: var(--text-primary);
  box-shadow: var(--top-highlight);
}

.btn-secondary:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--hairline-hover);
}

.btn-secondary:active {
  transform: scale(0.98);
}

.btn-danger {
  background-color: var(--semantic-negative-subtle);
  border-color: rgba(229, 72, 77, 0.2);
  color: var(--semantic-negative);
}

.btn-danger:hover {
  background-color: rgba(229, 72, 77, 0.18);
  border-color: rgba(229, 72, 77, 0.35);
}

.btn-danger:active {
  transform: scale(0.98);
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.btn-full {
  width: 100%;
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  transition: color var(--duration-fast) var(--ease-out);
}

.btn-link:hover {
  color: var(--text-primary);
}

/* Dropzone */
.dropzone-container {
  border: 1px dashed var(--hairline-hover);
  border-radius: var(--radius-card);
  padding: 32px 20px;
  text-align: center;
  background-color: var(--bg-surface);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out);
  margin-bottom: 20px;
  box-shadow: var(--top-highlight);
  width: 100%;
}

.dropzone-container.drag-over {
  border-color: var(--text-primary);
  background-color: var(--bg-surface-hover);
}

.dropzone-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-control);
  background-color: var(--bg-raised);
  border: 1px solid var(--hairline);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.dropzone-text h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.dropzone-text p {
  color: var(--text-muted);
  font-size: 12px;
}

.dropzone-actions {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

/* Upload Progress */
.upload-progress-container {
  margin-top: 16px;
  background-color: var(--bg-deep);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-control);
  padding: 12px 14px;
  text-align: left;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 8px;
}

.progress-bar-outer {
  height: 4px;
  background-color: var(--bg-raised);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-inner {
  height: 100%;
  width: 0%;
  background-color: var(--text-primary);
  transition: width 0.15s var(--ease-out);
}

/* Batch Toolbar & Controls */
.batch-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.batch-actions {
  display: flex;
  gap: 8px;
}

/* Files Table */
.files-table-wrapper {
  background-color: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  width: 100%;
  box-shadow: var(--top-highlight);
}

table.files-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

table.files-table th {
  height: 38px;
  padding: 0 16px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--hairline);
  background-color: var(--bg-deep);
}

table.files-table td {
  height: 48px;
  padding: 0 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}

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

table.files-table tr:hover td {
  background-color: var(--bg-surface-hover);
}

.dropzone-title-mobile,
.dropzone-sub-mobile {
  display: none;
}

.file-info-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}

.file-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-width: 0;
  width: 100%;
}

.file-icon-box {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.file-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-weight: 400;
  min-width: 0;
}

.file-name-text:hover {
  text-decoration: underline;
}

.file-mobile-meta {
  display: none;
}

.file-select-cell {
  width: 36px;
  text-align: center;
}

.file-size-cell {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--text-secondary);
}

.file-date-cell {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--text-muted);
}

.file-actions-cell {
  text-align: right;
}

.actions-cell {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}

.batch-search-input {
  max-width: 260px;
}

.btn-text-full {
  display: inline;
}

.btn-text-short {
  display: none;
}

#mobile-revoke-section {
  margin-bottom: 16px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.mobile-revoke-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mobile-revoke-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  flex-shrink: 0;
}

.mobile-revoke-sid {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Custom Checkbox */
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #ededed;
  cursor: pointer;
}

/* Empty Files State */
.empty-files {
  text-align: center;
  padding: 44px 16px;
  color: var(--text-muted);
}

.empty-files-icon {
  margin-bottom: 8px;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
}

.empty-files p {
  font-size: 13px;
}

/* Clipboard View */
.clipboard-input-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--top-highlight);
  width: 100%;
}

.clipboard-textarea {
  width: 100%;
  min-height: 88px;
  background-color: var(--bg-input);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-control);
  color: var(--text-primary);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  margin-bottom: 12px;
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.clipboard-textarea:focus {
  border-color: var(--hairline-focus);
}

.clipboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.clipboard-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--top-highlight);
  width: 100%;
}

.clipboard-meta {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.clipboard-item-content {
  flex: 1;
  word-break: break-all;
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 12, 13, 0.85);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-dialog {
  background-color: var(--bg-surface);
  border: 1px solid var(--hairline-hover);
  border-radius: var(--radius-card);
  max-width: 500px;
  width: 100%;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), var(--top-highlight);
  position: relative;
}

.modal-dialog-preview {
  max-width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 12px;
}

.modal-header h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-body {
  overflow: auto;
  max-height: 65vh;
  margin: 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-body img,
.preview-body video {
  max-width: 100%;
  max-height: 60vh;
  border-radius: var(--radius-control);
  border: 1px solid var(--hairline);
}

.preview-body pre {
  width: 100%;
  background-color: var(--bg-deep);
  border: 1px solid var(--hairline);
  padding: 12px;
  border-radius: var(--radius-control);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: pre-wrap;
  color: var(--text-primary);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 40px);
}

.toast {
  background-color: var(--bg-raised);
  border: 1px solid var(--hairline-hover);
  border-radius: var(--radius-control);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), var(--top-highlight);
  animation: toastIn 0.18s var(--ease-out);
}

@keyframes toastIn {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Alert boxes */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-control);
  font-size: 12px;
  margin-bottom: 14px;
}

.alert-error {
  background-color: var(--semantic-negative-subtle);
  border: 1px solid rgba(229, 72, 77, 0.25);
  color: var(--semantic-negative);
}

.alert-success {
  background-color: var(--semantic-positive-subtle);
  border: 1px solid rgba(76, 195, 138, 0.25);
  color: var(--semantic-positive);
}

/* ==========================================================================
   MOBILE RESPONSIVE OVERRIDES (max-width: 680px)
   Adapts layout to mobile screens (320px - 480px) without horizontal scrolling
   ========================================================================== */

@media (max-width: 680px) {
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Form inputs: 16px font to prevent iOS Safari auto-zooming on focus */
  .form-input,
  .clipboard-textarea {
    font-size: 16px !important;
  }

  header.app-header {
    height: 52px;
    padding: 0 12px;
  }

  .brand {
    gap: 8px;
  }

  .brand-glyph {
    width: 26px;
    height: 26px;
  }

  .brand-glyph .icon {
    width: 14px;
    height: 14px;
  }

  .brand-text h1 {
    font-size: 13px;
  }

  .brand-text p {
    display: none;
  }

  #btn-privacy-shield {
    display: none !important;
  }

  .session-indicator {
    padding: 3px 8px;
    font-size: 11px;
    gap: 6px;
  }

  #session-role-badge {
    font-size: 11px;
  }

  #btn-logout span {
    display: none;
  }

  #btn-logout {
    padding: 0 8px;
    height: 32px;
    width: 32px;
    min-width: 32px;
    justify-content: center;
  }

  main.container {
    padding: 12px 10px 24px 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .card {
    padding: 14px 12px;
    border-radius: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .app-tabs {
    width: 100%;
    margin-bottom: 12px;
  }

  .tab-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 6px;
    font-size: 12px;
  }

  /* Dropzone on Mobile */
  .dropzone-container {
    padding: 18px 12px;
    margin-bottom: 12px;
  }

  .dropzone-title-desktop,
  .dropzone-sub-desktop {
    display: none;
  }

  .dropzone-title-mobile,
  .dropzone-sub-mobile {
    display: block;
  }

  .dropzone-title-mobile {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
  }

  .dropzone-sub-mobile {
    font-size: 11px;
    color: var(--text-muted);
  }

  .dropzone-icon-box {
    width: 36px;
    height: 36px;
    margin-bottom: 6px;
  }

  .dropzone-actions {
    flex-direction: column;
    width: 100%;
    gap: 8px;
    margin-top: 12px;
  }

  .dropzone-actions .btn {
    width: 100%;
    height: 38px;
  }

  /* Batch Toolbar on Mobile */
  .batch-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
    width: 100%;
  }

  .batch-search-input {
    max-width: 100% !important;
    width: 100%;
    height: 36px;
  }

  .btn-text-full {
    display: none;
  }

  .btn-text-short {
    display: inline;
  }

  .batch-actions {
    display: flex;
    width: 100%;
    gap: 6px;
  }

  .batch-actions .btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 6px;
    font-size: 11px;
    height: 34px;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .files-stats {
    font-size: 11px;
    text-align: right;
    margin-top: 2px;
  }

  /* Native Mobile Card Layout for Files Table */
  .files-table-wrapper {
    overflow-x: hidden;
    border-radius: 10px;
    width: 100%;
    max-width: 100%;
  }

  table.files-table {
    display: block;
    width: 100%;
    max-width: 100%;
  }

  table.files-table thead {
    display: none;
  }

  table.files-table tbody {
    display: block;
    width: 100%;
  }

  table.files-table tr {
    display: flex;
    align-items: center;
    padding: 10px 8px;
    min-height: 52px;
    border-bottom: 1px solid var(--hairline);
    gap: 6px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  table.files-table td {
    border-bottom: none;
    padding: 0;
    height: auto;
  }

  table.files-table td.file-select-cell {
    width: 22px;
    flex: 0 0 22px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  table.files-table td.file-main-cell {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
  }

  .file-info-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    cursor: pointer;
  }

  .file-name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
  }

  .file-icon-box {
    flex: 0 0 16px;
  }

  .file-name-text {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .file-mobile-meta {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: 2px;
    padding-left: 24px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  table.files-table td.file-size-cell,
  table.files-table td.file-date-cell,
  .hide-mobile {
    display: none !important;
  }

  table.files-table td.file-actions-cell {
    flex: 0 0 auto;
    margin-left: auto;
  }

  .actions-cell {
    display: flex;
    gap: 4px;
    align-items: center;
  }

  .actions-cell .btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    padding: 0;
    border-radius: 6px;
    flex-shrink: 0;
  }

  .actions-cell .btn .icon {
    width: 14px;
    height: 14px;
  }

  /* Clipboard on Mobile */
  .clipboard-input-box {
    padding: 14px 12px;
    margin-bottom: 14px;
  }

  .clipboard-item {
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  .clipboard-actions {
    display: flex;
    width: 100%;
    gap: 8px;
    justify-content: flex-end;
  }

  .clipboard-actions .btn {
    flex: 1;
    height: 34px;
  }

  /* Remote Revoke Banner on Mobile */
  #mobile-revoke-section {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 10px;
  }

  #mobile-revoke-section .btn {
    width: 100%;
  }

  .mobile-revoke-info {
    justify-content: center;
  }

  /* Modals on Mobile */
  .modal-overlay {
    padding: 10px;
  }

  .modal-dialog {
    padding: 16px 14px;
    border-radius: 12px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .modal-dialog-preview {
    max-height: 85vh;
  }

  .toast-container {
    bottom: 12px;
    right: 12px;
    left: 12px;
    max-width: calc(100% - 24px);
  }

  .toast {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .actions-cell {
    gap: 2px;
  }
  .actions-cell .btn {
    width: 26px;
    height: 26px;
    min-width: 26px;
  }
  .actions-cell .btn .icon {
    width: 13px;
    height: 13px;
  }
  table.files-table tr {
    padding: 8px 4px;
    gap: 4px;
  }
}
