:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --text: #171a1c;
  --muted: #687076;
  --line: #dfe3e6;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --danger: #b42318;
  --shadow: 0 16px 45px rgba(23, 26, 28, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 32px;
}

.crumb {
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  padding: 5px 7px;
}

.crumb:hover,
.crumb:focus-visible {
  border-color: var(--line);
  background: var(--panel);
}

.crumb-separator {
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  padding: 0 13px;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover,
.button:focus-visible {
  border-color: #b8c1c7;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.button.primary:hover,
.button.primary:focus-visible {
  background: var(--accent-strong);
}

.button.small {
  min-height: 32px;
  padding: 0 10px;
}

.button.icon {
  min-width: 38px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.upload-panel,
.browser {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.upload-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
}

.muted {
  color: var(--muted);
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f3;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #d97706);
  transition: width 160ms ease;
}

.upload-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.browser {
  overflow: hidden;
}

.browser.dragging {
  outline: 3px solid rgba(15, 118, 110, 0.22);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

td:nth-child(1),
th:nth-child(1) {
  width: 52%;
}

td:nth-child(2),
th:nth-child(2) {
  width: 16%;
}

td:nth-child(3),
th:nth-child(3) {
  width: 22%;
}

td:nth-child(4),
th:nth-child(4) {
  width: 10%;
  text-align: right;
}

.entry-name {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.entry-name:hover,
.entry-name:focus-visible {
  color: var(--accent-strong);
}

.name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.type-mark {
  flex: 0 0 auto;
  width: 48px;
  color: var(--muted);
}

.download {
  color: var(--accent-strong);
  font-weight: 650;
  text-decoration: none;
}

.download:hover,
.download:focus-visible {
  text-decoration: underline;
}

.empty {
  padding: 44px 16px;
  color: var(--muted);
  text-align: center;
}

.login-page {
  display: grid;
  place-items: center;
}

.login-shell {
  width: min(420px, calc(100vw - 32px));
  padding: 32px 0;
}

.login-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-panel h1 {
  margin-bottom: 20px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}

.login-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  padding: 0 12px;
}

.login-form input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 118, 110, 0.16);
}

.login-submit {
  width: 100%;
  margin-top: 4px;
}

.login-error {
  margin: 0;
  color: var(--danger);
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 20px, 1180px);
    padding-top: 18px;
  }

  .topbar {
    display: grid;
    gap: 14px;
  }

  .actions {
    justify-content: flex-start;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
  }

  tr:last-child {
    border-bottom: 0;
  }

  td {
    width: 100% !important;
    border-bottom: 0;
    padding: 4px 0;
    text-align: left !important;
  }

  td:nth-child(4) {
    padding-top: 8px;
  }
}
