html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: #f3f3f3;
  color: #111;
}

body {
  padding: 16px;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

.page {
  max-width: 980px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #999;
  padding: 16px 24px 32px;
}

main.page.page-unboxed,
main.page-unboxed,
.page.page-unboxed,
.page-unboxed,
.page:has(.post) {
  max-width: none !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

.top-nav {
  max-width: 980px;
  margin: 0 auto 8px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  position: relative;
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid #999;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
  color: #111;
  background: #fff;
  border-radius: 0;
  z-index: 1001;
  position: relative;
}

.menu-toggle:hover {
  background: #f0f0f0;
}

.theme-dark .menu-toggle {
  background: #1d1d1d;
  border-color: #555;
  color: #f0f0f0;
}

.theme-dark .menu-toggle:hover {
  background: #262626;
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.mobile-menu-overlay.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.theme-dark .mobile-menu-overlay {
  background: rgba(0, 0, 0, 0.7);
}

.crumbs {
  color: #444;
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.03em;
}

.crumbs .separator {
  margin: 0 6px;
}

.path-root {
  margin-right: 4px;
}

.crumbs a.path-link {
  color: inherit;
  text-decoration: none;
}

.crumbs a.path-link:hover {
  text-decoration: underline;
}

.nav-links a {
  margin-left: 12px;
  padding: 4px 10px;
  border: 1px solid #999;
  background: #fff;
  text-decoration: none;
  font-size: 13px;
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
  border-radius: 0;
}

.nav-links a:hover {
  background: #e6ffe6;
}

.nav-links a.active {
  background: #222;
  color: #f4f4f4;
  border-color: #222;
}

.theme-toggle {
  margin-left: 12px;
  padding: 4px 12px;
  border: 1px solid #999;
  background: #f5f5f5;
  font-size: 13px;
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
  cursor: pointer;
  border-radius: 0;
}

.theme-toggle:hover {
  background: #e0e0e0;
}

.lang-switch {
  font-weight: 600;
}

.search-link {
  font-weight: 400;
}

/* Search input styling */
#search-input,
.search-input,
.search-input-large {
  width: 100%;
  max-width: 500px;
  padding: 8px 12px;
  border: 1px solid #999;
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  background: #fff;
  color: #111;
}

.search-input-large {
  max-width: 600px;
  padding: 12px 16px;
  font-size: 15px;
}

#search-input:focus,
.search-input:focus,
.search-input-large:focus {
  outline: none;
  border-color: #222;
  background: #f9f9f9;
}

.theme-dark #search-input,
.theme-dark .search-input,
.theme-dark .search-input-large {
  background: #1d1d1d;
  border-color: #555;
  color: #e0e0e0;
}

.theme-dark #search-input:focus,
.theme-dark .search-input:focus,
.theme-dark .search-input-large:focus {
  border-color: #888;
  background: #262626;
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  background: #e0e0e0;
  border: 1px solid #999;
  border-radius: 2px;
}

.theme-dark kbd {
  background: #333;
  border-color: #555;
  color: #e0e0e0;
}

h1, h2 {
  margin-top: 0;
  font-weight: 600;
}

.intro-block {
  margin-bottom: 32px;
}

.intro-block p {
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 16px;
  color: #333;
}

.intro-block p:last-of-type {
  font-size: 13px;
  color: #666;
  margin: 0;
}

.about-block {
  margin-bottom: 32px;
}

.notes-block {
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.small-link {
  font-size: 13px;
}

.grid-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 14px;
}

.grid-table th,
.grid-table td {
  border: 1px solid #999;
  padding: 4px 6px;
  vertical-align: top;
}

.grid-table thead th {
  background: #f0f0f0;
  font-weight: 600;
}

.col-date {
  width: 90px;
  white-space: nowrap;
}

.col-link {
  width: 100px;
  text-align: center;
  white-space: nowrap;
}

a {
  color: #0033aa;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.btn {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 0;
  border: 1px solid #006400;
  background: #008000;
  color: #ffffff;
  font-size: 13px;
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  background: #00a000;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #999;
  border-color: #666;
}

.btn:disabled:hover {
  background: #999;
}

.page-footer {
  margin-top: 24px;
  font-size: 12px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-footer,
.page-footer.back-footer,
.back-footer {
  margin-top: 48px !important;
  padding-top: 24px !important;
  border-top: 1px solid #ddd !important;
  text-align: center !important;
  font-size: 13px !important;
  display: block !important;
  gap: 0 !important;
}

.post-footer a,
.page-footer.back-footer a,
.back-footer a {
  color: #555;
  text-decoration: none;
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
}

.post-footer a:hover,
.page-footer.back-footer a:hover,
.back-footer a:hover {
  color: #111;
  text-decoration: underline;
}

.dot-separator {
  opacity: 0.6;
}

.post {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px 32px;
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
}

.post-header {
  border-bottom: 1px solid #999;
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.post-meta {
  margin: 0;
  font-size: 13px;
  color: #555;
}

.post-body p {
  line-height: 1.5;
  margin: 0 0 12px;
}

.status-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 12px;
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
  border-radius: 2px;
  border: 1px solid transparent;
}

/* Focus visibility for keyboard users */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #005fcc;
  outline-offset: 2px;
}

.status-active {
  background: #008000;
  border-color: #006400;
  color: #ffffff;
}

.status-paused {
  background: #fff8e1;
  border-color: #e0b800;
  color: #6b4c00;
}

.status-archive {
  background: #e5e5e5;
  border-color: #b0b0b0;
  color: #444444;
}

.status-planned {
  background: #e3f2fd;
  border-color: #64b5f6;
  color: #01579b;
}

.status-ongoing {
  background: #fff3e0;
  border-color: #ffb74d;
  color: #e65100;
}

.status-live {
  background: #e8f5e9;
  border-color: #4caf50;
  color: #1b5e20;
}

.status-legend {
  margin-bottom: 24px;
  padding: 16px 20px;
  background: #f8f8f8;
  border-left: 3px solid #999;
  font-size: 13px;
  color: #333;
  line-height: 1.8;
}

.status-legend strong {
  color: #111;
  display: block;
  margin-bottom: 8px;
}

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 140px);
  text-align: center;
  padding: 48px 24px;
  max-width: 800px;
  margin: 0 auto;
}

.error-code {
  font-size: 72px;
  margin: 0;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1;
}

.error-message {
  margin-top: 16px;
  font-size: 18px;
  color: #666;
}

.error-action {
  margin-top: 24px;
}

.theme-dark .error-message {
  color: #aaa;
}

@media (max-width: 768px) {
  .error-page {
    min-height: calc(100vh - 120px);
    padding: 32px 16px;
  }

  .error-code {
    font-size: 56px;
  }

  .error-message {
    font-size: 16px;
    margin-top: 12px;
  }

  .error-action {
    margin-top: 20px;
  }
}

@media (max-width: 480px) {
  .error-page {
    min-height: calc(100vh - 100px);
    padding: 24px 16px;
  }

  .error-code {
    font-size: 48px;
  }

  .error-message {
    font-size: 15px;
  }
}

.status-legend .status-badge {
  margin-right: 6px;
}

.status-legend br {
  margin-bottom: 4px;
}

/* Dark theme overrides */
html.theme-dark,
body.theme-dark {
  background: #141414;
  color: #f0f0f0;
}

.theme-dark .page {
  background: #1d1d1d;
  border-color: #444;
}

.theme-dark .page.page-unboxed,
.theme-dark .page-unboxed,
.theme-dark .page:has(.post) {
  background: transparent !important;
  border: none !important;
}

.theme-dark .post-footer,
.theme-dark .page-footer.back-footer,
.theme-dark .back-footer {
  border-top-color: #444;
}

.theme-dark .post-footer a,
.theme-dark .page-footer.back-footer a,
.theme-dark .back-footer a {
  color: #aaa;
}

.theme-dark .post-footer a:hover,
.theme-dark .page-footer.back-footer a:hover,
.theme-dark .back-footer a:hover {
  color: #f0f0f0;
}

.theme-dark .top-nav {
  color: #e0e0e0;
}

.theme-dark .intro-block p {
  color: #e0e0e0;
}

.theme-dark .intro-block p:last-of-type {
  color: #aaa;
}

.theme-dark .grid-table th,
.theme-dark .grid-table td {
  border-color: #555;
}

.theme-dark .grid-table thead th {
  background: #262626;
}

.theme-dark a {
  color: #7fb4ff;
}

.theme-dark .nav-links a {
  background: #1d1d1d;
  border-color: #555;
}

.theme-dark .nav-links a:hover {
  background: #333;
}

.theme-dark .nav-links a.active {
  background: #f0f0f0;
  color: #111;
  border-color: #f0f0f0;
}

.theme-dark .status-active {
  background: #2d5a2d;
  border-color: #4a7c4a;
  color: #a0ffa0;
}

.theme-dark .status-paused {
  background: #4a3d1a;
  border-color: #6b5a2a;
  color: #ffd54f;
}

.theme-dark .status-archive {
  background: #3a3a3a;
  border-color: #555;
  color: #bbb;
}

.theme-dark .status-planned {
  background: #1a2d3d;
  border-color: #2a4d6d;
  color: #7fb4ff;
}

.theme-dark .status-ongoing {
  background: #4a2d1a;
  border-color: #6b4d2a;
  color: #ffb74d;
}

.theme-dark .status-live {
  background: #1a3d1a;
  border-color: #2d5a2d;
  color: #81c784;
}

.theme-dark .status-legend {
  background: #262626;
  border-left-color: #666;
  color: #e0e0e0;
}

.theme-dark .status-legend strong {
  color: #f0f0f0;
}

.theme-dark .theme-toggle {
  background: #262626;
  border-color: #666;
  color: #f0f0f0;
}

.theme-dark .lang-switch {
  background: #1d1d1d;
  border-color: #555;
}

.theme-dark .btn {
  background: #009944;
  border-color: #007733;
  color: #ffffff;
}

.theme-dark .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #444;
  border-color: #333;
}

