/* HIRA — the NASABA family chat, as its own app, in NASABA's colours (night earth, bark, leaf, gold).
   Chat list, conversation with bubbles, ticks, reply quotes, hold-to-record voice notes.
   Full-height flex screen so the writing bar is always visible. Dark is the default, like NASABA. */

:root {
  --nk-accent: #2FB34A; --nk-accent-2: #4FD068; --nk-on-accent: #0F0A06;
  --nk-bar: #24180F; --nk-bar-text: #F5ECE0; --nk-gold: #F5B921; --nk-band: #842703;
  --nk-bg: #0F0A06; --nk-bg2: #0F0A06; --nk-panel: #1A120B; --nk-field: #24180F; --nk-line: #3A2716; --nk-hover: #24180F; --nk-sel: #2E1F12;
  --nk-text: #F5ECE0; --nk-muted: #B7A58F; --nk-meta: rgba(245, 236, 224, .62);
  --nk-wall: #0F0A06; --nk-in: #24180F; --nk-out: #4D2A10; --nk-quote: rgba(0, 0, 0, .28); --nk-chip: #1A120B; --nk-sys: #2A1D10;
  --nk-chip-on: rgba(47, 179, 74, .18); --nk-chip-on-text: #6FE08A;
  --nk-read: #7C80FF; --nk-danger: #E8352B; --nk-link: #9DA0FF;
  --nk-shadow: 0 1px .5px rgba(0, 0, 0, .45);
  --nk-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cg fill='none' stroke='%23F5B921' stroke-opacity='.05' stroke-width='2' stroke-linecap='round'%3E%3Cellipse cx='30' cy='26' rx='5' ry='6.5'/%3E%3Cpath d='M22 35h16M30 32v16'/%3E%3Cpath d='M92 30l10 18H82z'/%3E%3Cpath d='M86 96c4-10 4-18 0-26M86 82c6-4 12-4 18 0M86 76c-6-3-12-3-18 0'/%3E%3Ccircle cx='70' cy='70' r='1.6'/%3E%3Cpath d='M22 104l8-8 8 8-8 8z'/%3E%3Ccircle cx='118' cy='118' r='2.5'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: dark;
  --nk-h: 100dvh;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --nk-accent: #1E8E39; --nk-accent-2: #1E8E39; --nk-on-accent: #FFFDF9;
    --nk-bar: #FFFDF9; --nk-bar-text: #22160C; --nk-gold: #B98200; --nk-band: #842703;
    --nk-bg: #F6EFE4; --nk-bg2: #EFE5D6; --nk-panel: #FFFDF9; --nk-field: #EFE5D6; --nk-line: #E6D8C3; --nk-hover: #F6EFE4; --nk-sel: #EBDDC8;
    --nk-text: #22160C; --nk-muted: #6E5A45; --nk-meta: #8A7560;
    --nk-wall: #F6EFE4; --nk-in: #FFFDF9; --nk-out: #FBE3C2; --nk-quote: rgba(132, 39, 3, .06); --nk-chip: #FFFDF9; --nk-sys: #FFF1C9;
    --nk-chip-on: #E1F0D6; --nk-chip-on-text: #1E6B30;
    --nk-read: #2F33B5; --nk-danger: #C9241B; --nk-link: #2F33B5;
    --nk-shadow: 0 1px .5px rgba(60, 30, 5, .16);
    --nk-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cg fill='none' stroke='%23842703' stroke-opacity='.035' stroke-width='2' stroke-linecap='round'%3E%3Cellipse cx='30' cy='26' rx='5' ry='6.5'/%3E%3Cpath d='M22 35h16M30 32v16'/%3E%3Cpath d='M92 30l10 18H82z'/%3E%3Cpath d='M86 96c4-10 4-18 0-26M86 82c6-4 12-4 18 0M86 76c-6-3-12-3-18 0'/%3E%3Ccircle cx='70' cy='70' r='1.6'/%3E%3Cpath d='M22 104l8-8 8 8-8 8z'/%3E%3Ccircle cx='118' cy='118' r='2.5'/%3E%3C/g%3E%3C/svg%3E");
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --nk-accent: #1E8E39; --nk-accent-2: #1E8E39; --nk-on-accent: #FFFDF9;
  --nk-bar: #FFFDF9; --nk-bar-text: #22160C; --nk-gold: #B98200; --nk-band: #842703;
  --nk-bg: #F6EFE4; --nk-bg2: #EFE5D6; --nk-panel: #FFFDF9; --nk-field: #EFE5D6; --nk-line: #E6D8C3; --nk-hover: #F6EFE4; --nk-sel: #EBDDC8;
  --nk-text: #22160C; --nk-muted: #6E5A45; --nk-meta: #8A7560;
  --nk-wall: #F6EFE4; --nk-in: #FFFDF9; --nk-out: #FBE3C2; --nk-quote: rgba(132, 39, 3, .06); --nk-chip: #FFFDF9; --nk-sys: #FFF1C9;
  --nk-chip-on: #E1F0D6; --nk-chip-on-text: #1E6B30;
  --nk-read: #2F33B5; --nk-danger: #C9241B; --nk-link: #2F33B5;
  --nk-shadow: 0 1px .5px rgba(60, 30, 5, .16);
  --nk-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cg fill='none' stroke='%23842703' stroke-opacity='.035' stroke-width='2' stroke-linecap='round'%3E%3Cellipse cx='30' cy='26' rx='5' ry='6.5'/%3E%3Cpath d='M22 35h16M30 32v16'/%3E%3Cpath d='M92 30l10 18H82z'/%3E%3Cpath d='M86 96c4-10 4-18 0-26M86 82c6-4 12-4 18 0M86 76c-6-3-12-3-18 0'/%3E%3Ccircle cx='70' cy='70' r='1.6'/%3E%3Cpath d='M22 104l8-8 8 8-8 8z'/%3E%3Ccircle cx='118' cy='118' r='2.5'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: light;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body.nk {
  overflow: hidden; background: var(--nk-bg2); color: var(--nk-text);
  font-family: var(--font-body, system-ui, sans-serif); font-size: 15px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--nk-accent); }
