:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #edf4ff;
  background: #0a101c;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 3%, rgba(47, 87, 149, 0.2), transparent 38%),
    linear-gradient(145deg, #0a101c 0%, #101b2b 54%, #0a111e 100%);
  color: #edf4ff;
}

button, input { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.ambient {
  position: fixed;
  width: 420px;
  height: 420px;
  pointer-events: none;
  border: 1px solid rgba(119, 164, 235, 0.075);
  border-radius: 50%;
  box-shadow: 0 0 0 48px rgba(119, 164, 235, 0.018), 0 0 0 96px rgba(119, 164, 235, 0.012);
}
.ambient-one { top: -280px; right: 4%; }
.ambient-two { bottom: -355px; left: -210px; width: 560px; height: 560px; opacity: .6; }

.auth-page {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: auto;
  padding: 36px 20px 60px;
}

.auth-card {
  position: relative;
  width: min(100%, 440px);
  overflow: hidden;
  border: 1px solid rgba(166, 190, 225, .17);
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(25, 38, 58, .96), rgba(16, 26, 42, .97));
  box-shadow: 0 32px 90px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .035);
  backdrop-filter: blur(18px);
}

.auth-brand, .hub-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #c5d3e8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .17em;
}
.auth-brand { padding: 25px 30px; border-bottom: 1px solid rgba(166, 190, 225, .11); }
.auth-brand b, .hub-brand b { color: #f1f6ff; font-weight: 800; }
.auth-mark {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(117, 164, 239, .3);
  border-radius: 11px;
  color: #8fb8ff;
  background: linear-gradient(145deg, rgba(69, 119, 202, .24), rgba(41, 76, 132, .14));
}
.auth-mark svg { width: 22px; height: 22px; }
.auth-content { padding: 34px 36px 30px; }
.auth-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  margin-bottom: 24px;
  border: 1px solid rgba(112, 158, 231, .24);
  border-radius: 13px;
  color: #9abaff;
  background: rgba(66, 111, 188, .13);
}
.auth-icon svg { width: 23px; height: 23px; }
.eyebrow {
  margin: 0 0 9px;
  color: #8eb3f1;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .19em;
}
.auth-content h1, .hub-intro h1 {
  margin: 0;
  color: #f1f5fc;
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -.035em;
  line-height: 1.2;
}
.auth-subtitle, .hub-subtitle {
  margin: 10px 0 27px;
  color: #8fa1bc;
  font-size: 13px;
  line-height: 1.65;
}
.auth-form { display: flex; flex-direction: column; }
.auth-form label { margin: 0 0 8px; color: #c8d4e5; font-size: 12px; font-weight: 600; }
.auth-form input {
  width: 100%;
  height: 46px;
  margin-bottom: 20px;
  padding: 0 14px;
  border: 1px solid rgba(157, 180, 213, .2);
  border-radius: 9px;
  outline: 0;
  color: #f0f5fd;
  background: rgba(7, 13, 23, .48);
  font-size: 13px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.auth-form input::placeholder { color: #65758d; }
.auth-form input:focus { border-color: #6b9ce9; background: rgba(8, 15, 27, .72); box-shadow: 0 0 0 3px rgba(75, 129, 212, .16); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }
.visibility-button {
  position: absolute;
  top: 0;
  right: 3px;
  display: grid;
  width: 42px;
  height: 46px;
  place-items: center;
  border: 0;
  color: #8294ad;
  background: transparent;
  cursor: pointer;
}
.visibility-button svg { width: 19px; height: 19px; }
.visibility-button:hover { color: #cfdbec; }
.submit-button {
  display: flex;
  min-height: 47px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
  border: 1px solid rgba(158, 191, 248, .32);
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(110deg, #3973cc, #4b83d9);
  box-shadow: 0 8px 20px rgba(36, 83, 153, .22), inset 0 1px 0 rgba(255, 255, 255, .15);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: filter 150ms ease, transform 150ms ease;
}
.submit-button:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.submit-button:disabled { cursor: wait; opacity: .78; }
.login-error, .service-error { color: #ffaaaa; font-size: 12px; line-height: 1.5; }
.login-error { margin: -8px 0 14px; }
.secure-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 22px; color: #788ba5; font-size: 11px; }
.secure-note span { color: #71bc99; font-size: 8px; }
.service-error { position: fixed; bottom: 44px; }
.auth-footer { position: fixed; bottom: 20px; color: rgba(164, 183, 210, .42); font-size: 9px; font-weight: 700; letter-spacing: .22em; }

.hub-page { position: relative; width: min(calc(100% - 48px), 1680px); margin: 0 auto; padding: 32px 0 22px; }
.hub-header { display: flex; align-items: center; justify-content: space-between; min-height: 62px; border-bottom: 1px solid rgba(166, 190, 225, .13); }
.hub-brand { text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 20px; }
.signed-in { display: inline-flex; align-items: center; gap: 8px; color: #a8b8ce; font-size: 12px; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #63c69a; box-shadow: 0 0 10px rgba(99, 198, 154, .5); }
.logout-button { border: 0; color: #91a5bf; background: transparent; font-size: 12px; cursor: pointer; }
.logout-button:hover { color: #f2f6ff; }
.logout-button span { margin-left: 4px; color: #7eabed; }
.hub-intro { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding: 52px 0 34px; }
.hub-intro h1 { font-size: clamp(28px, 4vw, 38px); }
.hub-subtitle { margin: 11px 0 0; font-size: 14px; }
.search-box {
  display: flex;
  width: min(100%, 320px);
  height: 44px;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border: 1px solid rgba(157, 180, 213, .18);
  border-radius: 10px;
  color: #7d92ae;
  background: rgba(15, 26, 42, .72);
}
.search-box svg { width: 18px; height: 18px; flex: 0 0 auto; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; color: #eaf1fb; background: transparent; font-size: 12px; }
.search-box input::placeholder { color: #71839c; }
.search-box input::-webkit-search-cancel-button { cursor: pointer; }
.search-shortcut { display: grid; width: 21px; height: 21px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(157, 180, 213, .16); border-radius: 5px; color: #8294ad; font-family: ui-monospace, monospace; font-size: 11px; }
.link-groups { display: grid; gap: 38px; }
.link-group { min-width: 0; }
.group-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.group-heading h2 { margin: 0; color: #e2ebf8; font-size: 18px; font-weight: 650; letter-spacing: -.015em; }
.group-heading p { margin: 5px 0 0; color: #7e91ab; font-size: 13px; }
.group-count { color: #627791; font-family: ui-monospace, monospace; font-size: 11px; }
.card-grid { display: flex; width: 98%; flex-wrap: wrap; gap: 14px; margin-inline: auto; }
.link-card {
  display: flex;
  min-width: 0;
  min-height: 166px;
  flex: 1 1 max(176px, calc((100% - 70px) / 6));
  flex-direction: column;
  align-items: stretch;
  padding: 16px 17px 14px;
  border: 1px solid rgba(153, 179, 216, .14);
  border-radius: 13px;
  color: inherit;
  background: linear-gradient(145deg, rgba(24, 38, 59, .74), rgba(15, 25, 41, .82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.link-card:hover { transform: translateY(-2px); border-color: rgba(113, 160, 233, .42); background: linear-gradient(145deg, rgba(31, 50, 77, .88), rgba(17, 30, 50, .94)); box-shadow: 0 16px 36px rgba(0, 0, 0, .18); }
.card-heading { display: flex; min-width: 0; align-items: center; gap: 11px; }
.card-icon { position: relative; display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; overflow: hidden; border: 1px solid rgba(153, 179, 216, .22); border-radius: 12px; color: #dce9ff; background: linear-gradient(145deg, rgba(69, 119, 202, .3), rgba(41, 76, 132, .18)); }
.card-icon-fallback { font-size: 12px; font-weight: 750; letter-spacing: .04em; }
.card-icon img { position: absolute; inset: 0; width: 100%; height: 100%; padding: 6px; object-fit: contain; background: rgba(12, 20, 33, .92); }
.card-icon.has-image .card-icon-fallback { opacity: 0; }
.card-title-block { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 5px; }
.card-project { overflow: hidden; color: #83a9e5; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.card-title-row { display: flex; min-width: 0; align-items: center; gap: 8px; }
.card-title { display: -webkit-box; overflow: hidden; color: #edf4ff; font-size: 16px; font-weight: 650; letter-spacing: -.01em; line-height: 1.25; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.card-arrow { color: #7189a9; font-size: 15px; transition: color 150ms ease, transform 150ms ease; }
.link-card:hover .card-arrow { transform: translate(2px, -2px); color: #9bbdff; }
.card-subtitle { min-height: 36px; margin-top: 13px; color: #a8b7cb; font-size: 12px; line-height: 1.5; }
.card-url { overflow: hidden; margin-top: auto; padding-top: 12px; color: #8496af; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.empty-state { padding: 38px; border: 1px dashed rgba(153, 179, 216, .2); border-radius: 12px; color: #8fa1bc; text-align: center; font-size: 13px; }
.hub-footer { display: flex; justify-content: space-between; margin-top: 42px; padding: 18px 0 4px; border-top: 1px solid rgba(166, 190, 225, .1); color: #647892; font-size: 10px; }

@media (max-width: 800px) {
  .hub-intro { align-items: stretch; flex-direction: column; padding-top: 38px; }
  .search-box { width: 100%; }
}
@media (max-width: 540px) {
  .auth-page { padding: 18px 16px 52px; }
  .auth-card { border-radius: 18px; }
  .auth-brand { padding: 21px 23px; }
  .auth-content { padding: 29px 24px 25px; }
  .hub-page { width: min(calc(100% - 32px), 1680px); padding-top: 18px; }
  .hub-header { min-height: 56px; }
  .header-actions { gap: 11px; }
  .signed-in { font-size: 10px; }
  .logout-button { font-size: 11px; }
  .hub-intro { gap: 21px; padding: 34px 0 27px; }
  .link-card { min-height: 142px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
