@font-face {
  font-family: "Noto Sans JP";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/noto-sans-jp.woff2") format("woff2");
}
@font-face {
  font-family: "SignalBox Emoji";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/emoji-fallback.woff") format("woff");
}
/* Pushling brand (docs/design-system.md): warm ink and paper, lime for "landed, connected,
   go", orange for "a person needs to look". Lime text on paper uses the darker lime-text. */
:root {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  color-scheme: light dark;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --bg: #f7f4ef;
  --text: #1a1816;
  --surface: #ffffff;
  --surface-2: #efebe4;
  --line: #e3ded5;
  --line-strong: #cfc8bd;
  --muted: #635d56;
  --code-bg: var(--surface-2);
  --lime: #c6f432;
  --lime-text: #4a6b00;
  --lime-mark: #6f9a00;
  --lime-soft: #eef6d2;
  --on-lime: #121110;
  --orange: #ff6b2c;
  --orange-soft: #ffe9dc;
  --orange-text: #b03a0a;
  --danger: #c62a2f;
  --toast-bg: #1a1816;
  --row-selected: #f1ede6;
  --backdrop: rgb(26 24 22 / 0.45);
  --toast-text: #f2ece4;
  --radius-card: 8px;
  --radius-control: 6px;
  --radius-pill: 999px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121110;
    --text: #f2ece4;
    --surface: #1a1917;
    --surface-2: #24221f;
    --line: #2c2a27;
    --line-strong: #3d3a36;
    --muted: #aaa39b;
    --code-bg: #0c0b0a;
    --lime-text: #c6f432;
    --lime-mark: #c6f432;
    --lime-soft: #20260f;
    --orange-soft: #3a1c10;
    --orange-text: #ff6b2c;
    --danger: #ff7a7f;
    --toast-bg: #2c2a27;
    --row-selected: #1f1d1b;
    --backdrop: rgb(0 0 0 / 0.6);
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
  border-radius: var(--radius-control);
  padding: 10px 15px;
  background: var(--surface-2);
  color: inherit;
  min-height: 42px;
}
button:hover {
  filter: brightness(0.96);
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--lime-text);
  outline-offset: 2px;
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  padding: 11px;
  background: var(--surface);
  color: inherit;
}
label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin: 16px 0 8px;
}
label input,
label textarea,
label select {
  display: block;
  margin-top: 7px;
}
h1 {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 4px 0 0;
}
h2 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}
p {
  line-height: 1.7;
}
.primary {
  background: var(--lime);
  color: var(--on-lime);
  font-weight: 600;
}
.primary:disabled {
  background: var(--surface-2);
  color: var(--muted);
  opacity: 1;
}
.subtle {
  background: transparent;
  border: 1px solid var(--line-strong);
}
.subtle:hover {
  filter: none;
  background: var(--surface-2);
}
.danger {
  color: var(--danger);
}
/* Filled only for confirming a destructive step; text on it uses the page ground. */
.danger-fill {
  background: var(--danger);
  color: var(--bg);
  font-weight: 600;
}
a,
.link-button {
  color: var(--lime-text);
  text-underline-offset: 3px;
}
.muted {
  color: var(--muted);
  font-size: 0.875rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}
