/* app.linetappy.com: the same colours as linetappy.com and the app (brand blue #2B7BD6, signal red #E23A2E), light and dark. */
:root {
  --page: #f6f8fb;
  --surface: #ffffff;
  --ink: #15202b;
  --muted: #5b6776;
  --line: #dde3ea;
  --link: #2b7bd6;
  --accent: #e23a2e;
  --good: #1e9e5a;
  --tile: #eef3f8;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0e1117;
    --surface: #161e28;
    --ink: #e7ecf2;
    --muted: #9aa6b4;
    --line: #26303c;
    --link: #7db4f0;
    --good: #4cc98a;
    --tile: #1c2633;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  overflow-wrap: anywhere;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: var(--link); }
h1 { font-size: 26px; margin: 0 0 4px; line-height: 1.25; }
h2 { font-size: 20px; margin: 0 0 8px; }
h3 { font-size: 18px; margin: 0; }
p { margin: 8px 0; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.center { text-align: center; }
.loading-line { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.loading { text-align: center; color: #5b6776; padding: 80px 16px; font: 16px system-ui, sans-serif; }

header.site { border-bottom: 1px solid var(--line); background: var(--surface); }
header.site .wrap { display: flex; align-items: center; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; color: var(--ink); text-decoration: none; }
.brand img { width: 32px; height: 32px; }

main.wrap { padding-top: 24px; padding-bottom: 32px; }

footer.site { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; padding: 16px 0 32px; }
footer.site a { margin-right: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}
.card.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.card.quiet { background: transparent; border-style: dashed; }

.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

label { display: block; margin: 12px 0; font-weight: 600; }
input[type=email], input[type=password], input[type=url], input:not([type]), select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.row label select { display: inline-block; width: auto; margin: 0 6px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  font: 600 16px/1.2 inherit;
  font-family: inherit;
  color: #fff;
  background: var(--link);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
}
form .button, .narrow > .button, .button.wide { width: 100%; margin-top: 8px; }
.button:disabled { opacity: 0.5; cursor: default; }
.button.secondary { background: var(--tile); color: var(--ink); }
.button.google { background: var(--surface); color: var(--ink); border: 1px solid var(--line); width: 100%; margin-top: 12px; }
.button.google img { width: 18px; height: 18px; }
.button.danger { background: var(--accent); }
.button.playing { background: var(--link); color: #fff; font-variant-numeric: tabular-nums; }

.link { background: none; border: 0; padding: 4px 0; font: inherit; color: var(--link); cursor: pointer; text-decoration: underline; }
.link.danger { color: var(--accent); }
.links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 16px; }

.or { display: flex; align-items: center; gap: 12px; color: var(--muted); margin: 16px 0 4px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

.error { color: var(--accent); }
.notice { color: var(--good); }
.banner { background: var(--tile); border-radius: 12px; padding: 12px 16px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.notify-banner { margin: 8px 12px; align-items: center; font-size: 14px; }
.notify-banner .actions { display: flex; align-items: center; gap: 12px; }

.badge { padding: 4px 12px; border-radius: 999px; background: var(--tile); color: var(--muted); font-weight: 600; font-size: 14px; }
.badge.good { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.badge.bad { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.plan-line { font-size: 18px; }

.usage { display: flex; gap: 32px; margin: 12px 0 0; }
.usage dt { color: var(--muted); font-size: 14px; }
.usage dd { margin: 0; font-size: 20px; font-weight: 700; }

.toggle { display: inline-flex; background: var(--tile); border-radius: 999px; padding: 3px; }
.toggle button { border: 0; background: none; font: inherit; color: var(--ink); padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.toggle button.on { background: var(--link); color: #fff; }
.toggle small { opacity: 0.85; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 12px 0; }
.plan { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.plan .price { font-size: 22px; font-weight: 700; margin: 4px 0; }
.plan .button { margin-top: auto; }

.doc-links { display: grid; gap: 10px; margin: 16px 0; }
.doc-link { display: flex; justify-content: space-between; padding: 14px 16px; border-radius: 12px; background: var(--tile); text-decoration: none; font-weight: 600; }

.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 16px 0; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }

.points { padding-left: 20px; }
.points li { margin: 10px 0; }
.points li.warning { border: 2px solid var(--accent); border-radius: 12px; padding: 10px 12px; list-style-position: inside; margin-left: -20px; }
.points li.warning strong { color: var(--accent); }

.number-list { display: grid; gap: 4px; margin: 12px 0; }
.check.number { margin: 6px 0; }
.check.number .badge { margin-left: 8px; font-size: 12px; padding: 2px 8px; }
.number-setup { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.number-setup h2 { margin-bottom: 4px; }
fieldset { border: 0; padding: 0; margin: 12px 0; }
fieldset:disabled { opacity: 0.6; }
legend { font-weight: 600; margin-bottom: 4px; }
.radio { display: flex; gap: 10px; align-items: center; font-weight: 400; margin: 6px 0; }
.radio input { width: 18px; height: 18px; }

.greeting { margin: 12px 0; padding: 12px 14px; border-radius: 12px; background: var(--tile); }
.greeting h3 { font-size: 16px; margin-bottom: 4px; }
textarea { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; color: var(--ink);
  background: var(--page); border: 1px solid var(--line); border-radius: 10px; resize: vertical; }

.danger-zone { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
/* Support chat: a button in the corner, and a panel above it. */
.chat-fab { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; align-items: center; gap: 8px; border: 0;
  border-radius: 28px; padding: 12px 18px; background: var(--link); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.chat-fab svg { width: 22px; height: 22px; }
.chat-panel { position: fixed; right: 20px; bottom: 20px; z-index: 60; width: min(400px, calc(100vw - 24px)); height: min(620px, calc(100vh - 40px));
  display: flex; flex-direction: column; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .3); overflow: hidden; }
@media (max-width: 560px) { .chat-panel { right: 12px; bottom: 12px; height: calc(100vh - 24px); } }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-head h2 { font-size: 16px; margin: 0; flex: 1; }
.chat-head .tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; padding: 1px 8px; }
.chat-head button { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 4px 8px; }
.chat-note { margin: 0; padding: 8px 14px; font-size: 12px; color: var(--muted); background: var(--tile); }
.chat-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { max-width: 85%; padding: 8px 12px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; font-size: 14px; line-height: 1.4; }
.chat-msg.customer { align-self: flex-end; background: var(--link); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.customer a { color: #fff; }
.chat-msg.assistant { align-self: flex-start; background: var(--tile); border-bottom-left-radius: 4px; }
.chat-msg.notice { align-self: center; max-width: 95%; background: none; color: var(--muted); font-size: 13px; text-align: center; }
.chat-typing { align-self: flex-start; color: var(--muted); font-size: 13px; }
.chat-foot { border-top: 1px solid var(--line); padding: 10px 14px; display: grid; gap: 8px; }
.chat-foot .compose { display: flex; gap: 8px; align-items: flex-end; }
.chat-foot textarea { flex: 1; resize: none; font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--page); color: var(--ink); max-height: 120px; }
.chat-foot .small { font-size: 12px; }
/* The general form rules make buttons full width and give textareas a top margin; not in the chat's compose row. */
.chat-foot .compose textarea { margin-top: 0; min-width: 0; width: auto; }
.chat-foot .compose .button { width: auto; margin-top: 0; flex: none; }
.chat-warning { margin: 0; font-size: 12px; color: #b7791f; }

/* Delete my account: one highlighted box per consequence. */
.what-happens { border-left: 4px solid var(--line); background: var(--tile); border-radius: 10px; padding: 12px 16px; margin: 12px 0; }
.what-happens h2 { font-size: 16px; margin: 0 0 6px; }
.what-happens p { margin: 6px 0 0; }
.what-happens.info { border-left-color: var(--link); }
.what-happens.warn { border-left-color: #d69e2e; background: color-mix(in srgb, #d69e2e 10%, var(--tile)); }
.what-happens.danger { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--tile)); }
.what-happens.neutral { border-left-color: var(--muted); }
.confirm-delete { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; display: grid; gap: 10px; }

/* A small spinner inside a busy button. */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

.problem { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 12px 0;
  padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.problem p { margin: 0; color: var(--accent); }

/* ---------- Workspace (Messages, Account) ---------- */
main.wrap:has(.workspace) { max-width: 1200px; padding-top: 0; padding-bottom: 0; }
.workspace { display: grid; grid-template-columns: 96px 1fr; min-height: calc(100vh - 61px); }
.rail { display: flex; flex-direction: column; gap: 4px; padding: 12px 8px; border-right: 1px solid var(--line); }
.rail button { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; color: var(--muted);
  font: 600 12px/1.2 inherit; font-family: inherit; padding: 10px 4px; border-radius: 14px; cursor: pointer; }
.rail button svg { width: 24px; height: 24px; }
.rail button.on { background: var(--tile); color: var(--link); }
.workspace-main { min-width: 0; }
.account-scroll { padding: 20px 16px; max-width: 760px; }

.messages { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; height: calc(100vh - 61px); }
.thread-list { border-right: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; }
.list-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px; }
.chips { display: flex; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.chip.on { background: var(--link); border-color: var(--link); color: #fff; }
.filter-panel { margin: 0 12px 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.filter-panel .check { margin: 6px 0; }
.threads { list-style: none; margin: 0; padding: 0; }
.threads li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.threads li:hover { background: var(--tile); }
.threads li.selected { background: var(--tile); }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; background: #8e5bd6; color: #fff; display: grid; place-items: center; font-weight: 700; }
.thread-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.thread-top { display: flex; justify-content: space-between; gap: 8px; }
.snippet { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.threads li.unread .snippet { color: var(--ink); font-weight: 600; }
.tag { font-size: 12px; color: var(--muted); }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--link); }
.empty { padding: 32px 16px; }

.thread-pane { display: flex; flex-direction: column; min-width: 0; height: calc(100vh - 61px); }
.pane-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.pane-header h2 { margin: 0; font-size: 18px; }
.pane-header .back { display: none; }
.pane-empty { flex: 1; display: grid; place-items: center; }
.new-message { padding: 8px 16px; display: grid; gap: 4px; }
.bubbles { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 72%; padding: 8px 12px; border-radius: 16px; background: var(--tile); align-self: flex-start; }
.bubble.out { align-self: flex-end; background: var(--link); color: #fff; }
.bubble.failed { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--ink); }
.bubble p { margin: 0; white-space: pre-wrap; }
.bubble .meta { display: block; font-size: 11px; opacity: 0.75; margin-top: 2px; }
.photo { display: block; max-width: 260px; max-height: 320px; border-radius: 10px; margin-bottom: 4px; }
.photo-button { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; }
.viewer { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .92); display: flex; align-items: center;
  justify-content: center; padding: 64px 16px 16px; outline: none; }
.viewer > img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.viewer-bar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: flex-end;
  gap: 4px; padding: 10px 12px; color: #fff; }
.viewer-bar button { display: flex; align-items: center; gap: 6px; border: 0; border-radius: 20px; padding: 8px 12px;
  background: transparent; color: #fff; font: inherit; font-size: 14px; cursor: pointer; }
.viewer-bar button:hover { background: rgba(255, 255, 255, .14); }
.viewer-bar svg { width: 22px; height: 22px; }
.viewer-count { margin-right: auto; font-size: 14px; opacity: .8; }
.viewer-status { font-size: 14px; opacity: .85; margin-right: 8px; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.viewer-nav.prev { left: 12px; }
.viewer-nav.next { right: 12px; }
@media (max-width: 560px) { .viewer-bar button span { display: none; } .viewer-status { margin-right: auto; } }
.photo-loading { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 8px 0; }
.composer { border-top: 1px solid var(--line); padding: 10px 16px; }
.compose-row { display: flex; align-items: flex-end; gap: 8px; }
.compose-row textarea { margin: 0; flex: 1; }
.attach { margin: 0; cursor: pointer; padding: 8px; border-radius: 50%; color: var(--link); display: grid; place-items: center; }
.attach:hover { background: var(--tile); }
.attach svg { width: 24px; height: 24px; }
.attach input { display: none; }
.warning-line { margin: 0 0 8px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.attachment { position: relative; display: inline-block; margin-bottom: 8px; }
.attachment img { display: block; max-height: 96px; max-width: 160px; border-radius: 10px; border: 1px solid var(--line); }
.attachment .remove { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; border: 0;
  background: var(--ink); color: var(--page); font-size: 12px; cursor: pointer; }

@media (max-width: 720px) {
  .workspace { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .rail { flex-direction: row; justify-content: space-around; border-right: 0; border-top: 1px solid var(--line); order: 2; position: sticky; bottom: 0; background: var(--surface); }
  .rail button { flex-direction: row; gap: 6px; }
  .messages { grid-template-columns: 1fr; height: calc(100vh - 61px - 60px); }
  .thread-list, .thread-pane { height: calc(100vh - 61px - 60px); }
  .messages.has-selection .thread-list { display: none; }
  .messages:not(.has-selection) .thread-pane { display: none; }
  .pane-header .back { display: inline; }
}

#blazor-error-ui {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: #fdecea;
  color: #15202b;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; top: 10px; }
