:root {
  color-scheme: dark;
  --bg: #000000;
  --panel: #0b0b0c;
  --line: #1e1e21;
  --line-soft: #141417;
  --text: #ececf0;
  --muted: #8f9198;
  --accent: #4169e1;
  --accent-press: #355ad1;
  --brand-green: #caff00;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  background: var(--bg);
}

html.app-shell-root {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.view-list,
body.view-chat,
body.view-details {
  height: var(--app-viewport-height, 100vh);
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding: 10px 12px;
  background: #000000;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 24px;
  aspect-ratio: 878 / 758;
  background: var(--text);
  -webkit-mask: url("/static/images/radiocheck-radio-mask.png?v=4") center / contain no-repeat;
  mask: url("/static/images/radiocheck-radio-mask.png?v=4") center / contain no-repeat;
}

.brand-wordmark {
  display: block;
  width: 132px;
  aspect-ratio: 897 / 159;
  background: var(--text);
  -webkit-mask: url("/static/images/radiocheck-wordmark-mask.png?v=3") center / contain no-repeat;
  mask: url("/static/images/radiocheck-wordmark-mask.png?v=3") center / contain no-repeat;
}

.top-actions {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 12px;
  z-index: 20;
  min-width: 170px;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #080808;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  border: 1px solid var(--line);
  background: #080808;
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 18px;
  line-height: 1;
  box-shadow: none;
}

.topbar.menu-open .top-actions {
  display: flex;
}

.top-actions .nav-btn {
  width: 100%;
  text-align: center;
}

.user-chip {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--muted);
  background: #050505;
}

.nav-btn {
  text-decoration: none;
  color: var(--text);
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #080808;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.nav-btn:hover {
  border-color: #2a2a2f;
  background: #101012;
  transform: translateY(-1px);
}

.nav-btn:active {
  transform: translateY(0);
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr 280px;
  height: calc(var(--app-viewport-height, 100vh) - var(--app-topbar-height, 56px));
  min-height: 0;
  gap: 12px;
  padding: 12px;
  overflow: hidden;
}

.layout.no-details-layout {
  grid-template-columns: 300px 1fr;
}

.panel {
  background: transparent;
  border: 1px solid var(--line-soft);
  border-radius: 0;
  overflow: hidden;
  min-height: 0;
}

.left,
.right {
  display: flex;
  flex-direction: column;
}

