﻿:root {
  --bg-top: #eef2f7;
  --bg-bottom: #dfe6ee;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --surface-soft: #f8fafc;
  --text: #0f172a;
  --muted: #475569;
  --line: #d9e1ea;
  --line-strong: #becbda;
  --primary: #0f4fbf;
  --primary-strong: #0a3f99;
  --danger: #b91c1c;
  --shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 18px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-variant-numeric: tabular-nums;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 450px at 8% -15%, rgba(15, 79, 191, 0.12) 0%, rgba(15, 79, 191, 0) 70%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.modal-open {
  overflow: hidden;
}

.layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(22px + env(safe-area-inset-top)) 18px calc(36px + env(safe-area-inset-bottom));
  display: grid;
  gap: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.hero {
  position: relative;
  overflow: visible;
  z-index: 20;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border-top: 2px solid rgba(15, 79, 191, 0.16);
  pointer-events: none;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.hero-copy {
  max-width: 600px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 6px 0 0;
  font-size: clamp(1.1rem, 3vw, 1.62rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.hero-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-entry {
  position: relative;
  z-index: 50;
  flex: 0 0 auto;
}

.auth-open-button {
  min-height: 44px;
  min-width: 104px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 20px rgba(15, 79, 191, 0.25);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.auth-open-button:hover {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(10, 63, 153, 0.28);
}

.auth-open-button:active {
  transform: translateY(0);
}

.auth-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(390px, 92vw);
  max-height: min(82vh, 650px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-solid);
  box-shadow: 0 28px 60px rgba(2, 6, 23, 0.24);
  padding: 10px;
  z-index: 9999;
  animation: popover-in 150ms ease;
}

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

.auth-stack {
  display: grid;
  gap: 10px;
}

.auth-form {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px;
  background: var(--surface-soft);
}

.auth-form h3 {
  margin: 0;
  font-size: 0.96rem;
  letter-spacing: -0.01em;
}

.auth-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.84rem;
}

.auth-form input {
  min-height: 44px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
}

.auth-form input:focus-visible {
  outline: 2px solid rgba(15, 79, 191, 0.28);
  outline-offset: 1px;
}

.button-primary,
.button-secondary {
  min-height: 42px;
  border-radius: 9px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}

.button-primary {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
}

.button-primary:hover {
  border-color: var(--primary-strong);
  background: var(--primary-strong);
}

.button-secondary {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
}

.button-secondary:hover {
  border-color: #97abbe;
}

.google-login-button {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  background: #fff;
  touch-action: manipulation;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.google-login-button:hover {
  border-color: #97abbe;
  background: #f8fafc;
}

.google-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.auth-user {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: var(--surface-soft);
}

.auth-user p {
  margin: 0;
  font-size: 0.9rem;
}

.auth-message {
  min-height: 1.2em;
  margin: 8px 2px 2px;
  font-size: 0.84rem;
  color: var(--muted);
}

.upload-panel h2,
.list-panel h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.drop-zone {
  display: block;
  width: 100%;
  margin-top: 14px;
  border: 1px dashed #9ab0c6;
  border-radius: 12px;
  padding: 28px 16px;
  text-align: center;
  background: var(--surface-soft);
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--primary);
  background: #edf3ff;
}

.drop-zone input {
  display: none;
}

.drop-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.upload-status {
  margin-top: 14px;
  display: grid;
  gap: 9px;
}

.upload-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
}

.upload-item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
}

.upload-name {
  word-break: break-all;
}

.upload-percentage {
  color: var(--primary);
  font-weight: 700;
}

.progress-track {
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #e8edf5;
}

.progress-value {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2f6fde 0%, #0f4fbf 100%);
  transition: width 120ms linear;
}

.upload-message {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

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

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tbody tr {
  transition: background-color 120ms ease;
}

tbody tr:hover {
  background: #f8fbff;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: #334155;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.link-button,
.danger-button {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.link-button:hover,
.danger-button:hover {
  border-color: #97abbe;
  background: #f8fafc;
}

.danger-button {
  color: var(--danger);
  border-color: #f2cdcd;
}

.empty-state {
  text-align: center;
  padding: 20px 0;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .layout {
    max-width: 780px;
  }

  table {
    min-width: 650px;
  }
}

@media (max-width: 740px) {
  .layout {
    padding: calc(12px + env(safe-area-inset-top)) 12px calc(20px + env(safe-area-inset-bottom));
    gap: 12px;
  }

  .panel {
    border-radius: 13px;
    padding: 14px;
  }

  .hero-top {
    align-items: center;
  }

  .hero-subtitle {
    font-size: 0.9rem;
  }

  .auth-popover {
    position: fixed;
    top: calc(10px + env(safe-area-inset-top));
    right: 10px;
    left: 10px;
    width: auto;
    max-height: min(84vh, 760px);
  }

  .list-header {
    gap: 8px;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 10px;
  }

  tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    background: #fff;
  }

  td {
    border-bottom: none;
    padding: 5px 0;
    font-size: 0.88rem;
  }

  td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }

  .actions {
    margin-top: 3px;
  }
}

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