/* ======================================================
   hi-app.css — HI App Styles
   Identity · Today · Tasks · Mood · Tabs · AI FAB · Modal
   Design tokens from base.css:
     --brand-green: #046A38   --brand-orange: #FF671F
====================================================== */


/* ======================================================
   1. DASHBOARD GRID
====================================================== */

.hi-personal-hero {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  padding: clamp(28px, 5vw, 46px);
  margin-bottom: 34px;
  border: 1px solid rgba(4,106,56,.22);
}

.hi-personal-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(4,106,56,.16), transparent 42%),
    linear-gradient(300deg, rgba(255,103,31,.13), transparent 38%);
  pointer-events: none;
}

.hi-personal-hero-main,
.hi-personal-hero-rail {
  position: relative;
  z-index: 1;
}

.hi-personal-hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 24px;
  align-items: stretch;
}

.hi-personal-hero-left {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
}

.hi-personal-hero-logo {
  width: clamp(68px, 10vw, 100px);
  height: clamp(68px, 10vw, 100px);
  object-fit: contain;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
}

body.theme-light .hi-personal-hero-logo {
  background: rgba(0,0,0,.035);
  border-color: rgba(0,0,0,.08);
}

.hi-personal-kicker {
  margin: 0 0 8px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--brand-green);
}

.hi-personal-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.65rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.hi-personal-hero-copy {
  max-width: 760px;
  margin: 14px 0 0;
  font-size: clamp(.92rem, 1.6vw, 1.02rem);
  line-height: 1.7;
  opacity: .72;
}

.hi-personal-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hi-personal-hero-status {
  min-height: 100%;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid rgba(128,128,128,.16);
  background: rgba(255,255,255,.045);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

body.theme-light .hi-personal-hero-status {
  background: rgba(0,0,0,.025);
}

.hi-hero-status-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.hi-hero-greeting {
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: 0;
}

.hi-hero-date {
  margin-top: 7px;
  font-size: .78rem;
  opacity: .52;
}

.hi-hero-orbit {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(4,106,56,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,103,31,.24), transparent 35%),
    rgba(4,106,56,.08);
}

.hi-hero-orbit span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-green), var(--brand-orange));
  box-shadow: 0 0 26px rgba(4,106,56,.35);
}

.hi-hero-identity-line {
  display: grid;
  gap: 6px;
}

.hi-hero-identity-line span {
  font-weight: 800;
  font-size: .96rem;
}

.hi-hero-identity-line code {
  width: fit-content;
  max-width: 100%;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(4,106,56,.1);
  border: 1px solid rgba(4,106,56,.22);
  color: var(--brand-green);
  font-size: .7rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.hi-hero-vitals {
  display: grid;
  gap: 10px;
}

.hi-hero-vitals > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hi-hero-vitals span {
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  opacity: .48;
}

.hi-hero-dot-row {
  display: flex;
  gap: 5px;
}

.hi-hero-dot-row i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
  border: 1px solid rgba(4,106,56,.38);
}

.hi-hero-dot-row i.active {
  background: var(--brand-green);
  border-color: var(--brand-green);
}

.hi-hero-action {
  min-height: 44px;
  padding: 9px 15px;
  border-radius: 8px;
  border: 1px solid rgba(128,128,128,.18);
  background: rgba(255,255,255,.05);
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.hi-hero-action.primary {
  background: linear-gradient(135deg, var(--brand-green), rgba(4,106,56,.82));
  border-color: transparent;
  color: #fff;
}

.hi-hero-action:hover {
  transform: translateY(-2px);
  border-color: rgba(4,106,56,.42);
  background: rgba(4,106,56,.1);
}

.hi-personal-hero-rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 30px;
}

.hi-personal-hero-rail > div {
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(128,128,128,.16);
  background: rgba(255,255,255,.04);
}

body.theme-light .hi-personal-hero-rail > div {
  background: rgba(0,0,0,.025);
}

.hi-personal-hero-rail span {
  display: block;
  margin-bottom: 10px;
  font-family: "Courier New", monospace;
  font-size: .68rem;
  color: var(--brand-orange);
}

.hi-personal-hero-rail strong {
  font-size: .88rem;
}

.hi-dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
  align-items: start;
}

/* ======================================================
   DIGITAL WORLD COMMAND CENTER
====================================================== */

.hi-world-dashboard {
  margin: 0 0 34px;
  padding: clamp(24px, 4vw, 36px);
  border-radius: 14px;
  border: 1px solid rgba(128,128,128,.16);
  background: rgba(255,255,255,.035);
}

body.theme-light .hi-world-dashboard {
  background: #fff;
  border-color: rgba(0,0,0,.08);
  box-shadow: 0 14px 42px rgba(0,0,0,.06);
}

.hi-world-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: end;
  margin-bottom: 24px;
}

.hi-world-head h2,
.hi-ai-command-copy h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.hi-world-head p,
.hi-ai-command-copy p {
  max-width: 720px;
  margin: 12px 0 0;
  font-size: .94rem;
  line-height: 1.72;
  opacity: .72;
}

.hi-world-status {
  min-width: 190px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid rgba(4,106,56,.22);
  background: linear-gradient(135deg, rgba(4,106,56,.12), rgba(255,103,31,.08));
}

.hi-world-status span {
  display: block;
  margin-bottom: 8px;
  color: var(--brand-green);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.hi-world-status strong {
  display: block;
  font-size: .95rem;
  line-height: 1.3;
}

.hi-world-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.hi-world-card {
  min-height: 168px;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(128,128,128,.16);
  background: rgba(255,255,255,.035);
  color: inherit;
  text-align: left;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

body.theme-light .hi-world-card {
  background: rgba(0,0,0,.018);
}

.hi-world-card:hover {
  transform: translateY(-3px);
  border-color: rgba(4,106,56,.45);
  background: rgba(4,106,56,.075);
}

.hi-world-card.primary {
  border-color: rgba(4,106,56,.42);
  background: linear-gradient(135deg, rgba(4,106,56,.18), rgba(255,103,31,.1));
}

.hi-world-card span {
  display: block;
  margin-bottom: 18px;
  color: var(--brand-orange);
  font-family: "Courier New", monospace;
  font-size: .72rem;
  font-weight: 800;
}

.hi-world-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1.02rem;
  line-height: 1.25;
}

.hi-world-card p {
  margin: 0;
  font-size: .84rem;
  line-height: 1.58;
  opacity: .68;
}

.hi-ai-command-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .9fr);
  gap: 24px;
  align-items: center;
  margin: 0 0 34px;
  padding: clamp(24px, 4vw, 36px);
  border-radius: 14px;
}

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

.hi-ai-command-grid .hi-ai-prompt {
  min-height: 54px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(4,106,56,.26);
  background: rgba(4,106,56,.08);
  color: inherit;
  font: inherit;
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.hi-ai-command-grid .hi-ai-prompt:hover {
  transform: translateY(-2px);
  border-color: var(--brand-green);
  background: rgba(4,106,56,.14);
}


/* ======================================================
   2. IDENTITY CARD
====================================================== */

.hi-identity-card {
  padding: 32px;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  min-height: 180px;
}

.hi-identity-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-green), var(--brand-orange));
  border-radius: 3px 3px 0 0;
}

/* Setup state */
.hi-identity-setup {
  text-align: center;
  padding: 12px 0;
}

.hi-setup-icon {
  font-size: 2.8rem;
  margin-bottom: 14px;
}

.hi-identity-setup h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.hi-identity-setup p {
  font-size: 0.86rem;
  opacity: 0.6;
  margin-bottom: 20px;
  line-height: 1.7;
}

/* Identity inner */
.hi-identity-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: start;
}

.hi-identity-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.hi-identity-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-green), var(--brand-orange));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.hi-hdi-badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--brand-green);
  background: rgba(4,106,56,0.1);
  border: 1px solid rgba(4,106,56,0.25);
  border-radius: 999px;
  padding: 3px 7px;
  white-space: nowrap;
  text-align: center;
}

