* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: #101010;
  --panel-soft: #171717;
  --line: #272727;
  --line-strong: #3a3a3a;
  --text: #f5f5f5;
  --muted: #969696;
  --muted-strong: #d0d0d0;
  --accent: #ffffff;
  --accent-hover: #e7e7e7;
  --danger-bg: #171717;
  --danger-text: #dedede;
  --ok-bg: #171717;
  --ok-text: #dedede;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -18%, rgba(255, 255, 255, 0.08), transparent 30%),
    linear-gradient(180deg, #0b0b0b 0%, var(--bg) 48%);
  color: var(--text);
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.auth-shell,
.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.auth-panel {
  width: min(430px, 100%);
  padding: 34px;
  background: rgba(16, 16, 16, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.42);
}

.shell {
  padding: 34px 0 56px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: #d8d8d8;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

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

.copy {
  margin: 14px 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-strong);
}

.upload-panel,
.files {
  background: rgba(16, 16, 16, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
}

.upload-panel {
  padding: 18px;
  margin-bottom: 18px;
}

.upload-panel form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

input[type="file"],
.file-row input,
.edit-form input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #080808;
  color: var(--text);
  outline: none;
}

input[type="file"] {
  padding: 6px 10px;
  line-height: 28px;
}

input[type="file"]:focus,
.file-row input:focus,
.edit-form input:focus {
  border-color: #f2f2f2;
}

input[type="file"]::file-selector-button {
  height: 28px;
  margin-right: 12px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  background: #242424;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  line-height: 28px;
  vertical-align: top;
}

.primary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.primary-button {
  background: #f4f4f4;
  color: #050505;
}

.primary-button:hover {
  background: #dcdcdc;
}

.ghost-button {
  border: 1px solid var(--line-strong);
  background: #141414;
  color: var(--muted-strong);
}

.ghost-button:hover {
  border-color: #5a5a5a;
  background: #1c1c1c;
  color: var(--text);
}

.danger-button {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.danger-button:hover {
  background: #242424;
}

.notice {
  margin-bottom: 18px;
  padding: 13px 15px;
  border-radius: 6px;
  font-weight: 800;
}

.notice.ok {
  background: var(--ok-bg);
  color: var(--ok-text);
  border: 1px solid #333333;
}

.notice.bad {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid #333333;
}

.files {
  overflow: hidden;
}

.file-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.file-row {
  padding: 16px;
  border-top: 1px solid var(--line);
}

.file-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.file-info {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.file-main {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(260px, 1.1fr);
  gap: 14px;
  align-items: center;
}

.url-field {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.file-controls {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(260px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.edit-form,
.replace-form,
.delete-form {
  display: grid;
  gap: 10px;
  align-items: end;
}

.edit-form {
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto;
}

.replace-form {
  grid-template-columns: minmax(160px, 1fr) auto;
}

.delete-form {
  justify-self: end;
}

.edit-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.edit-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.file-info img,
.zip-icon {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  background: #07080b;
  border: 1px solid var(--line);
}

.zip-icon {
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
}

strong,
small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

strong {
  color: var(--text);
}

small {
  margin-top: 5px;
  color: var(--muted);
}

.empty {
  margin: 0;
  padding: 28px 16px;
  color: var(--muted);
}

@media (max-width: 760px) {
  .topbar,
  .upload-panel form,
  .file-main,
  .file-controls,
  .edit-form,
  .replace-form {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }

  .delete-form {
    justify-self: start;
  }
}
