:root {
  color-scheme: light;
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --background: #f2f2f7;
  --surface: #ffffff;
  --field: #f2f2f7;
  --text: #1c1c1e;
  --secondary: #5d5d65;
  --border: #d1d1d6;
  --accent: #005ac6;
  --on-accent: #ffffff;
  --selection: #ffffff;
  color: var(--text);
  background: var(--background);
  accent-color: var(--accent);
}
:root[data-appearance='dark'] {
  color-scheme: dark;
  --background: #000000;
  --surface: #1c1c1e;
  --field: #2c2c2e;
  --text: #f5f5f7;
  --secondary: #aeaeb7;
  --border: #48484a;
  --accent: #64aaff;
  --on-accent: #001c3d;
  --selection: #48484a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-appearance='light']) {
    color-scheme: dark;
    --background: #000000;
    --surface: #1c1c1e;
    --field: #2c2c2e;
    --text: #f5f5f7;
    --secondary: #aeaeb7;
    --border: #48484a;
    --accent: #64aaff;
    --on-accent: #001c3d;
    --selection: #48484a;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
/* Cover the entire viewport without animation, including dialogs in the top layer.
   Also hide descendants so async UI updates cannot expose content while away. */
html.privacy-covered,
html.privacy-covered body,
html.privacy-covered dialog::backdrop {
  background: #000000 !important;
}
html.privacy-covered body * {
  visibility: hidden !important;
}
#privacy-screen {
  display: none;
}
html.privacy-covered #privacy-screen {
  display: block;
  visibility: visible !important;
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: none;
  box-shadow: none;
  background: #000000;
}
main {
  max-width: 44rem;
  margin: auto;
  padding: max(1.5rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1.5rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}
.app-header,
.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.app-header {
  justify-content: space-between;
  flex-wrap: wrap;
}
.brand-mark {
  color: var(--accent);
  font-size: 2.25rem;
  line-height: 1;
}
.eyebrow {
  margin: 0;
  font-size: .75rem;
  font-weight: 600;
  color: var(--secondary);
}
h1 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -.035em;
}
h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  letter-spacing: -.02em;
}
p {
  margin: .75rem 0;
}
.intro {
  color: var(--secondary);
  margin: 1.5rem 0;
}
section {
  padding: clamp(1rem, 4vw, 1.75rem);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  background: var(--surface);
}
.transfer-status {
  color: var(--secondary);
  margin-bottom: 1.5rem;
  overflow-wrap: anywhere;
}
label {
  display: block;
  font-weight: 600;
  margin: 1rem 0 .5rem;
}
textarea,
input[type='text'],
input[type='password'],
input[type='file'] {
  width: 100%;
  min-width: 0;
  font: inherit;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: .85rem;
  padding: .85rem;
  margin: 0;
}
textarea {
  display: block;
  resize: vertical;
  min-height: 8rem;
}
textarea::placeholder {
  color: var(--secondary);
  opacity: 1;
}
input[type='file'] {
  padding: .5rem;
  overflow: hidden;
}
input[type='file']::file-selector-button {
  font: inherit;
  color: var(--accent);
  background: var(--surface);
  border: 0;
  border-radius: .5rem;
  padding: .6rem;
  margin-right: .5rem;
  min-height: 44px;
}
.hint,
#expiry,
#feedback,
#network,
#update {
  color: var(--secondary);
  font-size: .875rem;
}
#feedback {
  color: var(--text);
}
.file-choice {
  border-top: 1px solid var(--border);
  margin-top: 1.25rem;
  padding-top: .25rem;
}
.protection-toggle {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 44px;
}
.protection-toggle input {
  width: 1.25rem;
  height: 1.25rem;
}
button {
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  min-width: 44px;
  padding: .65rem 1rem;
  margin: .5rem .25rem .5rem 0;
  border-radius: .85rem;
  border: 1px solid var(--border);
  color: var(--accent);
  background: var(--field);
  cursor: pointer;
}
button.primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
}
button.wide {
  width: 100%;
  margin-top: 1rem;
}
button.quiet {
  background: transparent;
  border-color: transparent;
  padding-inline: .5rem;
  margin: 0;
}
button:disabled {
  cursor: default;
  opacity: .5;
}
button:active:not(:disabled) {
  filter: brightness(.9);
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.privacy-note {
  text-align: center;
  color: var(--secondary);
  font-size: .875rem;
  margin: 1.5rem 0;
}
.privacy-panel {
  color: var(--secondary);
  font-size: .875rem;
  padding: .25rem 0;
}
summary {
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  padding: .6rem 0;
}
ul {
  padding-left: 1.25rem;
}
li + li {
  margin-top: .5rem;
}
footer {
  text-align: center;
  color: var(--secondary);
  font-size: .8rem;
  margin-top: 1.5rem;
}
.appearance {
  border: 0;
  padding: 0;
  margin: 0;
}
.appearance legend {
  width: 100%;
  margin-bottom: .5rem;
}
.segmented {
  display: inline-flex;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: .25rem;
  max-width: 100%;
}
.segmented label {
  position: relative;
  margin: 0;
  font-size: .875rem;
  cursor: pointer;
}
.segmented input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.segmented span {
  display: block;
  padding: .6rem .9rem;
  min-height: 44px;
  border-radius: .75rem;
}
.segmented input:checked + span {
  color: var(--text);
  background: var(--selection);
  box-shadow: 0 1px 4px #0002;
}
.segmented input:focus-visible + span {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
#file-details {
  overflow-wrap: anywhere;
}
#expiry:empty,
#feedback:empty,
#update:empty {
  display: none;
}
[hidden] {
  display: none !important;
}
/* No animated transitions; state changes also respect reduced-motion preferences. */
@media (forced-colors: active) {
  .segmented input:checked + span {
    outline: 2px solid Highlight;
  }
}

