@import url("https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter+Tight:wght@300;400;500;600;700&display=swap");

/* hipobuy spreadsheet guide — shared styles for static article pages */
:root {
  --bg: #f4f6fa;
  --bg-soft: #eaedf5;
  --bg-card: #ffffff;
  --ink: #0c1119;
  --ink-soft: #202a3a;
  --body-text: #38424f;
  --muted: #5f6a7c;
  --line: #dde3ee;
  --line-strong: #c8d0de;
  --accent: #3454a5;
  --accent-dark: #28417f;
  --accent-soft: #e6ecf8;
  --silver: #c9d1df;
  --dark: rgba(12, 17, 25, 0.88);
  --nav-h: 64px;
  --font-heading: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-body: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-dark);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  color: var(--ink);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

:focus-visible {
  outline: 2px solid #9db4e8;
  outline-offset: 3px;
  border-radius: 4px;
}

[id] {
  scroll-margin-top: 96px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 200;
}

.skip-link:focus {
  left: 16px;
}

/* ---------- navigation ---------- */
.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgba(12, 17, 25, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 24px rgba(12, 17, 25, 0.18);
}

@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  .site-nav {
    background: #0c1119;
  }
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  height: var(--nav-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.logo {
  font-family: var(--font-heading);
  font-size: 25px;
  line-height: 1;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.logo:hover {
  color: #dfe6f4;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.nav-menu a,
.nav-menu button {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  background: none;
  border: 0;
  padding: 9px 13px;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu button:hover,
.nav-menu a[aria-current="page"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-menu a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 #8fa9dd;
}

.nav-shop {
  font-size: 13px;
  font-weight: 600;
  color: #0c1119;
  background: #fff;
  border-radius: 6px;
  padding: 9px 16px;
  text-decoration: none;
  white-space: nowrap;
}

.nav-shop:hover {
  color: #0c1119;
  background: #e3e9f6;
}

.nav-panel {
  position: absolute;
  top: calc(var(--nav-h) - 4px);
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, calc(100vw - 32px));
  background: rgba(14, 20, 30, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 24px 48px rgba(6, 10, 18, 0.45);
}

.nav-panel[hidden] {
  display: none;
}

.nav-panel .panel-title {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin: 4px 6px 10px;
}

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

.cat-grid a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
}

.cat-grid a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.cat-grid a i {
  color: #8fa9dd;
  font-size: 15px;
}

@media (max-width: 900px) {
  .nav-menu {
    display: none;
  }
  .nav-inner {
    justify-content: space-between;
    padding: 0 16px;
  }
}

/* ---------- layout ---------- */
main {
  padding-top: var(--nav-h);
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) 260px;
  gap: 56px;
  max-width: 1140px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  align-items: start;
}

.article-layout--single {
  grid-template-columns: minmax(0, 780px);
  justify-content: center;
  max-width: 900px;
}

@media (max-width: 1000px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding: 24px 20px 96px;
  }
  .article-aside {
    display: none;
  }
}

/* ---------- breadcrumb ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.breadcrumb span.sep {
  color: var(--silver);
}

/* ---------- article head ---------- */
.article-head {
  margin-bottom: 26px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid #d3ddf0;
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 16px;
}

.article-head h1 {
  font-size: clamp(30px, 4.2vw, 46px);
  margin: 0 0 14px;
}

.lede {
  font-size: 18.5px;
  line-height: 1.65;
  color: var(--body-text);
  margin: 0 0 18px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 13px;
  color: var(--muted);
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cover {
  margin: 24px 0 0;
}

.cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.cover figcaption {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 8px;
}

/* ---------- toc ---------- */
.toc {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 28px 0 34px;
}

.toc h2 {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
  font-weight: 600;
}

.toc ol {
  margin: 0;
  padding-left: 18px;
  columns: 2;
  column-gap: 26px;
  font-size: 14.5px;
}

.toc li {
  margin-bottom: 6px;
  break-inside: avoid;
}

.toc a {
  color: var(--ink-soft);
  text-decoration: none;
}

.toc a:hover {
  color: var(--accent);
  text-decoration: underline;
}

@media (max-width: 640px) {
  .toc ol {
    columns: 1;
  }
}

/* ---------- prose ---------- */
.prose h2 {
  font-size: clamp(23px, 3vw, 29px);
  margin: 40px 0 12px;
  padding-top: 6px;
}

.prose h3 {
  font-size: 20px;
  margin: 26px 0 8px;
}

.prose p {
  margin: 0 0 16px;
  color: var(--body-text);
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
  color: var(--body-text);
}

.prose li {
  margin-bottom: 8px;
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.prose a {
  text-decoration: underline;
}

.callout {
  background: var(--accent-soft);
  border: 1px solid #d3ddf0;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 18px;
  margin: 24px 0;
  font-size: 15.5px;
  color: #26344b;
}

.callout strong {
  color: var(--accent-dark);
}

/* ---------- tables ---------- */
.table-scroll {
  overflow-x: auto;
  margin: 22px 0 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  font-size: 14.5px;
}

caption {
  caption-side: top;
  text-align: left;
  font-size: 12.5px;
  color: var(--muted);
  padding: 12px 16px 0;
}

th,
td {
  text-align: left;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

thead th {
  font-family: var(--font-body);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: #f7f9fd;
  font-weight: 600;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- checklist ---------- */
.checklist {
  list-style: none;
  padding: 0;
  margin: 20px 0 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.checklist li {
  display: flex;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  margin: 0;
  color: var(--body-text);
}

.checklist li:last-child {
  border-bottom: 0;
}

.checklist li::before {
  content: "\2610";
  color: var(--accent);
  font-size: 15px;
  line-height: 1.5;
}

.step-list {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 20px 0 26px;
}

.step-list li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 14px;
  color: var(--body-text);
}

.step-list li::before {
  content: counter(step);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid #d3ddf0;
  border-radius: 999px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 3px;
}

/* ---------- related ---------- */
.related {
  margin-top: 46px;
  border-top: 1px solid var(--line-strong);
  padding-top: 26px;
}

.related h2 {
  font-size: 24px;
  margin: 0 0 4px;
}

.related p.related-intro {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 16px;
}

.related-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.related-list a {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  font-size: 15px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.related-list a:hover {
  border-color: var(--accent);
  transform: translateX(2px);
  color: var(--ink);
}

.related-list i {
  color: var(--accent);
  font-size: 16px;
  margin-top: 2px;
}

.related-list span {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.back-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}

.back-home:hover {
  background: #182234;
  color: #fff;
}

/* ---------- aside ---------- */
.article-aside {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}

.aside-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.aside-card h2 {
  font-size: 20px;
  margin: 0 0 8px;
}

.aside-card p {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 14px;
  line-height: 1.6;
}

.aside-card a.btn-dark {
  display: block;
  text-align: center;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 11px 14px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
}

.aside-card a.btn-dark:hover {
  background: var(--accent-dark);
}

.aside-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13.5px;
}

.aside-card ul li {
  border-top: 1px solid var(--line);
  padding: 8px 0;
}

.aside-card ul li:first-child {
  border-top: 0;
}

.aside-card ul a {
  color: var(--ink-soft);
  text-decoration: none;
}

.aside-card ul a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ---------- footer ---------- */
.site-footer {
  background: #101827;
  color: rgba(255, 255, 255, 0.72);
  padding: 44px 24px calc(96px + env(safe-area-inset-bottom));
  font-size: 14px;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 32px;
}

@media (max-width: 820px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 26px;
  }
}

.footer-brand .logo {
  font-size: 24px;
}

.footer-brand p {
  margin: 10px 0 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.6);
  max-width: 340px;
}

.site-footer h3 {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin: 0 0 12px;
  font-weight: 600;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin-bottom: 8px;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-bottom {
  max-width: 1180px;
  margin: 30px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}

/* ---------- mobile tab bar + sheet ---------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 110;
  display: none;
  background: rgba(12, 17, 25, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}

.tabbar a,
.tabbar button {
  flex: 1;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--font-body);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  padding: 4px 2px;
  border-radius: 8px;
}

.tabbar a i,
.tabbar button i {
  font-size: 19px;
  line-height: 1;
}

.tabbar a:hover,
.tabbar button:hover,
.tabbar [aria-expanded="true"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 900px) {
  .tabbar {
    display: flex;
  }
  body {
    padding-bottom: 0;
  }
}

.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-wrap[hidden] {
  display: none;
}

.sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 18, 0.55);
  border: 0;
  padding: 0;
  cursor: pointer;
}

.sheet {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 85dvh;
  background: #0e1420;
  color: #fff;
  border-radius: 18px 18px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sheetUp 0.24s ease-out;
  padding-bottom: env(safe-area-inset-bottom);
}

@keyframes sheetUp {
  from {
    transform: translateY(24px);
    opacity: 0.6;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.sheet-handle {
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  margin: 10px auto 0;
  flex: 0 0 auto;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sheet-head h2 {
  font-family: var(--font-heading);
  font-size: 21px;
  color: #fff;
  margin: 0;
}

.sheet-close {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.sheet-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 12px 20px;
}

.sheet-body .cat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sheet-body a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 13.5px;
  padding: 10px 10px;
  border-radius: 7px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.sheet-body a:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.sheet-body a i {
  color: #8fa9dd;
  margin-top: 2px;
}

.sheet-group-title {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin: 12px 10px 6px;
}

@media (min-width: 901px) {
  .sheet-wrap {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sheet {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ---------- utilities ---------- */
.visually-hidden-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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