:root {
  color-scheme: dark;
  color: #f5f8ff;
  background: #080e18;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
  --ink: #f5f8ff;
  --muted: #a8b5ca;
  --line: #293951;
  --surface: #101b2d;
  --raised: #182941;
  --lime: #d7f56b;
  --cyan: #70dcf6;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
body:has(dialog[open]) { overflow: hidden; }
.hh { min-height: 100dvh; background: radial-gradient(ellipse at 47% 0, #142540, transparent 60%); }
.hh :is(h1, h2, h3, h4, p, ul, dl, dd) { margin: 0; }
.hh :is(ul) { padding: 0; list-style: none; }
.hh p { color: var(--muted); line-height: 1.55; overflow-wrap: anywhere; }
.hh h1 { font-size: clamp(2.15rem, 4vw, 3.4rem); letter-spacing: -.062em; line-height: 1.04; font-weight: 690; }
.hh h2 { font-size: 1.18rem; letter-spacing: -.028em; }
.hh h3 { font-size: 1.02rem; letter-spacing: -.018em; }
.hh :is(a, button, input, textarea, select, summary):focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.hh :is(h1, main):focus { outline: none; }
.hh a { color: var(--cyan); text-underline-offset: .18em; }
.hh :is(button, input, select, textarea) { font: inherit; }
.hh button, .hh-button, .hh .file {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; border: 1px solid #37506f; border-radius: 9px; padding: .55rem .85rem;
  background: #16253c; color: var(--ink); cursor: pointer; font-size: .89rem; font-weight: 620;
  line-height: 1.25; text-decoration: none; transition: background-color .15s, border-color .15s, color .15s;
}
.hh :is(button, .hh-button, .file):hover { background: #203550; color: var(--ink); }
.hh button:disabled, .hh .file:has(input:disabled) { opacity: .5; cursor: default; }
.hh button.primary { background: var(--lime); color: #182015; border-color: transparent; }
.hh button.primary:hover { background: #e6ff95; color: #182015; }
.hh button.hh-quiet { background: transparent; border-color: transparent; color: var(--muted); }
.hh button.hh-quiet:hover { background: var(--raised); color: var(--ink); }
.hh button.hh-icon-button { padding: 0; width: 44px; flex-shrink: 0; }
.hh :is(input, textarea, select):not([type="checkbox"], [type="file"]) {
  min-height: 44px; width: 100%; background: #0d1829; color: var(--ink); border: 1px solid #38506e;
  border-radius: 8px; padding: .62rem .75rem;
}
.hh input::placeholder { color: var(--muted); }
.hh input[type="checkbox"] { width: 1rem; height: 1rem; margin: .18rem 0 0; accent-color: var(--lime); flex: none; }
.hh label:not(.file, .hh-sr) { display: block; margin: .95rem 0 .38rem; font-size: .89rem; font-weight: 600; }
.hh label.consent { display: flex; gap: .65rem; align-items: start; margin-block: .9rem; font-weight: 480; line-height: 1.5; }
.hh :is(code, dd, li) { overflow-wrap: anywhere; }
.hh .small { color: var(--muted); font-size: .82rem; }
.hh .bar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-block: .8rem; }
.hh .panel { min-width: 0; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.hh :is(.error, .notice) { padding: .7rem .85rem; margin-block: .65rem; border: 1px solid; border-radius: 9px; }
.hh .error { color: #ffd2d4; border-color: #663d4a; background: #392331; }
.hh .notice { color: #c4f4d7; border-color: #2b5a4c; background: #15342f; }
.hh :is(.hh-sr, .hh-skip:not(:focus)) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hh .hh-skip:focus { position: fixed; inset: .5rem auto auto .5rem; z-index: 5; background: var(--raised); padding: .7rem; }
.hh-top { background: #0b1423; border-bottom: 1px solid #24344e; }
.hh-top-inner { width: min(100% - 4rem, 82rem); margin: auto; min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: .85rem; }
.hh a.hh-brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); font-size: 1.24rem; font-weight: 710; letter-spacing: -.042em; text-decoration: none; }
.hh-brand img { border-radius: 9px; border: 1px solid #364760; }
.hh-account { display: flex; align-items: center; gap: .66rem; min-width: 0; }
.hh-account-name { color: var(--muted); font-size: .87rem; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hh-account button { white-space: nowrap; }
.hh-layout { width: min(100% - 4rem, 82rem); min-height: calc(100dvh - 67px); margin: auto; display: grid; grid-template-columns: 13rem minmax(0, 1fr); }
.hh-side { padding: 2rem 1.15rem 1.5rem 0; border-right: 1px solid #27374e; display: flex; flex-direction: column; gap: 1.5rem; }
.hh-side nav { display: grid; gap: .3rem; }
.hh-side nav :is(button, a) {
  display: flex; align-items: center; justify-content: flex-start; gap: .65rem; min-height: 46px;
  padding: .58rem .69rem; border: 1px solid transparent; border-radius: 8px; background: none;
  color: var(--muted); font-size: .9rem; font-weight: 610; text-decoration: none; white-space: nowrap;
}
.hh-side nav a svg:last-child { margin-left: auto; }
.hh-side nav :is(button, a):hover { background: var(--raised); color: var(--ink); }
.hh-side nav button[aria-current] { background: #1b2c43; border-color: #364d69; color: var(--ink); }
.hh-side nav button[aria-current] svg { color: var(--lime); }
.hh-private { display: flex; align-items: center; gap: .6rem; padding-inline: .69rem; color: var(--muted); font-size: .8rem; }
.hh-private svg { color: #92abc9; }
.hh-main { min-width: 0; padding: clamp(1.9rem, 4vw, 3.5rem) 0 3rem clamp(1.4rem, 4vw, 3.75rem); }
.hh-page-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.65rem; }
.hh-page-heading p { margin-top: .63rem; font-size: .96rem; }
.hh .hh-add { white-space: nowrap; padding-inline: 1rem; }
.hh-search { display: flex; align-items: center; gap: .65rem; padding: .38rem .44rem .38rem .88rem; border-radius: 12px; border: 1px solid #3a506e; background: #0d1829; color: #9fb8d7; }
.hh-search:focus-within { border-color: var(--cyan); }
.hh .hh-search input { flex: 1 0 0; min-width: 0; padding: .4rem 0; border: 0; background: transparent; outline: none; }
.hh .hh-search input::-webkit-search-cancel-button { appearance: none; }
.hh-search button { min-height: 38px; }
.hh-library { margin-top: 1.55rem; }
.hh-library-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.hh-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .7rem;
  padding: clamp(2rem, 6vw, 4.25rem) 1.1rem; text-align: center;
  background: radial-gradient(ellipse at 50% 4%, #1d3250, transparent 64%), #101b2d;
}
.hh-empty p { max-width: 32ch; }
.hh-empty button { margin-top: .4rem; }
.hh-feature-icon, .hh-tile {
  display: grid; place-items: center; flex: none; border-radius: 12px; width: 48px; height: 48px;
  color: var(--cyan); background: #192d46; border: 1px solid #355275;
}
.hh-feature-icon { width: 64px; height: 64px; color: var(--lime); border-color: #607444; background: linear-gradient(150deg, #283b42, #1b2d43); }
.hh-tile-receipt { color: var(--lime); background: #22353b; border-color: #425c4a; }
.hh .hh-doc-list > li + li { border-top: 1px solid var(--line); }
.hh .hh-doc-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; width: 100%; gap: .9rem; align-items: center;
  justify-content: initial; padding: .92rem; border: 0; background: transparent; border-radius: 12px; text-align: left;
}
.hh .hh-doc-row:hover { background: #182a43; }
.hh-doc-row > svg { color: #91a9cc; }
.hh-doc-text { display: grid; gap: .3rem; min-width: 0; }
.hh-doc-text strong { color: var(--ink); font-size: 1rem; overflow-wrap: anywhere; }
.hh-status { display: inline-flex; align-items: center; gap: .36rem; width: fit-content; color: #b8c9e0; background: #1b2b43; border-radius: 6px; padding: .23rem .43rem; font-size: .74rem; font-weight: 610; }
.hh-status i { width: .36rem; height: .36rem; border-radius: 100%; background: currentColor; flex: none; }
.hh-status-ready { color: #a0edc5; background: #1a3839; }
.hh-status-failed { color: #ffc0c3; background: #412838; }
.hh .hh-pagination { justify-content: flex-end; color: var(--muted); }
.hh-tabs { display: flex; flex-wrap: wrap; gap: .38rem; }
.hh .hh-tabs button { min-height: 42px; background: transparent; border-color: transparent; color: var(--muted); }
.hh .hh-tabs button[aria-pressed="true"] { background: #22364f; border-color: #416083; color: var(--ink); }
.hh .hh-tabs button:hover { background: var(--raised); color: var(--ink); }
.hh-connection-card { max-width: 49rem; margin-top: .85rem; padding: clamp(1.15rem, 3vw, 1.8rem); }
.hh-connection-heading { display: flex; align-items: center; gap: .85rem; margin-bottom: .85rem; }
.hh-connection-card p + p { margin-top: .5rem; }
.hh-connection-card input, .hh-connection-card select { max-width: 31rem; }
.hh-connection-card input + button { display: flex; margin-top: .65rem; }
.hh-signin { width: min(100% - 2rem, 82rem); margin: auto; padding: clamp(2.6rem, 9vw, 8rem) 0; }
.hh-signin-card { width: min(100%, 36rem); display: grid; justify-items: start; gap: 1rem; margin: auto; padding: clamp(1.5rem, 5vw, 3rem); border: 1px solid var(--line); border-radius: 19px; background: linear-gradient(145deg, #182c47, #101b2d 66%); }
.hh-dialog { width: min(100% - 2rem, 47rem); max-width: none; max-height: min(calc(100dvh - 2rem), 53rem); margin: auto; padding: 0; overflow: auto; background: #111d2f; color: var(--ink); border: 1px solid #3b5171; border-radius: 16px; box-shadow: 0 18px 80px #020611b3; }
.hh-drawer { width: min(100%, 39rem); height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; border-radius: 16px 0 0 16px; }
.hh-dialog::backdrop { background: #020711c2; }
.hh-dialog-heading { position: sticky; z-index: 1; top: 0; display: flex; align-items: start; justify-content: space-between; gap: .85rem; padding: 1.2rem 1.35rem; border-bottom: 1px solid var(--line); background: #111d2f; }
.hh-dialog-heading h2 { line-height: 1.15; font-size: clamp(1.3rem, 3vw, 1.8rem); overflow-wrap: anywhere; }
.hh-dialog-heading p { margin-bottom: .26rem; }
.hh-dialog-body { padding: 1.15rem 1.35rem 1.6rem; }
.hh-dialog-body > p + p { margin-top: .65rem; }
.hh-detail-status { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.hh-detail-panel { margin-top: .9rem; padding: 1rem; }
.hh-dialog-body > section.panel { padding: 1rem; margin-block: .85rem; }
.hh-detail-panel :is(h3, h4) { margin-bottom: .6rem; }
.hh-detail-panel p + p { margin-top: .4rem; }
.hh-detail-panel dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .4rem .75rem; margin: .75rem 0; }
.hh-detail-panel dt, .hh-doc-facts dt { color: var(--muted); font-size: .82rem; }
.hh-doc-facts { display: flex; gap: 1rem 2rem; flex-wrap: wrap; padding-block: .3rem 1rem; }
.hh-doc-facts dd { margin-top: .18rem; font-size: .91rem; font-weight: 620; }
.hh-receipt-items li { display: flex; justify-content: space-between; gap: .8rem; padding-block: .48rem; }
.hh-receipt-items li + li { border-top: 1px solid var(--line); }
.hh-receipt-items strong { flex: none; font-variant-numeric: tabular-nums; }
.hh-drop { padding: 1.3rem .85rem; display: grid; justify-items: center; text-align: center; border: 1px dashed #4d6d93; border-radius: 12px; background: #13233b; color: var(--cyan); }
.hh-drop.hh-dragging { background: #233d57; border-color: var(--lime); }
.hh-drop > p:first-of-type { color: var(--ink); margin-top: .55rem; font-weight: 600; }
.hh-drop .bar { justify-content: center; }
.hh .file { position: relative; overflow: hidden; margin: 0; }
.hh .file input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.hh .file:focus-within { outline: 2px solid var(--cyan); outline-offset: 3px; }
.hh .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .7rem; margin-top: .85rem; }
.hh figure { margin: 0; padding: .55rem; border: 1px solid var(--line); border-radius: 9px; overflow-wrap: anywhere; }
.hh .preview { height: 145px; display: grid; place-items: center; overflow: hidden; margin-bottom: .35rem; border-radius: 6px; background: #0b1422; }
.hh .preview img { max-width: 100%; max-height: 145px; object-fit: contain; }
.hh .page-actions { display: flex; gap: .26rem; flex-wrap: wrap; margin-top: .35rem; }
.hh .page-actions button { padding-inline: .48rem; }
.hh .saved-preview-viewport { width: 100%; max-height: 60vh; overflow: auto; background: #0b1422; border: 1px solid var(--line); border-radius: 8px; }
.hh .saved-sheet { position: relative; }
.hh .saved-sheet img { position: absolute; top: 50%; left: 50%; max-width: none; max-height: none; height: auto; }
.hh .saved-preview-viewport:focus { outline: 2px solid var(--cyan); }
.hh .excerpt { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .88rem; max-height: 12rem; overflow: auto; }
.hh-dialog form.panel { padding: 1rem; }
.hh-dialog fieldset { min-width: 0; margin: .9rem 0; padding: .7rem; border: 1px solid var(--line); border-radius: 8px; }
.hh-dialog textarea { min-height: 5rem; resize: vertical; }
.hh-connection-card details { margin-block: .75rem; }
.hh-connection-card summary { cursor: pointer; color: var(--ink); padding-block: .5rem; }
@media (max-width: 760px) {
  .hh-top-inner, .hh-layout { width: calc(100% - 2rem); }
  .hh-layout { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .hh-side { display: block; padding: .45rem 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .hh-side nav { display: flex; gap: .2rem; }
  .hh-side nav :is(button, a) { padding-inline: .55rem; gap: .34rem; font-size: .82rem; }
  .hh-side nav svg { width: 17px; }
  .hh-side nav a svg:last-child { display: none; }
  .hh-private, .hh-account-name { display: none; }
  .hh-main { padding: 1.65rem 0 2rem; }
  .hh-page-heading { align-items: flex-start; flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .hh-page-heading p { font-size: .9rem; }
  .hh .hh-add { width: 100%; }
  .hh .hh-doc-row { column-gap: .65rem; row-gap: .28rem; grid-template-columns: auto minmax(0, 1fr) auto; padding: .72rem; }
  .hh-doc-row .hh-tile { grid-row: span 2; width: 40px; height: 40px; }
  .hh-doc-row .hh-status { grid-column: 2; grid-row: 2; }
  .hh-doc-row > svg { grid-column: 3; grid-row: 1 / span 2; }
  .hh-dialog { width: calc(100% - 1rem); max-height: calc(100dvh - 1rem); }
  .hh-drawer { width: 100%; max-height: 100dvh; border-radius: 0; }
  .hh-dialog-heading, .hh-dialog-body { padding-inline: .85rem; }
  .hh .hh-tabs button { padding-inline: .55rem; font-size: .82rem; }
}
@media (max-width: 360px) {
  .hh-side nav :is(button, a) { padding-inline: .4rem; gap: .25rem; }
  .hh-side nav svg { width: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .hh :is(button, a) { transition: none; }
}
