:root {
  color-scheme: light;
  --paper: #f5f6f8;
  --panel: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: #e6e9ef;
  --blue: #2864d8;
  --shadow: 0 10px 28px rgba(16, 24, 40, 0.08);
  --shell-gutter: 17px;
  --detail-color: #ffffff;
  --detail-ink: #111827;
  --detail-control: rgba(17, 24, 39, 0.06);
  --detail-divider: rgba(16, 24, 40, 0.08);
  --detail-logo-filter: none;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Aptos", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  width: min(100%, 620px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) var(--shell-gutter) 34px;
}

.app-header,
.detail-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
}

.detail-topbar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.app-header,
.detail-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-top: calc(-1 * max(18px, env(safe-area-inset-top)));
  margin-right: calc(-1 * var(--shell-gutter));
  margin-left: calc(-1 * var(--shell-gutter));
  padding: max(18px, env(safe-area-inset-top)) var(--shell-gutter) 14px;
  border-bottom: 1px solid #eceef2;
  background: #ffffff;
}

.detail-topbar {
  color: var(--detail-ink);
  border-bottom-color: var(--detail-divider);
  background: var(--detail-color);
  transition: background-color 160ms ease, border-color 160ms ease;
}

.detail-topbar .icon-button {
  color: inherit;
  background: var(--detail-control);
}

.detail-brand {
  display: grid;
  width: min(100%, 174px);
  min-height: 42px;
  place-self: center;
  place-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
}

.detail-brand img {
  display: block;
  width: 150px;
  max-width: 100%;
  height: auto;
  filter: var(--detail-logo-filter);
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  color: #ffffff;
  background: var(--blue);
  box-shadow: 0 10px 24px rgba(40, 100, 216, 0.28);
}

.brand-mark svg,
.icon-button svg,
.search-box svg,
.star-button svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.brand-mark svg {
  width: 25px;
  height: 25px;
}

.brand-copy {
  min-width: 0;
  flex: 1;
}

.brand-copy h1,
.line-hero h1 {
  margin: 0;
  color: #111827;
  font-size: 1.28rem;
  font-weight: 820;
  letter-spacing: 0;
}

.brand-copy p,
.line-hero p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 14px;
  color: #111827;
  background: rgba(255, 255, 255, 0.72);
}

.icon-button svg {
  width: 22px;
  height: 22px;
}

.icon-button.is-loading svg {
  animation: spin 0.8s linear infinite;
}

.search-box {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: center;
  height: 52px;
  margin: 14px 0 15px;
  padding: 0 18px;
  border: 1px solid rgba(230, 233, 239, 0.8);
  border-radius: 14px;
  color: #344054;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.search-box svg {
  width: 22px;
  height: 22px;
}

.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 1rem;
}

.search-box input::placeholder {
  color: #667085;
}

.overview {
  min-height: 54px;
  margin-bottom: 8px;
  padding: 1px 1px 0;
}

.overview-title {
  margin: 0;
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 760;
}

.overview-note,
.offline-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.35;
}

.offline-note {
  text-align: center;
}

.group-list,
.group-block {
  display: grid;
  gap: 13px;
}

.group-block {
  margin-top: 9px;
}