.right {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.center {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-title {
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line-soft);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
}

.demo-warning {
  margin: 10px;
  padding: 10px 11px;
  border: 1px solid rgba(202, 255, 0, 0.34);
  border-radius: 8px;
  background: rgba(202, 255, 0, 0.08);
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.panel-title-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-title-with-action .nav-btn {
  text-transform: none;
  letter-spacing: normal;
}

.category-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.category-tab {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--muted);
  text-decoration: none;
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #060606;
  font-size: 12px;
}

.category-tab span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-tab b {
  color: var(--text);
  font-size: 13px;
}

.category-tab.active {
  color: #000;
  border-color: var(--brand-green);
  background: var(--brand-green);
}

.category-tab.active b {
  color: #000;
}

.list-filters {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.start-chat {
  border-bottom: 1px solid var(--line-soft);
  background: #030303;
}

.start-chat summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  list-style-position: inside;
}

.start-chat-form {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

.start-chat-note {
  margin: 0 10px 10px;
  padding: 9px 10px;
  border: 1px solid rgba(202, 255, 0, 0.32);
  border-radius: 8px;
  background: rgba(202, 255, 0, 0.08);
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.template-helper {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.list-filters input,
.list-filters select,
.start-chat-form input,
.start-chat-form select,
.start-chat-form textarea {
  width: 100%;
  background: #070707;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font: inherit;
}

.start-chat-form textarea {
  resize: vertical;
}

.member-picker {
  display: grid;
  gap: 7px;
  max-height: 150px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #070707;
}

.member-picker label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  min-width: 0;
}

.member-picker input[type="checkbox"] {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 0;
}

.member-picker label span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.member-picker.stacked {
  max-height: 220px;
}

.member-picker.stacked small {
  color: var(--muted-strong);
}

.list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  scroll-behavior: smooth;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  transition: background-color 120ms ease;
}

.list-item.active,
.list-item:hover {
  background: rgba(10, 132, 255, 0.2);
}

.list-item[hidden] {
  display: none;
}

.list-copy {
  display: grid;
  min-width: 0;
}

.list-name {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #101014;
  color: var(--brand-green);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 34px;
  height: 34px;
  font-size: 11px;
}

.chat-avatar {
  width: 42px;
  height: 42px;
}

.chat-header {
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  gap: 10px;
}

.chat-title {
  font-size: 16px;
  font-weight: 700;
}

.chat-subtitle {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.chat-user-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chat-user-link:hover .chat-title {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mobile-back {
  display: none;
}

.messages {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow-y: auto;
  padding: 12px 12px 92px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  scroll-padding-bottom: 112px;
}

.msg-row {
  display: flex;
  margin-bottom: 8px;
  transition: transform 120ms ease, opacity 120ms ease;
}

.msg-row.out {
  justify-content: flex-end;
}

.msg {
  max-width: 76%;
  border: 1px solid #232327;
  border-radius: 10px;
  padding: 9px 11px;
  background: #101014;
}

.msg-row.out .msg {
  background: rgba(10, 132, 255, 0.18);
  border-color: rgba(10, 132, 255, 0.42);
}

.msg-sender {
  margin-bottom: 4px;
  color: var(--brand-green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.msg-meta {
  margin-top: 5px;
  font-size: 11px;
  color: var(--muted);
}

.msg-error-code {
  margin-left: 6px;
  color: #ffb4ae;
  font-weight: 700;
}

.msg-error-detail {
  margin-top: 5px;
  color: #ffb4ae;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.msg-attachments {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.msg-attachments:first-child {
  margin-top: 0;
}

.msg-attachment {
  color: var(--text);
  text-decoration: none;
}

.msg-attachment img {
  display: block;
  width: min(280px, 58vw);
  max-height: 320px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #050505;
}

.file-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  overflow-wrap: anywhere;
}

.file-link::before {
  content: "↗";
  color: var(--muted);
}

.composer {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line-soft);
  background: #030303;
}

.send-error {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-top: 1px solid rgba(255, 69, 58, 0.28);
  background: rgba(255, 69, 58, 0.12);
  color: #ffb4ae;
  font-size: 13px;
  line-height: 1.35;
}

.send-error[hidden] {
  display: none;
}

.composer input,
.composer textarea {
  flex: 1;
  background: #080808;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.attach-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080808;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.composer-attachments {
  flex: 1 0 100%;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.composer-attachments[hidden] {
  display: none;
}

.composer textarea {
  min-height: 44px;
  max-height: 180px;
  resize: vertical;
  font: inherit;
  font-size: 16px;
}

.composer input:focus,
.composer textarea:focus,
.list-filters input:focus,
.list-filters select:focus,
.start-chat-form input:focus,
.start-chat-form select:focus,
.start-chat-form textarea:focus,
.profile-form input:focus,
.profile-form select:focus,
.profile-form textarea:focus,
.auth-card input:focus,
.inline-form input:focus,
.inline-form select:focus,
.table input:focus,
.user-management-form input:focus,
.user-management-form select:focus {
  outline: none;
  border-color: rgba(10, 132, 255, 0.8);
  background: #0b0b0d;
}

select option {
  background: #080808;
  color: var(--text);
}

button {
  background: var(--brand-green);
  color: #000;
  border: 1px solid rgba(202, 255, 0, 0.82);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 8px 22px rgba(202, 255, 0, 0.22);
  transition: transform 120ms ease, filter 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

button:hover {
  background: #d8ff33;
  color: #000;
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 10px 26px rgba(202, 255, 0, 0.28);
}

button:disabled {
  cursor: default;
  filter: grayscale(0.3);
  opacity: 0.68;
  transform: none;
  box-shadow: none;
}

button:active {
  transform: translateY(0);
  background: #bced00;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 6px 14px rgba(202, 255, 0, 0.2);
}

.composer #send-button,
.composer button[type="submit"],
.start-chat-form button[type="submit"],
.inline-form > button[type="submit"],
.profile-form > button[type="submit"],
.assistant-actions button[type="submit"] {
  background: var(--brand-green);
  color: #000;
  border-color: rgba(202, 255, 0, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 8px 22px rgba(202, 255, 0, 0.22);
}

.composer #send-button:hover,
.composer button[type="submit"]:hover,
.start-chat-form button[type="submit"]:hover,
.inline-form > button[type="submit"]:hover,
.profile-form > button[type="submit"]:hover,
.assistant-actions button[type="submit"]:hover {
  background: #d8ff33;
  color: #000;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 10px 26px rgba(202, 255, 0, 0.28);
}

.composer #send-button:active,
.composer button[type="submit"]:active,
.start-chat-form button[type="submit"]:active,
.inline-form > button[type="submit"]:active,
.profile-form > button[type="submit"]:active,
.assistant-actions button[type="submit"]:active {
  background: #bced00;
  color: #000;
}

.composer #send-button:disabled,
.composer button[type="submit"]:disabled,
.start-chat-form button[type="submit"]:disabled,
.inline-form > button[type="submit"]:disabled,
.profile-form > button[type="submit"]:disabled,
.assistant-actions button[type="submit"]:disabled {
  color: #000;
}

.ghost {
  background: #09090a;
  border: 1px solid var(--line);
  color: var(--text);
}

.brain-icon {
  display: block;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-launcher:active {
  background: var(--brand-green);
  color: #000;
  box-shadow: 0 8px 20px rgba(202, 255, 0, 0.14);
}

.ai-launcher {
  position: fixed;
  right: 18px;
  bottom: 110px;
  z-index: 50;
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0;
  background: var(--brand-green);
  color: #000;
  border: 1px solid rgba(202, 255, 0, 0.76);
  text-decoration: none;
  box-shadow: 0 16px 36px rgba(202, 255, 0, 0.18), 0 8px 26px rgba(0, 0, 0, 0.34);
}

.ai-launcher:hover {
  background: #d8ff33;
  transform: translateY(-1px);
}

.ai-launcher .brain-icon {
  width: 28px;
  height: 28px;
}

html.integratd-ios-app .ai-launcher {
  display: none !important;
}

html.integratd-ios-app a,
html.integratd-ios-app button,
html.integratd-ios-app img,
html.integratd-ios-app .list-item,
html.integratd-ios-app .category-tab,
html.integratd-ios-app .attach-button {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

html.integratd-ios-app input,
html.integratd-ios-app textarea,
html.integratd-ios-app [contenteditable="true"] {
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  user-select: text;
}

html.integratd-ios-app body:not(.view-list):not(.view-chat):not(.view-details) {
  min-height: var(--app-viewport-height, 100dvh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

html.integratd-ios-app body.settings-page {
  height: var(--app-viewport-height, 100dvh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

html.integratd-ios-app .settings-shell {
  min-height: var(--app-viewport-height, 100dvh);
  padding: 14px 12px calc(var(--integratd-app-bottom-bar-space, 104px) + 120px);
}

html.integratd-ios-app body:not(.options-page) .settings-actions {
  display: none;
}

html.integratd-ios-app .options-page .settings-actions {
  display: grid;
  gap: 10px;
}

html.integratd-ios-app .settings-card {
  margin-top: 0;
}

html.integratd-ios-app body.view-list,
html.integratd-ios-app body.view-chat,
html.integratd-ios-app body.view-details {
  height: var(--app-viewport-height, 100dvh);
  min-height: 0;
  overflow: hidden;
}

html.integratd-ios-app body.view-list .layout,
html.integratd-ios-app body.view-chat .layout,
html.integratd-ios-app body.view-details .layout {
  grid-template-columns: 1fr !important;
  height: calc(var(--app-viewport-height, 100dvh) - var(--app-topbar-height, 56px));
  min-height: 0;
  width: 100%;
  padding: 0;
  gap: 0;
  overflow: hidden;
}

html.integratd-ios-app body.view-list .center,
html.integratd-ios-app body.view-list .right,
html.integratd-ios-app body.view-chat .left,
html.integratd-ios-app body.view-chat .right,
html.integratd-ios-app body.view-details .left,
html.integratd-ios-app body.view-details .center {
  display: none !important;
}

html.integratd-ios-app body.view-list .left,
html.integratd-ios-app body.view-chat .center,
html.integratd-ios-app body.view-details .right {
  display: flex !important;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-left: none;
  border-right: none;
}

html.integratd-ios-app body.view-chat .messages {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 16px;
  scroll-padding-bottom: 32px;
}

html.integratd-ios-app body.view-chat .composer {
  flex: 0 0 auto;
  margin-bottom: 0;
}

.assistant-shell {
  min-height: calc(var(--app-viewport-height, 100vh) - var(--app-topbar-height, 56px));
  padding: 14px;
  background: #000;
}

.assistant-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(100%, 1120px);
  height: calc(var(--app-viewport-height, 100vh) - var(--app-topbar-height, 56px) - 28px);
  margin: 0 auto;
  border: 1px solid var(--line-soft);
  background: #030303;
  overflow: hidden;
}

.assistant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.assistant-heading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.assistant-heading h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1;
}

.assistant-heading-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--brand-green);
  color: #000;
}

.assistant-heading-icon .brain-icon {
  width: 24px;
  height: 24px;
}

.assistant-header select {
  width: min(360px, 48vw);
  min-height: 40px;
  background: #080808;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

.assistant-feed {
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.assistant-message {
  max-width: min(760px, 92%);
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 13px;
  background: #101014;
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.assistant-message.user {
  margin-left: auto;
  background: rgba(202, 255, 0, 0.12);
  border-color: rgba(202, 255, 0, 0.4);
}

.assistant-form {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line-soft);
  background: #030303;
}

.assistant-form textarea {
  width: 100%;
  min-height: 86px;
  max-height: 190px;
  resize: vertical;
  background: #080808;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
}

.assistant-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.assistant-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080808;
  color: var(--text);
  cursor: pointer;
}

.assistant-file-preview {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

.assistant-file-preview[hidden] {
  display: none;
}

.danger {
  background: #8f2f39;
  border-color: #7f2932;
  color: #fff;
}

.danger:hover {
  background: #a33a45;
  border-color: #91404a;
  color: #fff;
}

.danger:active {
  background: #7f2932;
}

.detail {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}

.detail span {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.hidden-details {
  display: none;
}

.detail-section {
  border-top: 1px solid var(--line-soft);
}

.detail-note {
  margin: 0;
  padding: 0 12px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.member-list,
.task-list {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
}

.member-row,
.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #050505;
}

.member-row span:not(.avatar),
.task-item div {
  min-width: 0;
}

.member-row small,
.task-item small {
  color: var(--muted);
}

.task-item {
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.task-item p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.task-item select {
  min-height: 34px;
  background: #080808;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
}

.group-task-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  background: #030303;
}

.group-task-hero h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: 0;
}

.group-task-hero p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.group-task-form {
  grid-template-columns: minmax(0, 1fr) minmax(140px, 0.6fr);
}

.group-task-form .span-2 {
  grid-column: 1 / -1;
}

.group-task-sections {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
}

.group-task-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #040404;
}

.group-task-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.group-task-section-header h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}

.group-task-section-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.group-task-list {
  display: grid;
  gap: 1px;
}

.group-task-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(116px, auto);
  align-items: start;
  gap: 10px;
  padding: 10px;
  background: #070707;
}

.group-task-row.done .group-task-copy b,
.group-task-row.done .group-task-copy p {
  color: var(--muted);
  text-decoration: line-through;
}

.task-check-form {
  margin: 0;
}

.task-check-button {
  position: relative;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 8px;
  border: 2px solid var(--muted);
  background: transparent;
  box-shadow: none;
}

.task-check-button:hover,
.task-check-button:active {
  background: rgba(202, 255, 0, 0.1);
  border-color: var(--brand-green);
  box-shadow: none;
  transform: none;
}

.group-task-row.done .task-check-button {
  background: var(--brand-green);
  border-color: var(--brand-green);
}

.group-task-row.done .task-check-button::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  width: 7px;
  height: 13px;
  border: solid #000;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.group-task-copy {
  min-width: 0;
}

.group-task-copy b {
  display: block;
  overflow-wrap: anywhere;
}

.group-task-copy p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.group-task-copy small {
  color: var(--muted);
  line-height: 1.3;
}

.group-task-state-form {
  margin: 0;
}

.group-task-state-form select {
  width: 100%;
  min-height: 34px;
  background: #080808;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
}

.task-edit-panel {
  grid-column: 2 / -1;
  min-width: 0;
}

.task-edit-panel-inline {
  flex: 1 0 100%;
}

.task-edit-panel summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #080808;
  cursor: pointer;
  user-select: none;
}

.task-edit-panel[open] summary {
  border-color: rgba(202, 255, 0, 0.48);
}

.task-edit-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #050505;
}

.task-edit-form .span-2 {
  grid-column: 1 / -1;
}

.group-member-picker {
  max-height: 280px;
}

.compact {
  padding: 8px 0;
}

.profile-form {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 8px;
}

.profile-form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.profile-form input,
.profile-form select,
.profile-form textarea {
  width: 100%;
  background: #080808;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

.profile-form textarea {
  resize: vertical;
}

.hint,
.empty {
  padding: 14px;
  color: var(--muted);
}

.center-empty {
  display: grid;
  place-items: center;
  height: 100%;
}

.auth-shell,
.settings-shell {
  min-height: 100vh;
  display: block;
  padding: 12px;
}

.auth-card,
.settings-card {
  width: 100%;
  max-width: 680px;
  margin: 24px auto 0;
  background: transparent;
  border: 1px solid var(--line-soft);
  border-radius: 0;
  padding: 14px;
}

.auth-shell {
  display: grid;
  place-items: center;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(255, 255, 255, 0.08), transparent 65%),
    linear-gradient(#000, #000);
}

.login-card {
  max-width: 840px;
  width: min(95vw, 840px);
  text-align: center;
  padding: 10px 36px 20px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  position: relative;
  overflow: visible;
}

.login-card::before {
  content: none;
}

.login-card > * {
  position: relative;
  z-index: 1;
}

.login-card h1 {
  text-align: center;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-weight: 560;
  margin: 0 0 18px;
  color: #d9dbe3;
}

.login-logo {
  display: block;
  margin: 0 auto 14px;
  width: clamp(132px, 34vw, 190px);
  height: auto;
  border-radius: 30px;
  filter: drop-shadow(0 18px 38px rgba(190, 255, 0, 0.08)) drop-shadow(0 10px 24px rgba(0, 0, 0, 0.42));
}

.login-wordmark {
  display: block;
  margin: 0 auto 18px;
  width: clamp(236px, 56vw, 370px);
  aspect-ratio: 897 / 159;
  background: #ffffff;
  -webkit-mask: url("/static/images/radiocheck-wordmark-mask.png?v=3") center / contain no-repeat;
  mask: url("/static/images/radiocheck-wordmark-mask.png?v=3") center / contain no-repeat;
}

.login-card p {
  text-align: center;
  margin-bottom: 32px;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.login-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 14px;
  color: #b6bac6;
  letter-spacing: -0.01em;
  font-weight: 500;
}

.login-card label {
  text-align: center;
}

.login-card input {
  margin-left: auto;
  margin-right: auto;
  width: min(92%, 520px);
  height: 64px;
  border-radius: 22px;
  font-size: 16px;
  padding: 0 20px;
  border: 2px solid transparent;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.login-action {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.login-action button {
  min-width: 300px;
  height: 58px;
  border-radius: 13px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.08) 100%);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 6px 18px rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.12);
}

.login-action button:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.11) 100%);
  border-color: rgba(255, 255, 255, 0.8);
  color: #ffffff;
}

.login-action button:active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0.07) 100%);
  transform: translateY(0);
  color: #ffffff;
}

