:root {
  --bg: #ffffff;
  --ink: #0f0f0f;
  --muted: #666a70;
  --faint: #f7f7f7;
  --line: #dedede;
  --line-soft: #ececec;
  --danger: #8a231d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Times New Roman", Times, serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1020px, calc(100vw - 48px));
  margin: 0 auto;
}

.topbar {
  border-bottom: 1px solid var(--line-soft);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 108px;
}

.kicker,
.section-title,
.field span,
.title-count,
.library-table th,
.drop-zone em,
.connection-state {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 6px;
  line-height: 1;
  text-transform: uppercase;
}

.kicker {
  margin: 0 0 10px;
}

h1 {
  margin: 0;
  color: #000;
  font-size: 31px;
  font-weight: 400;
  line-height: 1;
}

.connection-state {
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: 3px;
}

.connection-state span {
  width: 9px;
  height: 9px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.connection-state.connected {
  color: #111;
}

.connection-state.connected span {
  background: #111;
}

.notice,
.status-line {
  margin: 18px 0 0;
  color: var(--danger);
  font-size: 14px;
}

.status-line.good {
  color: #2e5f3f;
}

.section {
  margin-top: 56px;
}

.section-title {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.section-title.no-icon {
  grid-template-columns: auto 1fr;
}

.section-title::after {
  content: "";
  display: block;
  height: 1px;
  background: var(--line);
}

.section-title svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.connection-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 156px;
  gap: 16px;
  align-items: end;
}

.field {
  display: grid;
  gap: 12px;
}

.field span {
  color: #61656a;
  letter-spacing: 5px;
}

.field input,
.field select {
  width: 100%;
  height: 49px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  padding: 0 18px;
  outline: none;
}

.field input {
  background: var(--faint);
  color: var(--muted);
  text-align: center;
}

.primary-button {
  width: 100%;
  height: 49px;
  border: 1px solid #000;
  background: #000;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.secondary-button {
  height: 36px;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  padding: 0 16px;
  text-transform: uppercase;
}

.primary-button:disabled,
.secondary-button:disabled,
.row-action:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.storage-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.used-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.used-display strong {
  font-size: 40px;
  font-weight: 400;
  line-height: 1;
}

.used-display span {
  color: var(--muted);
  font-size: 18px;
}

.storage-totals {
  display: grid;
  gap: 8px;
  color: var(--muted);
  text-align: right;
}

.storage-totals strong {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.storage-totals span {
  font-size: 14px;
}

.storage-meter {
  overflow: hidden;
  width: 100%;
  height: 8px;
  border: 1px solid var(--line);
  margin-top: 18px;
}

.storage-fill {
  width: 0;
  height: 100%;
  background: #000;
  transition: width 180ms ease;
}

.storage-detail {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.library-title-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
}

.title-count {
  margin-top: 4px;
  letter-spacing: 4px;
}

.online-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: -8px 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.library-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  table-layout: fixed;
}

.library-table th,
.library-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 18px 22px;
  text-align: left;
}

.library-table th {
  background: var(--faint);
  letter-spacing: 6px;
}

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

.library-table td {
  color: var(--muted);
  font-size: 16px;
}

.library-table td:first-child {
  color: #000;
  font-weight: 700;
}

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

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

.library-table .action-heading,
.library-table td.action-cell {
  width: 32%;
  text-align: right;
}

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

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

.online-library-table .action-heading,
.online-library-table .action-cell {
  width: 32%;
}

.row-action {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-size: 12px;
  letter-spacing: 3px;
  opacity: 0;
  padding: 0;
  text-transform: uppercase;
}

.library-table td.online-row-actions {
  text-align: right;
  white-space: nowrap;
}

.online-row-actions .row-action {
  display: inline-block;
  margin-left: 18px;
}

.online-upload-action {
  color: #000;
}

.library-table tr:hover .row-action,
.row-action:focus {
  opacity: 1;
}

.empty-row {
  color: var(--muted) !important;
  font-weight: 400 !important;
  text-align: center !important;
}

#onlineFileInput,
#fileInput {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.drop-zone {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 252px;
  border: 1px dashed var(--line);
  color: #000;
  cursor: pointer;
  text-align: center;
}

.drop-zone.dragging {
  background: var(--faint);
  border-color: #000;
}

.drop-zone.disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.drop-zone svg {
  width: 26px;
  height: 26px;
  margin-bottom: 18px;
  stroke: #9b9b9b;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drop-zone strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
}

.drop-zone span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
}

.drop-zone em {
  display: block;
  font-style: normal;
  letter-spacing: 5px;
  margin-top: 24px;
}

.format-caution {
  color: #aaa;
  font-size: 12px;
  line-height: 1.5;
  margin: 12px 0 0;
}

.upload-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
}

.upload-progress > div {
  height: 6px;
  border: 1px solid var(--line);
}

.upload-progress > div > div {
  width: 0;
  height: 100%;
  background: #000;
}

.upload-progress span {
  color: var(--muted);
  font-size: 14px;
  min-width: 72px;
  text-align: right;
}

.upload-progress small {
  grid-column: 1 / -1;
  color: #aaa;
  font-size: 11px;
  letter-spacing: 2px;
  line-height: 1.4;
  text-align: right;
  text-transform: uppercase;
}

.cancel-upload-button {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-size: 12px;
  letter-spacing: 3px;
  padding: 0;
  text-transform: uppercase;
}

.cancel-upload-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.credit {
  position: fixed;
  left: 24px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b7b7b7;
  font-size: 12px;
  pointer-events: none;
}

.copyright-mark {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 10px;
  line-height: 1;
}

@media (max-width: 760px) {
  body {
    padding: 16px;
  }

  .shell {
    width: 100%;
  }

  .topbar {
    border: 1px solid #111;
    border-bottom: 0;
  }

  main.shell {
    border: 1px solid #111;
    border-top: 0;
    padding: 8px 18px 26px;
  }

  .topbar-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    justify-content: stretch;
    justify-items: center;
    min-height: auto;
    padding: 44px 18px 54px;
    text-align: center;
  }

  .storage-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-inner > div:first-child {
    display: grid;
    width: 100%;
    gap: 30px;
    justify-items: center;
  }

  .kicker {
    margin: 0;
  }

  h1 {
    margin: 0;
  }

  .connection-state {
    justify-content: center;
    width: 100%;
  }

  .section {
    margin-top: 46px;
  }

  .section-title,
  .section-title.no-icon {
    grid-template-columns: minmax(28px, 1fr) auto minmax(28px, 1fr);
    gap: 14px;
    justify-items: center;
    text-align: center;
  }

  .section-title::before,
  .section-title::after {
    content: "";
    display: block;
    width: 100%;
    height: 1px;
    background: var(--line);
  }

  .section-title svg {
    display: none;
  }

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

  .library-title-row {
    display: block;
  }

  .title-count {
    display: block;
    margin: -8px 0 22px;
    text-align: center;
  }

  .online-actions {
    align-items: stretch;
    flex-direction: column;
    margin-top: -4px;
    text-align: center;
  }

  .library-table {
    display: block;
    overflow-x: auto;
  }

  .library-table th,
  .library-table td {
    padding: 16px 14px;
  }

  .library-table th {
    letter-spacing: 4px;
  }

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

  .credit {
    position: static;
    justify-content: center;
    margin: 30px 0 2px;
  }
}