.brand-icon {
  display: block;
  width: 28px;
  height: 28px;
}
/* On the sign-in screen the wordmark links to pushling.com. */
a.brand {
  align-self: flex-start;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-control);
}
a.brand:hover {
  opacity: 0.8;
}
/* Sign-in: the form on the left, a drawn sample of what lands on the right. */
.login {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 100vh;
}
.login-panel {
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding: clamp(24px, 5vw, 56px);
}
.login-main {
  width: 100%;
  max-width: 380px;
  margin: auto;
}
.login-lead {
  margin: 10px 0 32px;
  color: var(--muted);
  font-size: 0.95rem;
}
.login input {
  padding: 12px;
}
.account-buttons {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}
.account-buttons button,
#mobile-connect button {
  min-height: 46px;
  width: 100%;
}
.google-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #747775;
  border-radius: 4px;
  background: #fff;
  color: #1f1f1f;
  font:
    500 14px/20px "Google Sans",
    Arial,
    sans-serif;
}
.google-login:hover {
  background: #f2f2f2;
}
.google-login img {
  flex: none;
}
#email-login-help,
#email-login-status:not(:empty),
#account-signup {
  margin-top: 12px;
  font-size: 0.85rem;
  line-height: 1.6;
}
#mobile-connect {
  display: grid;
  gap: 16px;
}
#account-error:not(:empty) {
  color: var(--orange-text);
  margin: 16px 0;
}
.login form > .primary {
  width: 100%;
  min-height: 46px;
  margin-top: 24px;
}
.login details {
  margin-top: 28px;
  border-top: 1px solid var(--line);
}
.login summary {
  padding: 14px 0;
}
.login details .muted {
  margin: 0;
}
.login-art {
  --grid: color-mix(in srgb, var(--text) 5%, transparent);
  display: grid;
  place-items: center;
  padding: 48px;
  overflow: hidden;
  background-color: var(--surface);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  border-left: 1px solid var(--line);
}
.art-stack {
  display: grid;
  gap: 14px;
  width: min(360px, 100%);
}
.art-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.art-card {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  animation: art-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.art-card.urgent {
  margin-left: 28px;
  border-color: var(--orange);
  animation-delay: 0.15s;
}
.art-card .row-meta {
  margin: 0;
}
.art-card .row-title {
  font-weight: 600;
}
.art-card .row-body {
  margin: 0;
}
@keyframes art-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .art-card {
    animation: none;
  }
}
summary {
  font-size: 0.875rem;
  color: var(--muted);
  cursor: pointer;
}
/* The window is the frame: the list and the detail scroll inside it, the page does not. */
.workspace {
  display: grid;
  grid-template-columns: 245px 1fr;
  height: 100vh;
  height: 100dvh;
}
aside {
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 25px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
aside .brand {
  margin: 0 10px 35px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: transparent;
  width: 100%;
  font-size: 0.925rem;
  padding: 12px;
  justify-content: space-between;
}
.nav.selected {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}
.sidebar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 24px 12px 5px;
  color: var(--muted);
  font-size: 0.78rem;
}
.icon-button {
  padding: 2px 8px;
  background: transparent;
  font-size: 1.4rem;
  min-height: 30px;
}
.project-nav {
  justify-content: flex-start;
}
.project-letter {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-control);
  color: white;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.project-name,
.email,
.row-source,
.log-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 40px;
}
.email {
  padding: 15px 12px;
}
.count {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--lime);
  color: var(--on-lime);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}
