/* ==========================================================
   0.  Design Tokens
   ========================================================== */

:root {
  --color-bg:      #0d0d0e;
  --color-card:    #161618;
  --color-border:  #252527;
  --color-hover:   #1c1c1f;
  --color-text:    #f0f0f0;
  --color-muted:   #888;
  --color-subtle:  #1a1a1c;
  --radius:        14px;
  --transition:    0.18s ease;
}

:root[data-theme="light"] {
  --color-bg:     #fafafa;
  --color-card:   #ffffff;
  --color-border: #e8e8e8;
  --color-hover:  #f5f5f5;
  --color-text:   #111;
  --color-muted:  #777;
  --color-subtle: #f0f0f0;
}


/* ==========================================================
   1.  Reset & Base
   ========================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;

  background: var(--color-bg);
  color: var(--color-text);

  font-family:
    "Segoe UI",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    sans-serif;
  font-size: 15px;
  line-height: 1.65;

  -webkit-font-smoothing: antialiased;

  transition:
    background var(--transition),
    color var(--transition);
}

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


/* ==========================================================
   2.  Layout
   ========================================================== */

.page {
  width: min(900px, calc(100% - 32px));

  margin: 0 auto;
  padding: 48px 0 64px;
}


/* ==========================================================
   3.  Header
   ========================================================== */

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;

  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

.header-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.subtitle {
  font-size: 13px;
  color: var(--color-muted);
}


/* ---  Theme Toggle  --- */

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 6px;

  padding: 6px 14px;

  border: 1px solid var(--color-border);
  border-radius: 999px;

  background: transparent;
  color: var(--color-muted);

  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;

  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition);
}

.theme-toggle:hover {
  background: var(--color-hover);
  color: var(--color-text);
  border-color: var(--color-muted);
}

.theme-toggle svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}


/* ==========================================================
   4.  Board (Section Header)
   ========================================================== */

.board {
  margin-top: 28px;
}

.board-head {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-bottom: 14px;
}

.board-head h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.board-count {
  font-size: 13px;
  color: var(--color-muted);
}


/* ==========================================================
   5.  Card Grid
   ========================================================== */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 12px;
}


/* ==========================================================
   6.  Card Components
   ========================================================== */

/* ---  Card Root  --- */

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;

  padding: 18px 20px;

  border: 1px solid var(--color-border);
  border-radius: var(--radius);

  background: var(--color-card);

  transition:
    background var(--transition),
    border-color var(--transition),
    transform var(--transition);
}

.card:hover {
  background: var(--color-hover);
  border-color: var(--color-muted);
  transform: translateY(-1px);
}

/* ---  Card Header  --- */

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
}

.card-badge {
  padding: 2px 9px;

  border: 1px solid var(--color-border);
  border-radius: 999px;

  color: var(--color-muted);
  font-size: 11px;
  white-space: nowrap;
}

/* ---  Card Body  --- */

.card-desc {
  font-size: 13px;
  color: var(--color-muted);
  line-height: 1.6;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 3px 9px;

  border-radius: 999px;

  background: var(--color-subtle);
  color: var(--color-muted);
  font-size: 12px;
}

/* ---  Card Footer  --- */

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;

  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);

  font-size: 12px;
  color: var(--color-muted);
}

