body {
  overflow: hidden;
}

#view {
  height: 100dvh;
  overflow: hidden;
}

.record-result .example {
  padding-left: 0;
  border-left: 0;
}

.library-filter-bar .desktop-more-filter {
  display: none;
}

.metric-tile {
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto;
}

.review-card {
  align-self: stretch;
  width: 100%;
}

.lookup-provider {
  margin: 6px 0 0;
  color: #8b8d94;
  font-size: 0.58rem;
}

.lookup-source-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  overflow-x: auto;
  border-top: 1px solid var(--border);
  scrollbar-width: none;
}

.lookup-source-strip::-webkit-scrollbar {
  display: none;
}

.lookup-source-strip span {
  flex: 0 0 auto;
  color: #85878e;
  font-size: 0.6rem;
}

.lookup-source-strip button {
  flex: 0 0 auto;
  min-height: 27px;
  padding: 0 9px;
  font-size: 0.6rem;
  background: #f4f4f6;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.dictionary-manager-intro {
  padding: 4px 2px 8px;
}

.dictionary-manager-intro strong {
  font-size: 0.88rem;
}

.dictionary-manager-intro p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.55;
}

@media (min-width: 900px) {
  .library-filter-bar .desktop-more-filter {
    display: inline-flex;
  }
}

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

.field-assist {
  min-height: 16px;
  margin: -8px 1px 0;
  color: #777a82;
  font-size: 0.68rem;
  line-height: 1.45;
}

.feature-dialog[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pack-content,
.smart-import-content {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.pack-content {
  padding: 18px 18px calc(24px + env(safe-area-inset-bottom));
}

.pack-hero {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 4px 0 18px;
}

.pack-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #fff;
  background: #101113;
  border-radius: 8px;
}

.pack-icon svg {
  width: 24px;
  height: 24px;
}

.pack-hero p,
.pack-hero h3,
.pack-hero span {
  margin: 0;
}

.pack-hero p {
  color: #7c7e85;
  font-size: 0.62rem;
  font-weight: 750;
}

.pack-hero h3 {
  margin-top: 3px;
  font-size: 1.12rem;
}

.pack-hero span {
  display: block;
  margin-top: 5px;
  color: #62646b;
  font-size: 0.72rem;
}

.pack-progress {
  height: 5px;
  overflow: hidden;
  background: #e9eaed;
  border-radius: 3px;
}

.pack-progress span {
  display: block;
  height: 100%;
  background: #111214;
  border-radius: inherit;
}

.pack-section {
  padding: 19px 0 5px;
  border-bottom: 1px solid #e7e8eb;
}

.pack-section h4 {
  margin: 0 0 10px;
  color: #25262a;
  font-size: 0.76rem;
}

.pack-category-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 20px;
}

.pack-category-list div,
.pack-source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
}

.pack-category-list div {
  color: #55575e;
  font-size: 0.74rem;
  border-bottom: 1px solid #f0f0f2;
}

.pack-category-list strong {
  color: #1c1d20;
}

.pack-source-row + .pack-source-row {
  border-top: 1px solid #f0f0f2;
}

.pack-source-row span {
  min-width: 0;
}

.pack-source-row strong,
.pack-source-row small {
  display: block;
}

.pack-source-row strong {
  overflow: hidden;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pack-source-row small {
  margin-top: 3px;
  color: #777a82;
  font-size: 0.66rem;
}

.pack-source-row button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #4f5157;
  background: transparent;
  border: 0;
}

.pack-source-row button svg {
  width: 16px;
  height: 16px;
}

.pack-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 20px;
}

.pack-actions .button {
  min-width: 128px;
}

.smart-import-content {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.smart-import-input {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 18px;
}

.smart-import-input textarea {
  flex: 1;
  width: 100%;
  min-height: 260px;
  padding: 14px;
  color: #17181b;
  font: inherit;
  font-size: 0.86rem;
  line-height: 1.65;
  resize: none;
  background: #f7f7f8;
  border: 1px solid #dfe0e3;
  border-radius: 8px;
  outline: 0;
}

.smart-import-input textarea:focus {
  background: #fff;
  border-color: #1b1c1f;
  box-shadow: 0 0 0 2px rgba(17, 18, 20, 0.08);
}

.smart-import-input-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 12px;
}

.smart-import-engine {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  color: #777a82;
  font-size: 0.66rem;
}

.smart-import-engine svg {
  width: 14px;
  height: 14px;
}

.smart-import-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 16px;
  color: #55575e;
  font-size: 0.74rem;
  border-bottom: 1px solid #e7e8eb;
}

.smart-import-toolbar button {
  padding: 8px;
  color: #151619;
  font: inherit;
  font-weight: 700;
  background: transparent;
  border: 0;
}

.smart-candidate-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px;
}

.smart-candidate {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 11px;
  padding: 14px 0;
  border-bottom: 1px solid #ececef;
}

.smart-candidate input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.smart-check {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: transparent;
  background: #fff;
  border: 1px solid #bfc1c6;
  border-radius: 5px;
}

.smart-check svg {
  width: 13px;
  height: 13px;
  stroke-width: 3;
}

.smart-candidate input:checked + .smart-check {
  color: #fff;
  background: #101113;
  border-color: #101113;
}

.smart-candidate.is-duplicate {
  opacity: 0.48;
}

.smart-candidate.is-incomplete:not(.is-duplicate) .smart-check {
  background: #f1f1f3;
  border-color: #d5d6da;
}

.smart-candidate-copy {
  min-width: 0;
}

.smart-candidate-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.smart-candidate-title strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.92rem;
}

.smart-candidate-title em {
  flex: 0 0 auto;
  color: #6d7077;
  font-size: 0.64rem;
  font-style: normal;
  font-weight: 700;
}

.smart-candidate-copy small,
.smart-source {
  display: block;
  color: #777a82;
  font-size: 0.65rem;
}

.smart-candidate-copy small {
  margin-top: 3px;
}

.smart-candidate-copy p {
  margin: 7px 0 6px;
  color: #34353a;
  font-size: 0.76rem;
  line-height: 1.5;
}

.smart-import-empty {
  display: grid;
  flex: 1;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: #73767d;
}

.smart-import-empty svg {
  width: 30px;
  height: 30px;
}

.smart-import-empty strong {
  font-size: 0.8rem;
}

.smart-import-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 70px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #dfe0e3;
  backdrop-filter: blur(16px);
}

.smart-import-footer span {
  color: #62646b;
  font-size: 0.74rem;
}

@media (max-width: 520px) {
  .feature-dialog {
    width: 100%;
    max-width: 100%;
    height: calc(100dvh - env(safe-area-inset-top));
    max-height: calc(100dvh - env(safe-area-inset-top));
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .pack-category-list {
    grid-template-columns: 1fr;
  }

  .pack-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .pack-actions .button:only-child {
    grid-column: 1 / -1;
  }
}