.count:empty {
  display: none;
}
main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
#inbox-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 29px 32px;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}
.eyebrow {
  font-size: 0.8rem;
  color: var(--muted);
}
.eyebrow:empty {
  display: none;
}
.header-actions {
  display: flex;
  gap: 18px;
  align-items: center;
}
#connection {
  white-space: nowrap;
  background: transparent;
  color: var(--muted);
  font-size: 0.875rem;
  padding: 6px 8px;
  min-height: 36px;
}
#connection:hover {
  filter: none;
  color: var(--text);
}
#connection::before,
.log-state::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 7px;
  background: var(--muted);
}
#connection[data-state="ok"]::before,
.log-state.ok::before {
  background: var(--lime-mark);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime-mark) 25%, transparent);
}
#connection[data-state="error"]::before {
  background: var(--danger);
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 26px;
  border-bottom: 1px solid var(--line);
}
.tabs {
  display: flex;
  gap: 4px;
}
.tab {
  font-size: 0.875rem;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.tab.selected {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}
.search {
  margin: 0 0 0 auto;
  max-width: 240px;
  font-weight: 400;
  min-width: 80px;
}
.search input {
  margin: 0;
  font-size: 0.875rem;
}
.toolbar > .subtle {
  font-size: 0.875rem;
  white-space: nowrap;
}
#local-state-filter {
  width: 132px;
  margin: 0;
  font-size: 0.875rem;
  flex-shrink: 0;
}
.local-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 0.8rem;
}
.state-badge,
.scope-label {
  border-radius: var(--radius-pill);
  padding: 3px 9px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.75rem;
}
.state-badge.done {
  background: var(--lime-soft);
  color: var(--lime-text);
}
.personal-section {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 24px;
}
.personal-heading,
.note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.personal-heading h3 {
  margin: 0;
  font-size: 1rem;
}
.scope-label {
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 20px 0;
}
.emoji-button {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 1.2rem;
  background: var(--surface-2);
  border: 1px solid transparent;
  font-family:
    "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji",
    "SignalBox Emoji", sans-serif;
}
.local-summary > span:first-child {
  font-family:
    "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji",
    "SignalBox Emoji", sans-serif;
}
.emoji-button[aria-pressed="true"] {
  border-color: var(--lime-text);
  background: var(--lime-soft);
}
.personal-state {
  max-width: 200px;
}
#personal-note {
  resize: vertical;
  min-height: 108px;
}
.note-footer {
  margin-top: 10px;
}
.inbox-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(330px, 0.95fr) minmax(300px, 1.1fr);
}
.inbox-layout > * {
  min-height: 0;
}
/* Before anything arrives there is nothing to filter or show beside the guide. */
.first-run .inbox-layout {
  grid-template-columns: 1fr;
}
.first-run .detail,
.first-run .toolbar {
  display: none;
}
.message-list {
  overflow-y: auto;
  border-right: 1px solid var(--line);
}
.list-group {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  padding: 9px 25px 7px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.list-group span {
  font-weight: 400;
}
.list-group.urgent {
  color: var(--orange-text);
  background: var(--orange-soft);
}
.message-row {
  width: 100%;
  border-radius: 0;
  background: var(--surface);
  text-align: left;
  padding: 18px 25px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.message-row:hover {
  filter: none;
  background: var(--row-selected);
}
.message-row.selected {
  background: var(--row-selected);
  box-shadow: inset 3px 0 0 var(--lime-mark);
}
.row-main {
  display: block;
  flex: 1;
  min-width: 0;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-card);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}
.hue-0 {
  background: #2563eb;
}
.hue-1 {
  background: #7c3aed;
}
.hue-2 {
  background: #db2777;
}
.hue-3 {
  background: #c2410c;
}
.hue-4 {
  background: #15803d;
}
.hue-5 {
  background: #0e7490;
}
.hue-6 {
  background: #a16207;
}
.hue-7 {
  background: #475569;
}
.row-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.row-source {
  min-width: 0;
}
.row-flags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.row-icon {
  display: inline-flex;
}
.row-icon svg {
  width: 14px;
  height: 14px;
}
time {
  font-family: var(--mono);
}
.row-flags time {
  font-size: 0.7rem;
}
.message-row.unread .row-meta > span:first-child {
  color: var(--text);
  font-weight: 600;
}
.row-title {
  display: block;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
/* A notice without its own title shows its body here instead, kept to two lines. */
.row-title.untitled {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 5px 0 2px;
}
.message-row.unread .row-title {
  font-weight: 650;
}
.row-body {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 3px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime-mark);
  margin-right: 7px;
  vertical-align: 1px;
}
.starred-symbol {
  color: #d99a00;
}
.badge {
  font-size: 0.72rem;
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.badge.urgent {
  background: var(--orange-soft);
  color: var(--orange-text);
  font-weight: 600;
}
.detail {
  --detail-pad: 32px;
  padding: 0 var(--detail-pad) var(--detail-pad);
  overflow-y: auto;
  overflow-anchor: none;
  background: var(--bg);
}
/* Actions stay in reach while the notice scrolls. */
.detail-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 calc(var(--detail-pad) * -1) 22px;
  padding: 12px var(--detail-pad);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
/* Desktop shows the detail beside the list, so only narrow screens need a way back. */
#close-detail {
  display: none;
}
.detail-tools {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
.detail-toolbar button,
.device-row button {
  font-size: 0.85rem;
  min-height: 36px;
  padding: 6px 12px;
  white-space: nowrap;
}
.detail-placeholder,
.empty {
  padding: 70px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.925rem;
  line-height: 1.8;
}
.empty strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 8px;
}
.empty button {
  display: block;
  margin: 18px auto 0;
}
.onboarding {
  max-width: 460px;
  margin: 0 auto;
}
.onboarding .muted {
  display: block;
  margin-top: 14px;
}
.steps {
  text-align: left;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 10px;
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 28px 1fr;
  column-gap: 12px;
  align-items: center;
  color: var(--muted);
}
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  align-self: start;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.8rem;
  border: 1px solid var(--line-strong);
}
.steps li.current {
  color: var(--text);
  font-weight: 600;
}
.steps li.current::before {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--on-lime);
}
.steps li span {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
}
.kbd-hint {
  font-size: 0.8rem;
  margin-top: 18px;
}
kbd {
  font-family: var(--mono);
  font-size: 0.75rem;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 3px;
  background: var(--surface);
  color: var(--text);
}
.detail h2 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.5;
  margin: 16px 0 20px;
  overflow-wrap: anywhere;
}
.detail-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.9;
}
.detail img {
  display: block;
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
  border-radius: var(--radius-card);
  margin-top: 18px;
}
/* The link is often the next step, so it reads as a control rather than inline text. */
.detail-link {
  display: inline-block;
  max-width: 100%;
  margin-top: 18px;
  padding: 10px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  color: var(--lime-text);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.detail-link:hover {
  background: var(--surface-2);
}
.detail-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.detail-meta time {
  font-size: 0.75rem;
}
.detail-meta .avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-card);
  font-size: 0.75rem;
}
.receipt-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px;
}
.receipt-card.waiting {
  background: var(--orange-soft);
  border-color: var(--orange);
  color: var(--orange-text);
}
.receipt-card div {
  display: grid;
  gap: 4px;
  flex: 1;
  min-width: 200px;
}
/* The detail cards share one box; attention states tint it orange or lime. */
.receipt-card,
.context-card,
.question-card {
  margin: 0 0 22px;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.875rem;
}
/* Where a notice came from: a quiet line in the list, a card in the detail. */
.context-line {
  color: var(--muted);
  font-weight: 400;
}
.context-card {
  display: grid;
  gap: 10px;
  padding: 14px 18px;
}
.context-card.high {
  border-color: var(--orange);
}
.context-card dl {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin: 0;
}
.context-card dt {
  color: var(--muted);
  font-size: 0.75rem;
}
.context-card dd {
  margin: 0;
}
.context-command {
  margin: 0;
  padding: 10px 12px;
  overflow-x: auto;
  border-radius: var(--radius-control);
  background: var(--code-bg);
  font-family: var(--mono);
  font-size: 0.8rem;
}
.context-card #same-session {
  justify-self: start;
}
/* A question sits below the body it asks about; open questions use the accent. */
.question-card {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
}
.question-card.open {
  background: var(--lime-soft);
  border-color: var(--lime-text);
}
.question-card > div:first-child {
  display: grid;
  gap: 4px;
}
.question-card .answers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.question-card textarea {
  width: 100%;
  resize: vertical;
}
.question-card #send-answer {
  justify-self: start;
}
.question-card .answer {
  min-width: 96px;
  font-weight: 600;
  background: var(--surface);
}
.risk-note {
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--radius-control);
  background: var(--orange-soft);
  color: var(--orange-text);
  font-weight: 600;
  line-height: 1.6;
}
.settings {
  max-width: 760px;
  padding: 28px 32px;
}
.settings-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 24px;
  margin-bottom: 22px;
}
.settings-card h2 {
  margin-bottom: 10px;
}
.form-row {
  display: flex;
  gap: 16px;
}
.form-row > label {
  flex: 1;
}
.delivery-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
#delivery-health [role="status"]:empty {
  margin: 0;
}
.delivery-row > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.delivery-row button {
  flex-shrink: 0;
}
.device-row,
.log-row {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.device-row:last-of-type {
  border: 0;
}
.log-row {
  width: 100%;
  background: transparent;
  border-radius: 0;
  text-align: left;
  color: inherit;
}
button.log-row:hover {
  filter: none;
  background: var(--surface-2);
}
.log-main {
  min-width: 0;
}
.log-id {
  font-family: var(--mono);
}
.log-state {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}
.log-state.ok {
  color: var(--text);
}
.card-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.card-heading h2 {
  margin: 0;
}
.copy-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin: 12px 0;
}
.copy-row .code {
  flex: 1;
  min-width: 0;
}
label.check {
  display: flex;
  align-items: center;
  gap: 10px;
}
label.check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--lime-text);
}
.link-button {
  background: transparent;
  padding: 0 4px;
  min-height: 0;
  text-decoration: underline;
}
.code {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  background: var(--code-bg);
  padding: 12px;
  border-radius: var(--radius-control);
  font-family: var(--mono);
  font-size: 0.8rem;
}
dialog {
  --dialog-pad: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: var(--dialog-pad);
  width: min(520px, calc(100vw - 32px));
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 24px 64px rgb(0 0 0 / 0.25);
  background: var(--surface);
  color: var(--text);
}
dialog::backdrop {
  background: var(--backdrop);
}
/* Actions stay visible at the foot of a dialog taller than the window. */
.dialog-actions {
  position: sticky;
  bottom: calc(var(--dialog-pad) * -1);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 25px calc(var(--dialog-pad) * -1) calc(var(--dialog-pad) * -1);
  padding: 16px var(--dialog-pad) var(--dialog-pad);
  background: var(--surface);
}
#secret-dialog textarea {
  font-family: var(--mono);
  font-size: 0.85rem;
  resize: none;
}
#secret-dialog .code {
  margin: 0 0 10px;
  font-size: 0.75rem;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--toast-bg);
  color: var(--toast-text);
  padding: 12px 20px;
  border-radius: var(--radius-card);
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.25);
  z-index: 10;
  max-width: 90vw;
  display: flex;
  align-items: center;
  gap: 16px;
}
.toast-action {
  background: transparent;
  color: var(--lime);
  font-weight: 600;
  padding: 4px 6px;
  min-height: 32px;
  white-space: nowrap;
}
#login-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.9rem;
}
#login-error:not(:empty) {
  margin-top: 14px;
}
.sr-only {
  position: absolute;
  clip: rect(0, 0, 0, 0);
  width: 1px;
  height: 1px;
  overflow: hidden;
}
[hidden] {
  display: none !important;
}
.usage-track {
  height: 5px;
  border-radius: 5px;
  background: var(--surface-2);
  margin: 15px 0;
}
.usage-track span {
  display: block;
  height: 100%;
  background: var(--lime-mark);
  border-radius: 5px;
}
.usage-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
}
.project-setting {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 16px 0;
}
.project-setting select {
  max-width: 160px;
}
.project-setting .project-title {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 900px) {
  .login {
    grid-template-columns: minmax(0, 1fr);
  }
  .login-art {
    display: none;
  }
  .toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .search {
    flex: 1;
    max-width: none;
  }
  .workspace {
    grid-template-columns: 190px 1fr;
  }
  header {
    padding: 20px 24px;
  }
  .inbox-layout {
    grid-template-columns: 1fr;
  }
  .detail {
    display: none;
  }
  .detail.mobile-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 5;
    background: var(--bg);
  }
  .message-list {
    border: 0;
  }
  .kbd-hint {
    display: none;
  }
  #close-detail {
    display: block;
  }
  body:has(.detail.mobile-open) {
    overflow: hidden;
  }
}
@media (max-width: 600px) {
  /* Phone: one compact bar (brand and the two pages), then the inbox and project
     chips in a single scrolling row, so the first notice sits near the top. */
  .workspace {
    display: block;
    height: auto;
  }
  aside {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 4px;
    padding: 10px 12px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  aside::after {
    content: "";
    order: 1;
    flex-basis: 100%;
  }
  aside .brand {
    order: 0;
    flex: 1 0 auto;
    margin: 0;
  }
  .sidebar-bottom {
    order: 1;
    display: flex;
    margin: 0;
    padding: 0;
  }
  .sidebar-bottom .email {
    display: none;
  }
  .sidebar-bottom .nav {
    font-size: 0.8rem;
    width: auto;
    padding: 8px;
    min-height: 36px;
  }
  aside > .nav {
    order: 2;
    width: auto;
    min-height: 36px;
    padding: 6px 10px;
    flex-shrink: 0;
  }
  #projects {
    order: 3;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, #000 85%, transparent);
  }
  #projects .nav {
    width: auto;
    max-width: 160px;
    min-height: 36px;
    padding: 6px 8px;
    font-size: 0.8rem;
    flex-shrink: 0;
  }
  .sidebar-label {
    order: 4;
    margin: 0;
    font-size: 0;
  }
  .sidebar-label button {
    font-size: 1.2rem;
    min-height: 36px;
  }
  main {
    display: block;
    overflow: visible;
  }
  header {
    padding: 12px 16px;
  }
  .eyebrow {
    display: none;
  }
  h1 {
    font-size: 1.25rem;
  }
  .header-actions {
    gap: 4px;
  }
  /* Only the status dot on phones; its name stays in the accessible label. */
  #connection {
    font-size: 0;
    padding: 6px 10px;
  }
  #connection::before {
    margin-right: 0;
  }
  #compose {
    font-size: 0.85rem;
    min-height: 36px;
    padding: 6px 12px;
  }
  .toolbar {
    padding: 10px 12px;
  }
  /* Row one: search and mark-all-read. Row two: the filters. */
  .search {
    order: -2;
    flex: 1 1 calc(100% - 120px);
    margin: 0;
  }
  .tab {
    padding: 8px 10px;
  }
  #local-state-filter {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    padding: 8px;
  }
  #mark-all-read {
    order: -1;
    padding: 8px 10px;
    min-height: 38px;
  }
  .inbox-layout {
    display: block;
  }
  .message-row {
    padding: 14px 16px;
    gap: 12px;
  }
  .list-group {
    padding: 8px 16px 6px;
  }
  .settings {
    padding: 20px 16px;
  }
  .settings-card {
    padding: 20px;
  }
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  .project-setting {
    flex-wrap: wrap;
  }
  .project-setting .project-title {
    flex-basis: calc(100% - 40px);
  }
  .project-setting select {
    max-width: none;
    flex: 1;
  }
  .log-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .detail {
    --detail-pad: 18px;
  }
  .wide-only {
    display: none;
  }
  /* Eight equal columns keep the picker on one row at phone widths. */
  .emoji-picker {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
  .emoji-button {
    width: auto;
  }
}

