:root {
  color: #182027;
  background: #f7f8f9;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --border: #dfe3e6;
  --muted: #68737d;
  --surface: #fff;
  --primary: #176b5b;
  --primary-hover: #125548;
  --soft: #e8f3f0;
  --danger: #b63b3b;
  --shadow: 0 18px 60px rgba(25, 34, 41, .08);
}

* { box-sizing: border-box; }

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

button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(23, 107, 91, .2);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small-text { font-size: .8rem; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 390px);
  padding: 38px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--primary);
  font-size: 1.1rem;
  font-weight: 750;
}

.mark.small {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: .86rem;
}

.login-card h1 {
  margin: 26px 0 6px;
  font-size: 1.75rem;
  letter-spacing: -.035em;
}

.login-card p { margin: 0 0 26px; }
.login-card label { display: block; margin-bottom: 8px; font-size: .86rem; font-weight: 650; }

.login-card input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid #cbd1d5;
  border-radius: 9px;
  color: inherit;
  background: #fff;
}

.login-card input:focus { border-color: var(--primary); }

.login-card .form-error {
  min-height: 19px;
  margin: 8px 0 5px;
  color: var(--danger);
  font-size: .82rem;
}

.primary {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--primary);
  font-weight: 680;
}

.primary:hover { background: var(--primary-hover); }
.login-card .primary { width: 100%; }

.app-shell {
  width: min(100% - 40px, 1040px);
  margin: 0 auto;
  padding-bottom: 72px;
}

header {
  display: flex;
  height: 76px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 740;
  letter-spacing: -.02em;
}

.text-button, .icon-button {
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: .86rem;
  font-weight: 620;
}

.text-button:hover, .icon-button:hover { color: inherit; background: #eceff1; }
.icon-button.danger:hover { color: var(--danger); background: #fbeaea; }

.hero { padding: 58px 0 26px; }
.hero h1 { margin: 0; font-size: clamp(1.8rem, 3.6vw, 2.4rem); letter-spacing: -.05em; }

.drop-zone {
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 1.5px dashed #b9c2c7;
  border-radius: 16px;
  background: var(--surface);
  transition: border-color .16s, background .16s, transform .16s;
}

.drop-zone:hover, .drop-zone.dragging {
  border-color: var(--primary);
  background: #fbfdfc;
}

.drop-zone.dragging { transform: scale(1.005); }

#drop-prompt {
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
}

#drop-prompt span { color: var(--muted); font-size: .88rem; }

.upload-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
  place-items: center;
  border-radius: 14px;
  color: var(--primary);
  background: var(--soft);
}

svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-progress {
  width: min(100%, 720px);
  display: flex;
  align-items: center;
  gap: 16px;
}

.file-glyph {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: var(--primary);
  background: var(--soft);
}

.progress-content { min-width: 0; flex: 1; }
.progress-meta { display: flex; justify-content: space-between; gap: 14px; }
.progress-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-meta span { color: var(--primary); font-size: .86rem; font-weight: 700; }

.progress-track {
  height: 7px;
  margin: 11px 0 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ecee;
}

#progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width .15s ease-out;
}

.upload-actions { display: flex; gap: 2px; }

.history-section { padding-top: 50px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin: 0 0 5px; font-size: 1.2rem; letter-spacing: -.025em; }
.section-heading p { margin: 0; font-size: .88rem; }
.count { color: var(--muted); font-size: .83rem; }

.file-list {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  padding: 20px;
  align-items: center;
}

.file-row + .file-row { border-top: 1px solid var(--border); }
.file-main { min-width: 0; display: flex; align-items: center; gap: 14px; }
.file-details { min-width: 0; }
.file-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.file-info { display: block; margin-top: 3px; font-size: .78rem; }

.link-line { display: flex; align-items: center; gap: 7px; margin-top: 8px; }
.file-link {
  min-width: 0;
  overflow: hidden;
  color: var(--primary);
  font-size: .8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}
.file-link:hover { text-decoration: underline; }
.copy-link {
  padding: 2px 5px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: .75rem;
}
.copy-link:hover { color: var(--primary); }

.file-controls { display: flex; align-items: end; gap: 22px; }
.file-controls label > span:first-child {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .04em;
}

select {
  height: 36px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: inherit;
  background: #fff;
  font-size: .82rem;
}

.visibility-control { position: relative; cursor: pointer; }
.visibility-control input { position: absolute; opacity: 0; pointer-events: none; }
.switch {
  position: relative;
  display: block;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #c8cfd3;
  transition: background .16s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  transition: transform .16s;
}
.visibility:checked + .switch { background: var(--primary); }
.visibility:checked + .switch::after { transform: translateX(18px); }
.visibility:focus-visible + .switch { outline: 3px solid rgba(23, 107, 91, .2); outline-offset: 2px; }

.empty-state {
  padding: 50px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  text-align: center;
  background: var(--surface);
}
.empty-state p { margin: 0 0 5px; font-weight: 650; }
.empty-state span { color: var(--muted); font-size: .86rem; }

dialog {
  width: min(calc(100% - 32px), 500px);
  padding: 30px;
  border: 0;
  border-radius: 16px;
  color: inherit;
  box-shadow: 0 24px 80px rgba(22, 30, 35, .22);
}
dialog::backdrop { background: rgba(20, 27, 31, .42); backdrop-filter: blur(2px); }
dialog h2 { margin: 18px 0 7px; letter-spacing: -.03em; }
dialog p { margin: 0 0 22px; }
dialog .primary { width: 100%; margin-top: 18px; }
.dialog-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: var(--soft);
  font-size: 1.25rem;
  font-weight: 750;
}
.dialog-icon.error { color: var(--danger); background: #fbeaea; }
.dialog-link {
  display: flex;
  height: 44px;
  align-items: center;
  gap: 8px;
  padding: 5px 5px 5px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f8faf9;
}
.dialog-link a {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--primary);
  font-size: .82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dialog-link button {
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: var(--primary);
  background: var(--soft);
  font-size: .78rem;
  font-weight: 650;
}

@media (max-width: 720px) {
  .app-shell { width: min(100% - 28px, 1040px); }
  .hero { padding-top: 40px; }
  .drop-zone { min-height: 200px; }
  .upload-progress { align-items: flex-start; flex-wrap: wrap; }
  .upload-progress .file-glyph { display: none; }
  .upload-actions { width: 100%; justify-content: flex-end; }
  .file-row { grid-template-columns: 1fr; gap: 18px; }
  .file-controls { justify-content: space-between; }
}

@media (max-width: 430px) {
  .login-card { padding: 30px 24px; }
  .hero h1 { font-size: 1.8rem; }
}