svg { width: 24px; height: 24px; flex: none; }
img { max-width: 100%; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.grow { flex: 1; min-width: 0; }
:focus-visible { outline: 2px solid var(--nk-accent); outline-offset: 2px; }

/* ------------------------------------------------------------------ app frame */
.nk-app { height: var(--nk-h, 100dvh); display: flex; overflow: hidden; background: var(--nk-panel); }
.nk-pane { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; }
.nk-pane--list { width: 100%; background: var(--nk-panel); }
.nk-pane--main { flex: 1; }
.nk-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.nk--list .nk-pane--main { display: none; }
.nk--chat .nk-pane--list { display: none; }
@media (min-width: 900px) {
  body.nk { background: linear-gradient(var(--nk-band) 0 120px, var(--nk-bg2) 120px); }
  .nk-app { max-width: 1600px; margin: 0 auto; box-shadow: 0 6px 18px rgba(11, 20, 26, .12); }
  .nk--list .nk-pane--main, .nk--chat .nk-pane--main { display: flex; }
  .nk--chat .nk-pane--list { display: flex; }
  .nk-pane--list { width: 34%; min-width: 340px; max-width: 440px; flex: none; border-right: 1px solid var(--nk-line); }
  .nk-back { display: none !important; }
  .nk-app--single { max-width: 760px; }
  .nk-app--single .nk-back { display: inline-grid !important; }
}
@media (min-width: 1440px) { .nk-app { height: calc(var(--nk-h, 100dvh) - 38px); margin-top: 19px; } }

/* ------------------------------------------------------------------ bars */
.nk-bar {
  flex: none; display: flex; align-items: center; gap: 4px; min-height: 58px;
  padding: env(safe-area-inset-top, 0px) 6px 0 8px; background: var(--nk-bar); color: var(--nk-bar-text); position: relative; z-index: 5;
  border-bottom: 1px solid var(--nk-line); box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--nk-gold) 22%, transparent);
}
.nk-bar--brand { padding-left: 12px; gap: 6px; }
.nk-brand { flex: 1; margin: 0; display: flex; align-items: center; line-height: 0; }
.nk-brand a { display: inline-flex; }
.nk-brand img { width: 40px; height: 40px; }
.nk-bar__title { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-left: 4px; }
.nk-bar__title strong { font-size: 18px; font-weight: 600; }
.nk-bar__title span { font-size: 13px; opacity: .8; }
.nk-ib {
  width: 42px; height: 42px; flex: none; border-radius: 50%; display: inline-grid; place-items: center;
  background: none; border: 0; color: inherit; cursor: pointer; text-decoration: none;
}
.nk-ib:hover { background: rgba(127, 127, 127, .14); }
.nk-ib--soft { color: var(--nk-muted); width: 40px; height: 42px; }
.nk-peer { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; padding: 4px 2px; border-radius: 8px; }
.nk-peer .nk-av { width: 40px; height: 40px; font-size: 15px; }
.nk-peer__text { display: flex; flex-direction: column; min-width: 0; }
.nk-peer__text strong { font-size: 16.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nk-peer__status { font-size: 13px; opacity: .82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1em; }
.nk-peer__status.is-typing { color: var(--nk-gold); opacity: 1; font-style: italic; }
:root[data-theme="dark"] .nk-peer__status.is-typing { color: var(--nk-accent-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nk-peer__status.is-typing { color: var(--nk-accent-2); } }

/* menu */
.nk-menu { position: relative; }
.nk-menu > summary { list-style: none; }
.nk-menu > summary::-webkit-details-marker { display: none; }
.nk-menu__panel {
  position: absolute; right: 4px; top: 46px; min-width: 230px; padding: 8px 0; border-radius: 12px; z-index: 30;
  background: var(--nk-panel); color: var(--nk-text); box-shadow: 0 8px 28px rgba(0, 0, 0, .28);
}
.nk-menu__panel a, .nk-menu__panel button {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 18px; border: 0; background: none; text-align: left;
  color: inherit; text-decoration: none; cursor: pointer; font-size: 15px;
}
.nk-menu__panel a:hover, .nk-menu__panel button:hover { background: var(--nk-hover); }
.nk-menu__panel svg { width: 20px; height: 20px; color: var(--nk-muted); }
.nk-menu__panel img { border-radius: 5px; }

/* ------------------------------------------------------------------ list pane */
.nk-tools { flex: none; background: var(--nk-panel); }
.nk-search {
  display: flex; align-items: center; gap: 12px; margin: 8px 12px 6px; padding: 0 14px; height: 40px; border-radius: 20px;
  background: var(--nk-field); color: var(--nk-muted);
}
.nk-search svg { width: 19px; height: 19px; }
.nk-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--nk-text); font-size: 15.5px; }
.nk-search--in { margin: 10px 12px; }
.nk-chips { display: flex; gap: 8px; padding: 4px 12px 10px; overflow-x: auto; scrollbar-width: none; }
.nk-chips button {
  flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 18px; padding: 6px 14px;
  background: var(--nk-field); color: var(--nk-muted); font-size: 14px; cursor: pointer;
}
.nk-chips button.is-on { background: var(--nk-chip-on); color: var(--nk-chip-on-text); font-weight: 600; }
.nk-chips b { font-size: 12px; }
.nk-scroll--list { padding-bottom: 96px; }
.nk-list { list-style: none; margin: 0; padding: 0; }
.nk-row {
  display: flex; align-items: center; gap: 13px; width: 100%; height: 72px; padding: 0 0 0 13px;
  color: var(--nk-text); text-decoration: none; background: none; border: 0; text-align: left; cursor: pointer;
}
.nk-row:hover { background: var(--nk-hover); }
.nk-row.is-current { background: var(--nk-sel); }
.nk-row__body {
  flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 3px;
  border-bottom: 1px solid var(--nk-line); padding-right: 14px;
}
.nk-list li:last-child .nk-row__body { border-bottom: 0; }
.nk-row__top, .nk-row__bottom { display: flex; align-items: center; gap: 8px; min-width: 0; }
.nk-row__name { flex: 1; min-width: 0; font-size: 16.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nk-row__time { font-size: 12px; color: var(--nk-muted); flex: none; }
.nk-row.is-unread .nk-row__time { color: var(--nk-accent); font-weight: 600; }
.nk-row__preview { flex: 1; min-width: 0; display: flex; align-items: center; gap: 3px; color: var(--nk-muted); font-size: 14px; }
.nk-row__preview > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nk-row.is-unread .nk-row__preview { color: var(--nk-text); }
.nk-row__body > .nk-row__name { flex: none; }
.nk-row__body > .nk-row__preview { flex: none; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nk-row__typing { flex: 1; color: var(--nk-accent); font-size: 14px; font-style: normal; font-weight: 500; }
.nk-count {
  flex: none; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 11px; display: inline-grid; place-items: center;
  background: var(--nk-accent); color: var(--nk-on-accent); font-size: 12px; font-weight: 700;
}
.nk-row--action .nk-row__name { font-weight: 600; }
.nk-row--static { cursor: default; }
.nk-row--static:hover { background: none; }
.nk-row--pick input { position: absolute; opacity: 0; pointer-events: none; }
.nk-check { width: 26px; height: 26px; margin-right: 16px; border-radius: 50%; border: 2px solid var(--nk-muted); display: grid; place-items: center; color: transparent; flex: none; }
.nk-check svg { width: 16px; height: 16px; stroke-width: 3; }
.nk-row--pick input:checked ~ .nk-check { background: var(--nk-accent); border-color: var(--nk-accent); color: var(--nk-on-accent); }
.nk-row--pick input:focus-visible ~ .nk-check { outline: 2px solid var(--nk-accent); outline-offset: 2px; }
.nk-row--pick .nk-row__body { border-bottom: 0; }
.nk-section { margin: 14px 18px 6px; font-size: 14px; color: var(--nk-accent); font-weight: 600; }
.nk-badge { margin-right: 16px; padding: 2px 8px; border-radius: 6px; background: var(--nk-chip-on); color: var(--nk-chip-on-text); font-size: 12px; font-weight: 600; }
.nk-private { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 22px 24px; color: var(--nk-muted); font-size: 12.5px; text-align: center; }
.nk-private svg { width: 14px; height: 14px; }
.nk-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 28px; text-align: center; color: var(--nk-muted); }
.nk-empty img { opacity: .9; }
.nk-fab {
  position: absolute; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 6;
  width: 58px; height: 58px; border-radius: 17px; display: grid; place-items: center; border: 0; cursor: pointer;
  background: var(--nk-accent); color: var(--nk-on-accent); box-shadow: 0 4px 12px rgba(0, 0, 0, .25); text-decoration: none;
}
.nk-fab svg { width: 26px; height: 26px; }
.nk-fab:active { transform: scale(.95); }

/* avatars */
.nk-av {
  width: 49px; height: 49px; flex: none; border-radius: 50%; overflow: hidden; display: inline-grid; place-items: center;
  font-weight: 600; font-size: 17px; color: #fff; background: #8A4A1E; text-transform: uppercase;
}
.nk-av img { width: 100%; height: 100%; object-fit: cover; }
.nk-av--xs { width: 28px; height: 28px; font-size: 11px; }
.nk-av--sm { width: 36px; height: 36px; font-size: 13px; }
.nk-av--lg { width: 64px; height: 64px; font-size: 22px; }
.nk-av--xl { width: 128px; height: 128px; font-size: 42px; }
.nk-av--xl svg { width: 60px; height: 60px; }
.nk-av--group { background: var(--nk-field); color: var(--nk-gold); box-shadow: inset 0 0 0 1px var(--nk-line); }
.nk-av--accent { background: var(--nk-accent); color: var(--nk-on-accent); }
.nk-av--accent svg, .nk-av--group svg { width: 55%; height: 55%; }
.nk-c0 { background: #c0844a; } .nk-c1 { background: #4f8f6b; } .nk-c2 { background: #5d7fbf; } .nk-c3 { background: #b4577c; }
.nk-c4 { background: #8a6bbf; } .nk-c5 { background: #3e9aa6; } .nk-c6 { background: #c56a3e; } .nk-c7 { background: #7d8a3c; }

/* ------------------------------------------------------------------ welcome (computer, no chat open) */
.nk-welcome {
  align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 32px;
  background: var(--nk-bg2); border-bottom: 6px solid var(--nk-gold); color: var(--nk-muted);
}
.nk-welcome img { width: 200px; height: auto; border-radius: 28px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35), 0 0 0 1px color-mix(in srgb, var(--nk-gold) 35%, transparent); }
.nk-welcome h2 { margin: 12px 0 0; font-family: var(--font-display, sans-serif); font-weight: 800; font-size: 32px; letter-spacing: .08em; background: linear-gradient(180deg, #FFD54A, #F5B921 40%, #C8641A); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nk-welcome p { max-width: 460px; margin: 0; }
.nk-app--single .nk-welcome { border-bottom: 0; }

/* ------------------------------------------------------------------ conversation */
.nk-chat { background: var(--nk-wall) var(--nk-pattern); background-size: 240px; }
.nk-wall { position: relative; }
.nk-notice {
  display: flex; align-items: center; gap: 6px; max-width: 480px; margin: 12px auto 4px; padding: 6px 12px; border-radius: 8px;
  background: var(--nk-sys); color: var(--nk-muted); font-size: 12.5px; text-align: center; box-shadow: var(--nk-shadow); width: fit-content;
}
.nk-notice svg { width: 13px; height: 13px; }
.nk-older { display: block; margin: 10px auto 0; border: 0; border-radius: 16px; padding: 6px 14px; background: var(--nk-chip); color: var(--nk-text); box-shadow: var(--nk-shadow); cursor: pointer; font-size: 13px; }
.nk-thread { list-style: none; margin: 0; padding: 4px clamp(10px, 5%, 64px) 10px; display: flex; flex-direction: column; }
.nk-hello { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 40px auto; padding: 16px 22px; max-width: 300px; border-radius: 12px; background: var(--nk-chip); color: var(--nk-muted); text-align: center; box-shadow: var(--nk-shadow); }
.nk-hello span { font-size: 40px; }

.nk-day { position: sticky; top: 6px; z-index: 2; align-self: center; margin: 10px 0 6px; pointer-events: none; }
.nk-day span, .nk-sys span {
  display: inline-block; padding: 5px 12px; border-radius: 8px; background: var(--nk-chip); color: var(--nk-muted);
  font-size: 12.5px; box-shadow: var(--nk-shadow);
}
.nk-day span { text-transform: uppercase; letter-spacing: .02em; }
.nk-sys { align-self: center; margin: 6px 0; text-align: center; max-width: 86%; }
.nk-sys span { background: var(--nk-sys); }
.nk-unread { margin: 10px calc(-1 * clamp(10px, 5%, 64px)); padding: 5px; text-align: center; background: color-mix(in srgb, var(--nk-chip) 45%, transparent); }
.nk-unread span { display: inline-block; padding: 4px 14px; border-radius: 8px; background: var(--nk-chip); color: var(--nk-accent); font-size: 12.5px; font-weight: 600; text-transform: uppercase; box-shadow: var(--nk-shadow); }

.nk-msg { position: relative; display: flex; align-items: flex-start; margin-top: 2px; }
.nk-msg--first { margin-top: 9px; }
.nk-msg--mine { justify-content: flex-end; }
.nk-msg.has-rx { margin-bottom: 16px; }
.nk-msg__av { width: 30px; flex: none; margin-right: 6px; }
.nk-bubble {
  position: relative; max-width: min(80%, 560px); min-width: 72px; padding: 6px 8px 7px 9px; border-radius: 8px;
  background: var(--nk-in); color: var(--nk-text); box-shadow: var(--nk-shadow);
  font-size: 15.2px; line-height: 1.36; overflow-wrap: anywhere; word-break: break-word;
  -webkit-touch-callout: none; user-select: text; transition: background .3s;
}
.nk-msg--mine .nk-bubble { background: var(--nk-out); }
.nk-msg--first .nk-bubble::before {
  content: ""; position: absolute; top: 0; width: 9px; height: 13px; background: inherit;
}
.nk-msg--first.nk-msg--theirs .nk-bubble { border-top-left-radius: 0; }
.nk-msg--first.nk-msg--theirs .nk-bubble::before { left: -8px; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.nk-msg--first.nk-msg--mine .nk-bubble { border-top-right-radius: 0; }
.nk-msg--first.nk-msg--mine .nk-bubble::before { right: -8px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.nk-msg.is-flash .nk-bubble { background: color-mix(in srgb, var(--nk-accent) 30%, var(--nk-in)); }
.nk-msg.is-picked .nk-bubble { filter: brightness(.93); }

.nk-bubble__name { display: block; margin-bottom: 2px; font-size: 13px; font-weight: 600; }
.nk-t0 { color: #c0844a; } .nk-t1 { color: #2f9a5e; } .nk-t2 { color: #4a73c4; } .nk-t3 { color: #c2437a; }
.nk-t4 { color: #8a5fcf; } .nk-t5 { color: #1f9aaa; } .nk-t6 { color: #d4642c; } .nk-t7 { color: #7e8f2b; }
.nk-text { display: inline; margin: 0; white-space: pre-wrap; }
.nk-text::after { content: ""; display: inline-block; width: 46px; }
.nk-msg--mine .nk-text::after { width: 66px; }
.nk-text a { color: var(--nk-link); }
.nk-meta {
  position: absolute; right: 7px; bottom: 4px; display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; color: var(--nk-meta); line-height: 1; white-space: nowrap;
}
.nk-tick svg { width: 17px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nk-tick { display: inline-flex; color: var(--nk-meta); }
.nk-tick--sent .nk-tick__b { display: none; }
.nk-tick--read { color: var(--nk-read); }
.nk-row__preview .nk-tick svg { width: 16px; }

.nk-bubble--deleted .nk-text { color: var(--nk-muted); }
.nk-bubble--deleted svg { width: 14px; height: 14px; vertical-align: -2px; }
.nk-bubble--emoji { background: none !important; box-shadow: none; padding: 0 0 18px; }
.nk-bubble--emoji::before { display: none; }
.nk-bubble--emoji .nk-text { font-size: 44px; line-height: 1.15; }
.nk-bubble--emoji .nk-text::after { display: none; }
.nk-bubble--emoji .nk-meta { background: var(--nk-chip); padding: 3px 6px; border-radius: 9px; bottom: 0; box-shadow: var(--nk-shadow); }

.nk-bubble--photo { padding: 3px; }
.nk-photo { display: block; border-radius: 6px; overflow: hidden; line-height: 0; background: rgba(0, 0, 0, .06); }
.nk-photo img { display: block; width: 100%; max-width: 330px; max-height: 360px; min-height: 120px; object-fit: cover; }
.nk-bubble--photo .nk-text { display: block; padding: 5px 6px 2px; }
.nk-bubble--photo .nk-meta { right: 9px; bottom: 8px; }
.nk-bubble--photo:not(:has(.nk-text)) .nk-meta { color: #fff; padding: 12px 4px 2px 18px; background: radial-gradient(at 100% 100%, rgba(0, 0, 0, .45), transparent 70%); }
.nk-bubble--photo:not(:has(.nk-text)) .nk-tick:not(.nk-tick--read) { color: #fff; }
.nk-bubble--photo .nk-bubble__name, .nk-bubble--photo .nk-quote { margin: 3px 5px 5px; }

.nk-bubble--voice { min-width: 250px; padding-bottom: 18px; }
.nk-voice__audio { width: 240px; max-width: 100%; height: 40px; }
.nk-voice__ui { display: none; align-items: center; gap: 8px; }
.nk-js .nk-voice__audio { display: none; }
.nk-js .nk-voice__ui { display: flex; }
.nk-voice__ui .nk-av { width: 44px; height: 44px; }
.nk-voice__play { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border: 0; background: none; color: var(--nk-muted); cursor: pointer; padding: 0; }
.nk-voice__play svg { width: 26px; height: 26px; }
.nk-voice__track { flex: 1; min-width: 0; display: flex; }
.nk-voice__track input { width: 100%; accent-color: var(--nk-accent); height: 20px; cursor: pointer; }
.nk-voice__time { position: absolute; left: 62px; bottom: 4px; font-size: 11px; color: var(--nk-meta); }
.nk-msg--mine .nk-bubble--voice .nk-voice__time, .nk-voice:not(:has(.nk-av)) .nk-voice__time { left: 52px; }
.nk-voice:has(.nk-av) .nk-voice__time { left: 104px; }

.nk-quote {
  display: block; margin: 0 -3px 5px; padding: 5px 9px 6px; border-left: 4px solid var(--nk-gold); border-radius: 6px;
  background: var(--nk-quote); color: var(--nk-text); text-decoration: none; cursor: pointer; min-width: 0;
}
.nk-quote--mine { border-left-color: var(--nk-accent); }
.nk-quote b { display: block; font-size: 13px; color: var(--nk-gold); }
.nk-quote--mine b { color: var(--nk-accent); }
.nk-quote span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 13.5px; color: var(--nk-muted); }

.nk-rx {
  position: absolute; bottom: -15px; z-index: 1; display: inline-flex; align-items: center; gap: 1px; padding: 2px 6px; height: 24px;
  border-radius: 12px; border: 0; background: var(--nk-in); box-shadow: 0 1px 3px rgba(11, 20, 26, .2); cursor: pointer; font-size: 14px;
}
.nk-bubble > .nk-rx { left: 8px; bottom: -19px; }
.nk-msg--mine .nk-bubble > .nk-rx { left: auto; right: 64px; }
.nk-rx small { margin-left: 3px; color: var(--nk-muted); font-size: 12px; }

.nk-down {
  position: absolute; right: 14px; bottom: 82px; z-index: 4; width: 42px; height: 42px; border-radius: 50%; border: 0;
  display: grid; place-items: center; background: var(--nk-panel); color: var(--nk-muted); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); cursor: pointer;
}
.nk-down svg { transform: rotate(90deg); }
.nk-down b { position: absolute; top: -6px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--nk-accent); color: var(--nk-on-accent); font-size: 11px; display: grid; place-items: center; }
.nk-closed { flex: none; margin: 0; padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px)); text-align: center; background: var(--nk-field); color: var(--nk-muted); font-size: 14px; }

/* ------------------------------------------------------------------ composer */
.nk-composer { flex: none; position: relative; z-index: 3; padding: 5px 6px calc(6px + env(safe-area-inset-bottom, 0px)); }
.nk-compose-row { display: flex; align-items: flex-end; gap: 6px; }
.nk-pill {
  flex: 1; min-width: 0; display: flex; align-items: flex-end; min-height: 48px; padding: 3px 4px;
  border-radius: 24px; background: var(--nk-in); box-shadow: var(--nk-shadow);
}
.nk-replybar:not([hidden]) + .nk-emojis + .nk-compose-row .nk-pill,
.nk-replybar:not([hidden]) ~ .nk-compose-row .nk-pill { border-top-left-radius: 0; border-top-right-radius: 0; }
.nk-pill textarea {
  flex: 1; min-width: 0; max-height: 132px; padding: 10px 4px; border: 0; outline: none; resize: none; background: none;
  color: var(--nk-text); font-size: 16px; line-height: 22px;
}
.nk-pill textarea::placeholder { color: var(--nk-muted); }
.nk-send {
  width: 48px; height: 48px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--nk-accent); color: var(--nk-on-accent); box-shadow: var(--nk-shadow); transition: transform .15s;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.nk-send svg { width: 23px; height: 23px; }
.nk-send:active { transform: scale(.94); }
.nk-composer.can-record:not(.has-text) [data-nk-send] { display: none; }
.nk-composer.has-text [data-nk-mic] { display: none !important; }
.nk-composer.has-text .nk-cam { display: none; }
.nk-composer.is-sending .nk-send { opacity: .7; }
.nk-replybar {
  display: flex; align-items: center; gap: 4px; margin-right: 54px; padding: 6px 4px 4px 6px;
  border-radius: 14px 14px 0 0; background: var(--nk-in);
}
.nk-replybar .nk-quote { flex: 1; margin: 0; }
.nk-emojis {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 2px; max-height: 196px; overflow-y: auto;
  margin: 0 54px 6px 0; padding: 6px; border-radius: 16px; background: var(--nk-in); box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}
.nk-emojis button { height: 42px; border: 0; background: none; font-size: 25px; border-radius: 10px; cursor: pointer; }
.nk-emojis button:hover { background: var(--nk-hover); }
.nk-rec {
  position: absolute; left: 6px; right: 60px; bottom: calc(6px + env(safe-area-inset-bottom, 0px)); height: 48px;
  display: flex; align-items: center; gap: 10px; padding: 0 16px; border-radius: 24px; background: var(--nk-in); box-shadow: var(--nk-shadow);
}
.nk-rec__dot { width: 11px; height: 11px; border-radius: 50%; background: var(--nk-danger); animation: nk-blink 1s infinite; }
.nk-rec__time { font-variant-numeric: tabular-nums; min-width: 38px; }
.nk-rec__slide { flex: 1; text-align: center; color: var(--nk-muted); font-size: 14px; transition: opacity .1s; }
.nk-composer.is-recording .nk-mic { transform: scale(1.35); background: var(--nk-accent-2); }
.nk-composer.is-cancelling .nk-rec__slide { color: var(--nk-danger); }
@keyframes nk-blink { 50% { opacity: .2; } }

/* ------------------------------------------------------------------ message action sheet, lightbox, toasts */
.nk-sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(11, 20, 26, .4); animation: nk-fade .15s; }
.nk-sheet__card {
  width: min(520px, 100%); padding: 14px 10px calc(10px + env(safe-area-inset-bottom, 0px)); border-radius: 20px 20px 0 0;
  background: var(--nk-panel); color: var(--nk-text); box-shadow: 0 -6px 24px rgba(0, 0, 0, .2); animation: nk-up .2s cubic-bezier(.2, .8, .2, 1);
}
@media (min-width: 900px) { .nk-sheet { align-items: center; } .nk-sheet__card { border-radius: 20px; } }
.nk-sheet__emojis { display: flex; justify-content: space-around; padding: 4px 4px 12px; border-bottom: 1px solid var(--nk-line); }
.nk-sheet__emojis button { width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--nk-field); font-size: 27px; cursor: pointer; transition: transform .1s; }
.nk-sheet__emojis button:active { transform: scale(1.2); }
.nk-sheet__emojis button.is-mine { background: var(--nk-chip-on); box-shadow: inset 0 0 0 2px var(--nk-accent); }
.nk-sheet__actions { display: flex; flex-direction: column; padding-top: 6px; }
.nk-sheet__actions button { display: flex; align-items: center; gap: 18px; padding: 13px 14px; border: 0; border-radius: 10px; background: none; text-align: left; font-size: 16px; cursor: pointer; }
.nk-sheet__actions button:hover { background: var(--nk-hover); }
.nk-sheet__actions svg { color: var(--nk-muted); }
.nk-sheet__actions .is-danger, .nk-sheet__actions .is-danger svg { color: var(--nk-danger); }
.nk-lightbox { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 56px 8px 16px; background: rgba(0, 0, 0, .94); animation: nk-fade .15s; }
.nk-lightbox img { max-width: 100%; max-height: calc(var(--nk-h, 100dvh) - 80px); object-fit: contain; }
.nk-lightbox .nk-ib { position: absolute; top: calc(8px + env(safe-area-inset-top, 0px)); right: 8px; color: #fff; }
.nk-toast {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top, 0px)); z-index: 90; transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 10px 18px; border-radius: 12px; background: #323739; color: #fff; font-size: 14.5px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3); animation: nk-toast 4.5s forwards; pointer-events: none;
}
.nk-toast--error { background: #b3261e; }
@keyframes nk-fade { from { opacity: 0; } }
@keyframes nk-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes nk-toast { 0% { opacity: 0; transform: translate(-50%, -10px); } 6%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

/* ------------------------------------------------------------------ new chat / info */
.nk-new, .nk-info { background: var(--nk-panel); }
.nk-new { padding-bottom: 100px; }
.nk-new button.nk-row { font-size: inherit; }
.nk-groupname { display: flex; align-items: center; gap: 14px; margin: 4px 16px 6px; }
.nk-groupname input, .nk-inline input {
  width: 100%; padding: 10px 2px; border: 0; border-bottom: 2px solid var(--nk-accent); background: none; outline: none; font-size: 16px; color: var(--nk-text);
}
.nk-error { margin: 4px 18px; color: var(--nk-danger); font-size: 14px; }
.nk-info { background: var(--nk-bg2); padding-bottom: 24px; }
.nk-card { margin-bottom: 10px; padding: 6px 0 10px; background: var(--nk-panel); box-shadow: 0 1px 2px rgba(11, 20, 26, .06); }
.nk-info__hero { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 18px 20px; text-align: center; }
.nk-info__hero h1 { margin: 10px 0 0; font-size: 23px; font-weight: 600; }
.nk-muted { margin: 0; color: var(--nk-muted); }
.nk-media { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0 14px; }
.nk-media a { aspect-ratio: 1; border-radius: 6px; overflow: hidden; }
.nk-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nk-inline { display: flex; align-items: flex-end; gap: 12px; padding: 0 18px 0 0; }
.nk-inline .nk-section { display: block; margin-top: 6px; }
.nk-inline label { padding-left: 0; }
.nk-inline label > input { margin-left: 18px; width: calc(100% - 18px); }
.nk-add > summary { list-style: none; }
.nk-add > summary::-webkit-details-marker { display: none; }
.nk-add form { padding-bottom: 8px; }
.nk-add form > .nk-btn { margin: 8px 18px 0; }
.nk-danger { display: flex; align-items: center; gap: 18px; width: 100%; padding: 14px 22px; border: 0; background: none; color: var(--nk-danger); font-size: 16px; cursor: pointer; }
.nk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 20px; border: 0; border-radius: 22px;
  background: var(--nk-accent); color: var(--nk-on-accent); font-weight: 600; text-decoration: none; cursor: pointer;
}
.nk-btn svg { width: 20px; height: 20px; }
.nk-btn--sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.nk-btn--ghost { background: var(--nk-field); color: var(--nk-text); font-weight: 500; margin-top: 10px; }
.nk-btn--ghost img { border-radius: 5px; }

/* ------------------------------------------------------------------ "Install HIRA" sheet (shared markup with NASABA) */
.install {
  position: fixed; z-index: 70; left: 10px; right: 10px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; align-items: center; padding: 14px; border-radius: 20px;
  background: var(--nk-panel); color: var(--nk-text); border: 1px solid color-mix(in srgb, var(--nk-accent) 45%, var(--nk-line));
  box-shadow: 0 18px 50px rgba(0, 0, 0, .4); transform: translateY(140%); opacity: 0; transition: transform .26s cubic-bezier(.2, .8, .2, 1), opacity .2s;
}
.install.is-in { transform: none; opacity: 1; }
.install__icon { width: 52px; height: 52px; border-radius: 13px; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.install__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-right: 30px; }
.install__text strong { font-family: var(--font-display, sans-serif); font-size: 16px; letter-spacing: .03em; }
.install__sub { font-size: 14px; color: var(--nk-muted); line-height: 1.45; }
.install__key { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 7px; background: var(--nk-field); color: var(--nk-text); font-weight: 600; white-space: nowrap; vertical-align: middle; }
.install__key svg { width: 16px; height: 16px; color: #2f6fdf; }
.install__actions { grid-column: 1 / -1; display: flex; }
.install__actions .btn { flex: 1; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 23px; background: var(--nk-accent); color: var(--nk-on-accent); font-weight: 600; font-size: 16px; cursor: pointer; }
.install__actions .btn svg { width: 20px; height: 20px; }
.install__close { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: transparent; border: 0; color: var(--nk-muted); font-size: 24px; line-height: 1; cursor: pointer; }
.install:has([data-install-go][hidden]) .install__actions { display: contents; }
@media (min-width: 700px) { .install { left: auto; right: 20px; bottom: 20px; width: 380px; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; } }
[data-install-android-manual] .install__key svg { transform: rotate(90deg); }

/* ------------------------------------------------------------------ HIRA front door (welcome + sign in) */
body.nk--login { overflow-y: auto; background: var(--nk-wall) var(--nk-pattern); background-size: 280px; }
.nk-door {
  min-height: var(--nk-h, 100dvh); display: grid; align-content: center; justify-items: center; gap: 22px;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 18px calc(24px + env(safe-area-inset-bottom, 0px));
}
.nk-door__hero { display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 440px; }
.nk-door__logo { width: 176px; height: 176px; border-radius: 36px; box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .55), 0 0 0 1px color-mix(in srgb, var(--nk-gold) 40%, transparent); margin-bottom: 8px; }
.nk-door__tagline { margin: 6px 0 14px; font-family: var(--font-display, sans-serif); font-size: 17px; line-height: 1.35; color: var(--nk-text); }
.nk-door__points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; text-align: left; }
.nk-door__points li { display: flex; align-items: center; gap: 10px; color: var(--nk-muted); font-size: 14.5px; }
.nk-door__points svg { width: 20px; height: 20px; color: var(--nk-gold); flex: none; }
.nk-door__card {
  width: min(420px, 100%); display: flex; flex-direction: column; gap: 12px; padding: 22px 20px;
  border-radius: 20px; background: var(--nk-panel); border: 1px solid var(--nk-line);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .5), inset 0 2px 0 color-mix(in srgb, var(--nk-gold) 30%, transparent);
}
.nk-door__card h2 { margin: 0; font-family: var(--font-display, sans-serif); font-size: 20px; }
.nk-field { display: flex; flex-direction: column; gap: 5px; font-size: 14px; color: var(--nk-muted); }
.nk-field input {
  height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--nk-line); background: var(--nk-field);
  color: var(--nk-text); font-size: 16px; outline: none;
}
.nk-field input:focus { border-color: var(--nk-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nk-accent) 25%, transparent); }
.nk-btn--wide { width: 100%; min-height: 48px; font-size: 16px; }
.nk-door__links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0; font-size: 14px; }
.nk-door__links a { color: var(--nk-gold); text-decoration: none; }
.nk-door__foot { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--nk-muted); font-size: 12.5px; }
@media (min-width: 900px) {
  .nk-door { grid-template-columns: minmax(0, 440px) 420px; align-items: center; justify-content: center; column-gap: 64px; }
  .nk-door__foot { grid-column: 1 / -1; }
  .nk-door__logo { width: 220px; height: 220px; }
}
