.hank-tile {
  width: 142px;
  cursor: pointer;
  user-select: none;
  text-align: center;
}

.hank-tile-box {
  width: 142px;
  height: 142px;
  border-radius: 18px;
  background: rgba(255,255,255,.13);
  border: 2px solid rgba(255,255,255,.24);
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.hank-tile:hover .hank-tile-box {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,.45);
  background: rgba(255,255,255,.18);
}

.hank-tile-initial {
  font-size: 18px;
  color: var(--hank-white);
}

.hank-tile-label {
  display: block;
  margin-top: 14px;
  font-size: 20px;
  color: var(--hank-white);
}

.hank-tile-alias {
  display: block;
  margin-top: 4px;
  color: rgba(255,255,255,.78);
  font-size: 14px;
  line-height: 1.3;
}

.hank-button {
  border: 2px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.12);
  color: var(--hank-white);
  border-radius: 16px;
  padding: 16px 24px;
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

/* ==========================================================
   H.A.N.K. Canonical Logo
   Locked: 2026-06-29
   ========================================================== */

.hank-logo{
    margin-top: 42px;
    margin-bottom: -14px;
    transform: translateX(-38px);
}

.hank-logo img{
    width:min(1090px,90vw);
    max-width:1090px;
    height:auto;
}


/* ==========================================================
   H.A.N.K. Universal Component Layer
   ========================================================== */

/* ---------- Page stage ---------- */

#tiles,
.hank-tiles,
.hank-tile-stage,
.hank-page {
  height: auto;
  min-height: unset;
  overflow: visible;
  box-sizing: border-box;
}

/* ---------- Buttons ---------- */

.hank-button,
button.hank-button {
  height: auto !important;
  min-height: 52px;
  max-height: 72px;
  align-self: flex-start;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.hank-button.compact-button {
  min-height: 46px !important;
  max-height: 54px !important;
  padding: 10px 18px !important;
}

.hank-button-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.hank-button-stack .hank-button,
.hank-button-stack button.hank-button {
  width: 100%;
}

/* ---------- Tiles ---------- */

.hank-card-tile {
  box-sizing: border-box;
}

.hank-card-tile-image {
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hank-card-tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* ---------- Blocks ---------- */

.hank-block {
  box-sizing: border-box;
  height: auto;
  min-height: 0;
  overflow: visible;
}

/* ---------- Info boxes ---------- */

.hank-info-box {
  box-sizing: border-box;
  height: auto;
  min-height: 0;
  overflow: visible;
  border: 1px solid #111;
  background: #f4f7f2;
  color: #111;
}

.hank-info-box * {
  color: inherit;
}

/* ---------- Forms ---------- */

.hank-form-control,
.hank-info-box input,
.hank-info-box select,
.hank-info-box textarea {
  box-sizing: border-box;
  max-width: 100%;
  font: inherit;
}

.hank-autogrow-textarea {
  min-height: 110px;
  resize: none;
  overflow: hidden;
}

/* ---------- H.A.N.K. Page Actions ---------- */

.hank-page-actions {
  width: min(900px, 90vw);
  margin: 20px auto 26px;
  display: flex;
  justify-content: flex-start;
}

.hank-back-button {
  min-width: 142px;
}

/* ---------- Canonical card tiles ---------- */

.hank-card-tile {
  box-sizing: border-box;
  width: 230px;
  min-height: 250px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,.13);
  border: 2px solid rgba(255,255,255,.24);
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
  cursor: pointer;
  text-align: left;
  display: grid;
  gap: 10px;
}

.hank-card-tile-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 2px;
}

