@font-face {
  font-family: "Source Sans 3";
  src: url("source-sans-3.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --canvas: #fafbfc;
  --paper: #fff;
  --ink: #203544;
  --muted: #526575;
  --blue: #145c80;
  --blue-dark: #0c4665;
  --blue-light: #edf4f8;
  --amber: #efbf47;
  --amber-dark: #e4ad27;
  --line: #d7e0e6;
  --control-line: #9fafbc;
  --danger: #a42b30;
  --danger-pale: #fbeef0;
  --radius: 6px;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.45;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body { margin: 0; }

h1, h2, p { margin: 0; }

h1 {
  font-size: clamp(2.1rem, 3.2vw, 2.85rem);
  font-weight: 730;
  line-height: 1.04;
  letter-spacing: -.038em;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 1.35rem;
  font-weight: 710;
  line-height: 1.1;
}

a { color: var(--blue); }

button, input, textarea, select {
  color: inherit;
  font: inherit;
}

button, select { cursor: pointer; }

button:disabled, select:disabled { cursor: default; opacity: .63; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

input, textarea, select {
  padding: .5rem .65rem;
  border: 1px solid var(--control-line);
  border-radius: var(--radius);
  background: var(--paper);
  min-height: 2.55rem;
}

:is(input, textarea)::placeholder { color: var(--muted); }

textarea { resize: vertical; }

.masthead {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.masthead-inner {
  width: min(100% - 3rem, 1100px);
  min-height: 4.25rem;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  gap: .55rem;
  align-items: center;
  color: var(--ink);
  font-weight: 760;
  font-size: 1.35rem;
  letter-spacing: -.035em;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  grid-template-columns: repeat(3, .24rem);
  gap: .12rem;
  align-items: end;
  width: 1.45rem;
  height: 1.45rem;
  padding: .25rem;
  border-radius: 3px;
  background: var(--amber);
}

.brand-mark i { height: .7rem; border-radius: 1px; background: var(--ink); }
.brand-mark i:nth-child(2) { height: .95rem; }
.brand-mark i:nth-child(3) { height: .52rem; }

.skip-link {
  position: absolute;
  top: .5rem;
  left: .5rem;
  z-index: 20;
  background: var(--paper);
  padding: .6rem 1rem;
  transform: translateY(calc(-100% - 1rem));
}

.skip-link:focus { transform: none; }

.page {
  width: min(100% - 3rem, 1100px);
  margin: 2.75rem auto 5.2rem;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.55rem;
}

.button {
  display: inline-flex;
  min-height: 2.45rem;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .38rem .85rem;
  border: 1px solid var(--control-line);
  border-radius: var(--radius);
  background: var(--paper);
  font-weight: 640;
  text-decoration: none;
  text-align: center;
  line-height: 1.15;
}

.button:hover:not(:disabled) { background: var(--blue-light); }

.button-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--blue-dark);
  padding-inline: .5rem;
}

.button-blue {
  color: var(--paper);
  border-color: var(--blue);
  background: var(--blue);
}

.button-blue:hover:not(:disabled) { background: var(--blue-dark); }

.button-amber {
  background: var(--amber);
  border-color: #9c7825;
  color: #242f38;
  white-space: nowrap;
}

.button-amber:hover:not(:disabled) { background: var(--amber-dark); }

.button-danger { color: var(--paper); border-color: var(--danger); background: var(--danger); }
.button-danger:hover:not(:disabled) { background: #882329; }
.button-danger-outline { color: var(--danger); border-color: #ca999d; }
.button-danger-outline:hover:not(:disabled) { background: var(--danger-pale); }

.muted, .caption { color: var(--muted); }
.caption { max-width: 62ch; }
.field-error { color: var(--danger); font-weight: 620; overflow-wrap: anywhere; }

.login-panel {
  width: min(100%, 28rem);
  padding: clamp(1.35rem, 4vw, 2.15rem);
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 4px solid var(--amber);
  border-radius: var(--radius);
  margin: clamp(2rem, 7vw, 5rem) 0;
}

.login-panel h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); }
.login-panel .caption { margin-top: .6rem; }
.login-panel form { display: grid; gap: .9rem; margin-top: 1.45rem; }
.login-panel .button { justify-self: start; }

.field {
  display: grid;
  gap: .28rem;
  font-weight: 625;
}

.field :is(input,textarea) { width: 100%; font-weight: 430; }

.filter-panel {
  display: grid;
  grid-template-columns: minmax(0, 34rem) minmax(13rem, 1fr);
  gap: .75rem 1.15rem;
  align-items: start;
  margin-bottom: 1.1rem;
}

.search-panel {
  display: grid;
  gap: .28rem;
}

.search-panel label { font-weight: 640; }
.search-wrap { position: relative; }
.search-wrap input { width: 100%; padding-inline-start: 2.15rem; }

.search-icon {
  position: absolute;
  left: .8rem;
  top: .82rem;
  width: .68rem;
  height: .68rem;
  border: 2px solid var(--muted);
  border-radius: 50%;
  pointer-events: none;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: .38rem;
  height: 2px;
  background: var(--muted);
  right: -.29rem;
  bottom: -.17rem;
  transform: rotate(45deg);
}

.results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .5rem;
}

.mobile-sort { display: none; }

.device-table {
  width: 100%;
  border-spacing: 0;
  table-layout: fixed;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.device-table thead th {
  padding: .22rem .95rem;
  color: var(--muted);
  font-weight: 680;
  text-align: left;
  background: var(--blue-light);
  border-bottom: 1px solid var(--line);
}

.device-table thead th:first-child { width: 44%; border-top-left-radius: var(--radius); }
.device-table thead th:nth-child(2) { width: 23%; }
.device-table thead th:last-child { width: 9.5rem; border-top-right-radius: var(--radius); }
.device-table thead .actions-heading { text-align: right; }

.device-table th button {
  min-height: 2.15rem;
  padding: .18rem 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: inherit;
  font-weight: inherit;
  text-align: start;
}

.device-table th button:hover { color: var(--ink); }
.sort-arrow { display: inline-block; color: var(--blue); min-width: .8ch; }

.device-table td {
  padding: .82rem .95rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.device-table tr:last-child td { border-bottom: 0; }
.device-table tbody tr:hover { background: #f7fafb; }
.device-name-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .55rem; }
.device-name-text { font-weight: 710; line-height: 1.2; min-width: 0; }
.device-link { display: inline-block; flex: 0 0 auto; color: var(--blue); font-size: .88rem; font-weight: 620; text-underline-offset: .15em; }
.device-link:hover { color: var(--blue-dark); }
.device-hostname { display: block; margin-top: .16rem; font-size: .88rem; color: var(--muted); }

.rustdesk-id {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: .035em;
  font-weight: 650;
}

.connection-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0;
  flex: 0 0 auto;
}

.connection-primary {
  border-color: var(--blue);
  border-radius: var(--radius) 0 0 var(--radius);
  color: var(--blue-dark);
}

.connection-menu { position: relative; display: flex; }

.connection-menu summary {
  display: grid;
  min-width: 2.45rem;
  min-height: 2.45rem;
  place-items: center;
  padding: .38rem;
  color: var(--blue-dark);
  background: var(--paper);
  border: 1px solid var(--blue);
  border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  list-style: none;
}

.connection-menu summary::-webkit-details-marker { display: none; }
.connection-menu:is([open],:hover) summary { background: var(--blue-light); }
.chevron { width: .45rem; height: .45rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }

.connection-options {
  position: absolute;
  z-index: 5;
  top: calc(100% + .35rem);
  right: 0;
  min-width: 10rem;
  padding: .22rem;
  background: var(--paper);
  border: 1px solid var(--control-line);
  border-radius: var(--radius);
  box-shadow: 0 5px 14px rgb(32 53 68 / 12%);
}

.connection-options button {
  display: block;
  width: 100%;
  min-height: 2.4rem;
  padding: .4rem .55rem;
  border: 0;
  border-radius: 3px;
  background: var(--paper);
  text-align: start;
  white-space: nowrap;
}

.connection-options button:hover { background: var(--blue-light); }

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-top: 1rem;
}

.button-group { display: flex; gap: .45rem; }

.empty {
  display: grid;
  justify-items: start;
  gap: .65rem;
  background: var(--paper);
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.notice {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .65rem .75rem .65rem 1rem;
  margin-bottom: 1.15rem;
  border-left: 3px solid var(--blue);
  background: var(--blue-light);
  overflow-wrap: anywhere;
}

.notice[data-error="true"] { border-color: var(--danger); background: var(--danger-pale); }
.notice a { font-weight: 650; }
.notice-close {
  min-width: 2rem;
  min-height: 2rem;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
}

.notice-close:hover { background: rgb(32 53 68 / 8%); }

.back-link { display: inline-flex; gap: .36rem; align-items: center; margin-bottom: 1rem; text-decoration: none; font-weight: 650; }
.back-link span { font-size: 1.45rem; line-height: .65; }
.back-link:hover { text-decoration: underline; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 1.15rem; align-items: start; }
.surface { padding: clamp(1rem, 2.5vw, 1.55rem); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.access-password { margin-bottom: 1.15rem; }
.access-password h2 { margin-bottom: .65rem; }
.password-controls { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
#stored-password { width: min(100%, 32ch); font-family: ui-monospace, monospace; }
#password-status:empty { margin: 0; }
.device-form { display: grid; gap: .95rem; }
.device-form > .button { justify-self: start; }
.device-form .field select { width: 100%; font-weight: 430; }
.device-form .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-sidebar { display: grid; gap: 1.15rem; min-width: 0; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.delete-zone { margin-top: 1.15rem; }
.technical h2 { margin-bottom: 1rem; }
.technical dl { display: grid; gap: .45rem .65rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin: 0; }
.technical dt { color: var(--muted); }
.technical dd { margin: 0; font-weight: 630; overflow-wrap: anywhere; }
.technical .button { margin-top: 1.15rem; }
.technical .status-warn { color: var(--danger); }

.tag-field { display: grid; gap: .28rem; min-width: 0; }
.tag-field > label { font-weight: 640; }
.tag-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.tag-controls > input { flex: 1 1 9rem; min-width: 0; }
.tag-controls > .button { min-height: 2.55rem; }

.tag-list, .row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .4rem;
  list-style: none;
  padding: 0;
  margin: .25rem 0 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  max-width: 100%;
  min-width: 0;
  padding: .08rem .5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--blue-dark);
  background: var(--blue-light);
  font-size: .85rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.tag span { min-width: 0; }
.tag button {
  min-width: 1.5rem;
  min-height: 1.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--blue-dark);
  font-size: 1.2rem;
  line-height: 1;
}

.tag button:hover { background: var(--paper); }
.row-tags { max-width: 100%; }
.row-tags .tag { font-size: .79rem; }

.setup-help summary, .ssh-fields summary {
  color: var(--blue-dark);
  cursor: pointer;
  font-weight: 690;
}

.setup-help summary:hover, .ssh-fields summary:hover { text-decoration: underline; }
.setup-help ol { display: grid; gap: .75rem; margin: .9rem 0 0; padding-inline-start: 1.25rem; }
.setup-help code { line-height: 1.4; overflow-wrap: anywhere; }
.server-key { display: block; margin: .4rem 0; color: var(--blue-dark); user-select: all; }
.setup-help .caption { margin-top: .4rem; }
.setup-help .caption:empty, .ssh-command-box .caption:empty { display: none; }
.mac-help { display: grid; gap: .55rem; margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--line); }
.mac-help h2 { font-size: 1.1rem; }
.guide-links { display: flex; flex-wrap: wrap; gap: .3rem .6rem; font-size: .89rem; }
.ssh-fields { border-top: 1px solid var(--line); padding-top: .65rem; }
.ssh-fields .field-grid { align-items: start; margin-top: .65rem; }
.check-field { display: flex; align-items: center; gap: .48rem; align-self: center; }
.check-field input { min-height: auto; margin: 0; accent-color: var(--blue); }
.ssh-command-box { display: grid; gap: .45rem; margin-top: .8rem; }
.ssh-command-box code {
  padding: .55rem;
  border-radius: var(--radius);
  color: var(--blue-dark);
  background: var(--blue-light);
  font-size: .86rem;
  overflow-wrap: anywhere;
  user-select: all;
}
.ssh-command-box .button { justify-self: start; margin: 0; }
.duplicate-link { color: var(--blue); font-weight: 650; }
.add-options { display: flex; flex-wrap: wrap; gap: .7rem; }

dialog {
  width: min(100% - 1.5rem, 35rem);
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid var(--control-line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 15px 48px rgb(32 53 68 / 23%);
}

dialog::backdrop { background: rgb(22 39 52 / 54%); }

.dialog-frame { padding: clamp(1rem, 4vw, 1.65rem); }
.dialog-frame > h2 { margin-bottom: .85rem; }
.dialog-frame .caption { margin-bottom: .7rem; }

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  margin-top: 1.15rem;
}

.duration-options { display: flex; flex-wrap: wrap; gap: .5rem; margin: .85rem 0; padding: 0; border: 0; }
.duration-options legend { margin-bottom: .35rem; padding: 0; font-weight: 650; }
.duration-options label { display: flex; align-items: center; padding: .34rem .6rem; gap: .4rem; border: 1px solid var(--control-line); border-radius: var(--radius); min-height: 2.35rem; cursor: pointer; }
.duration-options label:has(:checked) { background: var(--blue-light); border-color: var(--blue); }
.duration-options input { min-height: auto; margin: 0; accent-color: var(--blue); }

.expiry { color: var(--blue-dark); font-weight: 700; margin-bottom: .35rem; font-variant-numeric: tabular-nums; }
.commands { display: grid; gap: .75rem; }
.command { display: grid; gap: .3rem; align-items: center; grid-template-columns: minmax(0, 1fr) auto; }
.command pre { margin: 0; grid-column: 1 / -1; overflow: auto; background: var(--blue-light); color: var(--ink); border: 1px solid var(--line); padding: .6rem; border-radius: var(--radius); font-size: .83rem; user-select: all; }
.command .button { justify-self: end; }
.command span { font-weight: 640; }
#copy-status { margin-top: .65rem; }
#copy-status:empty { display: none; }

.change-list {
  display: grid;
  grid-template-columns: minmax(6rem, .5fr) minmax(0, 1.5fr);
  gap: .5rem .8rem;
  margin: .75rem 0;
  padding: .72rem;
  border-radius: var(--radius);
  background: var(--blue-light);
}

.change-list dt { font-weight: 680; }
.change-list dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.change-list ins { font-weight: 650; text-decoration: none; }
.change-list del { color: var(--muted); }
#confirm-error:not(:first-child) { margin-top: .65rem; }

@media (max-width: 700px) {
  .masthead-inner, .page { width: min(100% - 1.5rem, 1100px); }
  .page { margin-top: 1.65rem; }
  .page-heading { gap: .8rem; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .filter-panel { grid-template-columns: minmax(0, 1fr); }

  .results-bar { flex-wrap: wrap; gap: .45rem; }
  .mobile-sort { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; color: var(--muted); font-size: .9rem; }
  .mobile-sort select { min-height: 2rem; padding: .28rem .4rem; }

  .device-table { display: block; }
  .device-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .device-table tbody { display: block; }

  .device-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: center;
    column-gap: .6rem;
    padding: .68rem .72rem;
    border-bottom: 1px solid var(--line);
  }

  .device-table tr:last-child { border-bottom: 0; }
  .device-table td { min-width: 0; padding: 0; border: 0; }
  .device-table .device-name { grid-column: 1 / 3; }
  .device-table .action-cell { grid-column: 3; grid-row: 1 / 3; }
  .device-table .device-exhibition, .device-table .rustdesk-id { font-size: .88rem; }
  .device-table .device-exhibition { grid-column: 1; }
  .device-table .rustdesk-id { grid-column: 2; }
}

@media (max-width: 390px) {
  .device-form .field-grid { grid-template-columns: minmax(0, 1fr); }
  .pagination .button { padding-inline: .5rem; }
}

#account-nav, .key-downloads { display: flex; flex-wrap: wrap; gap: .4rem; }
#google-login, #login-error { margin-top: 1rem; }
.technician-steps { display: grid; gap: 1rem; max-width: 48rem; }
.technician-steps .surface { display: grid; gap: .85rem; min-width: 0; }
.technician-steps details { min-width: 0; }
.technician-steps summary { color: var(--blue-dark); font-weight: 650; cursor: pointer; }
.technician-steps details p { margin-top: .55rem; }
.technician-steps pre { padding: .65rem; background: var(--blue-light); white-space: pre-wrap; overflow-wrap: anywhere; }
.technician-steps [role="status"]:empty { display: none; }
.network-fields { margin: .6rem 0; display: grid; gap: .6rem; }
.network-fields dt { font-weight: 650; }
.network-fields dd { margin: .2rem 0 0; display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.network-fields code { min-width: 0; overflow-wrap: anywhere; user-select: all; }