.theme-dark .btn:disabled:hover {
  background: #444;
}

.pricing-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 32px 0;
}

.tier-card {
  border: 1px solid #999;
  padding: 24px;
  background: #fff;
  position: relative;
}

.tier-recommended {
  border-color: #008000;
  border-width: 2px;
}

.tier-badge {
  position: absolute;
  top: -12px;
  left: 24px;
  background: #008000;
  color: #fff;
  padding: 4px 12px;
  font-size: 12px;
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
}

.tier-header {
  margin-bottom: 16px;
}

.tier-header h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 600;
}

.tier-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.price-amount {
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
}

.price-period {
  font-size: 14px;
  color: #666;
}

.tier-description {
  font-size: 14px;
  color: #666;
  margin: 0 0 20px 0;
  line-height: 1.5;
}

.tier-btn {
  width: 100%;
  margin-bottom: 20px;
}

.tier-features {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
}

.tier-features li {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.tier-features li:last-child {
  border-bottom: none;
}

.faq-item {
  border-bottom: 1px solid #999;
  margin-bottom: 0;
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  background: none;
  border: none;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

.faq-question:hover {
  opacity: 0.7;
}

.faq-icon {
  font-size: 20px;
  font-weight: 300;
  line-height: 1;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 16px;
}

.faq-question[aria-expanded="true"] .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0;
}

.faq-question[aria-expanded="true"] + .faq-answer {
  max-height: 500px;
  padding-bottom: 16px;
}

.faq-answer p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #666;
}