.hi-identity-name {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 5px;
  line-height: 1.2;
}

.hi-identity-roles {
  font-size: 0.74rem;
  color: var(--brand-green);
  font-weight: 600;
  margin: 0 0 6px;
  opacity: 0.9;
  letter-spacing: 0.3px;
}

.hi-identity-username {
  font-size: 0.78rem;
  color: var(--brand-orange);
  font-weight: 700;
  margin: 0 0 6px;
}

.hi-identity-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

.hi-identity-contact span {
  max-width: 100%;
  overflow-wrap: anywhere;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
}

.hi-identity-tagline {
  font-size: 0.85rem;
  font-style: italic;
  opacity: 0.58;
  margin: 0 0 6px;
}

.hi-identity-location {
  font-size: 0.78rem;
  opacity: 0.5;
  margin: 0 0 6px;
}

.hi-identity-mission {
  font-size: 0.8rem;
  line-height: 1.75;
  opacity: 0.65;
  margin: 6px 0 0;
}

.hi-edit-identity-btn {
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.35;
  font-size: 0.88rem;
  padding: 6px 7px;
  border-radius: 8px;
  transition: opacity 0.2s ease, background 0.2s ease;
  flex-shrink: 0;
  color: inherit;
}

.hi-edit-identity-btn:hover {
  opacity: 1;
  background: rgba(4,106,56,0.1);
}


/* ======================================================
   3. TODAY PANEL
====================================================== */

.hi-today {
  padding: 32px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hi-today-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.hi-greeting {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.hi-today-date {
  font-size: 0.75rem;
  opacity: 0.45;
  letter-spacing: 0.2px;
}

/* Vitals (Mood + Energy) */
.hi-vitals {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.hi-vital-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hi-vital-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  opacity: 0.4;
  width: 50px;
  flex-shrink: 0;
}

.hi-dots {
  display: flex;
  gap: 5px;
}

.hi-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid rgba(4,106,56,0.3);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.14s ease;
}

.hi-dot.active {
  background: var(--brand-green);
  border-color: var(--brand-green);
}

.hi-dot:hover {
  border-color: var(--brand-green);
  transform: scale(1.2);
}


/* ======================================================
   4. TASKS
====================================================== */

.hi-tasks-section {
  flex: 1;
}

.hi-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--brand-green);
  margin-bottom: 12px;
  display: block;
}

.hi-task-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
}

.hi-task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 10px;
  transition: background 0.16s ease;
}

body.theme-dark .hi-task-item:hover { background: rgba(255,255,255,0.04); }
body.theme-light .hi-task-item:hover { background: rgba(0,0,0,0.04); }

.hi-task-item.done .hi-task-title {
  text-decoration: line-through;
  opacity: 0.38;
}

.hi-task-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid rgba(4,106,56,0.4);
  background: transparent;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: background 0.16s ease, border-color 0.16s ease;
  padding: 0;
}

.hi-task-item.done .hi-task-check {
  background: var(--brand-green);
  border-color: var(--brand-green);
}

.hi-task-check:hover {
  border-color: var(--brand-green);
  background: rgba(4,106,56,0.12);
}

.hi-task-title {
  flex: 1;
  font-size: 0.86rem;
  line-height: 1.4;
}

.hi-task-delete {
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0;
  font-size: 0.75rem;
  color: inherit;
  padding: 3px 6px;
  border-radius: 6px;
  transition: opacity 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.hi-task-item:hover .hi-task-delete { opacity: 0.3; }
.hi-task-delete:hover { opacity: 1 !important; color: #ff4d4d; background: rgba(255,77,77,0.1); }

.hi-task-empty {
  font-size: 0.8rem;
  opacity: 0.32;
  font-style: italic;
  padding: 8px 0;
  list-style: none;
}

/* Task input form */
.hi-task-form {
  display: flex;
  gap: 7px;
}

.hi-task-form input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.84rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.theme-dark .hi-task-form input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #e5e5e5;
}

body.theme-light .hi-task-form input {
  background: #f2f2f2;
  border: 1px solid rgba(0,0,0,0.1);
  color: #111;
}

.hi-task-form input:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(4,106,56,0.12);
}

.hi-task-form button[type="submit"] {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  background: var(--brand-green);
  color: #fff;
  font-size: 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  padding: 0;
  line-height: 1;
}

.hi-task-form button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(4,106,56,0.32);
}


/* ======================================================
   5. LIFE TABS
====================================================== */

.hi-tabs-bar {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(4,106,56,0.22);
  width: fit-content;
}

.hi-tab-btn {
  padding: 10px 30px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  border: none;
  background: transparent;
  cursor: pointer;
  color: inherit;
  opacity: 0.45;
  transition: all 0.22s ease;
  font-family: inherit;
  white-space: nowrap;
}

.hi-tab-btn + .hi-tab-btn {
  border-left: 1px solid rgba(4,106,56,0.22);
}

.hi-tab-btn.active {
  background: linear-gradient(135deg, var(--brand-green), rgba(4,106,56,0.82));
  color: #fff;
  opacity: 1;
}

.hi-tab-btn:hover:not(.active) {
  opacity: 0.7;
  background: rgba(4,106,56,0.07);
}


/* ======================================================
   6. PHASE PLACEHOLDER (Professional / Social)
====================================================== */

.hi-phase-placeholder {
  padding: 56px 40px;
  border-radius: 24px;
  text-align: center;
  margin-bottom: 40px;
}

.hi-phase-icon {
  font-size: 3rem;
  margin-bottom: 18px;
}

.hi-phase-placeholder h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.hi-phase-placeholder p {
  font-size: 0.86rem;
  opacity: 0.5;
  max-width: 380px;
  margin: 0 auto;
  line-height: 1.85;
}


/* ======================================================
   7. FLOATING AI BUTTON (FAB)
====================================================== */

.hi-ai-fab {
  position: fixed;
  bottom: 30px;
  right: 26px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-green), var(--brand-orange));
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  box-shadow: 0 8px 24px rgba(4,106,56,0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  z-index: 500;
  color: #fff;
}

.hi-ai-fab:hover {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 16px 36px rgba(4,106,56,0.55);
}

.hi-ai-icon {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 1;
}

.hi-ai-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  opacity: 0.82;
  line-height: 1;
}

/* AI placeholder panel */
.hi-ai-placeholder {
  position: fixed;
  bottom: 100px;
  right: 26px;
  width: 280px;
  padding: 20px;
  border-radius: 18px;
  z-index: 499;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

body.theme-dark .hi-ai-placeholder {
  background: #111;
  border: 1px solid rgba(255,255,255,0.1);
}

body.theme-light .hi-ai-placeholder {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.1);
}

.hi-ai-placeholder h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--brand-green);
}

.hi-ai-placeholder p {
  font-size: 0.8rem;
  line-height: 1.7;
  opacity: 0.6;
  margin: 0;
}


/* ======================================================
   8. BUTTONS
====================================================== */

.hi-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--brand-green), var(--brand-orange));
  color: #fff;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.2px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(4,106,56,0.28);
}

.hi-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(4,106,56,0.38);
}

.hi-btn-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 20px;
  border-radius: 999px;
  border: 1px solid rgba(128,128,128,0.22);
  background: transparent;
  color: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.6;
  font-family: inherit;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.hi-btn-cancel:hover {
  opacity: 1;
  background: rgba(128,128,128,0.08);
}


/* ======================================================
   9. IDENTITY MODAL
====================================================== */

.hi-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.hi-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.hi-modal {
  width: 100%;
  max-width: 480px;
  border-radius: 22px;
  overflow: hidden;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.26s cubic-bezier(0.22,1,0.36,1);
}

.hi-modal-overlay.open .hi-modal {
  transform: translateY(0) scale(1);
}

body.theme-dark .hi-modal {
  background: #0e0e0e;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 32px 80px rgba(0,0,0,0.65);
}

body.theme-light .hi-modal {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.hi-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(128,128,128,0.12);
  position: relative;
}

