:root {
  color-scheme: light;
  --background: #f4f3ef;
  --surface: #fffefc;
  --surface-soft: #f8f7f4;
  --field: #f0efec;
  --border: #deddd8;
  --text: #222629;
  --text-secondary: #656d72;
  --accent: #2b5877;
  --accent-soft: #e7f0f5;
  --success: #238558;
  --success-soft: #eff8f3;
  --attention: #9b5d26;
  --attention-soft: #fff4e8;
  --danger: #b54845;
  --shadow: 0 16px 44px rgb(31 38 43 / 10%);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--background);
  color: var(--text);
}

body {
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

button,
input,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

:where(button, input, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.app-shell {
  width: min(100%, 620px);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--surface);
  border-inline: 1px solid var(--border);
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 76px;
  padding: 13px 17px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
  gap: 11px;
}

.brand-lockup > div:last-child {
  min-width: 0;
  flex: 1;
}

.mascot-frame {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  background: var(--accent-soft);
}

.mascot-frame img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -0.35px;
}

h2 {
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.35px;
}

.device-status-button {
  display: flex;
  max-width: calc(100% + 16px);
  align-items: center;
  gap: 7px;
  min-height: 44px;
  margin: -8px -8px -9px;
  padding: 10px 8px 9px;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  outline-offset: 3px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

#connection-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-summary {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 10px;
}

.online-summary i,
.device-switcher-status i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #afb4b6;
}

.online-summary i[data-online="true"],
.device-switcher-status i[data-online="true"] {
  background: var(--success);
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: var(--field);
  color: var(--text-secondary);
  cursor: pointer;
}

.icon-button img {
  width: 19px;
  height: 19px;
  object-fit: contain;
  opacity: 0.72;
}

.install-app-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 16px 0;
  padding: 11px 12px;
  border: 1px solid #cbdde7;
  border-radius: 13px;
  background: var(--accent-soft);
}

.install-app-banner > img {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  object-fit: contain;
  border-radius: 10px;
}

.install-app-banner > img,
.install-dialog-copy img {
  background: var(--accent-soft);
}

