/* Cursor-inspired app shell — Kosdes */

:root {
  --app-nav-w: 14rem;
  --right-w: 14rem;
  --radius: 8px;
  --portal-max: none;
}

body {
  font-family: "Inter", "Segoe UI", "Noto Sans", "Helvetica Neue", Arial,
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.shell {
  min-height: 100vh;
  background: var(--page-bg);
}

.app-frame.portal-frame {
  max-width: none;
  margin: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

.app-chrome {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--page-bg);
}

.shell.has-app-chrome {
  padding-top: var(--app-chrome-h, 5.25rem);
}

.app-cache-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem 0.45rem 0.85rem;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  background: var(--panel);
  border-bottom: 1px solid var(--line-soft);
}

.app-cache-notice-summary {
  display: none;
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.app-cache-notice-summary:hover {
  color: var(--link-accent);
}

.app-cache-notice.is-collapsed {
  align-items: center;
  padding: 0.3rem 0.65rem 0.3rem 0.85rem;
}

.app-cache-notice.is-collapsed .app-cache-notice-body {
  display: none;
}

.app-cache-notice.is-collapsed .app-cache-notice-summary {
  display: block;
}

.app-cache-notice-body {
  flex: 1;
  min-width: 0;
}

.app-cache-notice-text {
  margin: 0;
}

.app-cache-notice-text strong {
  color: var(--text);
  font-weight: 500;
}

.app-cache-notice-shortcuts {
  display: inline;
}

.app-cache-notice-platform {
  white-space: nowrap;
}

.app-cache-notice-sep {
  margin: 0 0.35rem;
  opacity: 0.5;
}

.app-cache-notice kbd {
  display: inline-block;
  margin: 0 0.05rem;
  padding: 0.05rem 0.3rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  line-height: 1.35;
  color: var(--text);
  background: var(--panel-hover);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.app-cache-notice-toggle {
  flex-shrink: 0;
  margin: 0;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 1rem;
  line-height: 1;
  color: var(--muted);
  background: var(--panel-hover);
  cursor: pointer;
}

.app-cache-notice-toggle:hover {
  color: var(--text);
  border-color: var(--line-soft);
}

@media (max-width: 640px) {
  .app-cache-notice-shortcuts {
    display: block;
    margin-top: 0.25rem;
  }

  .app-cache-notice-sep {
    display: none;
  }

  .app-cache-notice-platform {
    display: block;
    white-space: normal;
  }

  .app-cache-notice-platform + .app-cache-notice-platform {
    margin-top: 0.2rem;
  }
}

.app-header.portal-header {
  background: var(--page-bg);
  border-bottom: 1px solid var(--line);
}

.app-topbar-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: none;
  margin: 0;
  padding: 0.9rem 1rem;
  min-height: 5.25rem;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex-shrink: 0;
  color: var(--text);
  text-decoration: none;
}

.app-brand .brand-logo {
  height: 4.25rem;
  width: auto;
  border-radius: 6px;
  background: var(--logo-bg, #505050);
}

.app-brand strong {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.app-brand small {
  display: none;
}

.app-topbar-context {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-topbar-context--home {
  display: flex;
  align-items: baseline;
  gap: 0.55rem 0.75rem;
}

.app-topbar-context-label {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--text);
}

.app-topbar-context-tagline {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
  color: var(--muted);
}

.app-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.app-topbar-utils {
  display: none;
  align-items: center;
  gap: 0.35rem;
  font-size: 11px;
  color: var(--muted);
}

@media (min-width: 720px) {
  .app-topbar-utils {
    display: flex;
  }
}

.app-topbar-util {
  margin: 0;
  padding: 0.25rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(255 255 255 / 0.03);
  font: inherit;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}

.app-topbar-util:hover {
  color: var(--text);
  background: var(--surface-hover);
}

a.app-topbar-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--link-blue-soft);
}

a.app-topbar-link:hover {
  color: var(--link-blue-soft);
}

.app-topbar-search.search {
  min-width: 0;
}

.app-topbar-search .search-input {
  width: 10rem;
  max-width: 40vw;
  padding: 0.4rem 0.65rem 0.4rem 2rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgb(255 255 255 / 0.04);
  font-size: 13px;
  color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239ca3af' stroke-width='1.5'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='M10.5 10.5L14 14'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.55rem center;
}

.app-layout.layout {
  display: grid;
  grid-template-columns: 1fr;
  max-width: none;
}

@media (min-width: 960px) {
  .app-layout.layout {
    grid-template-columns: minmax(0, 1fr) var(--right-w);
    align-items: start;
  }

  .sidebar--left {
    display: none;
  }
}

.app-sidebar-left.sidebar {
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0.65rem 1rem;
}

@media (min-width: 960px) {
  .app-sidebar-left.sidebar {
    position: sticky;
    top: var(--app-chrome-h, 3.25rem);
    max-height: calc(100vh - var(--app-chrome-h, 3.25rem));
    overflow: auto;
    border-bottom: none;
    border-right: 1px solid var(--line);
    padding: 1rem 0.5rem 1.25rem;
  }
}

.app-sidebar-right.sidebar {
  background: var(--sidebar-bg);
  border-top: 1px solid var(--line);
  padding: 1rem 0.85rem 1.25rem;
}

@media (min-width: 960px) {
  .app-sidebar-right.sidebar {
    position: sticky;
    top: var(--app-chrome-h, 3.25rem);
    max-height: calc(100vh - var(--app-chrome-h, 3.25rem));
    overflow: auto;
    border-top: none;
    border-left: 1px solid var(--line);
    padding: 1rem 0.75rem 1.25rem;
  }
}

.app-sidebar-section + .app-sidebar-section {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
}

.app-sidebar-heading {
  margin: 0 0 0.45rem;
  padding: 0 0.45rem;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-word-stat__row {
  padding: 0 0.45rem;
}

.sidebar-word-stat__row--live {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.sidebar-word-stat__row--live .sidebar-word-stat__value {
  margin: 0;
}

.sidebar-word-stat__row--secondary {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-soft);
}

.sidebar-word-stat__value {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--link-blue-soft);
  line-height: 1.15;
}

.sidebar-word-stat__value--sm {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--muted);
}