.hi-modal-header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-green), var(--brand-orange));
}

.hi-modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.hi-modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0.4;
  padding: 8px 10px;
  border-radius: 6px;
  color: inherit;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.hi-modal-close:hover {
  opacity: 1;
  background: rgba(128,128,128,0.1);
}

.hi-modal-body {
  padding: 20px 24px;
  max-height: 60vh;
  overflow-y: auto;
}

.hi-field {
  margin-bottom: 14px;
}

.hi-field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.5;
  margin-bottom: 6px;
}

.hi-field label small {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  opacity: 1;
}

.hi-req { color: var(--brand-orange); }

.hi-field input,
.hi-field textarea {
  width: 100%;
  padding: 11px 13px;
  min-height: 44px;
  border-radius: 10px;
  font-size: 0.88rem;
  outline: none;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

body.theme-dark .hi-field input,
body.theme-dark .hi-field textarea {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #e5e5e5;
}

body.theme-light .hi-field input,
body.theme-light .hi-field textarea {
  background: #f5f5f5;
  border: 1px solid rgba(0,0,0,0.12);
  color: #111;
}

.hi-field input:focus,
.hi-field textarea:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(4,106,56,0.13);
}

.hi-modal-err {
  font-size: 0.78rem;
  color: #ff4d4d;
  border-radius: 8px;
  min-height: 0;
}

.hi-modal-err:not(:empty) {
  background: rgba(255,77,77,0.08);
  padding: 8px 12px;
  margin-top: 4px;
}

.hi-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px 20px;
  border-top: 1px solid rgba(128,128,128,0.1);
}


/* ======================================================
   10. RESPONSIVE
====================================================== */

@media (max-width: 900px) {
  .hi-dashboard {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hi-tabs-bar {
    width: 100%;
    border-radius: 12px;
  }

  .hi-tab-btn {
    flex: 1;
    padding: 10px 10px;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
  }

  .hi-identity-card,
  .hi-today {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .hi-identity-avatar {
    width: 56px;
    height: 56px;
    font-size: 1.6rem;
  }

  .hi-identity-name {
    font-size: 1.25rem;
  }

  .hi-ai-fab {
    bottom: 22px;
    right: 18px;
    width: 50px;
    height: 50px;
  }

  .hi-ai-placeholder {
    right: 18px;
    width: calc(100dvw - 36px);
    max-width: 300px;
  }
}

@media (max-width: 540px) {
  .hi-identity-inner {
    grid-template-columns: 1fr auto;
    row-gap: 14px;
  }

  .hi-identity-left {
    flex-direction: row;
    grid-column: 1 / -1;
    align-items: center;
    gap: 12px;
  }

  .hi-hdi-badge {
    margin-top: 0;
  }

  .hi-modal-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .hi-btn-primary,
  .hi-btn-cancel {
    width: 100%;
    text-align: center;
    padding: 11px;
  }
}


/* ======================================================
   11. HABITS  (Phase 2)
====================================================== */

.hi-habits-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hi-habit-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1.5px solid rgba(4,106,56,0.25);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: inherit;
  transition: all 0.2s ease;
  position: relative;
  opacity: 0.65;
}

.hi-habit-btn:hover {
  border-color: var(--brand-green);
  opacity: 0.85;
  transform: translateY(-2px);
}

.hi-habit-btn.done {
  background: rgba(4,106,56,0.12);
  border-color: var(--brand-green);
  opacity: 1;
}

.hi-habit-icon { font-size: 1.1rem; line-height: 1; }

.hi-habit-check {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--brand-green);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}


/* ======================================================
   12. GOALS  (Phase 2)
====================================================== */

.hi-goals-list {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hi-goal-card {
  padding: 20px 22px;
  border-radius: 16px;
}

.hi-goal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.hi-goal-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

.hi-goal-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.hi-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.3;
  font-size: 0.8rem;
  padding: 4px 6px;
  border-radius: 6px;
  color: inherit;
  transition: opacity 0.18s, background 0.18s;
}

.hi-icon-btn:hover { opacity: 1; background: rgba(128,128,128,0.1); }

.hi-goal-note {
  font-size: 0.8rem;
  opacity: 0.55;
  margin: 0 0 12px;
  line-height: 1.6;
}

.hi-progress-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(128,128,128,0.15);
  overflow: hidden;
  margin-bottom: 8px;
}

.hi-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-green), var(--brand-orange));
  transition: width 0.4s ease;
}

.hi-goal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hi-goal-pct {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-green);
  opacity: 0.8;
}

.hi-goal-deadline {
  font-size: 0.72rem;
  opacity: 0.45;
}

/* Range input */
.hi-range {
  width: 100%;
  accent-color: var(--brand-green);
  height: 5px;
  border-radius: 999px;
  cursor: pointer;
}


/* ======================================================
   13. NOTES  (Phase 2)
====================================================== */

.hi-notes-list {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.hi-note-card {
  padding: 18px 20px;
  border-radius: 16px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hi-note-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(4,106,56,0.15);
}

.hi-note-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.hi-note-date {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--brand-green);
  opacity: 0.7;
}

.hi-note-title {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.hi-note-body {
  font-size: 0.82rem;
  line-height: 1.7;
  opacity: 0.62;
  margin: 0;
  white-space: pre-wrap;
}

.hi-empty {
  font-size: 0.82rem;
  opacity: 0.35;
  font-style: italic;
  padding: 8px 0;
}


/* ======================================================
   14. PROFESSIONAL STATS BAR  (Phase 3)
====================================================== */

.hi-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 40px;
  border: 1px solid rgba(128,128,128,0.12);
}

.hi-stat {
  padding: 22px 18px;
  text-align: center;
  border-right: 1px solid rgba(128,128,128,0.12);
}

.hi-stat:last-child { border-right: none; }

.hi-stat-val {
  display: block;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--brand-green);
  line-height: 1.1;
  margin-bottom: 4px;
}

.hi-stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  opacity: 0.42;
}


/* ======================================================
   15. PROJECTS  (Phase 3)
====================================================== */

.hi-projects-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hi-proj-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 14px;
  border: 1.5px solid rgba(128,128,128,0.18);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: inherit;
  transition: all 0.22s ease;
  opacity: 0.6;
}

.hi-proj-card:hover {
  opacity: 0.85;
  border-color: var(--proj-color, var(--brand-green));
  transform: translateY(-2px);
}

.hi-proj-card.active {
  opacity: 1;
  background: color-mix(in srgb, var(--proj-color, var(--brand-green)) 12%, transparent);
  border-color: var(--proj-color, var(--brand-green));
  box-shadow: 0 4px 18px color-mix(in srgb, var(--proj-color, var(--brand-green)) 25%, transparent);
}

.hi-proj-add {
  border-style: dashed;
  color: var(--brand-green);
  border-color: rgba(4,106,56,0.3);
}

.hi-proj-icon { font-size: 1.2rem; line-height: 1; }
.hi-proj-name { white-space: nowrap; }

/* Active project task section */
.hi-protask-project-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0;
}

.hi-protask-form {
  display: flex;
  gap: 7px;
  align-items: center;
}

.hi-priority-select {
  width: 100%;
  min-height: 42px;
  padding: 9px 38px 9px 12px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-family: inherit;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 17px,
    calc(100% - 12px) 17px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

body.theme-dark .hi-priority-select {
  background-color: rgba(255,255,255,0.065);
  border: 1px solid rgba(255,255,255,0.1);
  color: #e5e5e5;
}

body.theme-light .hi-priority-select {
  background-color: #f2f2f2;
  border: 1px solid rgba(0,0,0,0.1);
  color: #111;
}

.hi-priority-select:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(4,106,56,0.14);
}

.hi-priority-select:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.hi-priority-select option {
  font-weight: 600;
}

body.theme-dark .hi-priority-select option {
  background: #101512;
  color: #e5e5e5;
}

body.theme-light .hi-priority-select option {
  background: #fff;
  color: #111;
}