/* Keep native buttons keyboard accessible inside the field's visual boundary. */
.field-control {
  position: relative;
}
.field-control > input,
.field-control > textarea,
.field-control > .masked-preview,
.field-control > #mask-fallback {
  padding-right: calc(44px + .75rem);
}
.field-control.two-actions > input,
.field-control.two-actions > textarea,
.field-control.two-actions > .masked-preview {
  padding-right: calc(88px + .75rem);
}
button.field-icon {
  position: absolute;
  top: .2rem;
  right: .25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  background: transparent;
  border-color: transparent;
}
button.field-icon-leading {
  right: calc(44px + .25rem);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.field-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.visibility-control[data-visible='true'] .eye-slash {
  display: none;
}
.masked-preview,
#mask-fallback {
  min-height: 8rem;
  padding: .85rem;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: .85rem;
  background: var(--field);
}
/* Fail closed where this non-standard property is unavailable: reveal to edit. */
textarea.masked {
  display: none;
}
@supports (-webkit-text-security: disc) {
  textarea.masked {
    display: block;
    -webkit-text-security: disc;
  }
  textarea.masked::placeholder {
    -webkit-text-security: none;
  }
  #mask-fallback {
    display: none;
  }
}

.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.dialog-heading h2 {
  margin: 0;
}
#qr-dialog {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: clamp(1rem, 4vw, 1.75rem);
  width: min(32rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
}
#qr-dialog::backdrop {
  background: #0009;
}
#invitation-qr {
  display: block;
  width: min(100%, 20rem);
  height: auto;
  margin: 1.5rem auto;
  background: #fff;
  image-rendering: pixelated;
}
#qr-url {
  font-family: ui-monospace, monospace;
  overflow-wrap: anywhere;
}
#qr-feedback:empty {
  display: none;
}

.activity-panel {
  margin-top: 1rem;
  padding: .5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--surface);
}
#activity-events {
  max-height: 18rem;
  overflow: auto;
  padding-left: 1.5rem;
  font-size: .875rem;
  overflow-wrap: anywhere;
}
.activity-time {
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
}

#connection-details { margin: 1rem 0; font-size: .875rem; }
#connection-details dt { font-weight: 600; margin-top: .75rem; }
#connection-details dd { margin: .25rem 0 0; overflow-wrap: anywhere; }