.sidebar-word-stat__label {
  margin: 0.2rem 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

.sidebar-word-stat__label--sm {
  font-size: 10px;
  letter-spacing: 0.02em;
}

.app-nav-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-nav-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}

.app-nav-link:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.app-nav-link.is-on {
  color: var(--text);
  background: var(--surface-hover);
  font-weight: 500;
}

.app-nav-link[href^="https"] {
  color: var(--link-blue-soft);
}

.app-nav-link[href^="https"]:hover {
  color: var(--link-blue-soft);
}

.app-nav-icon {
  display: inline-flex;
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  opacity: 0.85;
}

.app-nav-icon svg {
  width: 100%;
  height: 100%;
}

.app-list-nav {
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-list-nav-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  color: var(--link-blue-soft);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.35;
}

.app-list-nav-link:hover {
  background: var(--surface-hover);
  color: inherit;
}

.app-list-nav-link.is-on {
  background: var(--surface-hover);
  color: var(--link-blue-soft);
}

.app-list-nav-title {
  display: block;
  font-weight: 500;
  color: inherit;
}

.app-link-list a {
  font-size: 13px;
}

.app-external-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 13px;
  color: var(--link-accent);
  text-decoration: none;
}

.app-external-link:hover {
  color: var(--text);
}

.app-external-link .app-nav-icon {
  width: 1rem;
  height: 1rem;
}

.main-col {
  background: var(--content-bg);
  min-width: 0;
}

.app-page-bar {
  padding: 1rem 1.25rem 0.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--content-bg);
}

.app-page-bar-kicker {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.app-page-bar-title {
  margin: 0.25rem 0 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.main-col main > section,
.main-col main > .grid,
.main-col main > ol.grid,
.list-body > .hero,
.list-body > .grid {
  border-bottom-color: var(--line-soft);
}

.hero h1,
.block-list h2,
.block h2,
.portal-section-head h2 {
  font-family: inherit;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: none;
}

@media (hover: hover) {
  .card:hover {
    background: var(--card-hover-bg);
    border-color: var(--line);
  }
}

.block-list .portal-section-head {
  border: none;
}

.feed-stack .clip video {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--video-bg);
}

.player {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.list-with-rail {
  border: none;
}

.list-rail {
  display: none;
}

.list-body > .hero,
.list-body > .grid,
.list-body > .print-link,
.list-body > .list-fun-fact {
  background: var(--content-bg);
}

.archive-row {
  border-radius: 8px;
  border: 1px solid transparent;
}

.archive-row:hover {
  background: var(--archive-row-hover);
  border-color: transparent;
}

.foot {
  background: var(--page-bg);
  border-top: 1px solid var(--line);
}

.foot-social a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem;
  color: var(--muted);
}

.foot-social a:hover {
  color: var(--text);
  background: var(--panel-hover);
}

.hero-watermark {
  display: none;
}

.top-inner {
  display: contents;
}

.nav {
  display: none;
}

.portal-banner,
.portal-nav,
.portal-brand-block,
.portal-title-block {
  display: none !important;
}

.alphabet-list .card {
  border-radius: 0;
}

.translit-combos,
.alphabet-appendix,
.block-doc {
  border-top: 1px solid var(--line-soft);
}

@media (max-width: 959px) {
  .app-topbar-context {
    display: none;
  }
}

@media (max-width: 639px) {
  .app-topbar-inner {
    min-height: 4.35rem;
    padding: 0.7rem 0.85rem;
  }

  .app-brand .brand-logo {
    height: 3.35rem;
  }
}
