:root {
  color-scheme: light;
  --text: #202124;
  --muted: #6b7280;
  --border: #d1d5db;
  --primary: #175cd3;
  --danger: #b42318;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--text);
  background: #fff;
  font: 14px/1.45 "Segoe UI", sans-serif;
}

button, input { font: inherit; }

header, main {
  width: min(720px, calc(100% - 32px));
  margin-inline: auto;
}

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

header a { color: inherit; font-size: 17px; font-weight: 600; text-decoration: none; }
header span { color: var(--muted); font-size: 13px; }

main { padding: 28px 0 48px; }
section + section { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
h1, h2 { margin: 0 0 16px; font-size: 16px; line-height: 1.3; }

.file-picker {
  width: 100%;
  height: 72px;
  border: 1px dashed #9ca3af;
  background: #fff;
  color: var(--primary);
  cursor: pointer;
}

.file-picker:hover, .file-picker.dragging { border-color: var(--primary); background: #f8faff; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(23, 92, 211, .2); outline-offset: 2px; }

.selection { margin-top: 12px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.selection-heading, .selected-file { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.selection-heading { color: var(--muted); }
.selected-file + .selected-file { border-top: 1px solid #eee; }
.selected-file strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.selected-file span { flex: none; color: var(--muted); }

fieldset { margin: 18px 0; padding: 0; display: flex; gap: 18px; border: 0; }
legend { width: 100%; margin-bottom: 7px; font-weight: 600; }
fieldset label { cursor: pointer; }
fieldset input { margin: 0 5px 0 0; vertical-align: -1px; accent-color: var(--primary); }

.primary-button {
  min-width: 88px;
  min-height: 34px;
  padding: 6px 14px;
  border: 1px solid var(--primary);
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.primary-button:disabled { border-color: #b8bec8; background: #b8bec8; cursor: not-allowed; }
.link-button { padding: 0; border: 0; background: none; color: var(--primary); cursor: pointer; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; }
.empty-state { color: var(--muted); }

.share-card { padding: 13px 0; border-top: 1px solid var(--border); }
.share-card:last-child { border-bottom: 1px solid var(--border); }
.share-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.visibility-pill { color: var(--muted); font-size: 12px; }
.share-file { display: flex; align-items: baseline; gap: 8px; margin: 3px 0 9px; }
.share-file strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.share-file small { flex: none; color: var(--muted); }
.share-actions { display: flex; gap: 12px; }
.share-actions button { padding: 0; border: 0; background: none; color: var(--primary); font-size: 13px; cursor: pointer; }
.share-actions .danger { color: var(--danger); }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  padding: 9px 12px;
  border-radius: 4px;
  background: #24272c;
  color: #fff;
  opacity: 0;
  pointer-events: none;
}

.toast.show { opacity: 1; }
.toast.error { background: var(--danger); }

@media (max-width: 520px) {
  fieldset { align-items: flex-start; flex-direction: column; gap: 8px; }
  .share-meta { align-items: flex-start; flex-direction: column; gap: 2px; }
}
