.page-title {
  margin-inline: 0;
  margin-block: 24px;
  font-size: 28px;
  font-weight: 700;
}

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

.story-item {
  display: flex;
  align-items: baseline;
  padding: 6px 0;
}

.story-item__vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 32px;
  margin-right: 4px;
  flex-shrink: 0;
  gap: 4px;
}

.story-item__body {
  min-width: 0;
}

.story-item__title {
  word-break: break-word;
  font-weight: var(--story-title-weight, 700);
}

.story-item__icon {
  color: var(--text-muted);
  margin-top: -2px;
}

.story-item__domain {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: normal;
  margin-left: 4px;
}

.story-item__meta {
  color: var(--text-muted);
  font-size: 16px;
}

.story-item__tags {
  display: inline;
  margin-left: 4px;
}

.story-item__action {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  padding: 0;
}

.story-item__action:hover {
  text-decoration: underline;
  color: var(--text);
}

.flag-dropdown {
  position: relative;
  display: inline;
}

.flag-dropdown__menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  flex-direction: column;
  min-width: 120px;
  z-index: 100;
  display: none;
  white-space: nowrap;
}

.flag-dropdown__menu--above {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 6px;
}

.flag-dropdown__menu--right {
  left: auto;
  right: 0;
}

.flag-dropdown__menu:not([hidden]) {
  display: flex;
}

.flag-dropdown__option {
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 6px 12px;
  text-align: left;
  cursor: pointer;
}

.flag-dropdown__option:hover {
  background: var(--border);
}

.story-item__title > a {
  color: var(--link);
}

.story-item__title > a:visited {
  color: var(--link-visited);
}

.vote-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
}

.vote-btn:hover {
  color: var(--primary);
}

.vote-btn--active {
  color: var(--primary);
}

.vote-btn--disabled {
  cursor: default;
  opacity: 0.4;
}

.vote-score {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1;
}

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 400;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--tag-bg);
  color: var(--tag-text);
  text-decoration: none;
  border: none;
  vertical-align: middle;
}

.tag:hover {
  text-decoration: underline;
}

.tag--media {
  background: var(--tag-media-bg);
  color: var(--tag-media-text);
}

.auth-wrapper {
  display: flex;
  justify-content: center;
  padding: 48px 0 64px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.auth-card__body {
  padding: 24px 32px 32px;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.tabs__tab {
  padding: 10px 16px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
  transition:
    color 0.15s,
    border-color 0.15s;
}

.tabs--full .tabs__tab {
  flex: 1;
}

.tabs__tab.active {
  color: var(--text);
  border-bottom-color: var(--primary);
}

.tabs__tab:hover {
  text-decoration: none;
  color: var(--text);
}

.tab-content {
  padding: 16px 8px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 14px;
}

.field-input {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.field-input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

.field-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

.field-with-action {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.field-with-action .field-input {
  flex: 1;
  min-width: 0;
}

.field-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 0;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn:hover {
  opacity: 0.85;
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn--secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.auth-btn {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  background: var(--primary);
  color: #fff;
}

.auth-link {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
}

.error {
  color: #c00;
  font-size: 14px;
  padding: 10px 12px;
  margin-bottom: 16px;
  background: color-mix(in srgb, #c00 8%, transparent);
  border: 1px solid color-mix(in srgb, #c00 25%, transparent);
  border-radius: 8px;
}

.error a {
  text-decoration: underline;
}

.field-error {
  color: #c00;
  font-size: 13px;
  margin: 4px 0 0;
}

.success {
  color: #2e7d32;
  font-size: 14px;
  padding: 10px 12px;
  margin-bottom: 16px;
  background: color-mix(in srgb, #2e7d32 8%, transparent);
  border: 1px solid color-mix(in srgb, #2e7d32 25%, transparent);
  border-radius: 8px;
}

.more-link {
  display: inline-block;
  padding: 12px 0;
  color: var(--text-muted);
}

.markdown-body a {
  color: var(--link);
}

.markdown-body a:visited {
  color: var(--link-visited);
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.6em;
  margin: 0.75em 0;
}

.markdown-body li + li {
  margin-top: 0.25em;
}

.markdown-body code {
  font-family: var(--font-monospace), monospace;
  font-size: 0.9em;
  padding: 0.15em 0.35em;
  background: var(--tag-bg);
  border-radius: 4px;
}

.markdown-body pre {
  margin: 0.75em 0;
  padding: 12px 16px;
  background: var(--tag-bg);
  border-radius: 6px;
  overflow-x: auto;
}

.markdown-body pre code {
  padding: 0;
  background: none;
  border-radius: 0;
}

.markdown-body blockquote {
  margin: 0.75em 0;
  padding: 0 0 0 12px;
  border-left: 3px solid var(--border);
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .auth-wrapper {
    padding: 24px 0 48px;
  }

  .auth-card {
    border: none;
    border-radius: 0;
  }

  .auth-card__body {
    padding: 20px 16px 28px;
  }
}
