:root {
  --ink: #111827;
  --muted: #657083;
  --line: #d9dfea;
  --soft-line: #e9edf4;
  --paper: #ffffff;
  --field: #f4f6fa;
  --blue: #315fda;
  --blue-dark: #2449a8;
  --navy: #111a2d;
  --green: #188a64;
  --amber: #ba771b;
  --shadow: 0 22px 60px rgba(29, 43, 78, 0.12);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }

.site-header {
  min-height: 72px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  position: relative;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
}

.brand { display: inline-flex; align-items: center; gap: 0.8rem; color: var(--ink); text-decoration: none; }
.brand img { width: 43px; height: 43px; object-fit: contain; }
.brand span { font: 700 0.92rem Georgia, "Times New Roman", serif; letter-spacing: 0.03em; white-space: nowrap; }
.private-label, .bench-label { margin-left: 1rem; border-left: 1px solid var(--line); padding-left: 1rem; font-size: 0.72rem; font-weight: 750; letter-spacing: 0.12em; color: var(--blue); }

.login-page { background: #f5f7fb; display: flex; flex-direction: column; }
.login-header { justify-content: space-between; }
.login-layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(380px, 0.82fr); min-height: calc(100vh - 140px); }
.login-intro { padding: clamp(4rem, 10vw, 9rem) clamp(2rem, 8vw, 8rem); display: flex; flex-direction: column; justify-content: center; background: linear-gradient(135deg, #f8faff 0%, #eef2f9 100%); position: relative; overflow: hidden; }
.login-intro::after { content: ""; width: 430px; height: 430px; border: 82px solid rgba(49, 95, 218, 0.06); border-radius: 50%; position: absolute; right: -175px; bottom: -170px; }
.eyebrow { margin: 0 0 1.65rem; display: flex; align-items: center; gap: 0.65rem; font: 700 0.78rem Georgia, "Times New Roman", serif; letter-spacing: 0.04em; }
.eyebrow span { width: 28px; height: 3px; background: var(--blue); display: inline-block; }
.login-intro h1, .portal-toolbar h1, .text-view > h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -0.04em; margin: 0; }
.login-intro h1 { font-size: clamp(3.6rem, 7vw, 6.8rem); max-width: 740px; line-height: 0.94; }
.intro-copy { margin: 2rem 0 0; max-width: 650px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.15rem, 2vw, 1.45rem); line-height: 1.6; color: #2b3446; }
.device-line { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; margin-top: 3.2rem; color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.device-line i { width: 3px; height: 3px; border-radius: 50%; background: var(--blue); }

.login-card { align-self: center; width: min(480px, calc(100% - 4rem)); margin: 3rem auto; padding: clamp(2rem, 5vw, 3.25rem); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }
.secure-mark { width: 54px; height: 54px; border-radius: 50%; color: white; background: var(--navy); display: grid; place-items: center; font-family: Georgia, serif; font-weight: 700; margin-bottom: 2.2rem; }
.kicker, .app-category, .dialog-heading p { margin: 0 0 0.6rem; color: var(--blue); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.login-card h2 { margin: 0; font: 500 2rem/1.1 Georgia, "Times New Roman", serif; letter-spacing: -0.025em; }
.muted { color: var(--muted); line-height: 1.55; margin: 0.75rem 0 2rem; }
.login-card label { display: block; font-size: 0.83rem; font-weight: 700; margin: 1.2rem 0 0.5rem; }
.login-card input { width: 100%; min-height: 50px; border: 1px solid #cfd6e3; padding: 0 0.9rem; background: #fbfcfe; outline: none; border-radius: 3px; }
.login-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(49, 95, 218, 0.12); }
.password-field { position: relative; }
.password-field input { padding-right: 4.2rem; }
.show-password { position: absolute; right: 0.55rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; font-size: 0.78rem; font-weight: 750; color: var(--blue); cursor: pointer; padding: 0.6rem; }
.primary-button { border: 0; background: var(--navy); color: white; min-height: 50px; padding: 0 1.2rem; font-weight: 750; cursor: pointer; transition: background 160ms ease, transform 160ms ease; border-radius: 3px; }
.primary-button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: 0.62; cursor: wait; transform: none; }
.login-button { width: 100%; margin-top: 1.4rem; }
.form-error { color: #a1262c; background: #fff0f0; border-left: 3px solid #c8464d; padding: 0.7rem 0.8rem; font-size: 0.85rem; margin: 0.8rem 0 0; }
.help-copy { color: var(--muted); font-size: 0.78rem; line-height: 1.5; margin: 1.5rem 0 0; text-align: center; }
.login-footer { min-height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 2rem; border-top: 1px solid var(--line); background: var(--paper); color: var(--muted); font-size: 0.76rem; }

.portal-page { background: #f5f7fb; }
.portal-header { position: sticky; top: 0; }
.bench-label { margin-right: auto; }
.desktop-nav { display: flex; align-items: stretch; align-self: stretch; gap: 1.8rem; margin-right: 2rem; }
.nav-link { border: 0; background: transparent; border-bottom: 2px solid transparent; padding: 0 0.15rem; font: 700 0.84rem Georgia, "Times New Roman", serif; cursor: pointer; }
.nav-link:hover, .nav-link.active { border-bottom-color: var(--blue); color: var(--blue); }
.account-button { display: flex; align-items: center; gap: 0.6rem; border: 0; background: transparent; cursor: pointer; padding: 0.4rem; border-radius: 999px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: white; font-size: 0.7rem; font-weight: 800; }
.account-name { font-size: 0.82rem; font-weight: 750; }
.account-menu { position: absolute; right: 2rem; top: 62px; width: 240px; background: white; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 1rem; }
.account-menu strong, .account-menu span { display: block; }
.account-menu strong { font-family: Georgia, serif; }
.account-menu span { color: var(--muted); font-size: 0.76rem; margin: 0.25rem 0 1rem; }
.account-menu button { width: 100%; min-height: 40px; border: 1px solid var(--line); background: var(--field); cursor: pointer; font-weight: 700; }

.portal-shell { max-width: 1460px; margin: 0 auto; padding: 3rem 2rem 5rem; }
.portal-toolbar { display: flex; justify-content: space-between; gap: 2rem; align-items: end; }
.portal-toolbar .eyebrow { margin-bottom: 0.8rem; }
.portal-toolbar h1, .text-view > h1 { font-size: clamp(2.5rem, 5vw, 4.3rem); line-height: 1; }
.toolbar-copy { color: var(--muted); margin: 0.85rem 0 0; font-family: Georgia, serif; font-size: 1.05rem; }
.search-box { min-width: min(330px, 100%); min-height: 48px; display: flex; align-items: center; gap: 0.65rem; padding: 0 0.9rem; border: 1px solid var(--line); background: white; }
.search-box span { font-size: 1.4rem; color: var(--muted); transform: rotate(-20deg); }
.search-box input { width: 100%; border: 0; outline: 0; min-height: 46px; background: transparent; }

.platform-bar { display: flex; gap: 0.55rem; overflow-x: auto; padding: 1.8rem 0 1.2rem; scrollbar-width: thin; }
.platform-chip { flex: 0 0 auto; border: 1px solid var(--line); background: white; border-radius: 999px; min-height: 40px; padding: 0.3rem 0.45rem 0.3rem 0.9rem; display: inline-flex; align-items: center; gap: 0.65rem; cursor: pointer; font-size: 0.78rem; font-weight: 700; }
.platform-chip small { min-width: 24px; height: 24px; border-radius: 999px; background: var(--field); display: grid; place-items: center; font-size: 0.66rem; }
.platform-chip:hover, .platform-chip.active { border-color: var(--navy); background: var(--navy); color: white; }
.platform-chip.active small { background: rgba(255, 255, 255, 0.14); }
.results-row { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: 1.3rem 0; color: var(--muted); font-size: 0.8rem; }
.results-row p { margin: 0; }
.legend { display: flex; gap: 1rem; }
.legend span { display: flex; align-items: center; gap: 0.4rem; }
.ready-dot, .prep-dot, .internal-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--green); }
.prep-dot { background: #aeb6c5; }
.internal-dot { background: var(--amber); }

.apps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.app-card { background: white; border: 1px solid var(--line); padding: 1.35rem; display: flex; flex-direction: column; min-height: 390px; transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease; }
.app-card:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(29, 43, 78, 0.1); border-color: #c5cedf; }
.app-card-top { display: flex; align-items: start; justify-content: space-between; }
.app-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 15px; color: white; font: 700 1rem Georgia, serif; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2); }
.app-icon.blue { background: linear-gradient(145deg, #284ca7, #5879df); }
.app-icon.violet { background: linear-gradient(145deg, #2a245f, #7365d8); }
.app-icon.amber { background: linear-gradient(145deg, #8e581b, #d69b3e); }
.app-icon.cyan { background: linear-gradient(145deg, #116477, #33a9b8); }
.app-icon.rose { background: linear-gradient(145deg, #8e365a, #d9718d); }
.app-icon.green { background: linear-gradient(145deg, #17624d, #3ca77d); }
.release-state { display: flex; align-items: center; gap: 0.45rem; color: var(--muted); font-size: 0.7rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.06em; }
.app-category { margin-top: 1.25rem; }
.app-card h2 { margin: 0; font: 500 1.65rem/1.1 Georgia, serif; letter-spacing: -0.025em; }
.app-summary { color: var(--muted); font-size: 0.86rem; line-height: 1.55; margin: 0.75rem 0 1.2rem; }
.version-line { display: flex; align-items: center; gap: 0.7rem; font-size: 0.72rem; color: var(--muted); margin-top: auto; }
.version-line strong { color: var(--ink); }
.card-platforms { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 1rem 0; min-height: 66px; }
.card-platforms span { display: inline-flex; align-items: center; gap: 0.32rem; background: var(--field); border-radius: 999px; padding: 0.35rem 0.55rem; font-size: 0.66rem; color: #4e5a6c; }
.card-platforms span i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.card-platforms span.preparing i { background: #aeb6c5; }
.card-platforms .more-platforms { font-weight: 750; color: var(--blue); }
.card-action { min-height: 44px; width: 100%; border: 1px solid var(--navy); background: var(--navy); color: white; padding: 0 0.9rem; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-weight: 750; }
.card-action:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.card-action span { opacity: 0.65; font-size: 0.7rem; font-weight: 500; }
.empty-state { text-align: center; background: white; border: 1px solid var(--line); padding: 5rem 2rem; }
.empty-state h2 { font: 500 2rem Georgia, serif; margin: 0; }
.empty-state p { color: var(--muted); }
.secondary-button { min-height: 44px; padding: 0 1rem; border: 1px solid var(--navy); background: transparent; cursor: pointer; font-weight: 750; }

.text-view { max-width: 1050px; margin: 0 auto; padding-top: 2rem; }
.notes-list { border-top: 1px solid var(--line); margin-top: 2rem; }
.notes-list article { display: grid; grid-template-columns: 180px 1fr; gap: 2rem; padding: 2rem 0; border-bottom: 1px solid var(--line); }
.notes-list article > div { display: flex; flex-direction: column; gap: 0.4rem; color: var(--muted); font-size: 0.78rem; }
.notes-list article > div strong { color: var(--blue); }
.notes-list section p { color: var(--blue); font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; margin: 0 0 0.4rem; }
.notes-list h2 { font: 500 1.65rem Georgia, serif; margin: 0; }
.notes-list ul { color: var(--muted); line-height: 1.8; padding-left: 1.1rem; margin-bottom: 0; }
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-left: 1px solid var(--line); margin-top: 2rem; }
.guide-grid article { background: white; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 2rem; min-height: 235px; }
.guide-grid article > span { color: var(--blue); font-size: 0.72rem; font-weight: 800; }
.guide-grid h2 { font: 500 1.45rem Georgia, serif; margin: 2.2rem 0 0.65rem; }
.guide-grid p { color: var(--muted); line-height: 1.65; margin: 0; font-size: 0.9rem; }
.safety-note { margin-top: 1rem; background: var(--navy); color: white; display: flex; gap: 1.5rem; padding: 1.3rem 1.5rem; align-items: center; }
.safety-note strong { font-family: Georgia, serif; }
.safety-note span { opacity: 0.75; font-size: 0.84rem; }

.build-dialog { width: min(680px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); border: 0; padding: 0; box-shadow: 0 35px 100px rgba(8, 17, 38, 0.3); }
.build-dialog::backdrop { background: rgba(13, 22, 41, 0.66); backdrop-filter: blur(4px); }
#dialog-content { padding: 2rem; }
.dialog-close { position: absolute; top: 1rem; right: 1rem; width: 36px; height: 36px; border: 1px solid var(--line); background: white; border-radius: 50%; cursor: pointer; font-size: 1.4rem; line-height: 1; }
.dialog-heading { display: flex; gap: 1rem; align-items: center; padding-right: 2.5rem; }
.dialog-heading p { margin: 0 0 0.3rem; }
.dialog-heading h2 { margin: 0; font: 500 2rem Georgia, serif; }
.dialog-heading span { display: block; color: var(--muted); font-size: 0.76rem; margin-top: 0.35rem; }
.dialog-notes { margin: 1.7rem 0; padding: 1.3rem; background: var(--field); }
.dialog-notes h3, .build-options h3 { margin: 0 0 0.8rem; font: 600 0.82rem Georgia, serif; text-transform: uppercase; letter-spacing: 0.05em; }
.dialog-notes ul { margin: 0; padding-left: 1.1rem; color: var(--muted); line-height: 1.7; font-size: 0.84rem; }
.build-option { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; border-top: 1px solid var(--line); }
.build-option strong, .build-option span { display: block; }
.build-option strong { font-family: Georgia, serif; }
.build-option span { color: var(--muted); font-size: 0.75rem; margin-top: 0.25rem; }
.build-option button { min-width: 140px; min-height: 40px; border: 1px solid var(--navy); background: var(--navy); color: white; cursor: pointer; font-weight: 750; font-size: 0.75rem; }
.build-option button:disabled { border-color: var(--line); background: var(--field); color: #8d96a5; cursor: not-allowed; }
.dialog-footnote { color: var(--muted); font-size: 0.72rem; line-height: 1.5; margin: 1.2rem 0 0; }
.toast { position: fixed; z-index: 100; right: 1.5rem; bottom: 1.5rem; max-width: 390px; background: var(--navy); color: white; box-shadow: var(--shadow); padding: 1rem 1.2rem; font-size: 0.84rem; }

@media (max-width: 1020px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-intro { min-height: 480px; padding-top: 5rem; padding-bottom: 5rem; }
  .login-card { margin-top: -2rem; position: relative; z-index: 2; }
  .apps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .desktop-nav { display: none; }
}

@media (max-width: 720px) {
  .site-header { padding: 0 1rem; min-height: 64px; }
  .brand img { width: 38px; height: 38px; }
  .private-label { font-size: 0.64rem; }
  .login-intro { min-height: 420px; padding: 3.5rem 1.25rem 5rem; }
  .login-intro h1 { font-size: clamp(3rem, 16vw, 4.6rem); }
  .intro-copy { font-size: 1.05rem; }
  .device-line { margin-top: 2rem; }
  .login-card { width: calc(100% - 2rem); padding: 1.5rem; }
  .login-footer { padding: 1rem; flex-direction: column; justify-content: center; gap: 0.45rem; text-align: center; }
  .bench-label { display: none; }
  .account-name { display: none; }
  .account-menu { right: 1rem; }
  .portal-shell { padding: 2rem 1rem 4rem; }
  .portal-toolbar { flex-direction: column; align-items: stretch; }
  .search-box { min-width: 0; }
  .apps-grid { grid-template-columns: 1fr; }
  .app-card { min-height: 365px; }
  .results-row { align-items: flex-start; }
  .legend { flex-direction: column; gap: 0.35rem; }
  .notes-list article { grid-template-columns: 1fr; gap: 1rem; }
  .notes-list article > div { flex-direction: row; }
  .guide-grid { grid-template-columns: 1fr; }
  .safety-note { align-items: flex-start; flex-direction: column; gap: 0.5rem; }
  .build-option { align-items: flex-start; flex-direction: column; }
  .build-option button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