.hank-card-tile-image {
  width: 100%;
  height: 105px;
  margin: 0 0 2px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(0,0,0,.16);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hank-card-tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.hank-card-tile-meta,
.hank-card-tile-summary {
  font-size: 14px;
  opacity: .85;
}

/* ==========================================================
   H.A.N.K. Prime Login / Agents / Apps / Chat
   ========================================================== */

.hank-auth-panel,
.hank-profile-panel {
  width: min(520px, 88vw);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hank-auth-panel,
.hank-profile-panel {
  margin: 0 auto 48px;
}

.hank-profile-panel {
  width: min(620px, calc(100vw - 48px));
  max-width: 620px;
  margin-inline: auto;
  align-self: auto;
}

.hank-profile-page {
  box-sizing: border-box;
  width: 100%;
  display: block;
  padding-inline: 24px;
}

.hank-profile-page .hank-top-actions,
.hank-profile-page .hank-page-actions {
  width: min(900px, 100%);
}

.hank-profile-panel input {
  display: block;
  width: 100%;
}

.hank-password-panel {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.hank-password-panel label {
  display: block;
  margin-top: 4px;
}

.hank-password-panel input,
.hank-password-panel .hank-button,
.hank-password-panel .hank-muted-note {
  width: 100%;
  margin: 0;
}

.hank-password-panel .hank-button {
  margin-top: 8px;
}

.hank-auth-panel input,
.hank-profile-panel input {
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #111;
  border-radius: 10px;
  background: #fff;
  color: #111;
}

.hank-top-actions {
  width: min(1200px, 92vw);
  margin: 8px auto 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.hank-user-strip {
  color: var(--hank-white);
  font-size: 16px;
}

.hank-top-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hank-agent-page {
  width: min(1200px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 34px;
  padding-bottom: 80px;
}

.hank-agent-section {
  width: 100%;
}

.hank-agent-section h2 {
  font-size: 24px;
  font-weight: 400;
  margin: 0 0 14px;
  color: var(--hank-white);
}

.hank-agent-section .hank-tile-row {
  justify-content: flex-start;
  margin-top: 0;
}

.hank-assistant-row {
  justify-content: space-between !important;
}

.hank-agent-category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.hank-agent-category-block {
  min-width: 0;
  padding: 18px;
  border: 2px solid rgba(255,255,255,.24);
  border-radius: 18px;
  background: rgba(255,255,255,.13);
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
}

.hank-agent-category-block h3 {
  min-height: 2.5em;
  margin: 0 0 14px;
  color: var(--hank-white);
  font-size: 19px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

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

.hank-small-agent {
  min-width: 0;
  min-height: var(--hank-touch-target, 44px);
  padding: 9px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 12px;
  background: rgba(0,0,0,.13);
  color: var(--hank-white);
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  text-align: center;
}

.hank-small-agent:hover,
.hank-small-agent:focus-visible {
  border-color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.18);
}

.hank-small-agent-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.14);
  font-weight: 700;
}

.hank-small-agent-name {
  min-width: 0;
  color: var(--hank-white);
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: normal;
}

.hank-small-agent-alias {
  min-width: 0;
  color: rgba(255,255,255,.76);
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: normal;
}

.hank-empty-category {
  padding: 16px 18px;
  border: 1px dashed rgba(255,255,255,.35);
  border-radius: 14px;
  color: rgba(255,255,255,.75);
}

.hank-muted-note {
  opacity: .72;
  font-size: 14px;
}

/* ==========================================================
   H.A.N.K. Prime Chat Page
   ========================================================== */

body.hank-chat-mode {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #101417;
  color: #dce7f3;
}

body.hank-chat-mode *,
body.hank-chat-mode *::before,
body.hank-chat-mode *::after {
  box-sizing: border-box;
}

body.hank-chat-mode .hank-blue-page {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: #101417;
}

body.hank-chat-mode .hank-blue-page::before,
body.hank-chat-mode .hank-blue-page::after,
body.hank-chat-mode .corner-detail,
body.hank-chat-mode .hank-logo,
body.hank-chat-mode .hank-question {
  display: none;
}

body.hank-chat-mode .hank-gate-inner {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

body.hank-chat-mode #tiles {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  display: block;
  overflow: hidden;
}

.hank-chat-app {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 280px;
  overflow: hidden;
  background: #121619;
  color: #dce7f3;
}

/* ---------- Left sidebar ---------- */

.hank-chat-sidebar {
  min-width: 0;
  min-height: 0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  background: #101820;
  border-right: 1px solid #263241;
}

.hank-mobile-chat-close,
.hank-mobile-chat-backdrop {
  display: none;
}

.hank-chat-brand {
  height: 42px;
  flex: 0 0 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #263241;
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: .18em;
}

.hank-status-pill {
  padding: 4px 10px;
  border: 1px solid #263241;
  border-radius: 999px;
  color: #79aef7;
  font-size: 12px;
  letter-spacing: .08em;
}

.hank-sidebar-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hank-dark-button,
.hank-dark-wide-button,
.hank-plus-button,
.hank-audio-button {
  border: 1px solid #2b3948;
  border-radius: 12px;
  background: #111a22;
  color: #dce7f3;
  cursor: pointer;
}

.hank-dark-button {
  min-height: 36px;
  padding: 8px 12px;
}

.hank-dark-button.primary {
  background: #3c78d8;
  border-color: #6aa0f0;
  color: #fff;
}

.hank-sidebar-label {
  margin-top: 8px;
  color: #8fa0b3;
  font-size: 13px;
}

.hank-sidebar-thread {
  min-width: 0;
  padding: 4px;
  border: 1px solid #263241;
  border-radius: 12px;
  font-size: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: center;
}

.hank-sidebar-thread.active { border-color: #6aa0f0; background: #17283e; }

.hank-sidebar-thread-list {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #405368 transparent;
}

.hank-sidebar-thread-open,
.hank-thread-menu-button,
.hank-thread-action-popover button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: #dce7f3;
  cursor: pointer;
  font: inherit;
}

.hank-sidebar-thread-open {
  min-width: 0;
  padding: 8px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hank-thread-menu-button {
  width: 40px;
  display: grid;
  place-items: center;
}

.hank-thread-action-popover {
  position: fixed;
  z-index: 1000;
  min-width: 112px;
  padding: 4px;
  border: 1px solid #34475b;
  border-radius: 10px;
  background: #111a22;
  box-shadow: 0 8px 20px #0008;
}

.hank-thread-action-popover button { width: 100%; padding: 8px 10px; text-align: left; }

.hank-chat-search {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #34475b;
  border-radius: 10px;
  background: #0f171f;
  color: #dce7f3;
  font: inherit;
}

.hank-sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hank-dark-wide-button {
  width: 100%;
  min-height: 36px;
  padding: 8px 12px;
}

.hank-sidebar-bottom p,
.hank-sidebar-bottom span {
  margin: 0;
  color: #8fa0b3;
  font-size: 12px;
  line-height: 1.35;
}

/* ---------- Centre conversation ---------- */

.hank-chat-main {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: 50px minmax(0, 1fr) 88px;
  overflow: hidden;
  background: #161b20;
}

.hank-chat-topbar {
  min-width: 0;
  padding: 0 18px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #263241;
  color: #dce7f3;
}

.hank-chat-messages {
  min-width: 0;
  min-height: 0;
  padding-block: 24px;
  padding-inline: max(24px, calc((100% - 800px) / 2));
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-x: hidden;
  overflow-y: auto;
}

.hank-message {
  width: fit-content;
  max-width: min(78%, 720px);
  padding: 12px 14px;
  border: 1px solid #2b3948;
  border-radius: 14px;
  background: #101820;
  color: #dce7f3;
}

.hank-message.user {
  align-self: flex-end;
  background: #1f3556;
}

.hank-message.assistant {
  align-self: flex-start;
}

.hank-message-text {
  font-size: 16px;
  line-height: 1.6;
}

.hank-message-text p { margin: 0 0 .75em; }
.hank-message-text p:last-child { margin-bottom: 0; }
.hank-message-text ul,
.hank-message-text ol { margin: .35em 0 .75em; padding-left: 1.5em; }
.hank-message-text li + li { margin-top: .2em; }
.hank-message-text code { overflow-wrap: anywhere; }
.hank-message-text pre {
  max-width: 100%;
  margin: .65em 0;
  padding: .75em;
  overflow-x: auto;
  border-radius: 6px;
  background: rgba(0,0,0,.28);
  white-space: pre;
}
.hank-message-text a { color: #9fc5ff; text-decoration: underline; }

.hank-time-separator {
  align-self: center;
  color: #7f90a3;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

/* ---------- Composer ---------- */

.hank-chat-composer {
  width: 100%;
  height: 88px;
  min-height: 88px;
  padding-block: 10px 26px;
  padding-inline: max(12px, calc((100% - 800px) / 2));
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px 92px;
  gap: 10px;
  align-items: center;
  overflow: hidden;
  border-top: 1px solid #263241;
  background: #12181e;
  position: relative;
}

.hank-microphone-status {
  position: absolute;
  left: 64px;
  right: 116px;
  bottom: 5px;
  overflow: hidden;
  color: #8fa0b3;
  font-size: 11px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.hank-audio-button.is-listening {
  border-color: #ff7474;
  background: #702c35;
  animation: hank-mic-pulse 1.2s infinite;
}

@keyframes hank-mic-pulse { 50% { box-shadow: 0 0 0 5px rgba(255,116,116,.18); } }

.hank-history-controls {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #8fa0b3;
  font-size: 12px;
}

.hank-plus-button,
.hank-audio-button,
.hank-send-button {
  width: 100%;
  height: 42px;
  min-height: 42px;
  padding: 0;
}

.hank-chat-input {
  width: 100%;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  margin: 0;
  padding: 10px 14px;
  resize: none;
  overflow-y: auto;
  border: 1px solid #2b3948;
  border-radius: 12px;
  background: #111a22;
  color: #dce7f3;
  font: inherit;
  line-height: 20px;
}

.hank-send-button {
  border: 1px solid #6aa0f0;
  border-radius: 12px;
  background: #3c78d8;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

/* ---------- Right status panel ---------- */

.hank-chat-status-panel {
  min-width: 0;
  min-height: 0;
  padding-top: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: var(--hank-blue);
  color: #fff;
}

.hank-chat-status-panel::after {
  content: "";
  position: absolute;
  top: 47%;
  right: 0;
  left: 0;
  height: 64px;
  background:
    linear-gradient(
      180deg,
      transparent,
      rgba(255,255,255,.20),
      transparent
    );
}

.hank-chat-status-panel img {
  width: min(240px, calc(100% - 24px));
  margin-bottom: 20px;
}

.hank-chat-status-panel span {
  margin-top: 6px;
  color: rgba(255,255,255,.78);
  letter-spacing: .28em;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .hank-assistant-row { justify-content: flex-start !important; }

  .hank-agent-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hank-chat-app {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .hank-chat-status-panel {
    display: none;
  }
}

@media (max-width: 720px) {
  .hank-agent-category-grid { grid-template-columns: minmax(0, 1fr); }

  .hank-agent-category-block h3 { min-height: 0; }

  .hank-chat-app {
    grid-template-columns: 1fr;
  }

  .hank-chat-composer {
    grid-template-columns: 38px minmax(0, 1fr) 38px 72px;
    gap: 7px;
    padding-inline: 8px;
  }

  .hank-profile-page { padding-inline: 12px; }
  .hank-profile-panel { width: 100%; padding: 20px; }
  .hank-microphone-status { left: 54px; right: 88px; }
}

/* ---------- Universal flip cards ---------- */

.hank-flip-card {
  width: 260px;
  min-height: 360px;
  perspective: 1200px;
  cursor: pointer;
  box-sizing: border-box;
}

.hank-flip-card-inner {
  position: relative;
  width: 100%;
  min-height: 360px;
  transition: transform .55s ease;
  transform-style: preserve-3d;
}

.hank-flip-card.is-flipped .hank-flip-card-inner {
  transform: rotateY(180deg);
}

.hank-flip-card-face {
  position: absolute;
  inset: 0;
  min-height: 360px;
  box-sizing: border-box;
  padding: 18px;
  border: 2px solid rgba(255,255,255,.24);
  border-radius: 18px;
  background: rgba(255,255,255,.13);
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
  backface-visibility: hidden;
  overflow: auto;
}

.hank-flip-card-back {
  transform: rotateY(180deg);
}

.hank-flip-card-image {
  width: 100%;
  height: 145px;
  margin-bottom: 14px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 10px;
  background: rgba(0,0,0,.16);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hank-flip-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hank-flip-card-title {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
}

.hank-flip-card-summary {
  display: grid;
  gap: 8px;
}

.hank-flip-card-detail {
  margin-top: 10px;
  line-height: 1.45;
}

.hank-flip-card:focus-visible {
  outline: 3px solid rgba(255,255,255,.75);
  outline-offset: 4px;
}

/* Dynamic Chat attachments only. The empty composer retains its original layout. */
.hank-chat-composer.hank-has-attachments { overflow: visible; }
.hank-attachment-tray {
  position: absolute;
  bottom: 100%;
  left: max(12px, calc((100% - 800px) / 2));
  right: max(12px, calc((100% - 800px) / 2));
  max-height: 160px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #2b3948;
  border-radius: 12px;
  background: #12181e;
  color: #dce7f3;
}
.hank-attachment-item { display: flex; align-items: center; gap: 10px; margin: 4px 0; }
.hank-attachment-item span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.hank-message-text table { max-width: 100%; display: block; overflow-x: auto; border-collapse: collapse; }
.hank-message-text th, .hank-message-text td { border: 1px solid #2b3948; padding: .35em .65em; }