.login-card input::placeholder {
  color: transparent;
  font-size: 16px;
}

.login-card input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.88);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.5),
    0 0 16px rgba(255, 255, 255, 0.26),
    0 0 30px rgba(255, 255, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  background: linear-gradient(90deg, #2a2b31 0%, #2c2d34 100%);
}

/* Phone step: always-active frame, with jet-black fill. */
.phone-step-form .phone-step-input {
  border-color: rgba(255, 255, 255, 0.88);
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.5),
    0 0 16px rgba(255, 255, 255, 0.26),
    0 0 30px rgba(255, 255, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  background: #000;
}

.phone-step-form .phone-step-input:focus {
  background: #000;
}

.phone-step-form .phone-step-input::placeholder {
  color: #b6bac6;
  text-align: center;
}

.phone-step-form:not(.phone-interacted) .phone-step-input::placeholder {
  color: transparent;
}

.phone-step-form .phone-step-input:focus::placeholder {
  color: transparent;
}

.phone-step-form .login-field {
  position: relative;
}

.phone-step-form .phone-scan-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  font-size: 16px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: transparent;
  background: linear-gradient(
    90deg,
    rgba(182, 186, 198, 0) 0%,
    rgba(182, 186, 198, 0) 42%,
    rgba(238, 242, 255, 0.98) 50%,
    rgba(182, 186, 198, 0) 58%,
    rgba(182, 186, 198, 0) 100%
  );
  background-size: 240% 100%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: phoneHintSweep 2.2s ease-in-out infinite alternate;
  transition: opacity 140ms ease;
}