/* Priority badges */
.hi-prio-badge {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--brand-orange);
  background: rgba(255,103,31,0.12);
  border: 1px solid rgba(255,103,31,0.3);
  border-radius: 999px;
  padding: 2px 7px;
  flex-shrink: 0;
}

.hi-prio-high .hi-task-check {
  border-color: rgba(255,103,31,0.5);
}


/* ======================================================
   16. RESPONSIVE ADDITIONS
====================================================== */

@media (max-width: 768px) {
  .hi-stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .hi-stat:nth-child(2) { border-right: none; }
  .hi-stat:nth-child(-n+2) { border-bottom: 1px solid rgba(128,128,128,0.12); }

  .hi-projects-grid {
    gap: 8px;
  }

  .hi-proj-card {
    padding: 11px 16px;
    font-size: 0.8rem;
  }

  .hi-notes-list {
    grid-template-columns: 1fr;
  }

  .hi-protask-form {
    flex-wrap: wrap;
  }

  .hi-priority-select {
    width: 100%;
  }
}

@media (max-width: 540px) {
  .hi-habits-grid {
    gap: 8px;
  }

  .hi-habit-btn {
    padding: 9px 15px;
    font-size: 0.8rem;
  }

  .hi-stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ======================================================
   17. SOCIAL — Upcoming / People / Events  (Phase 4)
====================================================== */

/* Upcoming list */
.hi-upcoming-list { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }

.hi-upcoming-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: 14px;
  transition: background .18s;
}
body.theme-dark .hi-upcoming-row:hover { background: rgba(255,255,255,.04); }
body.theme-light .hi-upcoming-row:hover { background: rgba(0,0,0,.04); }

.hi-upcoming-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}

.hi-upcoming-info { flex: 1; min-width: 0; }
.hi-upcoming-title { display: block; font-size: .88rem; font-weight: 600; }
.hi-upcoming-meta  { display: block; font-size: .72rem; opacity: .5; margin-top: 2px; }

.hi-upcoming-tag {
  font-size: .62rem; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; border: 1px solid; border-radius: 999px;
  padding: 2px 8px; white-space: nowrap; flex-shrink: 0;
}

/* People grid */
.hi-people-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.hi-person-card {
  padding: 20px 22px;
  border-radius: 18px;
  transition: transform .25s, box-shadow .25s;
}
.hi-person-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(4,106,56,.14); }

.hi-person-top {
  display: flex; align-items: flex-start; gap: 14px; margin-bottom: 12px;
}

.hi-person-avatar {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-green), var(--brand-orange));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 800; color: #fff;
}

.hi-person-info { flex: 1; min-width: 0; }
.hi-person-name { display: block; font-size: .92rem; font-weight: 700; }
.hi-person-role { display: block; font-size: .75rem; opacity: .55; margin-top: 2px; }
.hi-person-rel  {
  display: inline-block; margin-top: 5px;
  font-size: .6rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--brand-green); background: rgba(4,106,56,.1);
  border: 1px solid rgba(4,106,56,.22); border-radius: 999px; padding: 2px 8px;
}

.hi-bday-badge {
  display: inline-block; margin-bottom: 8px;
  font-size: .72rem; font-weight: 700;
  color: var(--brand-orange); background: rgba(255,103,31,.1);
  border: 1px solid rgba(255,103,31,.3); border-radius: 999px; padding: 3px 10px;
}

.hi-person-note { font-size: .78rem; opacity: .55; margin: 0 0 12px; line-height: 1.6; }

.hi-person-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

.hi-contact-btn {
  font-size: .75rem; font-weight: 600; padding: 5px 13px;
  border-radius: 999px; border: 1px solid rgba(4,106,56,.28);
  color: var(--brand-green); background: transparent; cursor: pointer;
  text-decoration: none; transition: background .18s, transform .16s;
  font-family: inherit;
}
.hi-contact-btn:hover { background: rgba(4,106,56,.1); transform: translateY(-1px); }

.hi-wa-btn { border-color: rgba(37,211,102,.4); color: #25d366; }
.hi-wa-btn:hover { background: rgba(37,211,102,.1); }

/* Events list */
.hi-events-list { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }

.hi-event-row {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 14px; border-radius: 14px;
  transition: background .18s;
}
body.theme-dark .hi-event-row:hover { background: rgba(255,255,255,.04); }
body.theme-light .hi-event-row:hover { background: rgba(0,0,0,.04); }
.hi-event-row.past { opacity: .45; }

.hi-event-date-block {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 50px; height: 50px; border-radius: 12px;
  border: 1.5px solid; flex-shrink: 0;
}
.hi-event-day   { font-size: 1.25rem; font-weight: 800; line-height: 1; }
.hi-event-month { font-size: .58rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; opacity: .7; }

.hi-event-info  { flex: 1; min-width: 0; }
.hi-event-title { display: block; font-size: .9rem; font-weight: 600; }
.hi-event-meta  { display: block; font-size: .72rem; opacity: .5; margin-top: 3px; }
.hi-event-tag   { font-weight: 700; font-size: .72rem; }


/* ======================================================
   18. AI CHAT PANEL  (Phase 5)
====================================================== */

.hi-chat-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  backdrop-filter: blur(3px); z-index: 1998;
}
.hi-chat-backdrop[hidden] { display: none; }

.hi-chat-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 420px; max-width: 100dvw;
  z-index: 1999;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.22,1,.36,1);
  border-left: 1px solid rgba(128,128,128,.12);
}

body.theme-dark .hi-chat-panel {
  background: #0c0c0c;
}
body.theme-light .hi-chat-panel {
  background: #fafafa;
}

.hi-chat-panel.open {
  transform: translateX(0);
}
.hi-chat-panel.open ~ #hi-chat-backdrop { display: block; }

/* Header */
.hi-chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(128,128,128,.12);
  flex-shrink: 0;
  position: relative;
}
.hi-chat-header::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand-green), var(--brand-orange));
}

.hi-chat-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-green), var(--brand-orange));
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 900; color: #fff; letter-spacing: 1px;
}

.hi-chat-header-text { flex: 1; min-width: 0; }
.hi-chat-title { font-size: .9rem; font-weight: 700; }
.hi-chat-context-status {
  font-size: .65rem; opacity: .45; margin-top: 1px;
  transition: opacity .5s ease;
}

.hi-chat-action-btn, .hi-chat-close-btn {
  background: none; border: none; cursor: pointer;
  opacity: .4; padding: 6px; border-radius: 8px;
  font-size: .9rem; color: inherit; line-height: 1;
  transition: opacity .18s, background .18s;
}
.hi-chat-action-btn:hover, .hi-chat-close-btn:hover { opacity: 1; background: rgba(128,128,128,.1); }

/* Messages */
.hi-chat-messages {
  flex: 1; overflow-y: auto; padding: 18px 16px;
  display: flex; flex-direction: column; gap: 12px;
  scrollbar-width: thin;
}