/* Notification automation settings stay compact while keeping the action and
   its current state together for keyboard and narrow-screen users. */
#automations h3 {
  margin: 22px 0 10px;
}
#automation-form {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}
#automation-form label {
  display: grid;
  gap: 6px;
}
#automation-form textarea {
  resize: vertical;
}
#automation-form select,
#automation-form input,
#automation-form textarea {
  max-width: 100%;
}
#automation-form .automation-schedule-fields,
#automation-form .automation-watchdog-fields {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--bg);
}
#automation-form .automation-watchdog-fields[hidden],
#automation-form .automation-schedule-fields[hidden] {
  display: none;
}
#automation-form .automation-schedule-fields > label,
#automation-form .automation-watchdog-fields > label {
  max-width: 320px;
}
#automations .automation-error {
  margin: 0;
  color: var(--orange-text);
}
#automations .automation-list {
  border-top: 1px solid var(--line);
}
#automations .automation-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
#automations .automation-main {
  min-width: 0;
  overflow-wrap: anywhere;
}
#automations .automation-main strong {
  display: block;
  margin-bottom: 3px;
}
#automations .automation-main .muted {
  margin-top: 3px;
}
#automations .automation-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
#automations > .subtle {
  margin-top: 14px;
}
@media (max-width: 600px) {
  #automations .automation-row {
    display: block;
  }
  #automations .automation-actions {
    justify-content: flex-start;
    margin-top: 10px;
  }
}