.group-title {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 12px;
  align-items: center;
  color: #344054;
  font-size: 0.74rem;
  font-weight: 780;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.group-title::after {
  height: 1px;
  background: #dfe3ea;
  content: "";
}

.line-card {
  position: relative;
  display: grid;
  content-visibility: auto;
  contain-intrinsic-size: auto 86px;
  grid-template-columns: 1fr 42px;
  gap: 8px 12px;
  min-height: 86px;
  padding: 16px;
  border: 1px solid rgba(230, 233, 239, 0.86);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.line-link {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 18px;
  align-items: center;
  min-width: 0;
}

.line-number,
.large-badge {
  display: grid;
  place-items: center;
  color: var(--badge-ink, #ffffff);
  background: var(--line-color);
  font-weight: 850;
}

.line-number {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 1.08rem;
}

.line-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.line-copy strong {
  overflow: hidden;
  color: #111827;
  font-size: 1.06rem;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--state-ink);
  font-size: 0.91rem;
}

.line-status i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.star-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  align-self: center;
  border: 0;
  border-radius: 12px;
  color: #667085;
  background: transparent;
}

.star-button svg {
  width: 28px;
  height: 28px;
}

.star-button.is-favorite {
  color: #e3ae18;
}

.star-button.is-favorite svg {
  fill: currentColor;
}

.issue-panel {
  grid-column: 1 / -1;
  padding: 12px;
  border-radius: 14px;
  color: #344054;
  background: #f8fafc;
}

.issue-panel strong {
  display: block;
  color: var(--ink);
  font-size: 0.92rem;
}

.issue-panel p,
.issue-panel > span:last-child {
  margin: 5px 0 0;
  color: #475467;
  font-size: 0.84rem;
  line-height: 1.35;
}

.issue-panel > span:last-child {
  display: block;
}

.empty {
  padding: 22px 16px;
  border: 1px dashed #d8dde6;
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.skeleton {
  min-height: 86px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent) -140px 0 /
      140px 100% no-repeat,
    #eef1f5;
  animation: shimmer 1.1s ease-in-out infinite;
}

.detail-shell {
  padding-bottom: 44px;
}

.line-hero {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.large-badge {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  font-size: 1.55rem;
}

.detail-kicker {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 780;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.detail-card {
  display: grid;
  gap: 12px;
}

.detail-status,
.detail-row,
.favorite-wide {
  border: 1px solid rgba(230, 233, 239, 0.86);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.detail-status {
  padding: 17px;
}

.share-button {
  display: inline-flex;
  width: auto;
  height: 40px;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  color: #475467;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 720;
}

.share-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.share-button.is-copied {
  color: #23814b;
}

.detail-status__actions {
  display: flex;
  margin: 12px -4px -8px;
  padding-top: 6px;
  border-top: 1px solid #e4e7ec;
}

.detail-status > span {
  display: inline-flex;
  margin-bottom: 7px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #23814b;
  background: #e8f6ee;
  font-size: 0.76rem;
  font-weight: 780;
}

.detail-status.has-issue > span {
  color: #b42318;
  background: #fee8e5;
}

.detail-status.is-closed > span {
  color: #344054;
  background: #e4e7ec;
}

.detail-status strong {
  display: block;
  color: var(--ink);
  font-size: 1.18rem;
}

.detail-status p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 0 16px;
}

.detail-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.detail-row strong {
  color: var(--ink);
  font-size: 0.94rem;
  text-align: right;
}

.favorite-wide {
  display: grid;
  min-height: 54px;
  place-items: center;
  color: #111827;
  font-weight: 760;
}

.favorite-wide.is-favorite {
  color: #9a6a00;
  background: #fff8df;
}

.skeleton-dot {
  background: #e4e8ef;
}

@keyframes shimmer {
  to {
    background-position: calc(100% + 140px) 0, 0 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 720px) {
  :root {
    --shell-gutter: 24px;
  }

  .group-block {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .group-title {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.consent-banner {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 16px;
  z-index: 900;
  max-width: 680px;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid #dfe3ea;
  border-radius: 8px;
  color: #101828;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(16, 24, 40, 0.2);
  font-family: "Aptos", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

.consent-banner__content {
  display: grid;
  gap: 16px;
}

.consent-banner strong {
  display: block;
  font-size: 1rem;
}

.consent-banner p {
  margin: 6px 0;
  color: #475467;
  font-size: 0.88rem;
  line-height: 1.45;
}

.consent-banner a {
  color: #1f55b5;
  font-size: 0.85rem;
  font-weight: 700;
}

.consent-banner__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.consent-button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #2864d8;
  border-radius: 8px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 760;
}

.consent-button--primary {
  color: #ffffff;
  background: #2864d8;
}

.consent-button--secondary {
  color: #1f55b5;
  background: #ffffff;
}

@media (min-width: 640px) {
  .consent-banner__content {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .consent-banner__actions {
    min-width: 300px;
  }
}

@media (max-width: 390px) {
  .consent-banner__actions {
    grid-template-columns: 1fr;
  }
}
