:root {
  color-scheme: light;
  --primary: #00679e;
  --primary-hover: #00547f;
  --text: #222222;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --field: #ededed;
  --page: #f5f5f5;
  --surface: #ffffff;
  --danger-bg: #fdecea;
  --danger: #8a1f11;
  --ok-bg: #e7f6ee;
  --ok: #146c36;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);
  --font: system-ui, "Segoe UI", Ubuntu, Cantarell, "Noto Sans", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  background-color: #000;
  background-image: url("/assets/img/space.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}

button, input {
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}

button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

body.guest {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.guest-wrap { width: min(380px, 100%); }

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.brand img { width: 84px; height: 84px; }

.brand h1 {
  margin: 0;
  color: #f4f7fb;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.04em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.75);
}

.card, .panel {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.card { padding: 22px 22px 18px; }

.card h2, .panel h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
}

.lede, .hint, .username {
  margin: 0 0 14px;
  color: var(--muted);
}

label {
  display: block;
  margin: 14px 0 6px;
  font-size: 14px;
  font-weight: 600;
}

.field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--field);
}

.field:focus-within {
  border-color: var(--primary);
  background: #fff;
}

.field img { width: 22px; height: 22px; flex: none; }

.field input {
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.field input:focus { outline: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  margin-top: 18px;
  padding: 0 18px;
  border: 0;
  border-radius: 100px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.btn:hover { background: var(--primary-hover); }

.btn-block { width: 100%; }

.btn-quiet {
  margin-top: 0;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-quiet:hover { background: rgba(0, 103, 158, 0.08); }

.btn img { width: 18px; height: 18px; }

.alert {
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 12px;
  font-size: 14px;
}

.alert.error { background: var(--danger-bg); color: var(--danger); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }

.guest-foot {
  margin: 16px 0 0;
  color: rgba(244, 247, 251, 0.86);
  text-align: center;
  font-size: 13px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brandlink {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brandlink img { width: 36px; height: 36px; }

.apps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.applink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.applink img { width: 22px; height: 22px; }

.applink:hover { background: var(--field); }

.applink.active {
  background: rgba(0, 103, 158, 0.12);
  color: var(--primary);
}

main.files {
  width: min(1080px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.files-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.files-head img { width: 36px; height: 36px; }

.files-head h1 {
  margin: 0;
  color: #f4f7fb;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.04em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.75);
}

.sheet {
  margin-bottom: 18px;
  padding: 22px 22px 18px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.sheet h2 { margin: 0 0 6px; font-size: 22px; font-weight: 700; }

.person-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.person-facts div {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--field);
}

.person-facts dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.person-facts dd {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.table-wrap {
  border-radius: 16px;
  overflow-x: auto;
  box-shadow: var(--shadow);
}

.filetable {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.filetable a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.filetable a:hover { text-decoration: underline; }

.filetable tr.is-selected { background: rgba(0, 103, 158, 0.1); }

.filetable th, .filetable td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.filetable th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.filetable td.files-empty {
  color: var(--muted);
  text-align: center;
}

.topbar-end {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
}

.userlink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 100px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.userlink:hover { background: var(--field); }

.userlink img { width: 32px; height: 32px; }

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8vh 16px 48px;
}

.stage-mark { width: 88px; height: 88px; }

.stage h1 {
  margin: 8px 0 22px;
  color: #f4f7fb;
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.045em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.75);
}

.finder { width: min(640px, 100%); }

.query {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 8px 0 8px;
  border: 2px solid transparent;
  border-radius: 100px;
  background: #fff;
  box-shadow: var(--shadow);
}

.query:focus-within { border-color: var(--primary); }

.query-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 100px;
  background: transparent;
}

.query-icon img { width: 20px; height: 20px; }

.query input {
  width: 100%;
  height: 46px;
  border: 0;
  background: transparent;
  font-size: 16px;
}

.query input:focus { outline: none; }

button.search-go {
  display: block;
  height: 44px;
  margin: 18px auto 0;
  padding: 0 22px;
  border: 0;
  border-radius: 100px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

button.search-go:hover { background: var(--primary-hover); }

.panel {
  width: min(720px, calc(100% - 32px));
  margin: 28px auto 48px;
  padding: 24px;
}

.panel .finder { width: 100%; margin-bottom: 18px; }

.panel .search-go { display: none; }

.term { margin: 0 0 6px; font-size: 16px; }

.username {
  display: flex;
  align-items: center;
  gap: 8px;
}

.username img { width: 22px; height: 22px; }

fieldset {
  margin: 18px 0 0;
  padding: 16px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

legend { padding: 0; font-weight: 700; }

@media (max-width: 720px) {
  .stage h1 { font-size: 36px; }
  .userlink span { max-width: 7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar { display: flex; flex-wrap: wrap; justify-content: space-between; padding-inline: 12px; }
  .apps { order: 3; flex: 1 0 100%; justify-content: flex-start; padding-bottom: 4px; }
  .person-facts { grid-template-columns: 1fr; }
  .files-head h1 { font-size: 28px; }
}