body.theme-dark .hi-chat-messages { scrollbar-color: #2a2a2a transparent; }
body.theme-light .hi-chat-messages { scrollbar-color: #ddd transparent; }

.hi-chat-welcome {
  text-align: center; padding: 40px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.hi-chat-welcome-icon { font-size: 3rem; }
.hi-chat-welcome p {
  font-size: .84rem; line-height: 1.8; opacity: .55; max-width: 280px;
}

.hi-chat-bubble {
  display: flex; max-width: 88%;
}
.hi-chat-bubble.user { align-self: flex-end; }
.hi-chat-bubble.assistant { align-self: flex-start; }

.hi-bubble-content {
  padding: 10px 14px; border-radius: 16px;
  font-size: .86rem; line-height: 1.65; word-break: break-word;
}

body.theme-dark .hi-chat-bubble.assistant .hi-bubble-content {
  background: #1c1c1e; color: #e8e8e8;
  border-bottom-left-radius: 4px;
}
body.theme-light .hi-chat-bubble.assistant .hi-bubble-content {
  background: #ebebeb; color: #111;
  border-bottom-left-radius: 4px;
}

.hi-chat-bubble.user .hi-bubble-content {
  background: linear-gradient(135deg, var(--brand-green), rgba(4,106,56,.8));
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.hi-typing-indicator .hi-bubble-content {
  display: flex; gap: 5px; align-items: center; padding: 13px 16px;
}
.hi-typing-indicator .hi-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #666;
  animation: hiTypingBounce .9s infinite ease-in-out;
  border: none; /* override .hi-dot button reset */
  cursor: default;
}
.hi-typing-indicator .hi-dot:nth-child(2) { animation-delay: .15s; }
.hi-typing-indicator .hi-dot:nth-child(3) { animation-delay: .3s; }
@keyframes hiTypingBounce {
  0%,60%,100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Suggestions */
.hi-chat-suggestions {
  padding: 8px 16px 0;
  display: flex; gap: 6px; flex-wrap: wrap;
  flex-shrink: 0;
}
.hi-suggestion-chip {
  border: 1px solid rgba(4,106,56,.28); background: transparent;
  color: var(--brand-green); font-size: .72rem; font-weight: 600;
  border-radius: 999px; padding: 5px 12px; cursor: pointer;
  font-family: inherit; transition: background .18s, border-color .18s;
  white-space: nowrap;
}
.hi-suggestion-chip:hover { background: rgba(4,106,56,.1); border-color: var(--brand-green); }

/* Input */
.hi-chat-form {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(128,128,128,.1);
  flex-shrink: 0;
}

.hi-chat-input {
  flex: 1; padding: 10px 13px;
  border-radius: 14px; font-size: .86rem; line-height: 1.5;
  font-family: inherit; resize: none; outline: none;
  max-height: 120px; overflow-y: auto;
  transition: border-color .2s, box-shadow .2s;
}
body.theme-dark .hi-chat-input {
  background: #1c1c1e; border: 1px solid #2a2a2a; color: #e8e8e8;
}
body.theme-light .hi-chat-input {
  background: #f2f2f2; border: 1px solid rgba(0,0,0,.1); color: #111;
}
.hi-chat-input:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(4,106,56,.1);
}
.hi-chat-input::placeholder { opacity: .45; }

.hi-chat-send-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-green), var(--brand-orange));
  border: none; cursor: pointer; color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: transform .18s, box-shadow .18s;
}
.hi-chat-send-btn svg { width: 16px; height: 16px; }
.hi-chat-send-btn:hover { transform: scale(1.08); box-shadow: 0 4px 14px rgba(4,106,56,.4); }
.hi-chat-send-btn:disabled { opacity: .4; cursor: default; transform: none; }

/* World-class AI operator surface */
.hi-chat-backdrop {
  background: rgba(0,0,0,.56);
  backdrop-filter: blur(10px) saturate(130%);
}

.hi-chat-panel {
  top: 18px;
  right: 18px;
  bottom: 18px;
  width: min(720px, calc(100dvw - 36px));
  max-width: none;
  border: 1px solid rgba(128,128,128,.16);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 28px 90px rgba(0,0,0,.46);
  transform: translateX(calc(100% + 28px)) scale(.98);
}

body.theme-dark .hi-chat-panel {
  background:
    linear-gradient(145deg, rgba(4,106,56,.08), rgba(255,103,31,.055)),
    #0a0b0a;
}

body.theme-light .hi-chat-panel {
  background:
    linear-gradient(145deg, rgba(4,106,56,.055), rgba(255,103,31,.045)),
    #fbfbf8;
}

.hi-chat-panel.open {
  transform: translateX(0) scale(1);
}

.hi-chat-header {
  min-height: 74px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(128,128,128,.14);
  background: rgba(255,255,255,.035);
}

body.theme-light .hi-chat-header {
  background: rgba(255,255,255,.68);
}

.hi-chat-header::before {
  height: 2px;
}

.hi-chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(4,106,56,.22);
}

.hi-chat-title {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0;
}

.hi-chat-context-status {
  margin-top: 4px;
  font-size: .72rem;
  opacity: .62;
}

.hi-chat-action-btn,
.hi-chat-close-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(128,128,128,.12);
  background: rgba(255,255,255,.045);
  opacity: .72;
}

body.theme-light .hi-chat-action-btn,
body.theme-light .hi-chat-close-btn {
  background: rgba(0,0,0,.035);
}

.hi-chat-messages {
  padding: 24px;
  gap: 16px;
  background:
    radial-gradient(circle at 15% 10%, rgba(4,106,56,.08), transparent 28%),
    radial-gradient(circle at 90% 70%, rgba(255,103,31,.065), transparent 30%);
}

.hi-chat-welcome {
  min-height: 100%;
  justify-content: center;
  padding: 44px 24px;
}

.hi-chat-welcome-icon {
  width: 74px;
  height: 74px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(4,106,56,.2), rgba(255,103,31,.16));
  border: 1px solid rgba(128,128,128,.16);
  font-size: 2.5rem;
}

.hi-chat-welcome p {
  max-width: 440px;
  font-size: .95rem;
  opacity: .72;
}

.hi-chat-bubble {
  max-width: min(86%, 560px);
}

.hi-bubble-content {
  padding: 14px 16px;
  border-radius: 18px;
  font-size: .93rem;
  line-height: 1.72;
  box-shadow: 0 10px 28px rgba(0,0,0,.12);
}

body.theme-dark .hi-chat-bubble.assistant .hi-bubble-content {
  background: rgba(255,255,255,.075);
  color: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.08);
}

body.theme-light .hi-chat-bubble.assistant .hi-bubble-content {
  background: rgba(255,255,255,.9);
  color: #111;
  border: 1px solid rgba(0,0,0,.08);
}

.hi-chat-bubble.user .hi-bubble-content {
  background: linear-gradient(135deg, var(--brand-green), #0a7a46);
  border: 1px solid rgba(255,255,255,.14);
}

.hi-chat-suggestions {
  padding: 14px 20px 0;
  gap: 8px;
  background: rgba(255,255,255,.02);
}

.hi-suggestion-chip {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: .76rem;
  background: rgba(4,106,56,.08);
}

.hi-chat-form {
  gap: 12px;
  padding: 16px 20px 20px;
  border-top: 1px solid rgba(128,128,128,.14);
  background: rgba(255,255,255,.035);
}

body.theme-light .hi-chat-form {
  background: rgba(255,255,255,.68);
}

.hi-chat-input {
  min-height: 52px;
  max-height: 180px;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: .94rem;
  line-height: 1.55;
}

body.theme-dark .hi-chat-input {
  background: rgba(255,255,255,.075);
  border: 1px solid rgba(255,255,255,.1);
}

body.theme-light .hi-chat-input {
  background: #fff;
  border: 1px solid rgba(0,0,0,.1);
}

.hi-chat-send-btn {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  box-shadow: 0 12px 26px rgba(4,106,56,.22);
}

.hi-chat-send-btn svg {
  width: 19px;
  height: 19px;
}

.hi-ai-fab {
  min-width: 118px;
  border-radius: 999px;
  box-shadow: 0 18px 44px rgba(4,106,56,.28);
}

.hi-chat-open .hi-ai-fab {
  transform: translateY(-2px);
  opacity: .88;
}


/* ======================================================
   19. LICENSE SYSTEM  (Phase 10)
====================================================== */

.hi-license-main {
  max-width: 1180px;
}

.hi-license-hero {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  padding: clamp(28px, 5vw, 48px);
  margin-bottom: 56px;
  border: 1px solid rgba(4,106,56,.22);
}

.hi-license-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(4,106,56,.16), transparent 42%),
    linear-gradient(300deg, rgba(255,103,31,.14), transparent 38%);
  pointer-events: none;
}

.hi-license-hero-brand,
.hi-license-hero-grid {
  position: relative;
  z-index: 1;
}

.hi-license-hero-brand {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
}

.hi-license-hero-logo {
  width: clamp(68px, 10vw, 104px);
  height: clamp(68px, 10vw, 104px);
  object-fit: contain;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
}

