:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: #172033;
  background: #f3f6fb;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #f3f6fb;
}

[hidden] {
  display: none !important;
}

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 max(24px, calc((100vw - 1060px) / 2));
  border-bottom: 1px solid #e4e9f1;
  background: #fff;
}

.brand {
  margin-right: auto;
  color: #172033;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand span {
  color: #4968d8;
}

.account-label,
.muted {
  color: #6b7689;
  font-size: 0.9rem;
}

.page {
  width: min(100% - 32px, 860px);
  margin: 64px auto;
}

.panel {
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid #e1e7f0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 20px 60px rgb(23 32 51 / 6%);
}

.auth-panel,
.share-panel {
  width: min(100%, 560px);
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 12px;
  color: #4968d8;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 2.7rem);
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
}

h2 {
  margin: 0;
  font-size: 1.1rem;
}

.auth-panel > .muted {
  margin: 14px 0 26px;
}

.tabs {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid #e4e9f1;
}

.tab {
  padding: 0 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #6b7689;
  background: none;
  font: inherit;
  cursor: pointer;
}

.tab.active {
  border-bottom-color: #4968d8;
  color: #2949bd;
  font-weight: 700;
}

form label {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  color: #3e4a5f;
  font-size: 0.92rem;
  font-weight: 600;
}

input[type="email"],
input[type="password"] {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #d5dce7;
  border-radius: 9px;
  color: #172033;
  font: inherit;
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid #aebeff;
  outline-offset: 3px;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  padding: 9px 14px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  color: #fff;
  background: #4968d8;
}

.button-primary:hover {
  background: #3654c2;
}

.button-quiet {
  color: #34415a;
  background: #f0f3f8;
}

.button-quiet:hover {
  background: #e5eaf2;
}

.button-danger {
  color: #a52e38;
  background: #fff0f1;
}

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

#auth-submit {
  width: 100%;
  min-height: 46px;
}

.message {
  min-height: 1.5em;
  margin: 14px 0 0;
  color: #315a3b;
  line-height: 1.5;
}

.message.error {
  color: #b42332;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.upload-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 0;
  padding: 16px;
  border: 1px dashed #c5cede;
  border-radius: 12px;
  background: #fafbfe;
}

.file-picker {
  flex: 1;
  margin: 0;
  font-weight: 500;
}

.file-picker input {
  display: block;
  width: 100%;
  margin-top: 10px;
  color: #6b7689;
}

.list-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 34px;
}

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

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid #edf0f5;
}

.file-details {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.file-name {
  overflow-wrap: anywhere;
}

.file-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.empty-state {
  margin: 18px 0 0;
  color: #6b7689;
}

.preview {
  display: grid;
  place-items: center;
  margin-top: 24px;
  overflow: hidden;
  border-radius: 12px;
  background: #f3f6fb;
}

.preview img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.share-panel > .muted {
  margin: 12px 0 0;
}

.share-panel > .button {
  margin-top: 22px;
}

@media (max-width: 640px) {
  .topbar {
    height: 62px;
    padding: 0 16px;
  }

  .account-label {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page {
    margin: 28px auto;
  }

  .upload-box,
  .file-item {
    align-items: stretch;
    flex-direction: column;
  }

  .file-actions {
    flex-wrap: wrap;
  }
}
