:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --canvas: #f5f7f6;
  --surface: #ffffff;
  --surface-subtle: #f8faf9;
  --sidebar: #fbfcfb;
  --text: #172520;
  --text-soft: #52635d;
  --text-muted: #75837e;
  --border: #dfe6e2;
  --border-strong: #cbd7d1;
  --brand: #285b4a;
  --brand-hover: #204c3e;
  --brand-soft: #eaf2ee;
  --success: #2d6a4f;
  --success-soft: #eaf5ef;
  --danger: #a33b36;
  --danger-soft: #f9eeee;
  --focus: #7cae9b;
  --shadow: 0 1px 2px rgb(18 42 33 / 5%), 0 10px 30px rgb(18 42 33 / 4%);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --control-height: 44px;
  --page-width: 1240px;
  color: var(--text);
  background: var(--canvas);
  font-size: 15px;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  overflow-x: hidden;
}

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

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 58%, transparent);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin-block-start: 0;
}

h1,
h2,
h3 {
  color: var(--text);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

h1 {
  margin-block-end: 10px;
  font-size: clamp(2rem, 3vw, 2.75rem);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.045em;
}

h2 {
  margin-block-end: 8px;
  font-size: 1.1rem;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.018em;
}

h3 {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 650;
  line-height: 1.4;
}

[hidden] {
  display: none !important;
}

.icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.small-label,
.eyebrow {
  display: block;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.095em;
  line-height: 1.3;
  text-transform: uppercase;
}

.eyebrow {
  margin-block-end: 14px;
}

.muted {
  color: var(--text-muted);
}

.skip-link {
  position: fixed;
  z-index: 100;
  inset-block-start: 10px;
  inset-inline-start: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--brand);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.brand {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
  white-space: nowrap;
}

.brand img {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
}

.primary,
.secondary,
.danger-button {
  min-height: var(--control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.primary {
  color: #fff;
  background: var(--brand);
}

.primary:hover:not(:disabled) {
  background: var(--brand-hover);
  transform: translateY(-1px);
}

.secondary {
  color: var(--text-soft);
  background: var(--surface);
  border-color: var(--border-strong);
}

.secondary:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface-subtle);
}

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

.danger-button:hover:not(:disabled) {
  background: var(--danger-soft);
}

.full {
  width: 100%;
  justify-content: space-between;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  flex: 0 0 36px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  background: var(--surface);
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.icon-button:hover:not(:disabled) {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: #c8dacf;
}

.loading {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 32px;
  text-align: center;
}

.loading h1 {
  font-size: 1.5rem;
}

.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(500px, 1.18fr);
  background: var(--surface);
}

.login-story {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(34px, 4.5vw, 68px);
  color: #315349;
  background: #edf3f0;
  border-inline-end: 1px solid #dde8e2;
}

.login-story::before,
.login-story::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid rgb(50 102 82 / 12%);
  border-radius: 50%;
}

.login-story::before {
  width: 360px;
  height: 360px;
  inset-block-end: -210px;
  inset-inline-end: -120px;
}

.login-story::after {
  width: 250px;
  height: 250px;
  inset-block-end: -155px;
  inset-inline-end: -65px;
}

.story-copy {
  position: relative;
  z-index: 1;
  max-width: 550px;
  margin-block: auto;
  padding-block: 72px;
}