body.theme-light .hi-license-hero-logo {
  background: rgba(0,0,0,.035);
  border-color: rgba(0,0,0,.08);
}

.hi-license-kicker {
  margin: 0 0 8px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--brand-green);
}

.hi-license-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: 0;
  line-height: 1;
}

.hi-license-hero-copy {
  max-width: 720px;
  margin: 14px 0 0;
  font-size: clamp(.92rem, 1.6vw, 1.05rem);
  line-height: 1.7;
  opacity: .72;
}

.hi-license-hero-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 34px;
}

.hi-license-hero-grid > div {
  min-height: 106px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(128,128,128,.16);
  background: rgba(255,255,255,.045);
}

body.theme-light .hi-license-hero-grid > div {
  background: rgba(0,0,0,.025);
}

.hi-license-hero-grid span {
  display: block;
  margin-bottom: 14px;
  font-family: "Courier New", monospace;
  font-size: .7rem;
  color: var(--brand-orange);
}

.hi-license-hero-grid strong {
  display: block;
  font-size: .95rem;
}

.hi-license-hero-grid p {
  margin: 4px 0 0;
  font-size: .78rem;
  opacity: .58;
}

.hi-license-section {
  position: relative;
}

.hi-license-section.glass {
  border-radius: 8px;
}

.hi-license-section-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  margin-bottom: 28px;
}

.hi-license-section-head h2 {
  margin: 0;
}

.hi-license-section-head h2::after {
  margin-top: 12px;
}

.hi-license-section-head p:not(.hi-license-kicker) {
  max-width: 720px;
  margin: 12px 0 0;
  font-size: .88rem;
  line-height: 1.8;
  opacity: .65;
}

.hi-section-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  padding: 7px;
  border-radius: 8px;
  background: rgba(4,106,56,.08);
  border: 1px solid rgba(4,106,56,.18);
}

.hi-license-test-section {
  margin-bottom: 24px;
}

.hi-license-test-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.hi-license-test-grid > div {
  min-width: 0;
  min-height: 128px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid rgba(128,128,128,.16);
  background: rgba(255,255,255,.045);
}

body.theme-light .hi-license-test-grid > div {
  background: rgba(0,0,0,.025);
}

.hi-license-test-grid span {
  display: block;
  margin-bottom: 12px;
  color: var(--brand-orange);
  font-family: "Courier New", monospace;
  font-size: .72rem;
  font-weight: 800;
}

.hi-license-test-grid strong {
  display: block;
  margin-bottom: 7px;
  font-size: .95rem;
}

.hi-license-test-grid p {
  margin: 0;
  font-size: .82rem;
  line-height: 1.6;
  opacity: .68;
}

.hi-license-demo-section,
.hi-license-flow-section {
  margin-bottom: 24px;
}

.hi-demo-cert {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 4vw, 34px);
  border-radius: 8px;
  border: 1px solid rgba(4,106,56,.28);
  background:
    linear-gradient(135deg, rgba(4,106,56,.12), transparent 42%),
    linear-gradient(315deg, rgba(255,103,31,.12), transparent 38%),
    rgba(255,255,255,.035);
}

body.theme-light .hi-demo-cert {
  background:
    linear-gradient(135deg, rgba(4,106,56,.08), transparent 42%),
    linear-gradient(315deg, rgba(255,103,31,.08), transparent 38%),
    #fff;
}

.hi-demo-cert-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.hi-demo-cert-head h3 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.hi-demo-cert-head span,
.hi-demo-hash span {
  display: block;
  color: var(--brand-orange);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.hi-demo-seal {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid rgba(4,106,56,.42);
  color: var(--brand-green);
  font-size: 1.4rem;
  font-weight: 900;
  box-shadow: 0 0 0 8px rgba(4,106,56,.08);
}

.hi-demo-cert-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.hi-demo-cert-grid > div,
.hi-demo-hash {
  min-width: 0;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(128,128,128,.16);
  background: rgba(255,255,255,.045);
}

body.theme-light .hi-demo-cert-grid > div,
body.theme-light .hi-demo-hash {
  background: rgba(0,0,0,.025);
}

.hi-demo-cert-grid span {
  display: block;
  margin-bottom: 6px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: .55;
}

.hi-demo-cert-grid strong,
.hi-demo-hash code {
  display: block;
  color: inherit;
  font-size: .86rem;
  overflow-wrap: anywhere;
}

.hi-demo-hash code {
  margin-top: 6px;
  color: var(--brand-green);
  font-weight: 800;
}

.hi-demo-notice {
  margin: 16px 0 0;
  max-width: 820px;
  font-size: .86rem;
  line-height: 1.7;
  opacity: .72;
}

.hi-license-flow {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.hi-license-flow li {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  align-items: start;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid rgba(128,128,128,.16);
  background: rgba(255,255,255,.04);
}

body.theme-light .hi-license-flow li {
  background: rgba(0,0,0,.025);
}

.hi-license-flow li > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(4,106,56,.12);
  border: 1px solid rgba(4,106,56,.25);
  color: var(--brand-green);
  font-size: .78rem;
  font-weight: 900;
}

.hi-license-flow strong {
  display: block;
  margin-bottom: 6px;
}

.hi-license-flow p {
  margin: 0;
  font-size: .88rem;
  line-height: 1.7;
  opacity: .72;
}

.hi-license-flow a {
  display: inline-flex;
  width: fit-content;
  margin-top: 10px;
  color: var(--brand-green);
  font-size: .84rem;
  font-weight: 800;
}

.hi-hdi-cert-wrapper {
  width: 100%;
  margin-top: 28px;
  display: grid;
  gap: 28px;
}

.hi-cert-card {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(4,106,56,.14), transparent 30%),
    linear-gradient(315deg, rgba(255,103,31,.12), transparent 34%),
    rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 80px rgba(0,0,0,.32);
  position: relative;
}

body.theme-light .hi-cert-card {
  background:
    linear-gradient(135deg, rgba(4,106,56,.08), transparent 30%),
    linear-gradient(315deg, rgba(255,103,31,.08), transparent 34%),
    #fff;
  border-color: rgba(0,0,0,.1);
  box-shadow: 0 18px 50px rgba(0,0,0,.1);
}

.hi-cert-card::before {
  content: ""; position: absolute;
  top: 0; left: 0; right: 0; height: 6px;
  background: linear-gradient(90deg, var(--brand-green), var(--brand-orange), var(--brand-blue));
}

.hi-cert-header {
  display: flex; align-items: center; gap: 12px;
  padding: 28px clamp(22px, 4vw, 46px) 18px;
  border-bottom: 1px solid rgba(128,128,128,.18);
}

.hi-cert-logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-green), var(--brand-orange));
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 900; color: #fff; letter-spacing: 1px;
}

.hi-cert-label {
  font-size: clamp(.95rem, 2vw, 1.35rem);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  color: inherit;
  opacity: .95;
  line-height: 1.2;
}

.hi-cert-body {
  padding: 30px clamp(22px, 4vw, 46px) 24px;
  text-align: center;
}

.hi-cert-avatar {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--brand-green), var(--brand-orange));
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 800; color: #fff;
  box-shadow: 0 8px 24px rgba(4,106,56,.4);
}

.hi-cert-name { font-size: clamp(1.45rem, 3vw, 2.15rem); font-weight: 800; margin: 0 0 6px; letter-spacing: 0; }
.hi-cert-roles { font-size: .84rem; opacity: .58; margin: 0 0 6px; }
.hi-cert-location { font-size: .8rem; opacity: .5; margin: 0 0 20px; }

.hi-cert-hdi {
  font-size: .95rem; font-weight: 700; letter-spacing: 2px;
  color: var(--brand-green); background: rgba(4,106,56,.12);
  border: 1px solid rgba(4,106,56,.3); border-radius: 12px;
  padding: 10px 22px; display: inline-block;
  font-family: "Courier New", monospace;
}