.theme-dark .tier-card {
  background: #1d1d1d;
  border-color: #555;
}

.theme-dark .tier-recommended {
  border-color: #009944;
}

.theme-dark .tier-badge {
  background: #009944;
}

.theme-dark .price-period {
  color: #aaa;
}

.theme-dark .tier-description {
  color: #aaa;
}

.theme-dark .tier-features li {
  border-bottom-color: #333;
}

.theme-dark .faq-item {
  border-bottom-color: #555;
}

.theme-dark .faq-answer p {
  color: #aaa;
}

.details-list {
  margin: 24px 0;
  padding: 0;
}

.details-list dt {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 16px;
  margin-bottom: 4px;
  font-weight: 500;
}

.details-list dt:first-child {
  margin-top: 0;
}

.details-list dd {
  font-size: 15px;
  color: #111;
  margin: 0 0 0 0;
  padding: 0;
}

.detail-note {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
  line-height: 1.5;
  font-style: italic;
}

.details-info {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #999;
}

.faq-section {
  margin-top: 48px;
}

.details-info h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 12px 0;
}

.details-info p {
  font-size: 14px;
  line-height: 1.6;
  color: #666;
  margin: 0 0 16px 0;
}

.details-info p:last-child {
  margin-bottom: 0;
}

.theme-dark .details-list dt {
  color: #aaa;
}