.install-app-banner > div {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

.install-app-banner strong {
  font-size: 13px;
}

.install-app-banner span {
  color: var(--text-secondary);
  font-size: 10px;
}

main {
  padding: 16px 16px 154px;
}

.pwa-launcher-view {
  display: flex;
  min-height: calc(100dvh - 120px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.pwa-launcher-view > img {
  width: 112px;
  height: 112px;
  margin-bottom: 19px;
  object-fit: contain;
  border-radius: 26px;
  background: var(--accent-soft);
}

.pwa-launcher-view h2 {
  margin-top: 7px;
  font-size: 23px;
}

.pwa-launcher-view p {
  max-width: 340px;
  margin-top: 9px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.pwa-launcher-view .primary-button {
  margin-top: 24px;
}

.boot-view,
.pair-view,
.empty-view {
  display: flex;
  min-height: calc(100dvh - 120px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.boot-view img {
  width: 72px;
  height: 72px;
  margin-bottom: 16px;
  object-fit: contain;
}

.boot-view h2 {
  font-size: 20px;
}

.boot-view p {
  max-width: 320px;
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.pair-view[hidden],
.empty-view[hidden],
#pwa-launcher-view[hidden],
#content-view[hidden],
.composer[hidden],
[hidden] {
  display: none !important;
}

.pair-mascot,
.sleeping-mascot {
  width: 112px;
  height: 112px;
  margin-bottom: 19px;
}

.pair-mascot {
  object-fit: contain;
}

.sleeping-mascot {
  position: relative;
  display: block;
  animation: sleeping-mascot-breathe 1.8s ease-in-out infinite;
}

.sleeping-mascot-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sleeping-mascot-frame-one {
  animation: sleeping-frame-one 1.8s steps(1, end) infinite;
}

.sleeping-mascot-frame-two {
  animation: sleeping-frame-two 1.8s steps(1, end) infinite;
}

@keyframes sleeping-frame-one {
  0%,
  49.999% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

@keyframes sleeping-frame-two {
  0%,
  49.999% {
    opacity: 0;
  }

  50%,
  100% {
    opacity: 1;
  }
}

@keyframes sleeping-mascot-breathe {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-2px);
  }
}

.pair-view h2,
.empty-view h2 {
  margin-top: 7px;
  font-size: 23px;
}

.supporting-text,
.empty-view p {
  max-width: 340px;
  margin-top: 9px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.field-label {
  width: min(100%, 360px);
  margin-top: 24px;
  margin-bottom: 7px;
  text-align: left;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.text-input {
  width: min(100%, 360px);
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  background: var(--surface-soft);
  color: var(--text);
}

.text-input:focus,
.composer textarea:focus {
  border-color: var(--accent);
}

.text-input:focus-visible,
.composer textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.primary-button,
.quiet-button,
.danger-button,
.small-button,
.send-button {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  font-weight: 750;
  cursor: pointer;
}

.primary-button {
  width: min(100%, 360px);
  margin-top: 12px;
  background: var(--accent);
  color: white;
}

.quiet-button {
  width: min(100%, 360px);
  margin-top: 8px;
  background: var(--field);
  color: var(--text-secondary);
}

.danger-button {
  background: var(--danger);
  color: white;
}

.small-button {
  min-height: 40px;
  padding: 0 11px;
  background: var(--field);
  color: var(--text-secondary);
  font-size: 12px;
}

.small-button.accent {
  background: var(--accent);
  color: white;
}

.offline-banner,
.notification-onboarding {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
}

.offline-banner > div,
.notification-onboarding > div {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

.offline-banner strong,
.notification-onboarding strong {
  font-size: 13px;
}

.offline-banner span,
.notification-onboarding span {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.4;
}

.notification-onboarding {
  border-color: rgb(43 88 119 / 24%);
  background: var(--accent-soft);
}

.notification-onboarding > img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.segmented-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 18px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  scroll-margin-top: 92px;
}

.tab {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 750;
  transition:
    color 220ms ease,
    background-color 220ms ease;
}

.tab.is-active {
  background: var(--surface);
  color: var(--accent);
}

.tab img {
  width: 17px;
  height: 17px;
  object-fit: contain;
  opacity: 0.72;
}

.tab span {
  min-width: 20px;
  padding: 2px 5px;
  border-radius: 6px;
  background: var(--field);
  font-size: 10px;
}

.feed-pager {
  display: flex;
  width: 100%;
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  transition: height 260ms cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-overflow-scrolling: touch;
}

.feed-pager::-webkit-scrollbar {
  display: none;
}

.feed-pager.is-scrolling {
  transition: none;
}

.feed-panel {
  width: 100%;
  min-width: 0;
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 0 2px 11px;
}

.section-heading h2 {
  margin-top: 3px;
}

.section-heading > span {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 650;
}

.content-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.clipboard-card,
.agent-card {
  contain: layout paint style;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
}

.clipboard-card-main {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.kind-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: var(--field);
}

.kind-icon img {
  width: 19px;
  height: 19px;
  object-fit: contain;
  opacity: 0.75;
}

.card-copy {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: white;
  font-size: 12px;
  font-weight: 750;
}

.card-copy:disabled {
  background: var(--field);
  color: var(--text-secondary);
}

.card-copy img {
  width: 15px;
  height: 15px;
  filter: brightness(0) invert(1);
}

.clipboard-copy {
  min-width: 0;
}

.clipboard-copy strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clipboard-copy p {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.clipboard-meta {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 10px;
}

.agent-card {
  padding: 14px;
}

.agent-section-heading + .content-list {
  margin-top: 0;
}

.agent-section-count {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 700;
}

.agent-section-count b {
  color: var(--text);
  font-size: 11px;
}

.agent-section-divider {
  height: 1px;
  margin: 22px 2px 18px;
  background: var(--border);
}

.list-empty-compact {
  min-height: 142px;
}

.list-empty-compact img {
  width: 42px;
  height: 42px;
}

.agent-card-running {
  border-color: rgb(43 126 93 / 24%);
  background: var(--success-soft);
}

.agent-card.is-unseen {
  border-color: rgb(247 151 62 / 34%);
}

.agent-card.needs-attention {
  border-color: rgb(155 93 38 / 38%);
  background: var(--attention-soft);
}

.agent-card.needs-attention .agent-summary {
  background: rgb(255 254 252 / 72%);
  color: #6f421b;
}

.agent-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.agent-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2b9a6d;
  content: "";
}

.agent-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-card-header img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.agent-card-header > div {
  min-width: 0;
  flex: 1;
}

.agent-card-header strong {
  display: block;
  font-size: 14px;
}

.agent-card-header span {
  display: block;
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 10px;
}

.agent-summary {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.agent-detail {
  margin-top: 9px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.58;
  white-space: pre-wrap;
}

.agent-timeline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.agent-time-item {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgb(255 255 255 / 58%);
}

.agent-time-item span,
.agent-time-item strong {
  display: block;
}

.agent-time-item span {
  color: var(--text-secondary);
  font-size: 10px;
}

.agent-time-item strong {
  overflow: hidden;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-duration {
  grid-column: 1 / -1;
}

.agent-workspace {
  margin-top: 10px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}

.list-empty {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 13px;
  text-align: center;
}

.list-empty img {
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
  object-fit: contain;
  opacity: 0.75;
}

.list-empty strong {
  font-size: 14px;
}

.list-empty span {
  max-width: 280px;
  margin-top: 5px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.5;
}

.composer {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  width: min(100%, 620px);
  margin: 0 auto;
  padding: 10px 13px calc(9px + env(safe-area-inset-bottom));
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 17px 17px 0 0;
  background: rgb(255 254 252 / 96%);
  box-shadow: 0 -12px 34px rgb(31 38 43 / 9%);
  backdrop-filter: blur(18px);
}

.composer-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: end;
  gap: 7px;
}

.attach-button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border-radius: 10px;
  border: 0;
  background: var(--field);
  cursor: pointer;
}

.attach-button img,
.send-button img,
.selected-file img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.composer textarea {
  width: 100%;
  min-height: 44px;
  max-height: 112px;
  resize: none;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.send-button {
  display: flex;
  height: 44px;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: var(--accent);
  color: white;
  font-size: 12px;
}

.send-button img {
  filter: brightness(0) invert(1);
}

.send-button:disabled {
  opacity: 0.45;
}

.composer-note {
  margin-top: 7px;
  color: var(--text-secondary);
  font-size: 10px;
  text-align: center;
}

.composer-note strong {
  display: block;
  margin-bottom: 2px;
  color: var(--accent);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.selected-file span {
  overflow: hidden;
  flex: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file button {
  min-width: 44px;
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
}

.settings-dialog {
  width: min(calc(100% - 28px), 440px);
  padding: 0;
  border: 0;
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.settings-dialog::backdrop {
  background: rgb(26 30 33 / 38%);
  backdrop-filter: blur(3px);
}

.settings-dialog form {
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px;
}

.dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.dialog-header h2 {
  margin-top: 3px;
}

.dialog-header > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

#settings-device-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.dialog-header > .icon-button,
.app-header > .icon-button {
  flex-shrink: 0;
}

.dialog-summary {
  display: block;
  margin-top: 5px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 650;
}

.connection-mode-note,
.add-device-note {
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.55;
}

.connection-mode-note {
  margin: 14px 1px 10px;
  color: var(--text-secondary);
}

.add-device-note {
  margin-top: 12px;
}

.device-switcher-list {
  display: grid;
  gap: 0;
  max-height: min(52dvh, 430px);
  overflow-y: auto;
}

.device-switcher-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.device-switcher-item.is-active {
  border-color: #aec9d8;
  background: var(--accent-soft);
}

.device-switcher-item > img {
  width: 24px;
  height: 24px;
  padding: 3px;
  object-fit: contain;
  opacity: 0.76;
}

.device-switcher-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.device-switcher-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-switcher-copy .device-platform {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
}

.device-switcher-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 10px;
}

.device-current-mark {
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 1px;
  border-bottom: 1px solid var(--border);
}

.setting-row > div {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}

.setting-row strong {
  font-size: 13px;
}

.setting-row span {
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.4;
}

.setting-row .small-button {
  flex: 0 0 auto;
  min-height: 44px;
}

.setting-row .small-button:disabled {
  cursor: default;
  opacity: 0.5;
}

.setting-row .small-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.switch-control input {
  position: absolute;
  opacity: 0;
}

.switch-control {
  display: grid;
  min-width: 44px;
  min-height: 44px;
  flex: 0 0 44px;
  margin: -11px 0;
  place-items: center;
  cursor: pointer;
}

.switch-control > span {
  position: relative;
  display: block;
  width: 38px;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--field);
  transition: background 140ms ease;
}

.switch-control > span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-secondary);
  content: "";
  transition: transform 140ms ease;
}

.switch-control input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
}

.switch-control input:checked + span::after {
  background: white;
  transform: translateX(16px);
}

.switch-control input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 16px;
}

.dialog-actions .quiet-button {
  width: auto;
  margin: 0;
}

.dialog-actions .primary-button {
  width: auto;
  margin: 0;
}

.install-dialog-copy {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px 2px 2px;
}

.delete-dialog-copy {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px 2px 2px;
}

.delete-dialog-copy img {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  padding: 10px;
  border-radius: 11px;
  background: rgb(181 72 69 / 10%);
  object-fit: contain;
  opacity: 0.78;
}

.delete-dialog-copy p {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.65;
}

.delete-dialog-copy strong {
  color: var(--text);
}

.install-dialog-copy img {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  object-fit: contain;
}

.install-dialog-copy p {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.65;
}

.permission-help-copy {
  padding: 17px 2px 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.65;
}

.permission-help-copy ol {
  margin: 12px 0;
  padding-left: 21px;
  color: var(--text);
}

.permission-help-copy li + li {
  margin-top: 8px;
}

.notification-status-list {
  display: grid;
  gap: 7px;
  margin: 13px 0;
}

.notification-status-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--surface-soft);
}

.notification-status-list dt {
  color: var(--text-secondary);
}

.notification-status-list dd {
  margin: 0;
  color: var(--text);
  font-weight: 750;
}

.notification-status-list dd[data-state="ready"] {
  color: var(--accent);
}

.notification-status-list dd[data-state="blocked"] {
  color: var(--danger);
}

.dialog-actions.single-action {
  grid-template-columns: 1fr;
}

.dialog-actions.single-action .primary-button {
  width: 100%;
  margin: 0;
}

.toast {
  position: fixed;
  z-index: 80;
  right: 20px;
  bottom: calc(145px + env(safe-area-inset-bottom));
  left: 20px;
  width: fit-content;
  max-width: min(calc(100% - 40px), 420px);
  margin: 0 auto;
  padding: 10px 13px;
  border-radius: 10px;
  background: #222629;
  color: white;
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .sleeping-mascot,
  .sleeping-mascot-frame-one {
    animation: none;
  }

  .sleeping-mascot-frame-two {
    display: none;
    animation: none;
  }
}

@media (pointer: coarse) {
  .small-button,
  .card-copy,
  .selected-file button {
    min-height: 44px;
  }
}

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

/* File actions remain a single vertical group on compact screens. */
.clipboard-file-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}
.clipboard-file-actions .card-copy { justify-content: center; }
.preview-button { background: var(--field); color: var(--accent); }
.clipboard-meta { flex-wrap: wrap; gap: 6px 12px; line-height: 1.5; }
.clipboard-meta > span:first-child { min-width: 0; overflow-wrap: anywhere; flex: 1; }
.clipboard-meta time { flex-shrink: 0; }
.download-receipt { flex-basis: 100%; color: var(--accent); }
.image-preview-dialog { width: min(calc(100% - 28px), 780px); }
.image-preview-content {
  padding: 18px;
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.image-preview-content .dialog-header { gap: 12px; }
.image-preview-content .dialog-header > div { flex: 1; }
.image-preview-content h2 { font-size: 16px; overflow-wrap: anywhere; }
.image-preview-content .quiet-button { width: auto; padding-inline: 12px; flex-shrink: 0; min-height: 44px; }
.image-preview-viewport { overflow: auto; margin-block: 16px; text-align: center; }
.image-preview-viewport img { max-width: 100%; max-height: 60dvh; object-fit: contain; }
#image-preview-status { font-size: 13px; line-height: 1.6; margin-block: 12px; }
#image-preview-save { width: 100%; min-height: 44px; }

/* File transfer is persistent task feedback, separate from the clipboard feed. */
.transfer-panel { margin: 12px 18px 18px; padding: 0 0 4px; border-bottom: 1px solid var(--border); }
.transfer-heading { margin: 0 0 8px; font-size: 14px; font-weight: 650; }
.transfer-row { padding: 12px 0; }
.transfer-row + .transfer-row { border-top: 1px solid var(--border); }
.transfer-title-line, .transfer-bottom { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.transfer-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.transfer-percent { flex-shrink: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.transfer-meta { margin: 5px 0 10px; color: var(--text-secondary); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.transfer-row progress { display: block; appearance: none; width: 100%; height: 5px; border: 0; border-radius: 4px; overflow: hidden; background: var(--border); accent-color: var(--accent); }
.transfer-row progress::-webkit-progress-bar { background: var(--border); }
.transfer-row progress::-webkit-progress-value { background: var(--accent); }
.transfer-row progress::-moz-progress-bar { background: var(--accent); }
.transfer-bottom { margin-top: 5px; align-items: flex-start; }
.transfer-status { padding-top: 9px; color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.transfer-actions { display: flex; flex-shrink: 0; gap: 3px; }
.transfer-action { min-width: 44px; min-height: 40px; padding: 8px; border: 0; border-radius: 6px; background: transparent; color: var(--accent); font-size: 13px; cursor: pointer; }
.transfer-action:hover { background: var(--accent-soft); }
.transfer-row[data-status="paused"] progress::-webkit-progress-value,
.transfer-row[data-status="waiting"] progress::-webkit-progress-value { background: var(--text-secondary); }
@media (max-width: 360px) {
  .transfer-panel { margin-inline: 12px; }
  .transfer-bottom { gap: 6px; }
}

/* On phone widths the shell spans the screen; match the page background so
   the area revealed when the browser toolbar collapses is not a grey band. */
@media (max-width: 620px) {
  html,
  body {
    background: var(--surface);
  }

  .app-shell {
    border-inline: 0;
  }
}

.pairing-actions {
  display: flex;
  width: min(100%, 360px);
  flex-direction: column;
  margin-top: 18px;
}

.pairing-actions > :first-child:not([hidden]) {
  margin-top: 0;
}

.field-error {
  width: min(100%, 360px);
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 13px;
  text-align: left;
}

#pairing-link-dialog .text-input,
#pairing-link-dialog .field-label {
  width: 100%;
}

.scanner-dialog {
  width: min(calc(100% - 24px), 420px);
  padding: 18px;
}

.device-switcher-dialog .dialog-actions {
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}

.scanner-viewport {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  margin-top: 12px;
  border-radius: 14px;
  background: #11161a;
}

.scanner-viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* A square guide shows where the desktop QR code should sit. */
.scanner-viewport::after {
  position: absolute;
  inset: 18%;
  border: 2px solid rgb(255 255 255 / 85%);
  border-radius: 12px;
  content: "";
  pointer-events: none;
}

.scanner-status {
  margin: 12px 2px 4px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.agent-card-running {
  padding: 11px 13px;
}

.agent-run-task {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.agent-run-task::before {
  flex: 0 0 7px;
  margin-top: 7px;
}

.agent-run-meta {
  margin-top: 4px;
  padding-left: 13px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}
