:root {
  color-scheme:dark;
  --bg:#0b0d10;
  --surface:#151a21;
  --input:#0e1218;
  --text:#f5f7fa;
  --muted:#b8c2cf;
  --border:#788698;
  --line:#354150;
  --accent:#8ac5ff;
  --error:#ffaaa7;
  --success:#92e0ac;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:16px;
  line-height:1.5;
  background:var(--bg);
  color:var(--text);
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
}

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

a {
  color:var(--accent);
  text-underline-offset:3px;
}

a:hover {
  text-decoration-thickness:2px;
}

button,.button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.45rem;
  min-height:42px;
  padding:.5rem .9rem;
  border:1px solid var(--border);
  border-radius:5px;
  background:#202936;
  color:var(--text);
  font-weight:600;
  cursor:pointer;
  text-decoration:none;
  white-space:normal;
}

button:hover,.button:hover {
  background:#2d3a4b;
}

button.primary,.button.primary {
  background:var(--accent);
  color:#08121d;
  border-color:var(--accent);
}

button.primary:hover,.button.primary:hover {
  background:#b1d9ff;
}

button.danger {
  color:var(--error);
  border-color:#b57474;
  background:transparent;
}

button.quiet {
  background:transparent;
}

button.show-more {
  color:var(--muted);
  border-color:var(--line);
  font-size:14px;
  font-weight:400;
}

button:disabled {
  opacity:.65;
  cursor:not-allowed;
}

button[aria-busy=true] {
  cursor:wait;
}

input,select,textarea {
  display:block;
  width:100%;
  min-height:44px;
  border:1px solid var(--border);
  border-radius:4px;
  padding:.6rem .7rem;
  color:var(--text);
  background:var(--input);
}

textarea {
  min-height:130px;
  resize:vertical;
}

textarea.checkin-message {
  min-height:0;
}

input::placeholder,textarea::placeholder {
  color:#97a5b8;
}

input:disabled,select:disabled {
  opacity:.85;
  cursor:not-allowed;
}

input[aria-invalid=true],textarea[aria-invalid=true] {
  border:2px solid var(--error);
}

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

input[type=checkbox] {
  display:inline-block;
  width:18px;
  min-height:18px;
  accent-color:var(--accent);
}

header {
  border-bottom:1px solid var(--line);
  background:var(--surface);
}

.header-inner {
  max-width:1164px;
  margin:auto;
  padding:16px 32px;
  display:flex;
  align-items:center;
  gap:32px;
  flex-wrap:wrap;
}

.brand {
  display:inline-flex;
  align-items:center;
  gap:10px;
  color:var(--text);
  font-size:20px;
  font-weight:750;
  letter-spacing:-.5px;
  text-decoration:none;
}

.brand::before {
  content:"";
  flex-shrink:0;
  width:32px;
  height:32px;
  background:url('./favicon-32.png') center / contain no-repeat;
}

nav {
  display:flex;
  gap:24px;
}

nav a {
  text-decoration:none;
  color:var(--muted);
  padding:.5rem 0;
}

nav a[aria-current=page] {
  color:var(--text);
  box-shadow:0 2px var(--accent);
}

.account {
  margin-left:auto;
  display:flex;
  gap:14px;
  align-items:center;
  color:var(--muted);
  font-size:14px;
}

.account button {
  min-height:36px;
  font-size:14px;
}

main {
  max-width:1164px;
  margin:auto;
  padding:36px 32px 80px;
}

h1 {
  font-size:28px;
  line-height:1.2;
  margin:0 0 8px;
  font-weight:650;
  letter-spacing:-.6px;
}

h2 {
  font-size:20px;
  margin:0 0 16px;
  font-weight:650;
}

h3 {
  font-size:17px;
  margin:0 0 12px;
}

p {
  margin:0 0 16px;
}

.muted,small,.help {
  color:var(--muted);
}

small,.help {
  font-size:14px;
}

.help {
  margin:6px 0 0;
}

.heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  margin-bottom:28px;
}

.heading p {
  margin:0;
}

.editor {
  max-width:760px;
}

.editor h2 {
  overflow-wrap:anywhere;
}

.auth {
  max-width:440px;
  margin:50px auto;
}

.auth-tower {
  display:block;
  width:192px;
  height:192px;
  margin:0 auto 28px;
  object-fit:contain;
}

.panel {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:6px;
  padding:24px;
  margin-bottom:24px;
}

.auth .panel {
  margin-top:24px;
}

.field {
  display:block;
  margin-bottom:20px;
}

.field>span,.field>label {
  display:block;
  font-weight:600;
  margin-bottom:6px;
}

.field:last-child {
  margin-bottom:0;
}

.field-error {
  color:var(--error);
  font-size:14px;
  margin-top:6px;
}

.row {
  display:flex;
  gap:12px;
  align-items:flex-start;
}

.row>.field {
  flex:1;
  min-width:0;
}

.row .remove {
  margin-top:30px;
}

.toolbar {
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.toolbar.between {
  justify-content:space-between;
}

.actions-footer {
  display:flex;
  align-items:center;
  gap:12px;
  border-top:1px solid var(--line);
  padding-top:24px;
  margin-top:24px;
}

.actions-footer .danger {
  margin-left:auto;
}

.error,.success,.info {
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:4px;
  margin:16px 0;
  overflow-wrap:anywhere;
}

.error {
  color:var(--error);
  border-color:#b57474;
  background:#2b171d;
}

.success {
  color:var(--success);
  border-color:#4d8863;
}

.info {
  color:var(--muted);
  background:var(--surface);
}

[hidden] {
  display:none!important;
}

.table-wrap {
  min-width:0;
  max-width:100%;
  overflow:auto;
  overscroll-behavior-x:contain;
  border:1px solid var(--line);
  border-radius:6px;
}

table {
  width:100%;
  border-collapse:collapse;
  text-align:left;
}

th {
  white-space:nowrap;
  font-size:13px;
  color:var(--muted);
  font-weight:600;
  background:var(--surface);
}

th,td {
  padding:15px 18px;
  border-bottom:1px solid var(--line);
  vertical-align:top;
}

tr:last-child td {
  border-bottom:0;
}

td:first-child {
  font-weight:600;
}

td {
  overflow-wrap:anywhere;
}

.table-wrap td {
  overflow-wrap:normal;
}

td .help {
  font-weight:400;
}

td:last-child {
  white-space:nowrap;
}

.channel-usage {
  margin-top:var(--space-5);
}

.channel-details {
  display:grid;
  gap:20px;
  margin:0;
}

.channel-details dt {
  color:var(--muted);
  font-size:13px;
  margin-bottom:6px;
}

.channel-details dd {
  margin:0;
  overflow-wrap:anywhere;
}

td.channel-usage-actions {
  white-space:normal;
}

.fire-count,.cron-expression {
  white-space:nowrap;
}

.resource-row {
  cursor:pointer;
}

.resource-row:hover,.resource-row:focus-within {
  background:var(--surface);
}

.resource-row-link {
  color:inherit;
  text-decoration:none;
}

.resource-row-link:focus-visible {
  outline:3px solid var(--accent);
  outline-offset:-3px;
}

.resource-row .toolbar {
  flex-wrap:nowrap;
  width:max-content;
}

td.trigger-stage-name {
  padding-inline-start:42px;
}

.stage-branch {
  color:var(--muted);
  margin-inline-end:8px;
}

.empty {
  padding:40px 24px;
  border:1px dashed var(--border);
  border-radius:6px;
  text-align:center;
}

.empty p {
  color:var(--muted);
}

.mono,code,pre {
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:14px;
}

code {
  overflow-wrap:anywhere;
}

.resource-id {
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:13px;
  font-weight:400;
  color:var(--muted);
  overflow-wrap:anywhere;
  min-width:0;
}

pre {
  padding:16px;
  border:1px solid var(--line);
  background:var(--input);
  border-radius:4px;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  max-height:400px;
  overflow:auto;
}

details {
  margin:16px 0;
}

summary {
  cursor:pointer;
  color:var(--accent);
  font-weight:550;
}

details[open]>summary {
  margin-bottom:14px;
}

.action-card {
  border:1px solid var(--border);
  border-radius:5px;
  padding:20px;
  margin:16px 0;
  background:var(--surface);
}

.action-card .toolbar {
  margin-bottom:18px;
}

.action-card .toolbar h3 {
  margin:0;
}

.action-card textarea {
  min-height:170px;
}

.badge {
  font-size:12px;
  font-weight:650;
  border:1px solid var(--border);
  border-radius:999px;
  padding:3px 9px;
  display:inline-block;
  white-space:nowrap;
  color:var(--muted);
}

.badge[data-status=ACTIVE],.badge[data-status=CURRENT_SESSION] {
  color:var(--success);
  border-color:#4d8863;
  background:#142b1d;
}

.badge[data-status=DISABLED] {
  color:var(--error);
  border-color:#b57474;
  background:#321b1b;
}

.badge[data-status=read_write] {
  color:#ffb66e;
  border-color:#b87838;
  background:#332315;
}

.badge[data-status=read_only] {
  color:var(--accent);
  border-color:#527fa8;
  background:#15283b;
}

.role-label-short {
  display:none;
}

.badge[data-status=SUCCEEDED] {
  color:var(--success);
  border-color:#4d8863;
}

.badge[data-status=DEAD] {
  color:var(--error);
  border-color:#b57474;
}

.badge[data-status=RUNNING] {
  color:var(--accent);
}

.channel-type[data-kind=SIGNAL] {
  color:#fff;
  border-color:#3a76f0;
  background:#2457c5;
}

.channel-type[data-kind=SLACK] {
  color:#fff;
  border-color:#aa79dd;
  background:#713ca6;
}

.channel-type[data-kind=EMAIL] {
  color:#161b22;
  border-color:#fff;
  background:#fff;
}

.checkin-stage-heading {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:8px 16px;
}

.success-check {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:24px;
  height:24px;
  flex-shrink:0;
  border:1px solid currentColor;
  border-radius:50%;
  color:var(--success);
  font-weight:650;
}

.checkin-alarm[data-level=red] {
  color:#ffb3b3;
  border-color:#d26b6b;
  background:#401d24;
}

.checkin-alarm[data-level=yellow] {
  color:#ffe08a;
  border-color:#b8963f;
  background:#352c16;
}

.checkin-alarm[data-level=green] {
  color:var(--success);
  border-color:#4d8863;
  background:#142b1d;
}

.back {
  display:inline-block;
  margin-bottom:20px;
}




.address-count {
  font-size:14px;
  color:var(--muted);
}

.template-tools {
  display:flex;
  gap:10px;
  align-items:center;
  margin:-6px 0 20px;
}

.template-tools select {
  max-width:340px;
}

.template-tools label {
  white-space:nowrap;
  font-size:14px;
}

.template-help li {
  margin:8px 0;
}

.secret-wrap {
  display:flex;
  gap:8px;
}

.secret-wrap input {
  min-width:0;
}

.checkbox {
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:18px;
}

.inline-channel {
  border:1px solid var(--accent);
  padding:16px;
  border-radius:4px;
  margin:16px 0;
}

.inline-channel .toolbar {
  margin-bottom:0;
}

.history {
  margin-top:36px;
}

.history details {
  border:1px solid var(--line);
  border-radius:4px;
  padding:14px;
}

.history summary {
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
}

.skip {
  position:absolute;
  left:12px;
  top:-100px;
  background:var(--surface);
  padding:10px;
  z-index:10;
}

.skip:focus {
  top:10px;
}

#notice:not(:empty) {
  position:fixed;
  bottom:24px;
  left:50%;
  transform:translateX(-50%);
  background:#23372b;
  color:#b9f7cf;
  border:1px solid #6cab82;
  padding:12px 20px;
  border-radius:5px;
  max-width:90vw;
  z-index:5;
}