.theme-dark .details-list dd {
  color: #f0f0f0;
}

.theme-dark .detail-note {
  color: #aaa;
}

.theme-dark .details-info {
  border-top-color: #555;
}

.theme-dark .details-info h3 {
  color: #f0f0f0;
}

.theme-dark .details-info p {
  color: #aaa;
}

@media (max-width: 768px) {
  .faq-section {
    margin-top: 32px;
  }
  
  .pricing-tiers {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .tier-card {
    padding: 20px;
  }
  
  .price-amount {
    font-size: 28px;
  }
}

@media (max-width: 768px) {
  body {
    padding: 8px;
    font-size: 16px;
  }

  .page,
  .top-nav {
    margin: 0 4px;
  }

  .page {
    padding: 16px;
  }

  .page.page-unboxed,
  .page-unboxed,
  .page:has(.post) {
    margin: 0;
    padding: 0;
  }

  .post {
    padding: 32px 16px 24px;
  }

  .top-nav {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
  }

  .menu-toggle {
    display: block;
    order: 2;
    z-index: 1001;
    position: relative;
    flex-shrink: 0;
  }

  .crumbs {
    order: 1;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-menu-overlay {
    display: block;
  }

  .nav-links {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 100vh;
    background: #fff;
    margin: 0;
    padding: 60px 0 0;
    flex-direction: column;
    gap: 0;
    z-index: 999;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    align-items: flex-start;
    justify-content: flex-start;
    visibility: hidden;
  }

  .nav-links.mobile-open {
    transform: translateX(0);
    visibility: visible;
  }

  .nav-links a,
  .nav-links button {
    margin-left: 0;
    width: 100%;
    text-align: left;
    min-height: 56px;
    padding: 16px 20px;
    border: none;
    border-bottom: 1px solid #ddd;
    border-radius: 0;
    display: flex;
    align-items: center;
    font-size: 16px;
    background: #fff;
    font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
  }

  .nav-links button.theme-toggle {
    font-size: 16px;
    padding: 16px 20px;
    min-height: 56px;
    width: 100%;
    text-align: left;
    justify-content: flex-start;
  }

  .nav-links a:last-child,
  .nav-links button:last-child {
    border-bottom: none;
  }

  .nav-links a:hover,
  .nav-links button:hover {
    background: #f5f5f5;
  }

  .nav-links a.active {
    background: #222;
    color: #f4f4f4;
    border-color: #222;
  }

  .theme-dark .nav-links {
    background: #1d1d1d;
  }

  .theme-dark .nav-links a,
  .theme-dark .nav-links button {
    border-bottom-color: #444;
    background: #1d1d1d;
    color: #f0f0f0;
  }

  .theme-dark .nav-links a:hover,
  .theme-dark .nav-links button:hover {
    background: #262626;
  }

  .search-input-large {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    font-size: 16px;
    padding: 14px 16px;
  }

  .grid-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
}