.phone-step-form.phone-interacted .phone-scan-hint {
  display: none;
}

.phone-step-form .phone-step-input:focus + .phone-scan-hint,
.phone-step-form .phone-step-input:not(:placeholder-shown) + .phone-scan-hint {
  opacity: 0;
}

@keyframes phoneHintSweep {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

/* OTP step: centered text only in verification input. */
.otp-step-form .otp-step-input {
  text-align: center;
}

.settings-card.wide {
  max-width: 1100px;
  border: none;
}

.privacy-shell {
  min-height: 100vh;
  padding: 32px 16px 56px;
  background:
    radial-gradient(900px 360px at 50% -120px, rgba(255, 255, 255, 0.08), transparent 70%),
    #000;
}

.privacy-policy {
  width: min(100%, 820px);
  margin: 0 auto;
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
}

.privacy-logo {
  display: block;
  width: min(240px, 62vw);
  height: auto;
  margin: 0 0 32px;
}

.privacy-logo-mark {
  display: block;
  width: min(240px, 62vw);
  aspect-ratio: 897 / 159;
  margin: 0 0 32px;
  background: var(--text);
  -webkit-mask: url("/static/images/radiocheck-wordmark-mask.png?v=3") center / contain no-repeat;
  mask: url("/static/images/radiocheck-wordmark-mask.png?v=3") center / contain no-repeat;
}

.privacy-policy h1 {
  margin: 0 0 6px;
  font-size: clamp(34px, 9vw, 54px);
  line-height: 1;
}

.privacy-updated {
  margin: 0 0 28px;
  color: var(--muted);
}

.privacy-policy h2 {
  margin: 34px 0 10px;
  font-size: 20px;
  line-height: 1.2;
}

.privacy-policy p,
.privacy-policy li {
  color: #d7d9df;
}

.privacy-policy ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

.privacy-policy a {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-card h1,
.settings-card h1 {
  margin: 0 0 8px;
}

.auth-card p,
.settings-card p {
  margin: 0 0 14px;
  color: var(--muted);
}

.auth-card label {
  display: block;
  margin-bottom: 12px;
  font-size: 14px;
}

.auth-card:not(.login-card) input,
.inline-form input,
.inline-form select,
.table input {
  width: 100%;
  margin-top: 6px;
  background: #080808;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.error {
  margin-bottom: 12px;
  border: 1px solid #9d404a;
  background: rgba(157, 64, 74, 0.14);
  color: #ffdce0;
  padding: 10px 12px;
  border-radius: 8px;
}

.success {
  margin-bottom: 12px;
  border: 1px solid #2f6f54;
  background: rgba(47, 111, 84, 0.18);
  color: #d9ffe7;
  padding: 10px 12px;
  border-radius: 8px;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.user-groups {
  display: grid;
  gap: 16px;
}

.user-role-group {
  display: grid;
  gap: 10px;
}

.user-role-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 8px;
}

.user-role-heading h3 {
  margin: 0;
  font-size: 17px;
}

.user-role-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.user-card-list {
  display: grid;
  gap: 10px;
}

.user-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050505;
  overflow: hidden;
}

.user-card summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.user-card summary::-webkit-details-marker {
  display: none;
}

.user-card summary::after {
  content: "⌄";
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  transform: rotate(-90deg);
  transition: transform 140ms ease;
}

.user-card[open] summary::after {
  transform: rotate(0deg);
}

.user-summary-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.user-summary-copy b,
.user-summary-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-summary-copy small {
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: #080808;
  white-space: nowrap;
}

.status-pill.active {
  border-color: rgba(202, 255, 0, 0.42);
  color: var(--brand-green);
  background: rgba(202, 255, 0, 0.08);
}

.status-pill.inactive {
  border-color: rgba(255, 69, 58, 0.32);
  color: #ffb4ae;
  background: rgba(255, 69, 58, 0.08);
}

.user-card-body {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line-soft);
  padding: 12px;
}