.card-url {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-action {
  flex-shrink: 0;
  font-weight: 500;
  color: var(--color-text);
}


/* ==========================================================
   7.  Empty State
   ========================================================== */

.empty-state {
  padding: 40px 24px;

  border: 1px dashed var(--color-border);
  border-radius: var(--radius);

  background: var(--color-subtle);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.empty-state p {
  color: var(--color-muted);
  font-size: 13px;
}

.empty-state code {
  color: var(--color-text);
  font-family: Consolas, "SFMono-Regular", monospace;
}


/* ==========================================================
   8.  Footer
   ========================================================== */

.footer {
  margin-top: 32px;
  font-size: 12px;
  color: var(--color-muted);
}


/* ==========================================================
   9.  Responsive
   ========================================================== */

@media (max-width: 640px) {
  .page {
    padding: 28px 0 48px;
  }

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

  .header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================
   10.  Tool page additions
   Everything below reuses the tokens from section 0 above, so a tool
   page built with these classes looks like a native part of ToolHub.
   ========================================================== */

/* ---  Back to hub --- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  margin-bottom: 18px;

  color: var(--color-muted);
  font-size: 13px;

  transition: color var(--transition);
}

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


/* ---  Panels (drop zone, settings groups) --- */

.panel {
  padding: 18px 20px;

  border: 1px solid var(--color-border);
  border-radius: var(--radius);

  background: var(--color-card);
}

.panel + .panel {
  margin-top: 12px;
}


/* ---  Drop zone --- */

.tool-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;

  min-height: 220px;
  padding: 28px 20px;

  border: 1px dashed var(--color-border);
  border-radius: var(--radius);

  background: var(--color-card);

  cursor: pointer;
  text-align: center;

  transition:
    background var(--transition),
    border-color var(--transition);
}

.tool-drop:hover {
  background: var(--color-hover);
  border-color: var(--color-muted);
}

.tool-drop.is-hot {
  background: var(--color-hover);
  border-color: var(--color-text);
}

.tool-drop__title {
  font-size: 15px;
  font-weight: 600;
}

.tool-drop__title em {
  font-style: normal;
  color: var(--color-muted);
  font-weight: 400;
}

.tool-drop__hint {
  font-size: 12.5px;
  color: var(--color-muted);
  line-height: 1.6;
}

.tool-drop__name {
  font-size: 12.5px;
  color: var(--color-muted);
  min-height: 18px;
  word-break: break-all;
}


/* ---  Field rows --- */

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: 12px;
  color: var(--color-muted);
}

.field select,
.field input[type="text"],
.field input[type="number"] {
  width: 100%;
  padding: 7px 10px;

  border: 1px solid var(--color-border);
  border-radius: 8px;

  background: var(--color-subtle);
  color: var(--color-text);

  font: inherit;
  font-size: 13px;

  transition:
    border-color var(--transition),
    background var(--transition);
}

.field select:hover,
.field input:hover {
  border-color: var(--color-muted);
}

.field select:focus,
.field input:focus {
  outline: none;
  border-color: var(--color-text);
}

.field input[type="range"] {
  width: 100%;
  accent-color: var(--color-text);
}


/* ---  Actions row --- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;

  margin-top: 16px;
}

.btn {
  padding: 7px 15px;

  border: 1px solid var(--color-border);
  border-radius: 999px;

  background: transparent;
  color: var(--color-muted);

  font: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;

  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition);
}

.btn:hover:not(:disabled) {
  background: var(--color-hover);
  border-color: var(--color-muted);
  color: var(--color-text);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--color-text);
  border-color: var(--color-text);
  color: var(--color-bg);
  font-weight: 600;
}

.btn--primary:hover:not(:disabled) {
  background: var(--color-text);
  border-color: var(--color-text);
  color: var(--color-bg);
  opacity: 0.86;
}

.btn--small {
  padding: 4px 10px;
  font-size: 12px;
}


/* ---  Status / progress --- */

.status {
  margin-top: 12px;

  font-size: 12.5px;
  color: var(--color-muted);
  min-height: 18px;
}

.status--error {
  color: #e5484d;
}

.progress {
  height: 3px;
  margin-top: 10px;

  border-radius: 2px;
  background: var(--color-border);

  overflow: hidden;
}

.progress > i {
  display: block;
  height: 100%;
  width: 0;

  background: var(--color-text);
  transition: width 0.18s ease;
}

.progress.is-hidden {
  display: none;
}


/* ---  Result cards (same shape as ToolHub cards) --- */

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;

  margin-top: 12px;
}

.result-card {
  display: flex;
  flex-direction: column;

  border: 1px solid var(--color-border);
  border-radius: var(--radius);

  background: var(--color-card);
  overflow: hidden;

  transition:
    background var(--transition),
    border-color var(--transition);
}

.result-card:hover {
  background: var(--color-hover);
  border-color: var(--color-muted);
}

.result-card img {
  width: 100%;
  height: 190px;
  object-fit: contain;

  background: var(--color-subtle);
  border-bottom: 1px solid var(--color-border);
}

