/* Brand palette and type from samlyons.dev (src/styles/global.css). */
:root {
  color-scheme: light;
  --ink: #172b24;
  --paper: #f3f2ec;
  --white: #fffef9;
  --muted: #58645e;
  --line: #d2d7cc;
  --lime: #ddf36b;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Aptos, "Segoe UI", Arial, sans-serif;
  --tint: #e7ebdf;
  --soft: #f7f7ef;
  --focus: #52722c;
  --white-muted: #c6d2c6;
  --dark-line: #3e5549;
  --radius: 5px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 100%;
  line-height: 1.5;
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }

h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 {
  font-weight: 550;
  line-height: 1.13;
  letter-spacing: -.035em;
}
h1 { font-size: clamp(2.25rem, 4.4vw, 3.55rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.12rem; }
p + p { margin-top: .65rem; }
a { color: inherit; text-underline-offset: .24em; }
img { max-width: 100%; display: block; }
.muted { font-size: .9rem; color: var(--muted); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  z-index: 3;
  inset: .75rem auto auto .75rem;
  padding: .75rem 1rem;
  background: var(--lime);
  color: var(--ink);
  transform: translateY(calc(-100% - 1rem));
}
.skip-link:focus { transform: none; }

button, input, select, textarea { font: inherit; }
button {
  min-height: 44px;
  max-width: 100%;
  padding: .6rem 1rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--white);
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.3;
  cursor: pointer;
}
button:hover:enabled { background: #2b4d40; }
button:disabled { opacity: .55; cursor: not-allowed; }
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.accent-button {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--ink);
}
.accent-button:hover:enabled { background: #eafa91; }
.secondary, .compact-button, .sms-pager button {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
}
:is(.secondary, .compact-button, .sms-pager button):hover:enabled { background: var(--tint); }
.compact-button { padding-inline: .72rem; }
button + button { margin-inline-start: .4rem; }
input:not([type="checkbox"]), select, textarea {
  min-height: 44px;
  min-width: 0;
  max-width: 100%;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--white);
  color: var(--ink);
}
textarea { width: 100%; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: var(--ink);
  flex: none;
}
label {
  display: block;
  margin-bottom: .32rem;
  font-size: .875rem;
  font-weight: 650;
}
label:has(input[type="checkbox"]) {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  width: fit-content;
  font-weight: 500;
}
label:has(input[type="checkbox"]) input { margin-top: .12rem; }
summary { cursor: pointer; font-weight: 650; }
pre {
  margin-block: .75rem;
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  font: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Sign-in and password setup */
.login { min-height: 100dvh; }
.site-header { border-bottom: 1px solid var(--line); }
.site-header-inner {
  width: min(77.5rem, calc(100% - 2 * clamp(1rem, 5vw, 3rem)));
  min-height: 84px;
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: inherit;
  text-decoration: none;
  font-size: 1.36rem;
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -.025em;
}
.brand img { flex: none; object-fit: contain; }
.site-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  font-size: .875rem;
  font-weight: 650;
}
.site-link:hover { color: #395f4f; }
.login-layout {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  align-items: stretch;
  width: min(64rem, calc(100% - 2 * clamp(1rem, 5vw, 3rem)));
  margin: clamp(1.5rem, 9vh, 6rem) auto 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 12px 42px #172b2410;
}
.login-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 29rem;
  padding: clamp(1.75rem, 5vw, 4rem);
  border-radius: calc(var(--radius) - 1px) 0 0 calc(var(--radius) - 1px);
  background: var(--ink);
  color: var(--white);
}
.login-intro h1 {
  margin-block: auto 1.2rem;
  font-size: clamp(2.7rem, 5.5vw, 4.8rem);
  letter-spacing: -.055em;
  overflow-wrap: anywhere;
}
.login-intro h1 em {
  display: block;
  color: #e0edbf;
  font-family: var(--serif);
  font-weight: 400;
}
.login-intro p {
  max-width: 28ch;
  color: var(--white-muted);
  font-size: 1.05rem;
}
.login-intro .staff-label {
  display: flex;
  align-items: center;
  gap: .52rem;
  margin-top: auto;
  padding-top: 2rem;
  font-size: .8rem;
}
.auth-panel {
  align-self: center;
  padding: clamp(1.5rem, 5vw, 3.6rem);
  min-width: 0;
}
.auth-panel h2 { margin-bottom: .45rem; font-size: clamp(1.8rem, 3.3vw, 2.4rem); }
.auth-panel form { margin-top: 1.5rem; }
.auth-panel input { width: 100%; margin-bottom: .95rem; }
.auth-panel button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 50px;
  margin-top: .5rem;
}