.user-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.user-detail-grid div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 9px 10px;
  background: #030303;
}

.user-detail-grid span,
.user-management-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.user-detail-grid b {
  color: var(--text);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.user-management-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
}

.user-management-form.compact {
  grid-template-columns: minmax(0, 1fr) auto;
}

.user-management-form label {
  display: grid;
  gap: 6px;
}

.user-management-form input,
.user-management-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080808;
  color: var(--text);
  padding: 10px;
  font: inherit;
  text-transform: none;
  letter-spacing: 0;
}

.user-actions,
.user-credential-actions {
  display: grid;
  gap: 10px;
}

.user-actions {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.user-actions form,
.user-actions a,
.user-actions button,
.user-credential-actions button {
  width: 100%;
}

.user-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.inline-link {
  text-decoration: none;
  justify-content: center;
}

.task-filter-form,
.task-create-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  align-items: end;
  margin: 14px 0 20px;
}

.task-filter-form label,
.task-create-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.task-filter-form input,
.task-filter-form select,
.task-create-form input,
.task-create-form select,
.task-create-form textarea,
.task-status-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #070707;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

.task-create-form textarea {
  min-height: 84px;
  resize: vertical;
}

.task-filter-form input:focus,
.task-filter-form select:focus,
.task-create-form input:focus,
.task-create-form select:focus,
.task-create-form textarea:focus,
.task-status-form select:focus {
  outline: none;
  border-color: rgba(202, 255, 0, 0.65);
  box-shadow: 0 0 0 3px rgba(202, 255, 0, 0.12);
}