.result-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;

  padding: 8px 12px;

  font-size: 12px;
  color: var(--color-muted);
}

.result-card__meta a {
  color: var(--color-text);
  font-weight: 500;
}

.result-card__meta a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* ---  Image queue rows --- */

.row-list {
  display: flex;
  flex-direction: column;
  gap: 8px;

  margin-top: 12px;
}

.row-item {
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 8px 12px;

  border: 1px solid var(--color-border);
  border-radius: 10px;

  background: var(--color-card);

  transition:
    background var(--transition),
    border-color var(--transition);
}

.row-item:hover {
  background: var(--color-hover);
}

.row-item.is-over {
  border-color: var(--color-text);
}

.row-item__idx {
  width: 20px;
  flex-shrink: 0;

  font-size: 12px;
  color: var(--color-muted);
}

.row-item img {
  width: 42px;
  height: 42px;
  flex-shrink: 0;

  border-radius: 6px;
  background: var(--color-subtle);
  object-fit: cover;
}

.row-item__file {
  flex: 1;
  min-width: 0;
}

.row-item__file b {
  display: block;

  font-size: 13px;
  font-weight: 600;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-item__file span {
  font-size: 11.5px;
  color: var(--color-muted);
}


/* ---  Attribution block --- */

.credit {
  margin-top: 28px;
  padding: 18px 20px;

  border: 1px solid var(--color-border);
  border-radius: var(--radius);

  background: var(--color-subtle);
}

.credit__badge {
  display: inline-block;

  margin-bottom: 10px;
  padding: 2px 9px;

  border-radius: 999px;
  background: var(--color-card);

  color: var(--color-muted);
  font-size: 11px;
}

.credit__title {
  margin-bottom: 6px;

  font-size: 15px;
  font-weight: 600;
}

.credit__text {
  font-size: 13px;
  color: var(--color-muted);
  line-height: 1.65;
}

.credit__text + .credit__text {
  margin-top: 6px;
}

.credit a {
  color: var(--color-text);
}

.credit a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* ---  Responsive --- */

@media (max-width: 640px) {
  .panel {
    padding: 14px 16px;
  }

  .tool-drop {
    min-height: 180px;
    padding: 22px 14px;
  }

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

  .result-card img {
    height: 170px;
  }

  .actions .btn {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}


/* ---  Output visibility toggles used by the upstream JS --- */

.empty-state,
#imageOutputActionsContainer {
  display: none;
}

.empty-state.is-active {
  display: block;
}

#imageOutputActionsContainer.is-active {
  display: block;
}

/* ---  Result items produced by the upstream renderer --- */

#outputDownloadContent .image-output__item {
  display: flex;
  flex-direction: column;

  border: 1px solid var(--color-border);
  border-radius: var(--radius);

  background: var(--color-card);
  overflow: hidden;

  transition:
    background var(--transition),
    border-color var(--transition);
}

#outputDownloadContent .image-output__item:hover {
  background: var(--color-hover);
  border-color: var(--color-muted);
}

#outputDownloadContent .image-output__item-tint {
  display: none;
}

#outputDownloadContent .image-output__item-thumbnail {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: contain;

  background: var(--color-subtle);
  border-bottom: 1px solid var(--color-border);
}

#outputDownloadContent .image-output__item-text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;

  padding: 8px 12px;

  font-size: 12px;
  color: var(--color-muted);
}

#outputDownloadContent .image-output__item-filename {
  display: flex;
  min-width: 0;
  flex: 1 1 100%;

  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

#outputDownloadContent .image-output__item-filename-start,
#outputDownloadContent .image-output__item-filename-end {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#outputDownloadContent .image-output__item-dimensions,
#outputDownloadContent .image-output__item-filesize {
  font-size: 12px;
  color: var(--color-muted);
}

#outputDownloadContent .image-output__item-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

#outputDownloadContent .badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-subtle);
  font-size: 11px;
}

#outputDownloadContent .image-output__item-download {
  margin-left: auto;
  color: var(--color-text);
  font-weight: 500;
}


/* ---  Option cards (upstream class names, ToolHub look) --- */

