:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-alt: #f7f9fc;
  --text: #172033;
  --muted: #657184;
  --border: #d9e0ea;
  --border-strong: #b8c3d2;
  --blue: #246bfe;
  --blue-dark: #1d55ca;
  --green: #12805c;
  --red: #b42318;
  --amber: #9a6700;
  --shadow: 0 16px 38px rgba(23, 32, 51, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.login-screen,
.share-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f4f7fb;
}

.login-panel,
.share-panel {
  width: min(100%, 460px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--text);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
}

.brand-name {
  font-size: 17px;
  font-weight: 760;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 28px;
  font-size: 32px;
  line-height: 1.15;
  font-weight: 760;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
  font-weight: 760;
}

.login-form {
  margin-top: 22px;
  display: grid;
  gap: 10px;
}

.login-form label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  padding: 0 12px;
  outline: none;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 107, 254, 0.14);
}

.form-message {
  min-height: 20px;
  color: var(--red);
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--bg);
}

.topbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.storage-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.workspace {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.tool-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(23, 32, 51, 0.05);
  padding: 20px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

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

.primary-button,
.ghost-button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 720;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.primary-button {
  background: var(--blue);
  color: #ffffff;
}

.primary-button:hover:not(:disabled) {
  background: var(--blue-dark);
}

.ghost-button {
  background: #ffffff;
  color: var(--text);
  border-color: var(--border);
}

.ghost-button:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--panel-alt);
}

.ghost-button.compact {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.icon-button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  color: var(--muted);
  background: #ffffff;
  border-color: var(--border);
}

.icon-button:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--panel-alt);
}

.icon-button.danger:hover {
  color: var(--red);
  border-color: rgba(180, 35, 24, 0.35);
  background: #fff6f5;
}

.full-width {
  width: 100%;
}

.dropzone {
  min-height: 178px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 8px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  background: #fbfcfe;
  color: var(--muted);
  text-align: center;
  font-size: 15px;
  font-weight: 720;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.dropzone svg {
  width: 34px;
  height: 34px;
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dropzone.is-over {
  background: #eef5ff;
  border-color: var(--blue);
  color: var(--blue);
}

.selected-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  min-height: 52px;
}

.selected-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}

.file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 680;
}

.file-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.progress-shell {
  height: 5px;
  border-radius: 999px;
  background: #e8edf5;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--green);
  transition: width 120ms ease;
}

.search-box {
  width: min(260px, 100%);
  position: relative;
  display: block;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.search-box input {
  padding-left: 40px;
}

.share-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(18, 128, 92, 0.28);
  background: #f1fbf7;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 14px;
}

.share-strip span {
  color: var(--green);
  font-size: 13px;
  font-weight: 760;
}

.share-strip input {
  min-height: 36px;
  font-size: 13px;
}

.file-table {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.table-head,
.file-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 110px 160px 132px;
  align-items: center;
  gap: 14px;
}

.table-head {
  min-height: 42px;
  padding: 0 14px;
  background: var(--panel-alt);
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  border-bottom: 1px solid var(--border);
}

.file-row {
  min-height: 64px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.file-row:last-child {
  border-bottom: 0;
}

.file-size,
.file-date {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.actions-header {
  text-align: right;
}

.empty-state {
  min-height: 190px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 650;
}

.empty-state svg {
  width: 34px;
  height: 34px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  background: var(--text);
  color: #ffffff;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 650;
  z-index: 20;
}

.share-shell {
  width: min(100%, 520px);
}

.share-panel h1 {
  overflow-wrap: anywhere;
}

.share-meta {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.share-download {
  margin-top: 24px;
  text-decoration: none;
  min-width: 180px;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .workspace {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .table-head {
    display: none;
  }

  .file-table {
    border: 0;
    border-radius: 0;
  }

  .file-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 10px;
  }

  .file-size,
  .file-date {
    grid-column: 1;
  }

  .row-actions {
    grid-column: 2;
    grid-row: 1 / span 3;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .password-row,
  .share-strip {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

  .topbar-actions .ghost-button,
  .topbar-actions .storage-pill {
    flex: 1 1 auto;
  }
}