/* Workspace navigation and page layout */
#shell {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  min-height: 100dvh;
}
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  height: 100dvh;
  overflow: auto;
  padding: 1.65rem 1rem 1.1rem;
  background: var(--ink);
  color: var(--white);
}
.workspace-brand { padding: 0 .32rem; }
.workspace-brand > div { min-width: 0; overflow-wrap: anywhere; }
.workspace-brand small {
  display: block;
  margin-top: .42rem;
  color: var(--white-muted);
  font-size: .77rem;
  font-weight: 500;
  letter-spacing: 0;
}
.sidebar :focus-visible { outline-color: var(--lime); }
.workspace-nav {
  display: grid;
  gap: .22rem;
  padding-top: 1rem;
  border-top: 1px solid var(--dark-line);
}
.navigation-toggle { display: none; }
.workspace-nav button {
  margin: 0;
  padding-inline: .86rem;
  border-color: transparent;
  background: transparent;
  color: var(--white-muted);
  text-align: left;
}
.workspace-nav button:hover { background: #294338; color: var(--white); }
.workspace-nav button[aria-current="page"] {
  background: var(--lime);
  color: var(--ink);
  font-weight: 700;
}
.sidebar-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: auto;
  padding-top: .8rem;
  border-top: 1px solid var(--dark-line);
  color: var(--white-muted);
  font-size: .82rem;
}
.sidebar-foot a { padding: .65rem .4rem; }
.sidebar-foot a:hover { color: var(--white); }
#logout {
  background: transparent;
  color: var(--white);
  border-color: #80978a;
  padding-inline: .67rem;
  font-size: .82rem;
}
#logout:hover { background: #294338; }
.workspace-main {
  width: 100%;
  max-width: 94rem;
  min-width: 0;
  margin-inline: auto;
  padding: clamp(1.2rem, 3.2vw, 3rem);
  overflow-wrap: anywhere;
}
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .6rem 1rem;
  padding-block: .2rem 1.2rem;
  margin-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}
.line-status, .pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: .38rem .6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--tint);
  font-size: .875rem;
  font-weight: 650;
}
.line-status { font-variant-numeric: tabular-nums; }