.button-card-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.button-card-radio {
  display: flex;
  align-items: center;
  gap: 8px;

  flex: 1 1 auto;
  min-width: 120px;
  padding: 9px 12px;

  border: 1px solid var(--color-border);
  border-radius: 10px;

  background: var(--color-subtle);
  color: var(--color-muted);

  cursor: pointer;
  font-size: 13px;

  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition);
}

.button-card-radio:hover {
  background: var(--color-hover);
  border-color: var(--color-muted);
  color: var(--color-text);
}

.button-card-radio--is-selected {
  border-color: var(--color-text);
  background: var(--color-hover);
  color: var(--color-text);
  font-weight: 600;
}

.button-card-radio__radio-input {
  display: none;
}

.button-card-radio__content {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.button-card-radio__label {
  font-size: 13px;
  line-height: 1.4;
}

.button-card-radio__description {
  font-size: 11.5px;
  color: var(--color-muted);
  line-height: 1.4;
}

.button-card-radio--is-selected .button-card-radio__description {
  color: var(--color-muted);
}

/* 每个格式卡保持等宽，不要被长文案撑开 */
#formatMethodGroup .button-card-radio {
  flex: 0 1 auto;
  min-width: 92px;
}

@media (max-width: 640px) {
  .button-card-radio {
    flex: 1 1 100%;
  }
}


/* ---  Result item footer: keep download action on one tidy row --- */

#outputDownloadContent .image-output__item-bookmark,
#outputDownloadContent .image-output__item-delete,
#outputDownloadContent .image-output__item-download {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#outputDownloadContent .image-output__item-stats {
  flex-wrap: wrap;
  row-gap: 4px;
}

#outputDownloadContent .image-output__item-stats > * {
  flex: 0 0 auto;
}

/* 下载/删除图标统一尺寸，避免和文字挤在一起 */
#outputDownloadContent .image-output__item-text svg,
#outputDownloadContent .image-output__item-stats svg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

#outputDownloadContent .image-output__item-button {
  display: inline-flex;
  align-items: center;
  gap: 3px;

  padding: 3px 8px;

  border: 1px solid var(--color-border);
  border-radius: 999px;

  background: transparent;
  color: var(--color-text);

  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

#outputDownloadContent .image-output__item-button:hover {
  background: var(--color-subtle);
  border-color: var(--color-muted);
}


/* ---  Upstream toggles visibility with a .hidden class, not the hidden
        attribute. Support both so the JS keeps working after the restyle. --- */

.hidden {
  display: none !important;
}

/* When the class is removed the element becomes visible again; the inline
   hidden attribute is cleared by the JS path below. */
.field:not(.hidden),
.progress-container:not(.hidden) {
  display: flex;
}

.progress-container:not(.hidden) {
  display: block;
}


/* ---  Result card actions: the upstream renderer emits
        .button-cta.button-secondary anchors with inline SVGs. Give them a
        pill shape and stop the icon from sitting on its own line. --- */

#outputDownloadContent .button-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;

  min-width: 0;
  padding: 4px 10px;

  border: 1px solid var(--color-border);
  border-radius: 999px;

  background: transparent;
  color: var(--color-text);

  font: inherit;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;

  transition:
    background var(--transition),
    border-color var(--transition);
}

#outputDownloadContent .button-cta:hover {
  background: var(--color-subtle);
  border-color: var(--color-muted);
}

#outputDownloadContent .button-cta svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* 删除按钮只有图标，收紧内边距 */
#outputDownloadContent .image-output__item-delete-button {
  padding: 4px 8px;
}

/* 操作行独占一行，靠右 */
#outputDownloadContent .image-output__item-text > .flex {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  width: 100%;
  margin-top: 2px;
}


/* ---  Final pass on the result card action row:
        the download anchor wraps an SVG plus a <span>, so force a single
        non-wrapping flex row and centre both children. --- */

#outputDownloadContent .image-output__item-text > .flex {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
}

#outputDownloadContent .image-output__item-text > .flex > .button-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 3px;

  height: 26px;
  padding: 0 10px;

  line-height: 1;
  white-space: nowrap;
}

