:root {
  --navy: #142c44;
  --ink: #20364b;
  --muted: #526577;
  --line: #dce4eb;
  --bg: #f3f6f8;
  --blue: #215d8e;
  --soft: #eaf2f7;
  --green: #17654c;
  --danger: #9e313b;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: var(--blue);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-thickness: 2px;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #c17b00;
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
.skip {
  position: fixed;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  padding: 12px;
  background: #fff;
  z-index: 20;
}
.skip:focus {
  transform: none;
}
header {
  background: var(--navy);
  color: #fff;
  border-bottom: 4px solid #6f9bb8;
}
.header-inner {
  max-width: 1180px;
  margin: auto;
  min-height: 106px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: #fff;
  text-decoration: none;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: 0.2px;
}
.brand-mark {
  display: block;
  flex: none;
  width: 42px;
  height: 46px;
}
.brand-sub {
  display: block;
  font-size: 10px;
  letter-spacing: 2.8px;
  color: #b4c9da;
  font-weight: 500;
  margin-top: 2px;
}
.back-link {
  color: #d5e3ef;
  font-size: 13px;
  text-decoration: none;
}
.layout {
  max-width: 1180px;
  margin: auto;
  padding: 46px 32px 70px;
  display: flex;
  gap: 38px;
  min-height: calc(100vh - 191px);
}
nav {
  width: 195px;
  flex-shrink: 0;
  padding-top: 6px;
}
nav a {
  display: block;
  padding: 11px 14px;
  margin-bottom: 5px;
  border-radius: 7px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
nav a[aria-current="page"] {
  background: #e1ebf2;
  color: var(--navy);
}
nav .signout {
  margin: 23px 14px;
  font-size: 13px;
}
main {
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}
main:focus {
  outline: none;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 750;
  margin: 0 0 12px;
}
h1 {
  font-size: clamp(28px, 3.5vw, 38px);
  letter-spacing: -1.1px;
  line-height: 1.2;
  font-weight: 650;
  margin: 0 0 14px;
}
h2 {
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.3px;
  margin: 0 0 12px;
}
h3 {
  font-size: 16px;
  margin: 0 0 6px;
}
.intro {
  color: var(--muted);
  max-width: 660px;
  margin: 0 0 30px;
  font-size: 16px;
}
.auth-wrap {
  max-width: 510px;
  margin: 14px auto 25px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px;
  margin-bottom: 20px;
  box-shadow: 0 3px 12px #14314b04;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}
.grid .card {
  margin: 0;
}
.card p {
  margin-top: 0;
  color: var(--muted);
}
.card p:last-child {
  margin-bottom: 0;
}
.field {
  display: block;
  margin-bottom: 19px;
  font-size: 14px;
  font-weight: 600;
}
.field input,
.field select {
  display: block;
  width: 100%;
  padding: 11px 12px;
  margin-top: 7px;
  border: 1px solid #afbdc9;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  min-height: 46px;
}
.field small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  font-weight: 400;
  margin: 18px 0;
}
.check input {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  margin: 2px 0;
  accent-color: var(--blue);
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--blue);
  color: white;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  line-height: 1.4;
}
.button:hover {
  background: #174d78;
  text-decoration: none;
}
.button.secondary {
  background: #fff;
  color: var(--ink);
  border-color: #afbdc9;
}
.button.secondary:hover {
  background: var(--soft);
}
.button.danger {
  background: #fff;
  color: var(--danger);
  border-color: #d7a6ab;
}
.button.full {
  width: 100%;
}
.text-button {
  border: 0;
  background: none;
  color: var(--blue);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 32px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
}
.form-footer {
  font-size: 14px;
  text-align: center;
  color: var(--muted);
  margin-top: 20px;
}
.note {
  background: var(--soft);
  border-left: 3px solid #769cb9;
  padding: 16px 18px;
  border-radius: 0 6px 6px 0;
  font-size: 14px;
  color: var(--ink);
  margin: 20px 0;
}
.message {
  border-radius: 6px;
  padding: 12px 15px;
  background: #fbeff0;
  color: #862b34;
  font-size: 14px;
  margin-bottom: 18px;
  overflow-wrap: anywhere;
}
.message.success {
  background: #eaf5ef;
  color: var(--green);
}
.message:empty {
  display: none;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.badge {
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  background: var(--soft);
  color: var(--blue);
  border-radius: 5px;
  letter-spacing: 0.3px;
}
.badge.active {
  background: #e6f3eb;
  color: var(--green);
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 22px 0;
}
.profile-list {
  display: grid;
  gap: 18px;
  margin-bottom: 20px;
}
.profile-list .card {
  margin: 0;
}
.profile-name {
  overflow-wrap: anywhere;
}
.app-name {
  font-size: 22px;
  margin-top: 16px;
}
.app-icon {
  font-size: 24px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--soft);
  border-radius: 10px;
  color: var(--blue);
}
ul.clean {
  list-style: none;
  padding: 0;
  margin: 0;
}
ul.clean li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
ul.clean li:last-child {
  border: 0;
}
.prose {
  max-width: 780px;
}
.prose li {
  margin: 9px 0;
}
.prose h2 {
  margin-top: 30px;
}
.prose p {
  color: var(--muted);
}
.loading {
  padding: 50px;
  text-align: center;
  color: var(--muted);
}
footer {
  border-top: 1px solid var(--line);
  max-width: 1116px;
  margin: auto;
  padding: 23px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
}
footer span:first-child {
  font-weight: 650;
  margin-right: auto;
}
footer a {
  color: var(--muted);
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th,
td {
  text-align: left;
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
}
.empty {
  border: 1px dashed #b8c8d5;
  background: #ffffff70;
  text-align: center;
  padding: 32px;
  border-radius: 10px;
}
.empty p {
  color: var(--muted);
}
.safety-list {
  padding-left: 20px;
  font-size: 14px;
  color: var(--muted);
}
@media (max-width: 760px) {
  .header-inner {
    padding: 20px;
    min-height: 92px;
  }
  .brand {
    font-size: 16px;
  }
  .back-link {
    max-width: 96px;
    text-align: right;
    font-size: 12px;
  }
  .layout {
    padding: 22px 20px 46px;
    display: block;
  }
  .layout nav {
    display: flex;
    overflow-x: auto;
    width: 100%;
    gap: 3px;
    margin-bottom: 28px;
    padding: 0 0 8px;
  }
  nav a {
    white-space: nowrap;
    padding: 9px 11px;
    font-size: 13px;
  }
  nav .signout {
    margin: 0 8px;
    white-space: nowrap;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 21px;
  }
  .auth-wrap {
    margin-top: 15px;
  }
  .row {
    align-items: flex-start;
  }
  .row .button {
    flex-shrink: 0;
  }
  footer {
    padding: 21px 20px;
    gap: 12px;
  }
  footer span:last-child {
    width: 100%;
  }
  .intro {
    font-size: 15px;
  }
  .actions > .button {
    flex-grow: 1;
  }
  h1 {
    letter-spacing: -0.6px;
  }
  .profile-list .row {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .button {
    transition: background 0.15s ease;
  }
}
.cloud-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  overflow: auto;
  box-sizing: border-box;
  padding: 28px;
  border: 1px solid #d8dce3;
  border-radius: 16px;
  background: #fff;
  color: #1c2940;
  box-shadow: 0 20px 70px #0004;
}
.cloud-dialog::backdrop { background: #14203699; }
.cloud-dialog h2 { margin-top: 0; }
#beads-delete-error { color: #b42318; }