.hi-cert-footer {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(128,128,128,.18);
  padding: 16px 0;
}
.hi-cert-stat { text-align: center; padding: 8px 12px; }
.hi-cert-stat-val { display: block; font-size: .9rem; font-weight: 700; opacity: .82; }
.hi-cert-stat-lbl { display: block; font-size: .58rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; opacity: .38; margin-top: 3px; }

/* License cards */
.hi-license-list { margin-top: 28px; display: flex; flex-direction: column; gap: 14px; }

.hi-lic-card {
  padding: 20px 22px; border-radius: 16px;
  position: relative; overflow: hidden;
}
.hi-lic-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--brand-green), var(--brand-orange));
}

.hi-lic-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.hi-lic-id { font-size: .65rem; font-weight: 800; letter-spacing: 1.5px; color: var(--brand-green); margin-bottom: 4px; font-family: monospace; }
.hi-lic-title { font-size: .92rem; font-weight: 700; }

.hi-lic-type-badge {
  font-size: .62rem; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  color: var(--brand-orange); background: rgba(255,103,31,.1);
  border: 1px solid rgba(255,103,31,.3); border-radius: 999px; padding: 3px 9px; white-space: nowrap; flex-shrink: 0;
}

.hi-lic-meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: .72rem; opacity: .48; margin-bottom: 12px;
}
.hi-lic-meta code { font-family: monospace; font-size: .68rem; }

.hi-lic-actions { display: flex; gap: 8px; align-items: center; }

.hi-license-certificate-wrap {
  margin-top: 28px;
}

.hi-pro-cert {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(4,106,56,.12), transparent 28%),
    linear-gradient(315deg, rgba(255,103,31,.12), transparent 30%),
    rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 80px rgba(0,0,0,.32);
}

body.theme-light .hi-pro-cert {
  background:
    linear-gradient(135deg, rgba(4,106,56,.08), transparent 28%),
    linear-gradient(315deg, rgba(255,103,31,.08), transparent 30%),
    #fff;
  border-color: rgba(0,0,0,.1);
  box-shadow: 0 18px 50px rgba(0,0,0,.1);
}

.hi-pro-cert-ribbon {
  height: 6px;
  background: linear-gradient(90deg, var(--brand-green), var(--brand-orange), var(--brand-blue));
}

.hi-pro-cert-head,
.hi-pro-cert-hero,
.hi-pro-cert-grid,
.hi-pro-cert-hashes,
.hi-pro-cert-foot {
  padding-left: clamp(22px, 4vw, 46px);
  padding-right: clamp(22px, 4vw, 46px);
}

.hi-pro-cert-head {
  padding-top: 30px;
  padding-bottom: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(128,128,128,.18);
}

.hi-pro-cert-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hi-pro-cert-logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-green), var(--brand-orange));
  color: #fff;
  font-weight: 900;
  letter-spacing: 1px;
}

.hi-pro-cert-kicker,
.hi-pro-cert-label,
.hi-pro-cert-block span,
.hi-pro-cert-hashes span,
.hi-pro-cert-foot span {
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--brand-green);
}

.hi-pro-cert h3 {
  margin: 2px 0 0;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  letter-spacing: 0;
}

.hi-pro-cert-status {
  text-align: right;
  min-width: 130px;
}

.hi-pro-cert-status span,
.hi-pro-cert-status strong {
  display: block;
}

.hi-pro-cert-status span {
  font-size: .68rem;
  opacity: .55;
}

.hi-pro-cert-status strong {
  font-size: .95rem;
  color: var(--brand-orange);
}

.hi-pro-cert-hero {
  padding-top: 34px;
  padding-bottom: 34px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
}

.hi-pro-cert-id {
  margin: 8px 0 14px;
  font-family: "Courier New", monospace;
  font-size: clamp(1.08rem, 2.4vw, 1.6rem);
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--brand-orange);
  overflow-wrap: anywhere;
}

.hi-pro-cert h4 {
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  line-height: 1.15;
  margin: 0 0 10px;
  letter-spacing: 0;
}

.hi-pro-cert-hero p {
  margin: 0;
  font-size: .94rem;
  opacity: .68;
}

.hi-pro-cert-seal {
  width: 154px;
  height: 154px;
  border-radius: 50%;
  border: 1px solid rgba(255,103,31,.42);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255,103,31,.08);
}

.hi-pro-cert-seal > span {
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--brand-orange);
}

.hi-cert-seal-grid {
  width: 72px;
  height: 72px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.hi-cert-seal-grid span {
  border-radius: 2px;
  background: rgba(255,255,255,.14);
}

body.theme-light .hi-cert-seal-grid span {
  background: rgba(0,0,0,.12);
}

.hi-cert-seal-grid span.on {
  background: var(--brand-green);
}

.hi-cert-seal-grid span.strong {
  background: var(--brand-orange);
}

.hi-pro-cert-grid {
  padding-top: 8px;
  padding-bottom: 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.hi-pro-cert-block {
  min-width: 0;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(128,128,128,.16);
  background: rgba(255,255,255,.045);
}

body.theme-light .hi-pro-cert-block {
  background: rgba(0,0,0,.025);
}

.hi-pro-cert-block strong,
.hi-pro-cert-block code {
  display: block;
  overflow-wrap: anywhere;
}

.hi-pro-cert-block strong {
  margin-top: 7px;
  font-size: .92rem;
}

.hi-pro-cert-block code {
  margin-top: 5px;
  font-size: .72rem;
  opacity: .58;
}

.hi-pro-cert-hashes {
  padding-top: 0;
  padding-bottom: 26px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hi-pro-cert-hashes > div {
  padding: 16px;
  border-radius: 8px;
  background: rgba(0,0,0,.2);
  border: 1px solid rgba(128,128,128,.16);
}

body.theme-light .hi-pro-cert-hashes > div {
  background: rgba(0,0,0,.035);
}

.hi-pro-cert-hashes code {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  font-family: "Courier New", monospace;
  font-size: .75rem;
  line-height: 1.35;
  opacity: .78;
  overflow-wrap: anywhere;
}

.hi-pro-cert-foot {
  padding-top: 20px;
  padding-bottom: 26px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid rgba(128,128,128,.18);
}

.hi-pro-cert-foot p {
  max-width: 650px;
  margin: 0;
  font-size: .78rem;
  line-height: 1.7;
  opacity: .58;
}

.hi-pro-cert-foot div {
  text-align: right;
  flex-shrink: 0;
}

.hi-pro-cert-foot strong {
  display: block;
  margin-top: 4px;
  color: var(--brand-orange);
}

.hi-hdi-pro-wrap {
  margin-top: 28px;
}

.hi-hdi-pro-cert {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(4,106,56,.14), transparent 30%),
    linear-gradient(315deg, rgba(255,103,31,.13), transparent 34%),
    rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 80px rgba(0,0,0,.32);
}

body.theme-light .hi-hdi-pro-cert {
  background:
    linear-gradient(135deg, rgba(4,106,56,.08), transparent 30%),
    linear-gradient(315deg, rgba(255,103,31,.08), transparent 34%),
    #fff;
  border-color: rgba(0,0,0,.1);
  box-shadow: 0 18px 50px rgba(0,0,0,.1);
}

.hi-hdi-hero {
  padding: 34px clamp(22px, 4vw, 46px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
}

.hi-hdi-avatar-large {
  width: 96px;
  height: 96px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-green), var(--brand-orange));
  color: #fff;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 1px;
  box-shadow: 0 14px 32px rgba(4,106,56,.28);
}

.hi-hdi-main h4 {
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 1.12;
  margin: 6px 0 8px;
  letter-spacing: 0;
}

.hi-hdi-main p {
  margin: 0 0 5px;
  opacity: .65;
  font-size: .92rem;
}

.hi-hdi-code {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: "Courier New", monospace;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--brand-green);
  background: rgba(4,106,56,.1);
  border: 1px solid rgba(4,106,56,.28);
}

.hi-hdi-mission,
.hi-hdi-claims {
  margin: 0 clamp(22px, 4vw, 46px) 24px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid rgba(128,128,128,.16);
  background: rgba(255,255,255,.035);
}