.task-create-form .span-2 {
  grid-column: span 2;
}

.task-board {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.task-group {
  border: 1px solid var(--line-soft);
  background: #040404;
  overflow: hidden;
}

.task-group-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.task-group-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.task-group-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.task-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.task-column {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.task-column h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.task-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #08080a;
  padding: 10px;
}

.task-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.task-card-title {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.task-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.task-status-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.task-status-form button,
.task-filter-form button,
.task-create-form button {
  min-height: 42px;
}

.task-empty {
  margin-top: 12px;
}

.diagnostics-card {
  max-width: 960px;
}

.diagnostics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.diagnostic-section {
  border: 1px solid var(--line-soft);
  background: #040404;
  padding: 12px;
}

.diagnostic-section.span-2 {
  grid-column: 1 / -1;
}

.diagnostic-section h2,
.diagnostic-section h3 {
  margin: 0 0 12px;
}

.diagnostic-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.diagnostic-list > div {
  display: grid;
  grid-template-columns: minmax(130px, 0.35fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.diagnostic-list dt {
  color: var(--muted);
  font-size: 13px;
}

.diagnostic-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.diagnostic-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #0a0a0a;
}

.diagnostic-note.ok {
  border-color: rgba(202, 255, 0, 0.5);
  background: rgba(202, 255, 0, 0.12);
}

.diagnostic-note.bad {
  border-color: rgba(255, 92, 112, 0.5);
  background: rgba(255, 92, 112, 0.14);
  color: #ffd4da;
}

.diagnostic-actions {
  margin-top: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0a0a0a;
  font-size: 13px;
}

.status-pill.ok {
  border-color: rgba(202, 255, 0, 0.5);
  background: rgba(202, 255, 0, 0.14);
  color: #efffc0;
}

.status-pill.warn {
  border-color: rgba(255, 190, 92, 0.45);
  background: rgba(255, 190, 92, 0.12);
  color: #ffe1ad;
}

.status-pill.bad {
  border-color: rgba(255, 92, 112, 0.5);
  background: rgba(255, 92, 112, 0.14);
  color: #ffd4da;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
  gap: 8px;
  margin-bottom: 16px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.check input {
  width: auto;
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  border: 1px solid var(--line);
  padding: 8px;
  vertical-align: top;
  background: #060606;
  overflow-wrap: anywhere;
}

.inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0;
}

.inline input {
  width: 160px;
  margin: 0;
  padding: 8px;
}

.stacked-inline {
  align-items: stretch;
  flex-wrap: wrap;
  margin-top: 8px;
}

.stacked-inline input {
  width: min(100%, 220px);
}

html.integratd-ios-app .settings-page .table-wrap {
  overflow: visible;
}

html.integratd-ios-app .settings-page .table,
html.integratd-ios-app .settings-page .table tbody,
html.integratd-ios-app .settings-page .table tr,
html.integratd-ios-app .settings-page .table td {
  display: block;
  width: 100%;
}

html.integratd-ios-app .settings-page .table {
  border-collapse: separate;
  border-spacing: 0 12px;
}

html.integratd-ios-app .settings-page .table thead {
  display: none;
}

html.integratd-ios-app .settings-page .table tr {
  border: 1px solid var(--line);
  background: #060606;
}

html.integratd-ios-app .settings-page .table td {
  display: grid;
  grid-template-columns: minmax(92px, 28%) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 46px;
  padding: 12px;
  border-width: 0 0 1px;
  font-size: 15px;
}

html.integratd-ios-app .settings-page .table td:last-child {
  border-bottom: none;
}

html.integratd-ios-app .settings-page .table td::before {
  content: attr(data-label);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

html.integratd-ios-app .settings-page .table td[data-label="Actions"] {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
}

html.integratd-ios-app .settings-page .table td[data-label="Actions"]::before {
  flex: 0 0 100%;
}

html.integratd-ios-app .settings-page .table td[data-label="Actions"] .inline {
  flex: 1 1 160px;
  margin: 0;
}

html.integratd-ios-app .settings-page .table td[data-label="Actions"] button {
  width: 100%;
  min-height: 40px;
}

/* Minimal scrollbar styling for smoother dark UI feel */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #060607;
}

::-webkit-scrollbar-thumb {
  background: #2a2a30;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a3a43;
}

@media (max-width: 1024px) {
  body.view-list,
  body.view-chat,
  body.view-details {
    height: var(--app-viewport-height, 100dvh);
    overflow: hidden;
  }

  .layout {
    grid-template-columns: 1fr;
    height: calc(var(--app-viewport-height, 100dvh) - var(--app-topbar-height, 56px));
    min-height: 0;
    width: 100%;
    padding: 0;
    gap: 0;
  }
  .layout.no-details-layout {
    grid-template-columns: 1fr;
  }
  .left,
  .right,
  .center {
    height: 100%;
    min-height: 0;
    max-height: none;
  }
  body.view-chat .center {
    height: 100%;
    min-height: 0;
  }
  body.view-chat .messages {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
  }
  .inline-form {
    grid-template-columns: 1fr;
  }
  .topbar {
    position: sticky;
    top: 0;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
  }

  .brand-wordmark {
    width: 105px;
  }

  .brand-mark {
    width: 21px;
  }

  /* Mobile flow: list -> chat -> details (single screen at a time). */
  body.view-list .center,
  body.view-list .right {
    display: none;
  }
  body.view-list .left {
    display: flex;
    width: 100%;
    border-left: none;
    border-right: none;
  }

  body.view-chat .left,
  body.view-chat .right {
    display: none;
  }
  body.view-chat .center {
    display: flex;
    flex-direction: column;
    width: 100%;
    border-left: none;
    border-right: none;
  }

  body.view-details .left,
  body.view-details .center {
    display: none;
  }
  body.view-details .right {
    display: flex;
    width: 100%;
    border-left: none;
    border-right: none;
  }

  .right {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-back {
    display: inline-flex;
  }

  .ai-launcher {
    right: 16px;
    bottom: 118px;
  }
  .assistant-shell {
    padding: 0 0 104px;
  }
  .assistant-main {
    width: 100%;
    height: calc(var(--app-viewport-height, 100vh) - var(--app-topbar-height, 56px) - 104px);
    border-left: none;
    border-right: none;
  }
  .assistant-header {
    align-items: stretch;
    flex-direction: column;
  }
  .assistant-header select {
    width: 100%;
  }
  .assistant-feed {
    padding: 12px;
  }
  .assistant-message {
    font-size: 14px;
  }
  .assistant-actions {
    align-items: stretch;
  }
  .assistant-file-button,
  .assistant-actions button {
    min-height: 44px;
  }
  .msg-attachment img {
    width: min(260px, 70vw);
  }
  .composer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .category-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .category-tab {
    padding: 8px 6px;
  }
  .chat-user-link {
    flex: 1 1 auto;
  }
  .chat-title,
  .chat-subtitle {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .auth-card,
  .settings-card {
    margin-top: 12px;
  }
  .settings-shell {
    padding: 18px 12px 110px;
  }
  .settings-card.wide {
    max-width: none;
    padding: 0;
  }
  .settings-card h1 {
    font-size: 42px;
    line-height: 1.05;
  }
  .settings-card h2 {
    font-size: 28px;
    line-height: 1.1;
    margin: 28px 0 14px;
  }
  .settings-card p {
    font-size: 20px;
    line-height: 1.3;
  }
  .settings-actions .nav-btn {
    padding: 10px 14px;
    font-size: 15px;
  }
  .task-filter-form,
  .task-create-form {
    grid-template-columns: 1fr;
  }
  .task-create-form .span-2 {
    grid-column: auto;
  }
  .task-columns {
    grid-template-columns: 1fr;
  }
  .task-group-header {
    align-items: stretch;
    flex-direction: column;
  }
  .task-status-form {
    grid-template-columns: 1fr;
  }
  .group-task-hero {
    align-items: stretch;
    flex-direction: column;
  }
  .group-task-form {
    grid-template-columns: 1fr;
  }
  .group-task-form .span-2 {
    grid-column: auto;
  }
  .group-task-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }
  .group-task-state-form {
    grid-column: 2;
  }
  .task-edit-panel {
    grid-column: 1 / -1;
  }
  .task-edit-form {
    grid-template-columns: 1fr;
  }
  .task-edit-form .span-2 {
    grid-column: auto;
  }
  html.integratd-ios-app body.view-details .right {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    scroll-padding-bottom: calc(var(--integratd-app-bottom-bar-space, 104px) + 80px);
    padding-bottom: calc(var(--integratd-app-bottom-bar-space, 104px) + 40px);
  }
  html.integratd-ios-app .group-task-form input,
  html.integratd-ios-app .group-task-form select,
  html.integratd-ios-app .group-task-form textarea,
  html.integratd-ios-app .task-edit-form input,
  html.integratd-ios-app .task-edit-form select,
  html.integratd-ios-app .task-edit-form textarea {
    font-size: 16px;
  }
  .diagnostics-grid {
    grid-template-columns: 1fr;
  }
  .diagnostic-section.span-2 {
    grid-column: auto;
  }
  .diagnostic-list > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .inline-form {
    gap: 12px;
  }
  .inline-form input,
  .inline-form select {
    min-height: 48px;
    margin-top: 0;
    font-size: 16px;
  }
  .inline-form button {
    min-height: 48px;
  }
  .check {
    font-size: 16px;
  }
  .check input {
    width: 28px;
    height: 28px;
  }
  .table-wrap {
    overflow: visible;
  }
  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: 100%;
  }
  .table {
    border-collapse: separate;
    border-spacing: 0 12px;
  }
  .table thead {
    display: none;
  }
  .table tr {
    border: 1px solid var(--line);
    background: #060606;
  }
  .table td {
    display: grid;
    grid-template-columns: minmax(84px, 34%) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    border-width: 0 0 1px;
    min-height: 48px;
    padding: 12px;
    font-size: 15px;
  }
  .table td:last-child {
    border-bottom: none;
  }
  .table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
  }
  .table td[data-label="Actions"] {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 54px;
  }
  .table td[data-label="Actions"]::before {
    flex: 0 0 76px;
    margin: 0;
  }
  .table td[data-label="Actions"] .inline {
    display: inline-flex;
    flex: 1 1 112px;
    margin: 0;
  }
  .table td[data-label="Actions"] button {
    width: 100%;
    min-height: 38px;
    margin-top: 0;
    padding: 8px 10px;
  }
  html.integratd-ios-app .settings-shell {
    padding: 12px 10px calc(var(--integratd-app-bottom-bar-space, 104px) + 120px);
  }
  html.integratd-ios-app .settings-card {
    border: none;
    padding: 0;
  }
  html.integratd-ios-app .settings-card h1 {
    font-size: 32px;
    line-height: 1.05;
    margin-bottom: 4px;
  }
  html.integratd-ios-app .settings-card h2 {
    font-size: 22px;
    line-height: 1.1;
    margin: 18px 0 10px;
  }
  html.integratd-ios-app .settings-card p {
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 12px;
  }
  html.integratd-ios-app .automations-page .inline-form,
  html.integratd-ios-app .users-page .inline-form,
  html.integratd-ios-app .tasks-page .task-filter-form,
  html.integratd-ios-app .tasks-page .task-create-form {
    gap: 8px;
    margin-bottom: 14px;
  }
  html.integratd-ios-app .automations-page .inline-form input,
  html.integratd-ios-app .automations-page .inline-form select,
  html.integratd-ios-app .users-page .inline-form input,
  html.integratd-ios-app .users-page .inline-form select,
  html.integratd-ios-app .tasks-page .task-filter-form input,
  html.integratd-ios-app .tasks-page .task-filter-form select,
  html.integratd-ios-app .tasks-page .task-create-form input,
  html.integratd-ios-app .tasks-page .task-create-form select,
  html.integratd-ios-app .tasks-page .task-create-form textarea,
  html.integratd-ios-app .tasks-page .task-status-form select {
    min-height: 42px;
    padding: 8px 10px;
  }
  html.integratd-ios-app .automations-page .inline-form button,
  html.integratd-ios-app .users-page .inline-form button,
  html.integratd-ios-app .tasks-page .task-filter-form button,
  html.integratd-ios-app .tasks-page .task-create-form button,
  html.integratd-ios-app .tasks-page .task-status-form button {
    min-height: 42px;
  }
  html.integratd-ios-app .tasks-page .task-board {
    gap: 10px;
    margin-top: 12px;
  }
  html.integratd-ios-app .tasks-page .task-group-header {
    padding: 10px;
  }
  html.integratd-ios-app .tasks-page .task-columns {
    grid-template-columns: 1fr;
    padding: 10px;
  }
  html.integratd-ios-app .tasks-page .task-card {
    padding: 10px;
  }
  html.integratd-ios-app .tasks-page .task-status-form {
    grid-template-columns: 1fr;
  }
  html.integratd-ios-app .automations-page .check {
    min-height: 42px;
  }
  html.integratd-ios-app .automations-page .check input {
    width: 24px;
    height: 24px;
  }
  html.integratd-ios-app .automations-page .table {
    border-spacing: 0 8px;
  }
  html.integratd-ios-app .automations-page .table td {
    min-height: 40px;
    padding: 9px 10px;
    font-size: 14px;
  }
  html.integratd-ios-app .automations-page .table td[data-label="Reply"] {
    max-height: 96px;
    overflow-y: auto;
  }
  html.integratd-ios-app .automations-page .table td[data-label="Actions"] {
    align-items: stretch;
    padding-bottom: 10px;
  }
  html.integratd-ios-app .automations-page .table td[data-label="Actions"]::before {
    flex-basis: 100%;
  }
  html.integratd-ios-app .automations-page .table td[data-label="Actions"] .inline {
    flex: 1 1 calc(50% - 4px);
  }
  html.integratd-ios-app .automations-page .table td[data-label="Actions"] button {
    min-height: 42px;
  }
  html.integratd-ios-app .users-page .table {
    border-spacing: 0 8px;
  }
  html.integratd-ios-app .users-page .table td[data-label="Actions"] {
    align-items: stretch;
  }
  html.integratd-ios-app .users-page .table td[data-label="Actions"]::before {
    flex-basis: 100%;
  }
  html.integratd-ios-app .users-page .table td[data-label="Actions"] .inline {
    flex: 1 1 100%;
  }
  .login-card h1 {
    font-size: 20px;
  }
  .login-field {
    font-size: 13px;
  }
  .login-card input,
  .login-action button {
    height: 52px;
    font-size: 15px;
  }
}