/* Conversation list, thread, and customer history */
.inbox-grid {
  display: grid;
  grid-template-columns: minmax(15.5rem, 18.5rem) minmax(0, 1fr);
  align-items: start;
  gap: clamp(.9rem, 1.8vw, 1.5rem);
}
.contacts, .conversation, .integration, #activity-list:not(:empty), #calls-workspace > ul {
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.contacts, .conversation-head, .sms-composer, #customer-history {
  padding: clamp(.9rem, 1.65vw, 1.45rem);
}
.panel-heading, .conversation-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem 1rem;
}
.panel-heading { gap: .5rem; margin-bottom: 1rem; }
.contacts h2 { font-size: 1.2rem; }
.contacts > h2 { margin-bottom: .7rem; }
.contacts input[type="search"] {
  width: 100%;
  margin-bottom: .65rem;
  background: var(--soft);
}
.sms-filter-check { margin-bottom: 1rem; }
.contact-list {
  display: grid;
  align-content: start;
  gap: .28rem;
  max-height: 30rem;
  overflow: auto;
  scrollbar-width: thin;
}
.contact-list:empty { display: none; }
.contact, .contact + .contact {
  margin: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
  min-height: 57px;
  padding: .67rem .6rem;
  border: 1px solid transparent;
  border-inline-start: 3px solid transparent;
  background: transparent;
  color: var(--ink);
  text-align: start;
}
.contact:hover:enabled { background: var(--soft); }
.contact.selected, .contact.selected:hover:enabled {
  background: var(--tint);
  border-color: var(--line);
  border-inline-start-color: var(--focus);
}
.contact:focus-visible { outline-offset: -3px; }
.contact > :is(div, span) { min-width: 0; }
.contact b, .contact small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contact small { margin-top: .18rem; color: var(--muted); font-weight: 500; font-size: .8rem; }
#customer-search-help { margin-bottom: .65rem; }
#empty:empty { display: none; }
.sms-unread {
  flex: none;
  min-width: 1.5rem;
  padding: .18rem .35rem;
  border-radius: 1rem;
  background: var(--ink);
  color: var(--white);
  font-size: .75rem;
  text-align: center;
}
.panel-hint {
  margin-top: 1rem;
  padding-top: .7rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .875rem;
}
.panel-hint p { margin-top: .55rem; }
.history-hint { margin: 0 1.45rem 1.2rem; }
.conversation-head { border-bottom: 1px solid var(--line); }
.conversation-head > div { min-width: 0; }
.conversation-head h2 + p { margin-top: .24rem; }
.conversation-head p:empty { display: none; }
.sms-back { display: none; }
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .85rem;
  min-height: 24rem;
  padding: 2rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  text-align: center;
}
.empty-state h2 { font-size: 1.6rem; }
.empty-state p { max-width: 34ch; }
#sms-timeline {
  min-height: 7rem;
  max-height: max(12rem, 42vh);
  overflow-y: auto;
  background: var(--soft);
  padding: clamp(.9rem, 1.65vw, 1.45rem);
}
#sms-timeline:has(.message) { min-height: 12rem; }
.message {
  max-width: min(90%, 38rem);
  width: fit-content;
  margin-bottom: .9rem;
}
.message:last-child { margin-bottom: 0; }
.bubble {
  padding: .6rem .8rem;
  border: 1px solid var(--line);
  border-radius: 8px 8px 8px 2px;
  background: var(--white);
  font-size: .93rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message small { display: block; margin: .25rem .12rem 0; color: var(--muted); font-size: .8rem; }
.message.outbound { margin-inline-start: auto; }
.message.outbound .bubble { background: var(--tint); border-radius: 8px 8px 2px 8px; }
.message.outbound small { text-align: end; }
.sms-pictures { margin-top: .5rem; }
.sms-pictures img {
  max-width: min(100%, 30rem);
  max-height: 25rem;
  margin-top: .5rem;
  border-radius: var(--radius);
  object-fit: contain;
}
.sms-composer { border-top: 1px solid var(--line); }
.sms-composer > :is(input, textarea) { width: 100%; margin-bottom: .85rem; }
.sms-consent { margin-bottom: .9rem; }
#sms-setup { margin: .6rem 1rem; }
.sms-pager {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .75rem;
  color: var(--muted);
  font-size: .8rem;
}
.sms-pager button { margin: 0; padding-inline: .55rem; font-size: .8rem; }
#sms-history-pager {
  margin: 0;
  padding: .55rem clamp(.9rem, 1.65vw, 1.45rem);
  border-bottom: 1px solid var(--line);
}
#customer-history { display: grid; gap: .85rem; }
#customer-history:empty { min-height: 4rem; }
.history-source {
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}
.history-source h3, .history-source p { margin-bottom: .55rem; }
.history-source p:last-child { margin-bottom: 0; }
.history-source ul { margin: .35rem 0; padding-inline-start: 1.15rem; }
.history-source li { padding-block: .27rem; }
.history-source small { display: block; margin-top: .23rem; color: var(--muted); }
.customer-profile form { display: grid; gap: .35rem; max-width: 28rem; }
.customer-profile form input { margin-bottom: .55rem; }
.profile-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.profile-actions button { margin-inline-start: 0; }
#customer-data-request[open] summary { margin-bottom: .75rem; }
#customer-data-request [role="status"] { margin-top: .75rem; }
.note {
  margin-top: 1rem;
  padding: .8rem;
  background: var(--tint);
  border-inline-start: 3px solid var(--focus);
  font-size: .875rem;
}
.note p { margin-top: .4rem; }