body.theme-light .hi-hdi-mission,
body.theme-light .hi-hdi-claims {
  background: rgba(0,0,0,.025);
}

.hi-hdi-mission span {
  display: block;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--brand-green);
  margin-bottom: 8px;
}

.hi-hdi-mission p {
  margin: 0;
  line-height: 1.7;
  opacity: .72;
}

.hi-hdi-claim-row {
  display: grid;
  grid-template-columns: 160px 1fr 150px;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(128,128,128,.14);
  font-size: .78rem;
}

.hi-hdi-claim-row:last-child {
  border-bottom: none;
}

.hi-hdi-claim-row span,
.hi-hdi-claim-row code {
  font-family: "Courier New", monospace;
  overflow-wrap: anywhere;
  opacity: .68;
}

.hi-hdi-claim-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Claim form */
.hi-claim-form { max-width: 760px; }
.hi-claim-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.hi-claim-result {
  padding: 20px; border-radius: 16px; text-align: center;
  background: rgba(4,106,56,.1); border: 1px solid rgba(4,106,56,.3);
  margin-top: 16px;
}
.hi-claim-result-id {
  font-size: 1.1rem; font-weight: 800; font-family: monospace;
  color: var(--brand-green); margin-bottom: 10px; letter-spacing: 2px;
}
.hi-claim-result p { font-size: .84rem; opacity: .65; margin-bottom: 14px; }

/* Sync / certificate controls */
.hi-cert-actions,
.hi-sync-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}

.hi-sync-actions {
  justify-content: flex-start;
}

.hi-import-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hi-sync-status {
  margin-top: 14px;
  font-size: .82rem;
  opacity: .68;
}

.hi-sync-status.error {
  color: #ff6b6b;
  opacity: 1;
}

.hi-existing-actions {
  display: flex;
  flex-direction: column;
}

.hi-existing-actions .hi-btn-primary {
  min-height: 42px;
  width: 100%;
}

.hi-license-footer .footer-inner {
  align-items: center;
}

.hi-footer-brand {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
}

.hi-footer-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.hi-license-footer .social-icons {
  margin-top: 16px;
}

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  body.hi-printing-license *,
  body.hi-printing-hdi * {
    visibility: hidden !important;
  }

  .hi-print-target,
  .hi-print-target * {
    visibility: visible !important;
  }

  .hi-print-target {
    position: absolute !important;
    inset: 0 auto auto 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-height: auto !important;
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #111 !important;
    color: #111 !important;
    background: #fff !important;
  }

  .hi-print-target .hi-pro-cert-head,
  .hi-print-target .hi-pro-cert-hero,
  .hi-print-target .hi-hdi-hero,
  .hi-print-target .hi-pro-cert-grid,
  .hi-print-target .hi-pro-cert-hashes,
  .hi-print-target .hi-pro-cert-foot,
  .hi-print-target .hi-hdi-mission,
  .hi-print-target .hi-hdi-claims {
    background: #fff !important;
    color: #111 !important;
  }

  .hi-lic-actions,
  .hi-cert-actions,
  .personal-header,
  .site-footer,
  #backToTop {
    display: none !important;
  }
}

/* nav license link */
.license-link,
.hi-nav-license { color: var(--brand-orange) !important; opacity: .85 !important; }
.hi-nav-identity { color: var(--brand-green) !important; opacity: .95 !important; }


/* ======================================================
   20. RESPONSIVE — Phase 4/5/10
====================================================== */

@media (max-width: 768px) {
  .hi-chat-panel {
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100dvw;
    border-left: none;
    border-radius: 0;
  }
  .hi-chat-header { padding: 16px 18px; }
  .hi-chat-messages { padding: 18px 16px; }
  .hi-chat-form { padding: 12px 14px 16px; }
  .hi-people-grid { grid-template-columns: 1fr; }
  .hi-claim-row { grid-template-columns: 1fr; }
  .hi-cert-footer { grid-template-columns: 1fr 1fr; }
  .hi-cert-footer .hi-cert-stat:last-child { grid-column: 1 / -1; }
  .hi-personal-hero-main { grid-template-columns: 1fr; }
  .hi-personal-hero-left { grid-template-columns: 1fr; }
  .hi-personal-hero-rail { grid-template-columns: repeat(2, 1fr); }
  .hi-world-head,
  .hi-ai-command-panel { grid-template-columns: 1fr; }
  .hi-world-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hi-license-hero-grid { grid-template-columns: repeat(2, 1fr); }
  .hi-license-test-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hi-demo-cert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hi-license-hero-brand { grid-template-columns: 1fr; }
  .hi-pro-cert-hero { grid-template-columns: 1fr; }
  .hi-hdi-hero { grid-template-columns: 1fr; }
  .hi-pro-cert-grid,
  .hi-pro-cert-hashes { grid-template-columns: 1fr 1fr; }
  .hi-pro-cert-seal { width: 132px; height: 132px; }
  .hi-hdi-claim-row { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 480px) {
  .hi-chat-suggestions { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .hi-chat-bubble { max-width: 94%; }
  .hi-bubble-content { font-size: .88rem; }
  .hi-chat-input { font-size: .9rem; }
  .hi-cert-name { font-size: 1.25rem; }
  .hi-personal-hero-rail { grid-template-columns: 1fr; }
  .hi-personal-hero-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .hi-hero-action { width: 100%; }
  .hi-world-grid,
  .hi-ai-command-grid { grid-template-columns: 1fr; }
  .hi-world-card { min-height: auto; }
  .hi-license-hero-grid { grid-template-columns: 1fr; }
  .hi-license-test-grid { grid-template-columns: 1fr; }
  .hi-demo-cert-head { flex-direction: column; }
  .hi-demo-cert-grid { grid-template-columns: 1fr; }
  .hi-license-flow li { grid-template-columns: 1fr; }
  .hi-license-section-head { grid-template-columns: 1fr; }
  .hi-footer-brand { grid-template-columns: 1fr; }
  .hi-pro-cert-head,
  .hi-pro-cert-foot { display: block; }
  .hi-pro-cert-status,
  .hi-pro-cert-foot div { text-align: left; margin-top: 16px; }
  .hi-pro-cert-grid,
  .hi-pro-cert-hashes { grid-template-columns: 1fr; }
  .hi-pro-cert-id { font-size: .95rem; }
}

@media (min-width: 1024px) {
  .personal-main,
  .hi-license-main {
    max-width: 1280px;
  }
}

/* Habit Editor */
.hi-habit-list-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 8px;
}
.hi-habit-edit-row {
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(255,255,255,0.05);
  padding: 8px;
  border-radius: 8px;
}
.hi-habit-edit-icon {
  width: 50px;
  text-align: center;
  font-size: 1.2rem;
}
.hi-habit-edit-name {
  flex: 1;
}
.hi-habit-edit-del {
  background: none;
  border: none;
  color: #ff4444;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 8px;
  line-height: 1;
}
.hi-btn-add-inline {
  width: 100%;
  padding: 10px;
  background: rgba(255,255,255,0.1);
  border: 1px dashed rgba(255,255,255,0.3);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.hi-btn-add-inline:hover {
  background: rgba(255,255,255,0.15);
  border-color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .hi-typing-indicator .hi-dot { animation: none; }
  .hi-ai-fab { transition: none; }
  .hi-ai-fab:hover { transform: none; }
  .hi-modal-overlay,
  .hi-modal { transition: none; }
  .hi-chat-panel { transition: none; }
  .hi-note-card,
  .hi-person-card,
  .hi-habit-btn,
  .hi-proj-card,
  .hi-btn-primary,
  .hi-progress-fill { transition: none; }
  .hi-note-card:hover,
  .hi-person-card:hover,
  .hi-habit-btn:hover,
  .hi-proj-card:hover,
  .hi-btn-primary:hover { transform: none; }
  .hi-dot { transition: none; }
  .hi-dot:hover { transform: none; }
}
