:root {
  color-scheme: light;
  --bg: #f7f5ef;
  --ink: #222831;
  --muted: #6d737c;
  --panel: #ffffff;
  --line: #dedbd2;
  --accent: #167a72;
  --accent-dark: #0c5f58;
  --warm: #d98c35;
  --danger: #b74343;
  --shadow: 0 18px 42px rgba(33, 40, 49, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(22, 122, 114, 0.11), transparent 42%),
    linear-gradient(225deg, rgba(217, 140, 53, 0.12), transparent 40%),
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
input {
  font: inherit;
}

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

.topbar,
.panel-header,
.file-row,
.upload-zone,
.auth-panel,
.account-strip {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.kicker {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4.25rem);
  line-height: 0.98;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.3rem;
}

.status-pill {
  min-width: 112px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.install-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(22, 122, 114, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-dark);
  font-weight: 700;
}

.auth-panel,
.account-strip {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.auth-panel p {
  max-width: 440px;
  margin-bottom: 0;
  color: var(--muted);
}

.auth-hint {
  font-size: 0.88rem;
}

.error-box {
  padding: 10px 12px;
  border: 1px solid rgba(183, 67, 67, 0.35);
  border-radius: 6px;
  background: #fff0f0;
  color: var(--danger);
  font-size: 0.92rem;
  line-height: 1.35;
}

.auth-form {
  display: grid;
  min-width: min(360px, 100%);
  gap: 10px;
}

.auth-form input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.auth-actions {
  display: flex;
  gap: 10px;
}

.upload-zone {
  position: relative;
  min-height: 220px;
  gap: 22px;
  padding: 28px;
  border: 2px dashed rgba(22, 122, 114, 0.45);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.upload-zone.dragging {
  border-color: var(--warm);
  background: rgba(255, 255, 255, 0.92);
  transform: translateY(-2px);
}

.upload-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.upload-icon {
  display: grid;
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 3rem;
  line-height: 1;
}

.upload-zone p {
  max-width: 520px;
  margin-bottom: 0;
  color: var(--muted);
}

.primary-button,
.secondary-button,
.icon-button,
.delete-button {
  border: 0;
  cursor: pointer;
}

.primary-button {
  margin-left: auto;
  padding: 12px 16px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}

.secondary-button {
  padding: 9px 12px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}

.text-button {
  justify-self: start;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 700;
}

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

.panel-header {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #eef4f2;
  color: var(--accent-dark);
  font-size: 1.2rem;
}

.empty-state {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.file-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-row {
  min-height: 70px;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.file-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--accent) 0 50%, var(--warm) 50% 100%);
}

.file-meta {
  min-width: 0;
  flex: 1;
}

.file-name {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-detail {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.delete-button {
  padding: 9px 12px;
  border-radius: 6px;
  background: #f7e8e8;
  color: var(--danger);
  font-weight: 700;
}

@media (max-width: 680px) {
  .shell {
    width: min(100vw - 24px, 980px);
    padding: 22px 0;
  }

  .topbar,
  .upload-zone,
  .auth-panel,
  .account-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .status-pill {
    width: fit-content;
  }

  .primary-button {
    width: 100%;
    margin-left: 0;
  }

  .install-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-actions {
    flex-direction: column;
  }

  .file-panel,
  .upload-zone {
    padding: 18px;
  }

  .file-row {
    align-items: flex-start;
  }

  .delete-button {
    align-self: center;
  }
}