/* Scheduling, Zoho, calls, activity, and connections */
.alternate { max-width: 70rem; }
.alternate > h2 { margin-bottom: .45rem; }
.alternate > .muted { margin-bottom: 1rem; }
.integration { padding: clamp(.95rem, 2vw, 1.5rem); }
.integration + .integration { margin-top: .85rem; }
.integration :is(h2, h3, h4, p) + p { margin-top: .5rem; }
.integration > :is(button, form, details, ul, dl, div:not(:empty)) { margin-top: .75rem; }
.integration > p + button { margin-top: .8rem; }
.integration .pill { margin-inline-start: .55rem; }
.integration small { display: block; margin-top: .5rem; color: var(--muted); }
.integration :where(ul, ol) { padding-inline-start: 1.3rem; }
.integration :where(ul, ol) li + li { margin-top: .36rem; }
.integration form { display: grid; gap: .6rem; max-width: 38rem; }
.integration form button { justify-self: start; }
.integration form label { margin-bottom: .4rem; }
.integration label :is(input:not([type="checkbox"]), select, textarea) {
  display: block;
  width: 100%;
  margin-top: .32rem;
}
.integration details {
  border-top: 1px solid var(--line);
  padding-top: .65rem;
}
.integration details[open] summary { margin-bottom: .55rem; }
.workspace-tools { margin-top: 1.4rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.workspace-tools > summary { padding-block: .5rem; }
.workspace-tools[open] > summary { margin-bottom: .6rem; }
#workspace-tool-panels { display: grid; gap: .85rem; }
#workspace-tool-panels > .integration { margin: 0; }
#event-list, #zoho-workspace, #integration-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: .85rem;
}
:is(#event-list, #zoho-workspace, #integration-list) > .integration { margin: 0; }
#event-list { margin-bottom: 1.8rem; }
#event-list a { font-weight: 650; }
#calls-workspace > :is(button, ul, p, .integration) + * { margin-top: .85rem; }
#calls-workspace > ul { padding: .35rem 1rem; list-style: none; }
#calls-workspace > ul > li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  padding: .7rem 0;
}
#calls-workspace > ul > li + li { border-top: 1px solid var(--line); }
.call-summary-copy {
  margin-block: .7rem;
  padding: .85rem;
  background: var(--soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.activity-row, #activity-list > p { padding: .9rem 1.1rem; }
.activity-row + .activity-row { border-top: 1px solid var(--line); }
#integrations-view > .integration:last-of-type { margin-bottom: .85rem; }
dt { margin-top: .65rem; color: var(--muted); font-size: .84rem; font-weight: 650; }
dd { margin: .14rem 0 .4rem; }
#status {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  position: fixed;
  z-index: 2;
  bottom: max(1rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(32rem, calc(100% - 2rem));
  padding: .78rem 1rem;
  border: 1px solid var(--dark-line);
  border-radius: var(--radius);
  background: var(--ink);
  box-shadow: 0 5px 20px #172b2430;
  color: var(--white);
  font-size: .875rem;
  overflow-wrap: anywhere;
}
#status-message { flex: 1; min-width: 0; align-self: center; }
#status-dismiss {
  flex: none;
  padding-inline: .6rem;
  border-color: #80978a;
  background: transparent;
  color: var(--white);
  font-size: .8rem;
}
#status-dismiss:hover { background: #294338; }
#status-dismiss:focus-visible { outline-color: var(--lime); }

@media (max-width: 56rem) {
  #shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    height: auto;
    gap: .8rem;
    padding: .9rem clamp(.9rem, 3.2vw, 1.4rem);
    overflow: visible;
  }
  .workspace-brand { padding: 0; }
  .navigation-toggle {
    display: block;
    align-self: center;
    background: transparent;
    border-color: #80978a;
    color: var(--white);
  }
  .navigation-toggle:hover:enabled { background: #294338; }
  .workspace-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    gap: .2rem;
    padding-top: .62rem;
  }
  .workspace-nav:not(.is-open) { display: none; }
  .workspace-nav button { padding-inline: .65rem; }
  .sidebar-foot {
    display: none;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .sidebar:has(.workspace-nav.is-open) .sidebar-foot {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 3;
  }
}
@media (max-width: 44rem) {
  .site-header-inner { min-height: 68px; }
  .login-layout, .inbox-grid, #event-list, #zoho-workspace, #integration-list { grid-template-columns: minmax(0, 1fr); }
  .login-intro {
    min-height: auto;
    padding: 1.35rem;
    border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  }
  .login-intro h1 { margin: 0 0 .55rem; font-size: clamp(2.15rem, 8vw, 3.55rem); }
  .login-intro h1 em { display: inline; }
  .login-intro p { max-width: 40ch; font-size: .95rem; }
  .login-intro .staff-label { padding-top: .7rem; }
  .auth-panel { padding: 1.35rem; }
  .auth-panel form { margin-top: 1rem; }
  .workspace-main { padding: .95rem; }
  .view-header { padding-block: .05rem .75rem; margin-bottom: .9rem; }
  .contact-list { max-height: 10.75rem; }
  #sms-start { display: none; }
  #sms-view[data-panel="thread"] > .contacts { display: none; }
  #sms-view[data-panel="list"] > .conversation { display: none; }
  #sms-view[data-panel="list"] .contact-list { max-height: 55vh; }
  .sms-back {
    display: inline-flex;
    margin: .8rem .9rem 0;
    width: fit-content;
  }
  .message { max-width: 96%; }
}
@media (max-width: 25rem) {
  .sidebar-foot a { display: none; }
  .workspace-brand { font-size: 1.14rem; }
  .workspace-brand img { width: 48px; height: 48px; }
  .workspace-nav button { padding-inline: .55rem; }
}
