:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #64748b;
  --border: #d9e0e8;
  --primary: #176b87;
  --primary-dark: #0f4f63;
  --danger: #b42318;
  --ok: #157347;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 15px;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.brand {
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}

nav {
  display: flex;
  gap: 18px;
  align-items: center;
}

nav a,
.link-button {
  color: var(--primary);
  text-decoration: none;
  font: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

main {
  width: min(1220px, calc(100% - 32px));
  margin: 28px auto;
}

h1 {
  margin: 0 0 8px;
  font-size: 30px;
  letter-spacing: 0;
}

p {
  margin: 0;
}

.auth-panel,
.settings {
  width: min(620px, 100%);
  margin: 70px auto;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 22px;
}

.page-head {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
}

.upload-form,
.actions form,
.url-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

button,
.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  color: var(--text);
  background: #eef2f6;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.primary {
  color: white;
  background: var(--primary);
  border-color: var(--primary);
}

.primary:hover {
  background: var(--primary-dark);
}

.danger {
  color: white;
  background: var(--danger);
  border-color: var(--danger);
}

.copy-button {
  min-width: 88px;
}

input,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

input[type="file"] {
  width: auto;
  max-width: 260px;
  padding: 7px;
  background: white;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 650;
}

label .muted {
  font-weight: 400;
}

.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

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

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

th {
  color: #405166;
  font-size: 13px;
  text-transform: uppercase;
}

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

td strong,
.muted {
  display: block;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.url-row input {
  min-width: 280px;
}

.actions {
  min-width: 360px;
}

.actions,
.actions form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notice {
  margin-bottom: 16px;
  color: var(--ok);
  font-weight: 650;
}

.alert {
  padding: 12px 14px;
  color: #7a271a;
  background: #fff1ee;
  border: 1px solid #ffccc5;
  border-radius: 6px;
}

.empty {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  .topbar,
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    height: auto;
    padding: 16px;
    gap: 12px;
  }

  .upload-form {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  input[type="file"] {
    max-width: 100%;
    width: 100%;
  }
}