dialog {
  background:var(--surface);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:6px;
  max-width:480px;
  padding:24px;
}

dialog::backdrop {
  background:#000a;
}

.auth .primary {
  width:100%;
}

.auth-links {
  text-align:center;
  margin-top:22px;
}

.auth h1 {
  font-size:30px;
}

.section-caption {
  font-size:13px;
  font-weight:650;
  letter-spacing:.07em;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:10px;
}

@media(max-width:650px) {
  .role-label {
    position:absolute;
    width:1px;
    height:1px;
    overflow:hidden;
    clip-path:inset(50%);
    white-space:nowrap;
  }
  .role-label-short {
    display:inline;
  }
  .header-inner {
    display:grid;
    grid-template-columns:auto minmax(0,1fr);
    padding:14px 18px;
    gap:12px 8px;
  }
  .brand { font-size:18px; gap:6px; }
  .brand::before { width:24px; height:24px; }
  nav {
    grid-column:1 / -1;
    grid-row:2;
    width:100%;
    gap:8px;
    justify-content:space-around;
    font-size:14px;
  }
  .account {
    grid-column:2;
    grid-row:1;
    font-size:12px;
    min-width:0;
    max-width:100%;
    gap:8px;
  }
  .account > a {
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .account .badge,.account button { flex-shrink:0; }
  .account button {
    font-size:12px;
  }
  main {
    padding:24px 18px 60px;
  }
  .heading {
    align-items:flex-start;
  }
  .heading h1 {
    font-size:24px;
  }
  .panel {
    padding:18px;
  }
  .row {
    display:block;
  }
  .row .remove {
    margin:0 0 18px;
  }
  .auth {
    margin:24px auto;
  }
  .actions-footer {
    flex-wrap:wrap;
  }
  .actions-footer button {
    font-size:14px;
    padding-inline:.6rem;
  }
  .template-tools {
    display:block;
  }
  .template-tools label {
    display:block;
    margin-bottom:6px;
  }
  th,td {
    padding:12px;
  }
  .action-card {
    padding:16px;
  }
  .table-wrap table {
    min-width:540px;
  }
}

.create-channel {
  margin-bottom:20px;
}


.empty .toolbar {
  justify-content:center;
}

.info .toolbar {
  margin-top:10px;
}

.resource-heading {
  width:100%;
  min-width:0;
}

.resource-title {
  display:flex;
  align-items:baseline;
  justify-content:flex-start;
  flex-wrap:wrap;
  gap:8px 24px;
  margin-bottom:8px;
}

.resource-title h1 {
  margin:0;
  overflow-wrap:anywhere;
  min-width:0;
}

select:not([multiple]) {
  appearance:none;
  -webkit-appearance:none;
  padding-right:2.75rem;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23b8c2cf' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 1rem center;
  background-size:1rem;
}

.retriever-select {
  padding:6px;
  border-color:var(--line);
  border-radius:8px;
  scrollbar-color:var(--border) var(--input);
}

.retriever-select:hover:not(:disabled),.retriever-select:focus {
  border-color:var(--accent);
}

.retriever-select option {
  padding:12px;
  border-radius:4px;
  white-space:normal;
  overflow-wrap:anywhere;
}

.retriever-select option:hover {
  background-color:#202936;
}

.retriever-select option:checked {
  background:linear-gradient(#29435d,#29435d);
  color:var(--text);
  font-weight:600;
}

.retriever-select[aria-invalid=true] {
  border-color:var(--error);
}

@media(forced-colors:active) {
  select {
    appearance:auto;
    -webkit-appearance:auto;
    background-image:none;
  }

  .retriever-select option:checked {
    background:Highlight;
    color:HighlightText;
  }
}

/* Shared spacing: labels stay close to controls;
groups have room to breathe. */
:root {
  --space-1:4px;
  --space-2:8px;
  --space-3:12px;
  --space-4:16px;
  --space-5:24px;
  --space-6:32px;
}

.stack {
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:var(--space-4);
}

.stack.section-stack {
  gap:var(--space-5);
}

.stack>* {
  margin-block:0;
}

.stack>div:empty,.stack>p:empty {
  display:none;
}

.stack>button,.stack>.button {
  align-self:flex-start;
}

.stack>.field,.stack>.row,.stack>.panel,.stack>.action-card,.stack>.inline-channel,.stack>.template-tools {
  margin-block:0;
}

.panel,.action-card,.inline-channel {
  padding:var(--space-5);
}

.field {
  margin-bottom:var(--space-5);
}

.field>label,.field>span {
  margin-bottom:var(--space-2);
}

.field .help,.field-error {
  margin:var(--space-2) 0 0;
}

.row {
  gap:var(--space-4);
  margin-bottom:var(--space-5);
}

.row>.field {
  margin-bottom:0;
}

.row .remove {
  margin-top:var(--space-6);
}

.toolbar {
  gap:var(--space-3);
}

.toolbar :is(h2,h3) {
  margin:0;
}

.toolbar .help {
  margin:0;
}

.action-card .toolbar,.inline-channel .toolbar {
  margin-bottom:0;
}

.actions-footer {
  gap:var(--space-3);
  padding-top:var(--space-5);
  margin-top:var(--space-5);
}

.stack>.actions-footer {
  margin-top:0;
}




.template-tools {
  gap:var(--space-3);
  margin:0;
}

.template-tools .help {
  margin:0;
}

.create-channel {
  margin:0;
}

.info .toolbar {
  margin-top:var(--space-4);
}

.error,.success,.info {
  padding:var(--space-4);
}

:is(.panel,.info,.error,.success)>:last-child {
  margin-bottom:0;
}

.section-caption {
  margin-bottom:var(--space-3);
}

.heading {
  gap:var(--space-5);
  margin-bottom:var(--space-6);
}

.heading h1 {
  margin-bottom:var(--space-3);
}

.resource-title h1 {
  margin-bottom:0;
}

.back {
  margin-bottom:var(--space-5);
}

.history {
  margin-top:var(--space-6);
}

.history>.history {
  margin-top:0;
}

.history details {
  padding:var(--space-4);
}

.history summary {
  gap:var(--space-3);
}

.history details[open]>summary {
  margin-bottom:var(--space-4);
}

.history .info .toolbar {
  margin-top:0;
}

.history .info .help {
  margin-top:var(--space-2);
}

details[open]>summary {
  margin-bottom:var(--space-4);
}

details>.help {
  margin:0 0 var(--space-4);
}

details>.field {
  margin-bottom:var(--space-4);
}

details>button+.help {
  margin-top:var(--space-4);
}

pre {
  margin:var(--space-4) 0;
  padding:var(--space-4);
}

.stack>pre {
  margin:0;
}

.auth .panel {
  margin-block:var(--space-5);
}

@media(max-width:650px) {
  .actions-footer {
    gap:var(--space-2);
  }
  .panel,.action-card,.inline-channel {
    padding:var(--space-4);
  }
  .row {
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:var(--space-4);
  }
  .row>.field {
    flex:auto;
    width:100%;
  }
  .row .remove {
    align-self:flex-start;
    margin:0;
  }
  .template-tools {
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:var(--space-2);
  }
  .template-tools select {
    max-width:none;
  }
  .heading {
    flex-wrap:wrap;
  }
}

.stack > .section-caption {
  margin: 0;
}

/* Page focus supports navigation without drawing a border around the whole page. */
main:focus {
  outline: none;
}

/* Keep recursive HTTP maps readable without adding native fieldset chrome. */
.http-fields {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.http-map {
  border: 0;
  border-left: 2px solid var(--border, #45516b);
  padding: 0 0 0 32px;
  margin: 0;
  min-width: 0;
}
.http-map legend {
  padding: 0 4px;
  font-size: .85rem;
}

.http-schema-error {
  color: var(--error);
}

.editor-summary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:var(--space-4);
}

@media(max-width:650px) {
  .retrieval-stage>.editor-summary {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
  }

  .retrieval-stage>.editor-summary>.checkin-alarm {
    grid-row:2;
    grid-column:1 / -1;
    justify-self:start;
    max-width:100%;
    white-space:normal;
  }

  .retrieval-stage>.editor-summary>.editor-toggle {
    grid-row:1;
    grid-column:2;
  }
}

.editor-summary-text {
  flex:1;
  min-width:0;
  overflow-wrap:anywhere;
}

.editor-summary-text :is(h2,h3) {
  margin:0;
}

.editor-summary-text .muted {
  font-size:14px;
}

.editor-toggle {
  flex-shrink:0;
  width:44px;
  height:44px;
  padding:0;
  line-height:1;
}

.chevron {
  display:block;
  width:20px;
  height:20px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
  transform-origin:center;
}

.editor-toggle[aria-expanded=true] .chevron {
  transform:rotate(90deg);
}

.duration-controls {
  display:flex;
  gap:var(--space-2);
}

.duration-controls input {
  flex:1;
  min-width:0;
}

.duration-controls select {
  width:auto;
}

.profile-page {
  display:flex;
  flex-direction:column;
  gap:var(--space-6);
}

.profile-identity h1 {
  margin:0;
  overflow-wrap:anywhere;
}

.profile-keys > .heading { margin-bottom:0; }

.profile-key-row {
  display:flex;
  align-items:center;
  gap:var(--space-2);
  margin-top:var(--space-2);
}

.profile-key {
  font-size:16px;
}

button.copy-key {
  width:28px;
  min-height:28px;
  flex-shrink:0;
  padding:0;
  border:0;
  background:transparent;
  color:var(--muted);
}

button.copy-key:hover {
  background:transparent;
  color:var(--text);
}

.copy-icon {
  position:relative;
  width:14px;
  height:16px;
  border:1.5px solid currentColor;
  border-radius:2px;
}

.copy-icon::before {
  content:"";
  position:absolute;
  width:11px;
  height:13px;
  top:-5px;
  left:-5px;
  border-top:1.5px solid currentColor;
  border-left:1.5px solid currentColor;
  border-radius:2px 0 0;
}

.badge[data-status=ACTIVE] {
  color:var(--success);
  border-color:#4d8863;
}

.profile-page time,.profile-page td code {
  white-space:nowrap;
}

/* Session metadata stays compact so locations have room to breathe. */
.sessions-heading {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.sessions-heading p { margin-bottom:0; }
.session-legend { display:flex; flex-wrap:wrap; gap:16px; font-size:13px; }
.session-legend span { display:inline-flex; align-items:center; gap:7px; color:var(--muted); }
.session-legend span::before { content:""; width:7px; height:7px; border-radius:50%; background:currentColor; }
.session-legend [data-geography=us] { color:var(--success); }
.session-legend :is([data-geography=non-us],[data-geography=unknown]) { color:var(--error); }

.sessions-table { table-layout:auto; }
.sessions-table thead th:first-child { width:190px; }
.sessions-table thead th:nth-child(2) { width:22%; }
.sessions-table thead th:last-child { width:220px; }
.sessions-table td, .sessions-table tbody th { padding:18px; font-weight:400; }
.sessions-table .session-group + .session-group { border-top:2px solid var(--line); }
.sessions-table .session-token { vertical-align:middle; background:var(--surface); border-right:1px solid var(--line); }
.session-token .badge { margin-top:8px; margin-right:6px; }
.session-ip td:first-of-type { border-left:3px solid var(--muted); }
.session-group[data-state=ACTIVE] .session-ip td:first-of-type { border-left-color:var(--success); }
.profile-page td .session-ip-address { white-space:normal; overflow-wrap:anywhere; font-size:13px; }
[data-geography=us] :is(.session-location,.session-ip-address) { color:var(--success); }
:is([data-geography=non-us],[data-geography=unknown]) :is(.session-location,.session-ip-address) { color:var(--error); }
.session-location { line-height:1.4; white-space:nowrap; }
.session-location strong { font-size:14px; font-weight:600; }
.bitcoin-amount-toggle {
  padding:2px 4px;
  min-height:32px;
  max-width:100%;
  border-color:transparent;
  background:transparent;
  font:inherit;
  font-variant-numeric:tabular-nums;
  overflow-wrap:anywhere;
}

.bitcoin-total { white-space:nowrap; font-variant-numeric:tabular-nums; }
.sessions-table .session-ip-seen { font-size:12px; white-space:normal; }
.profile-page .session-ip-seen time { white-space:normal; }

@media (max-width: 800px) {
  .table-wrap .sessions-table { min-width:0; }
  .sessions-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .sessions-table, .sessions-table tbody { display:block; }
  .sessions-table tbody tr { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); padding:16px; gap:16px; border-bottom:1px solid var(--line); }
  .sessions-table tbody tr:last-child { border-bottom:0; }
  .sessions-table td, .sessions-table tbody th { display:block; min-width:0; padding:0; border:0; }
  .sessions-table .session-token { grid-column:1 / -1; padding-bottom:12px; border:0; border-bottom:1px solid var(--line); background:transparent; }
  .sessions-table td[data-label="Location"] { grid-column:2; }
  .sessions-table .session-location { white-space:normal; overflow-wrap:anywhere; }
  .sessions-table .session-ip-seen, .sessions-table td[colspan] { grid-column:1 / -1; }
  .sessions-table [data-label]::before { content:attr(data-label); display:block; font-size:12px; color:var(--muted); margin-bottom:6px; }
  .session-ip td:first-of-type { border-left:0; }
}

.bitcoin-sync-metrics { display:grid; grid-template-columns:repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap:20px; margin:0; }
.bitcoin-sync-metrics dt { color:var(--muted); font-size:13px; margin-bottom:6px; }
.bitcoin-sync-metrics dd { color:var(--text); margin:0; font-weight:600; overflow-wrap:anywhere; }
.bitcoin-sync-summary .help { margin-bottom:0; }
.bitcoin-address-table { table-layout:fixed; }
.bitcoin-address-table th { white-space:normal; }
.bitcoin-address-table th:first-child { width:38%; }
.bitcoin-address-table th:nth-child(2) { width:14%; }
.bitcoin-address-table th:nth-child(3) { width:23%; }
.bitcoin-address-table th:last-child { width:44px; }
.bitcoin-address-table th,.bitcoin-address-table td { padding:12px 8px; font-size:12px; }
.bitcoin-address-table td { font-weight:400; vertical-align:middle; white-space:normal; overflow-wrap:anywhere; }
.bitcoin-address-cell textarea { min-width:0; width:100%; min-height:54px; padding:8px; font-size:12px; line-height:1.4; overflow-wrap:anywhere; word-break:break-all; resize:vertical; }
.bitcoin-address-value { display:block; white-space:normal; overflow-wrap:anywhere; word-break:break-all; }
.bitcoin-address-cell .help { display:block; margin-top:6px; font-size:12px; }
.bitcoin-address-table .remove-address { display:inline-flex; align-items:center; justify-content:center; width:28px; min-height:28px; padding:0; border:0; background:transparent; color:var(--error); font-size:22px; line-height:1; }
.bitcoin-address-table .remove-address:hover { background:#3b1d24; }
@media (max-width: 800px) {
  .table-wrap .bitcoin-address-table { min-width:0; }
  .bitcoin-address-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .bitcoin-address-table,.bitcoin-address-table tbody { display:block; }
  .bitcoin-address-table tr { position:relative; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; padding:16px; border-bottom:1px solid var(--line); }
  .bitcoin-address-table tr:last-child { border-bottom:0; }
  .bitcoin-address-table td { display:block; min-width:0; padding:0; border:0; }
  .bitcoin-address-table .bitcoin-address-cell { grid-column:1 / -1; padding-right:32px; }
  .bitcoin-address-table .bitcoin-address-remove { position:absolute; top:40px; right:12px; }
  .bitcoin-address-table [data-label]::before { content:attr(data-label); display:block; font-size:12px; color:var(--muted); margin-bottom:6px; }
}

.bitcoin-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; }
.bitcoin-columns table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.bitcoin-columns caption { text-align: left; font-weight: 700; padding: .6rem 0; }
.bitcoin-columns td { vertical-align: top; padding: .8rem .4rem; border-top: 1px solid var(--border, #3d4658); }
.bitcoin-columns td:first-child { width: 68%; }
.bitcoin-address { display: block; overflow-wrap: anywhere; font-size: .8rem; margin: .4rem 0; }
.bitcoin-amount { text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bitcoin-flags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.bitcoin-flags .badge[data-sighash=all] { color: var(--success); border-color: #4d8863; background: #142b1d; }
.bitcoin-flags .badge[data-sighash=warning] { color: #ffe08a; border-color: #b8963f; background: #352c16; }
.bitcoin-fee { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--border, #3d4658); padding-top: 1rem; }
@media (max-width: 700px) { .bitcoin-columns { grid-template-columns: minmax(0, 1fr); } }

/* Keep login key details within profile cards. */
.key-card { min-width: 0; }
.key-authorizer { overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
.key-card h3 { margin: 0; }

/* Compact resource titles sit close to their check-in or settings panel. */
.resource-page-heading { margin-bottom:var(--space-4); }
.resource-page-heading .resource-title { margin-bottom:0; }
.maximum-fires > :last-child { margin-bottom:0; }

@media (max-width:650px) {
  .table-wrap .channel-usage-table { min-width:0; table-layout:fixed; }
  .channel-usage-table :is(th,td) { padding:10px 8px; font-size:13px; white-space:normal; overflow-wrap:anywhere; }
  .channel-usage-table th:first-child { width:45%; }

  .table-wrap .triggers-table { min-width:0; table-layout:fixed; }
  .triggers-table :is(th,td):is(:nth-child(2),:nth-child(4),:nth-child(5)) { display:none; }
  .triggers-table :is(th,td) { padding:12px 8px; font-size:13px; white-space:normal; overflow-wrap:anywhere; }
  .triggers-table th:nth-child(3) { width:27%; }
  .triggers-table th:nth-child(6) { width:39%; }
  .triggers-table .badge { font-size:11px; padding:3px 6px; }
  .triggers-table .trigger-stage-name { padding-inline-start:16px; }
  .triggers-table .stage-branch { margin-inline-end:4px; }

  .table-wrap .channels-table { min-width:0; }
  .channels-table thead { display:none; }
  .channels-table,.channels-table tbody { display:block; }
  .channels-table tr {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto auto;
    grid-template-areas:"name state kind" "destination destination destination" "test test test";
    align-items:start;
    gap:12px 8px;
    padding:16px;
    border-bottom:1px solid var(--line);
  }
  .channels-table tr:last-child { border-bottom:0; }
  .channels-table td { display:block; min-width:0; padding:0; border:0; white-space:normal; overflow-wrap:anywhere; }
  .channels-table .channel-name { grid-area:name; }
  .channels-table .channel-kind { grid-area:kind; }
  .channels-table .channel-state { grid-area:state; }
  .channels-table .channel-destination { grid-area:destination; }
  .channels-table .channel-test { grid-area:test; }
}

.session-key { display: block; overflow-wrap: anywhere; }