.story-copy h1 {
  max-width: 10ch;
  margin-block-end: 22px;
  color: #21483b;
  font-size: clamp(2.8rem, 5.2vw, 5.3rem);
  font-weight: 560;
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.story-copy p {
  max-width: 46ch;
  margin: 0;
  color: #587067;
  font-size: 1rem;
  line-height: 1.75;
}

.story-status {
  position: relative;
  z-index: 1;
  display: flex;
  max-width: 490px;
  align-items: center;
  gap: 12px;
  color: #667a73;
  font-size: 0.76rem;
}

.login-panel {
  position: relative;
  min-width: 0;
  display: grid;
  place-items: center;
  padding: clamp(32px, 6vw, 88px);
  background: var(--surface);
}

.login-toolbar {
  position: absolute;
  inset-block-start: 30px;
  inset-inline-end: 36px;
}

.login-form-wrap {
  width: min(100%, 420px);
  padding-block: 70px 30px;
}

.login-form-wrap h2 {
  margin-block-end: 8px;
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.login-form-wrap > p {
  margin-block-end: 30px;
  line-height: 1.65;
}

.login-form-wrap form {
  display: grid;
}

label {
  display: block;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 650;
}

input:not([type="checkbox"]),
select,
textarea {
  width: 100%;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

input:not([type="checkbox"]),
select {
  min-height: var(--control-height);
  padding: 9px 12px;
}

textarea {
  min-height: 96px;
  padding: 11px 12px;
  line-height: 1.6;
  resize: vertical;
}

input:hover:not(:disabled),
select:hover:not(:disabled),
textarea:hover:not(:disabled) {
  border-color: #b8c8c0;
}

input::placeholder,
textarea::placeholder {
  color: #98a49f;
}

.login-form-wrap input {
  margin-block: 7px 18px;
}

.login-form-wrap #password {
  margin-block-end: 0;
}

.login-note {
  margin: 20px 0 0;
  color: var(--text-muted);
  font-size: 0.76rem;
  text-align: center;
}

.form-message {
  min-height: 21px;
  margin: 10px 0;
  color: var(--success);
  font-size: 0.8rem;
  line-height: 1.5;
}

.error {
  color: var(--danger) !important;
}

.language-select {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.language-select select {
  width: auto;
  min-width: 118px;
  min-height: 38px;
  padding-block: 6px;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.workspace {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  z-index: 10;
  inset-block-start: 0;
  height: 100vh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 30px 20px 22px;
  background: var(--sidebar);
  border-inline-end: 1px solid var(--border);
}

.sidebar .brand {
  margin: 2px 10px 48px;
}

.sidebar nav {
  display: grid;
  gap: 5px;
}

.sidebar nav a {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  color: #687872;
  font-size: 0.86rem;
  font-weight: 550;
  transition: color 150ms ease, background-color 150ms ease;
}

.sidebar nav a:hover {
  color: var(--text);
  background: #f0f4f2;
}

.sidebar nav a[aria-current="page"] {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 680;
}

.workspace-account {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 0 10px;
  align-items: center;
  margin-block-start: auto;
  padding-block-start: 20px;
  border-block-start: 1px solid var(--border);
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  grid-row: span 2;
  place-items: center;
  border-radius: 10px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 0.82rem;
  font-weight: 750;
}

.account-copy {
  min-width: 0;
  align-self: end;
}

.account-copy strong,
.account-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy strong {
  font-size: 0.78rem;
  font-weight: 650;
}

.account-copy span {
  margin-block-start: 2px;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.workspace-account .logout {
  width: auto;
  height: auto;
  grid-column: 2;
  justify-self: start;
  display: inline-flex;
  gap: 6px;
  margin-block-start: 6px;
  padding: 4px 0;
  border: 0;
  color: var(--text-muted);
  background: transparent;
  font-size: 0.72rem;
  white-space: nowrap;
}

.workspace-account .logout .icon {
  width: 15px;
  height: 15px;
}

.main-area {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 68px;
  display: flex;
  flex: 0 0 68px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-inline: clamp(24px, 4vw, 52px);
  color: var(--text-muted);
  background: rgb(255 255 255 / 78%);
  border-block-end: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.breadcrumb {
  overflow: hidden;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumb > span {
  margin-inline: 7px;
  color: #a4afaa;
}

.breadcrumb strong {
  color: var(--text-soft);
  font-weight: 650;
}

.content {
  width: min(100%, var(--page-width));
  min-width: 0;
  flex: 1;
  margin-inline: auto;
  padding: clamp(34px, 5vw, 64px) clamp(24px, 4vw, 52px) 64px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-block-end: 34px;
}

.page-heading > div {
  max-width: 720px;
}

.page-heading p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.7;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.merchant-summary {
  min-width: 0;
  display: grid;
  gap: 2px;
  margin-inline-start: auto;
  color: var(--text-muted);
  font-size: 0.74rem;
}

.merchant-summary strong {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-button {
  width: max-content;
  padding: 2px 0;
  border: 0;
  color: var(--brand);
  background: transparent;
  font-size: 0.76rem;
  font-weight: 650;
  text-align: start;
}

.text-button:hover {
  color: var(--brand-hover);
  text-decoration: underline;
}

.industry-onboarding {
  min-height: 100vh;
  padding: clamp(22px, 4vw, 56px);
  background: linear-gradient(145deg, #edf3f0 0%, var(--canvas) 48%, #f8faf9 100%);
}

.onboarding-toolbar {
  width: min(100%, 1000px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-inline: auto;
}

.industry-card {
  width: min(100%, 760px);
  margin: clamp(48px, 11vh, 112px) auto 40px;
  padding: clamp(26px, 5vw, 48px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.industry-card > p {
  max-width: 62ch;
  margin-block-end: 28px;
  color: var(--text-soft);
  line-height: 1.7;
}

.industry-card form {
  display: grid;
  gap: 20px;
}

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

.industry-option {
  min-width: 0;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  background: var(--surface);
  font-weight: 600;
  text-align: start;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.industry-option:hover,
.industry-option.selected {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.import-preview {
  margin-block-start: 20px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.import-preview h2,
.import-preview h3 {
  margin-block-end: 8px;
}

.import-preview > p {
  color: var(--text-soft);
}

.import-errors {
  max-height: 320px;
  overflow: auto;
  margin: 0 0 18px;
  padding-inline-start: 22px;
  color: var(--danger);
}

.import-errors li + li {
  margin-block-start: 5px;
}

.merchant-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-block-end: 22px;
  padding: 0 2px 20px;
  border-block-end: 1px solid var(--border);
}

.merchant-heading h2 {
  margin: 7px 0 0;
  font-size: 1.35rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 680;
  line-height: 1.45;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.badge.positive {
  color: var(--success);
  background: var(--success-soft);
}

.badge.neutral {
  color: #718079;
  background: #eef1ef;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.overview-card {
  min-width: 0;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(18 42 33 / 3%);
}

.card-icon,
.channel-icon,
.empty-icon {
  display: grid;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
}

.card-icon {
  width: 38px;
  height: 38px;
  margin-block-end: 24px;
  border-radius: 10px;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-top h2 {
  min-width: 0;
  font-size: 0.94rem;
}

.metric {
  color: var(--brand);
  font-size: 1.65rem;
  font-weight: 650;
  line-height: 1;
}

.overview-card > p {
  margin-block: 12px 20px;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.65;
}

.overview-card .channel-number {
  color: var(--text);
  font-size: 1rem;
  font-weight: 620;
  overflow-wrap: anywhere;
}

.text-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-block-start: auto;
  padding-block-start: 15px;
  color: var(--brand);
  border-block-start: 1px solid #edf1ef;
  font-size: 0.78rem;
  font-weight: 650;
}

.text-link .icon {
  width: 16px;
  height: 16px;
  transition: transform 150ms ease;
}

.text-link:hover .icon {
  transform: translateX(2px);
}

.handoff-card {
  background: var(--surface-subtle);
}

.connection-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.connection-hero {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: clamp(24px, 4vw, 38px);
  background: var(--surface-subtle);
  border-block-end: 1px solid var(--border);
}

.channel-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
}

.channel-icon .icon {
  width: 25px;
  height: 25px;
}

.large-number {
  margin: 7px 0 2px;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 620;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.connection-hero p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  padding: 6px clamp(24px, 4vw, 38px);
}

.details > div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding-block: 20px;
}

.details > div + div {
  margin-inline-start: 30px;
  padding-inline-start: 30px;
  border-inline-start: 1px solid var(--border);
}

.details dt {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.details dd {
  min-width: 0;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 620;
  overflow-wrap: anywhere;
  text-align: end;
}

.handoff-note {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin: 0 clamp(24px, 4vw, 38px) clamp(24px, 4vw, 38px);
  padding: 18px;
  border-radius: var(--radius-md);
  color: #587067;
  background: var(--brand-soft);
}

.handoff-note > .icon {
  margin-block-start: 1px;
}

.handoff-note strong {
  color: #355d50;
  font-size: 0.82rem;
}

.handoff-note p {
  margin: 4px 0 0;
  font-size: 0.76rem;
  line-height: 1.6;
}

.owner-note:empty {
  display: none;
}

.owner-note {
  margin: -14px 0 22px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: #765e35;
  background: #faf5e9;
  font-size: 0.78rem;
}

.manager-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.56fr);
  gap: 20px;
  align-items: start;
}

.manager-layout:has(> .editor-card[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}

.records-panel {
  min-width: 0;
}

.record-list {
  display: grid;
  gap: 8px;
}

.record {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(200px, 1.25fr) minmax(150px, 0.75fr) auto;
  grid-auto-flow: row;
  align-items: center;
  gap: 6px 20px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.record:hover {
  border-color: var(--border-strong);
  box-shadow: 0 3px 12px rgb(18 42 33 / 4%);
}

.record-header {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.record-header h3 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.record-meta,
.record-description,
.keywords {
  min-width: 0;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.record-meta {
  grid-column: 2;
}

.record-description,
.keywords {
  grid-column: 1 / 3;
}

.record-description:empty,
.keywords:empty {
  display: none;
}

.record-actions {
  display: flex;
  grid-column: 3;
  grid-row: 1 / span 3;
  align-items: center;
  gap: 6px;
}

.record-actions .icon-button {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
}

.record-actions .icon {
  width: 16px;
  height: 16px;
}

.editor-card {
  position: sticky;
  inset-block-start: 88px;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.editor-heading {
  padding-block-end: 17px;
  border-block-end: 1px solid var(--border);
}

.editor-heading h2 {
  margin: 6px 0 0;
  font-size: 1.2rem;
}

.editor-card form {
  display: grid;
  gap: 16px;
  padding-block-start: 18px;
}

.editor-card label > input:not([type="checkbox"]),
.editor-card label > textarea {
  margin-block-start: 7px;
}

.field-hint {
  display: block;
  margin-block-start: 5px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 450;
}

.keyword-field {
  display: grid;
  gap: 7px;
}

.keyword-field > label {
  font-size: 0.78rem;
  font-weight: 650;
}

.keyword-composer {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
}

.keyword-composer:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(31 121 99 / 14%);
}

.keyword-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.keyword-tags:empty {
  display: none;
}

.keyword-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  min-height: 30px;
  padding: 4px 7px 4px 9px;
  border: 1px solid #a8d7c8;
  border-radius: 999px;
  color: #245f51;
  background: var(--brand-soft);
  font-size: 0.76rem;
  font-weight: 650;
}

.keyword-tag > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keyword-tag .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.keyword-entry-row {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.keyword-entry-row input {
  min-width: 0;
  margin: 0;
}

.keyword-add {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--brand-dark);
  background: #fff;
  font-weight: 650;
}

.keyword-add .icon {
  width: 16px;
  height: 16px;
}

.keyword-helper,
.keyword-notice,
.keyword-warning {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.73rem;
  line-height: 1.5;
}

.keyword-warning {
  padding: 8px 10px;
  border-inline-start: 3px solid #d89c39;
  color: #77551a;
  background: #fff8e8;
}

.keyword-example {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-inline-start: 3px solid #88c7b5;
  color: var(--text-muted);
  background: #f3faf7;
  font-size: 0.74rem;
}

.keyword-example p,
.keyword-example strong {
  margin: 0;
}

.keyword-example p {
  color: var(--text);
}

.keyword-example strong {
  color: var(--brand-dark);
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
}

.check input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--brand);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.form-actions .danger-button {
  margin-inline-start: auto;
}

.preview {
  margin-block-start: 20px;
  padding-block-start: 18px;
  border-block-start: 1px solid var(--border);
}

.message-bubble {
  margin: 10px 0 0;
  padding: 13px 14px;
  color: #35594d;
  background: var(--brand-soft);
  border-radius: 4px var(--radius-md) var(--radius-md) var(--radius-md);
  font-size: 0.78rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.empty {
  display: grid;
  justify-items: center;
  padding: 48px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: rgb(255 255 255 / 46%);
  text-align: center;
}

.empty-icon {
  width: 42px;
  height: 42px;
  margin-block-end: 13px;
  border-radius: 12px;
}

.empty p {
  margin: 0;
  font-size: 0.82rem;
}

.workspace-message {
  position: fixed;
  z-index: 50;
  inset-block-start: 82px;
  inset-inline-end: 24px;
  max-width: min(360px, calc(100vw - 48px));
  margin: 0;
  padding: 11px 14px;
  border: 1px solid #cfe0d7;
  border-radius: var(--radius-sm);
  color: var(--success);
  background: var(--success-soft);
  box-shadow: var(--shadow);
  font-size: 0.8rem;
}

.workspace-message.error {
  border-color: #efd5d3;
  background: var(--danger-soft);
}

html[dir="rtl"] .text-link .icon,
html[dir="rtl"] .primary .icon:last-child {
  transform: scaleX(-1);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.public-link {
  margin-block-start: 18px;
}

.account-state {
  min-height: 100vh;
  padding: clamp(22px, 4vw, 56px);
  background: linear-gradient(145deg, #edf3f0 0%, var(--canvas) 48%, #f8faf9 100%);
}

.state-card {
  width: min(100%, 680px);
  margin: clamp(48px, 14vh, 128px) auto 40px;
  padding: clamp(26px, 5vw, 48px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.state-card > p {
  max-width: 62ch;
  color: var(--text-soft);
  line-height: 1.7;
}

.admin-page {
  min-height: 100vh;
  padding: 22px clamp(18px, 4vw, 56px) 48px;
  background: var(--canvas);
}

.admin-topbar {
  width: min(100%, var(--page-width));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-inline: auto;
}

.admin-tools,
.admin-filters,
.admin-actions,
.admin-access-control,
.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-content {
  width: min(100%, var(--page-width));
  margin: 56px auto 0;
}

.admin-filters {
  margin-block-end: 16px;
}

.admin-filters > select,
.admin-search input,
.admin-access-control select,
.admin-access-control input {
  min-height: var(--control-height);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface);
}

.admin-filters > select,
.admin-access-control select,
.admin-access-control input {
  padding-inline: 10px;
}

.admin-search {
  flex: 1 1 280px;
}

.admin-search input {
  width: 100%;
  padding-inline: 12px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  align-items: start;
  gap: 20px;
}

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

.admin-merchant,
.admin-detail {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-merchant {
  content-visibility: auto;
  contain-intrinsic-size: auto 180px;
}

.admin-merchant h2,
.admin-detail h2 {
  overflow-wrap: anywhere;
}

.admin-phone,
.admin-meta {
  margin-block: 4px 0;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}

.admin-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-block: 12px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.admin-merchant > .secondary {
  margin-block-start: 16px;
}

.admin-detail {
  position: sticky;
  inset-block-start: 20px;
}

.admin-facts {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.admin-facts div {
  display: grid;
  grid-template-columns: minmax(96px, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
}

.admin-facts dt {
  color: var(--text-muted);
}

.admin-facts dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.admin-access-control {
  align-items: flex-end;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.admin-access-control > span {
  flex: 1 0 100%;
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 650;
}

.admin-channel {
  margin-block-start: 24px;
  padding-block-start: 20px;
  border-block-start: 1px solid var(--border);
}

.admin-channel h3 {
  margin: 0;
  font-size: 1rem;
}

.admin-channel-empty,
.admin-channel-note {
  color: var(--text-soft);
  line-height: 1.55;
}

.admin-channel-form {
  display: grid;
  gap: 12px;
  margin-block-start: 16px;
}

.admin-channel-form > label {
  display: grid;
  gap: 6px;
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 650;
}

.admin-channel-form input,
.admin-channel-form select {
  min-height: var(--control-height);
  padding-inline: 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface);
}

.admin-channel-form select:disabled {
  color: var(--text-soft);
  cursor: not-allowed;
}

.admin-channel-form input[name="wabaPhoneNumber"] {
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
}

.admin-channel-actions {
  margin-block-start: 16px;
}

.admin-channel-note {
  margin-block: 12px 0;
  font-size: 0.82rem;
}

@media (max-width: 840px) {
  .admin-page {
    padding: 18px;
  }

  .admin-topbar,
  .admin-tools {
    align-items: flex-start;
  }

  .admin-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-detail {
    position: static;
  }
}

@media (max-width: 520px) {
  .admin-topbar {
    flex-wrap: wrap;
  }

  .admin-tools,
  .admin-tools > * {
    width: 100%;
  }

  .admin-filters,
  .admin-access-control {
    align-items: stretch;
  }

  .admin-filters > select,
  .admin-search,
  .admin-access-control select,
  .admin-access-control input,
  .admin-access-control button {
    width: 100%;
  }

  .admin-channel-actions > * {
    width: 100%;
  }
}

html[dir="rtl"] .text-link:hover .icon {
  transform: scaleX(-1) translateX(2px);
}

html[dir="rtl"] .channel-number,
html[dir="rtl"] .large-number {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: right;
}

html[dir="rtl"] #country-code,
html[dir="rtl"] #local-phone {
  direction: ltr;
  text-align: right;
}

@media (max-width: 1180px) {
  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-card {
    min-height: 220px;
  }

  .manager-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  }

  .record {
    grid-template-columns: minmax(170px, 1fr) auto;
  }

  .record-meta,
  .record-description,
  .keywords {
    grid-column: 1;
  }

  .record-actions {
    grid-column: 2;
  }
}

@media (max-width: 900px) {
  .login-layout {
    grid-template-columns: minmax(300px, 0.72fr) minmax(440px, 1fr);
  }

  .workspace {
    display: flex;
    flex-direction: column;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px 24px;
    padding: 17px 22px 12px;
    border-inline-end: 0;
    border-block-end: 1px solid var(--border);
  }

  .sidebar .brand {
    margin: 0;
    align-self: center;
  }

  .sidebar nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .sidebar nav a {
    flex: 1 0 max-content;
    justify-content: center;
    min-width: 116px;
    padding: 9px 12px;
  }

  .workspace-account {
    grid-template-columns: 34px minmax(80px, 150px) 36px;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .avatar {
    width: 34px;
    height: 34px;
    grid-row: auto;
  }

  .account-copy {
    align-self: center;
  }

  .workspace-account .logout {
    width: 36px;
    height: 36px;
    grid-column: 3;
    justify-self: end;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border);
  }

  .workspace-account .logout span {
    display: none;
  }

  .topbar {
    height: 60px;
    flex-basis: 60px;
  }

  .manager-layout {
    grid-template-columns: 1fr;
  }

  .editor-card {
    position: static;
  }
}

@media (max-width: 760px) {
  .login-layout {
    display: block;
    background: #edf3f0;
  }

  .login-story {
    min-height: 98px;
    display: block;
    padding: 25px 24px;
    border: 0;
  }

  .story-copy,
  .story-status,
  .login-story::before,
  .login-story::after {
    display: none;
  }

  .login-panel {
    min-height: calc(100vh - 98px);
    display: block;
    padding: 84px 24px 40px;
    border-radius: 24px 24px 0 0;
  }

  .login-toolbar {
    inset-block-start: 22px;
    inset-inline-end: 24px;
  }

  .login-form-wrap {
    max-width: 440px;
    margin-inline: auto;
    padding: 0;
  }

  .page-heading {
    align-items: flex-start;
  }

  .connection-hero {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .connection-hero > .badge {
    grid-column: 2;
    justify-self: start;
  }

  .details {
    grid-template-columns: 1fr;
  }

  .details > div + div {
    margin-inline-start: 0;
    padding-inline-start: 0;
    border-inline-start: 0;
    border-block-start: 1px solid var(--border);
  }
}

@media (max-width: 600px) {
  :root {
    font-size: 14px;
  }

  .sidebar {
    gap: 14px;
    padding-inline: 16px;
  }

  .sidebar .brand {
    font-size: 1.08rem;
  }

  .sidebar .brand img {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .workspace-account {
    grid-template-columns: 34px 36px;
  }

  .workspace-account .account-copy {
    display: none;
  }

  .workspace-account .logout {
    grid-column: 2;
  }

  .sidebar nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
  }

  .sidebar nav a {
    min-width: 0;
    flex-direction: column;
    gap: 4px;
    padding: 8px 3px;
    font-size: 0.7rem;
    line-height: 1.25;
    text-align: center;
  }

  .topbar {
    padding-inline: 18px;
  }

  .breadcrumb {
    display: none;
  }

  .topbar {
    justify-content: flex-end;
  }

  .language-select > span {
    display: none;
  }

  .language-select select {
    min-width: 112px;
  }

  .content {
    padding: 30px 18px max(42px, env(safe-area-inset-bottom));
  }

  h1 {
    font-size: 2rem;
  }

  .page-heading {
    flex-direction: column;
    gap: 18px;
    margin-block-end: 26px;
  }

  .page-heading .primary {
    width: 100%;
  }

  .page-actions {
    width: 100%;
    justify-content: stretch;
  }

  .page-actions > * {
    flex: 1 1 calc(50% - 4px);
  }

  .merchant-summary {
    margin-inline-start: 0;
  }

  .industry-onboarding {
    padding: 18px;
  }

  .onboarding-toolbar {
    align-items: flex-start;
  }

  .industry-card {
    margin-block-start: 42px;
    padding: 24px 20px;
  }

  .industry-options {
    grid-template-columns: 1fr;
  }

  .merchant-heading {
    align-items: flex-start;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .overview-card {
    min-height: 205px;
    padding: 20px;
  }

  .connection-card {
    border-radius: var(--radius-md);
  }

  .connection-hero {
    padding: 22px 18px;
  }

  .details {
    padding-inline: 18px;
  }

  .handoff-note {
    margin-inline: 18px;
    margin-block-end: 18px;
  }

  .record {
    display: block;
    padding: 16px;
  }

  .record-header {
    justify-content: space-between;
  }

  .record-meta,
  .record-description,
  .keywords {
    margin-block-start: 8px;
  }

  .record-actions {
    justify-content: flex-end;
    margin-block-start: 13px;
    padding-block-start: 12px;
    border-block-start: 1px solid var(--border);
  }

  .editor-card {
    padding: 18px;
  }

  .form-actions {
    align-items: stretch;
  }

  .form-actions .primary,
  .form-actions .secondary {
    flex: 1;
  }

  .form-actions .danger-button {
    width: 100%;
    margin-inline-start: 0;
  }

  .keyword-entry-row {
    align-items: stretch;
    flex-direction: column;
  }

  .keyword-add {
    width: 100%;
  }
}

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