#outputDownloadContent .image-output__item-text > .flex svg {
  display: block;
  width: 13px;
  height: 13px;
}

#outputDownloadContent .image-output__item-text > .flex span {
  display: inline-block;
  font-size: 12px;
  line-height: 1;
}

/* 图标按钮（删除）保持方一点 */
#outputDownloadContent .image-output__item-text > .flex > .image-output__item-delete-button {
  width: 26px;
  padding: 0;
}


/* ---  Preview image: show the whole picture, never crop or upscale past its
        native size. Height follows the viewport instead of a fixed 190px. --- */

#outputDownloadContent .image-output__item-thumbnail {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;

  object-fit: contain;

  background: var(--color-subtle);
  border-bottom: 1px solid var(--color-border);

  image-rendering: auto;
}

/* 卡片按内容自适应，避免图片被容器裁切 */
#outputDownloadContent .image-output__item {
  min-width: 0;
}

#outputDownloadContent .image-output__item img {
  max-width: 100%;
}


/* ==========================================================
   Visibility rules (must stay last so they win)
   The upstream JS toggles the `hidden` class. A plain
   `.field:not(.hidden) { display: flex }` rule placed earlier gets beaten by
   later `.field`-related declarations, so pin it here with !important.
   ========================================================== */

.field.hidden,
.progress-container.hidden,
.hidden {
  display: none !important;
}

.field:not(.hidden) {
  display: flex !important;
  flex-direction: column;
  gap: 6px;
}

.progress-container:not(.hidden) {
  display: block !important;
}


/* ---  Quality control: slider + editable number box side by side --- */

.range-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-group input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: var(--color-text);
  cursor: pointer;
}

/* 数字框：做成一眼可见的输入控件，而不是像标签文字 */
.range-group input[type="number"] {
  width: 76px;
  height: 34px;
  flex-shrink: 0;

  padding: 0 8px;

  border: 1px solid var(--color-border);
  border-radius: 8px;

  background: var(--color-card);
  color: var(--color-text);

  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: center;

  cursor: text;

  transition:
    border-color var(--transition),
    background var(--transition),
    box-shadow var(--transition);
}

.range-group input[type="number"]:hover {
  border-color: var(--color-muted);
  background: var(--color-hover);
}

.range-group input[type="number"]:focus {
  outline: none;
  border-color: var(--color-text);
  background: var(--color-card);
  box-shadow: 0 0 0 3px rgba(127, 127, 127, 0.18);
}

.range-group input[type="number"]::-webkit-inner-spin-button,
.range-group input[type="number"]::-webkit-outer-spin-button {
  opacity: 0.55;
  height: 26px;
  cursor: pointer;
}

/* 深色主题下输入框与卡片区分度 */
:root[data-theme="dark"] .range-group input[type="number"] {
  background: var(--color-subtle);
}

:root[data-theme="dark"] .range-group input[type="number"]:focus {
  background: var(--color-card);
}

/* 目标体积 / 最长边等其它数字输入框统一造型 */
.field input[type="number"],
.field select {
  height: 34px;
  padding: 0 10px;
  font-size: 14px;
  border-radius: 8px;
  cursor: text;
}

.field select {
  cursor: pointer;
}


/* ==========================================================
   Segmented tabs (PDF ⇄ 图片)
   Mirrors the nav site's pill button style.
   ========================================================== */

.seg {
  display: inline-flex;
  gap: 4px;

  padding: 3px;

  border: 1px solid var(--color-border);
  border-radius: 999px;

  background: var(--color-card);
}

.seg__btn {
  padding: 7px 16px;

  border: 0;
  border-radius: 999px;

  background: transparent;
  color: var(--color-muted);

  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;

  transition:
    background var(--transition),
    color var(--transition);
}

.seg__btn:hover {
  color: var(--color-text);
}

.seg__btn.is-active {
  background: var(--color-text);
  color: var(--color-bg);
  font-weight: 600;
}

.seg__btn:focus-visible {
  outline: 2px solid var(--color-muted);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .seg {
    display: flex;
    width: 100%;
  }

  .seg__btn {
    flex: 1;
    padding: 8px 10px;
  }
}
