/**
 * Styles shared by the overlays and the dashboard.
 *
 * Overlays default to a fully transparent page: they are OBS browser sources, so
 * the stream canvas must show through everywhere the widgets do not paint.
 */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, "Segoe UI", Roboto, sans-serif;
}

/* --- overlays ----------------------------------------------------------------- */

body.overlay {
  background: transparent;
  color: var(--chat-text, #ffffff);
  overflow: hidden;
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  padding: 0.6em;
  font-size: var(--chat-font-size, 18px);
  line-height: 1.35;
}

.chat-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
  padding: 0.3em 0.55em;
  border-radius: 0.6em;
  background: var(--chat-background, rgba(0, 0, 0, 0));
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
  transition: opacity 0.6s ease;
  word-break: break-word;
}

.chat-row.removing {
  opacity: 0;
}

.chat-avatar {
  display: grid;
  place-items: center;
  width: 1.7em;
  height: 1.7em;
  flex: 0 0 auto;
  border-radius: 50%;
  overflow: hidden;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.15);
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-avatar-initial {
  font-weight: 700;
  font-size: 0.9em;
  opacity: 0.9;
}

.chat-body {
  min-width: 0;
}

.chat-user {
  font-weight: 700;
  color: var(--chat-username, #ff2e63);
  margin-right: 0.4em;
}

.chat-comment {
  color: var(--chat-text, #ffffff);
}

.alerts-stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.alert {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: min(90vw, 900px);
  padding: 1.2rem 2rem;
  border-radius: 1.2rem;
  background: rgba(12, 12, 18, 0.82);
  color: #fff;
  font-size: 2.2rem;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  transform: translateY(24px) scale(0.94);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3), opacity 0.35s ease;
}

.alert.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.alert-gift {
  border: 0.18rem solid #ffd166;
}

.alert-follow {
  border: 0.18rem solid #4cc9f0;
}

.alert-share {
  border: 0.18rem solid #b388ff;
}

.alert-join {
  border: 0.18rem solid #7bdff2;
}

.alert-subscribe {
  border: 0.18rem solid #ff8fab;
}

.alert-like {
  border: 0.18rem solid #ff6b6b;
}

.alert-media {
  width: 3.2rem;
  height: 3.2rem;
  flex: 0 0 auto;
  object-fit: contain;
}

.alert-count {
  color: #ffd166;
}

.alert-sub {
  font-size: 0.55em;
  font-weight: 500;
  opacity: 0.85;
}

.viewers-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2em;
  padding: 0.8em 1.2em;
  color: #fff;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.85);
}

.viewers-count {
  font-size: var(--viewers-font-size, 72px);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.viewers-peak {
  font-size: 0.32em;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.75;
}

.link-state {
  position: fixed;
  left: 0.5rem;
  bottom: 0.4rem;
  font-size: 12px;
  opacity: 0.55;
  pointer-events: none;
}

/* --- goals and top gifters ----------------------------------------------------- */

/*
 * Both widgets are translucent plates rather than opaque cards: they sit over gameplay, and
 * the stream must still read behind them. The preset decides the plate, the accent decides
 * the bar and the winner row.
 */

.goals-widget,
.gifters-widget {
  display: flex;
  flex-direction: column;
  gap: 0.55em;
  width: 100%;
  color: var(--chat-text, #ffffff);
  font-size: var(--widget-font-size, 15px);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
}

.goals-widget {
  max-width: 32rem;
}

.gifters-widget {
  max-width: 24rem;
}

.goal {
  padding: 0.55em 0.75em;
  border-radius: 0.7em;
  background: rgba(10, 12, 18, 0.55);
  animation: goal-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.goal-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75em;
  margin-bottom: 0.4em;
}

.goal-label {
  font-weight: 700;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-value {
  flex: 0 0 auto;
  font-size: 0.85em;
  font-variant-numeric: tabular-nums;
  opacity: 0.82;
}

.goal-track {
  height: 0.55em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.goal-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    var(--theme-accent, #ff2e63),
    color-mix(in srgb, var(--theme-accent, #ff2e63) 55%, #ffffff)
  );
  transition: width 0.8s cubic-bezier(0.2, 0.9, 0.25, 1);
}

.goal.is-complete .goal-fill {
  background: var(--theme-accent, #ff2e63);
}

.goal-done {
  display: inline-block;
  margin-top: 0.3em;
  font-size: 0.66em;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--theme-accent, #ff2e63);
}

.goal-done[hidden] {
  display: none;
}

.gifters-title {
  font-size: 0.7em;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.72;
}

.gifters-list {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gifter {
  display: flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.4em 0.6em;
  border-radius: 0.6em;
  background: rgba(10, 12, 18, 0.55);
  animation: gifter-in 0.35s ease both;
}

.gifter-rank {
  width: 1.3em;
  flex: 0 0 auto;
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

.gifter[data-rank="1"] .gifter-rank {
  color: #ffcf4a;
  opacity: 1;
}

.gifter[data-rank="2"] .gifter-rank {
  color: #cfd8e3;
  opacity: 1;
}

.gifter[data-rank="3"] .gifter-rank {
  color: #e2a06a;
  opacity: 1;
}

.gifter[data-rank="1"] {
  background: color-mix(in srgb, var(--theme-accent, #ff2e63) 24%, rgba(10, 12, 18, 0.62));
}

.gifter-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.gifter-diamonds {
  flex: 0 0 auto;
  font-size: 0.85em;
  font-variant-numeric: tabular-nums;
  opacity: 0.86;
}

.gifter .chat-avatar {
  width: 1.6em;
  height: 1.6em;
  font-size: 0.85em;
}

.gifters-empty {
  font-size: 0.8em;
  font-style: italic;
  opacity: 0.6;
}

@keyframes goal-in {
  from {
    opacity: 0;
    transform: translateY(0.4em);
  }
}

@keyframes gifter-in {
  from {
    opacity: 0;
    transform: translateX(-0.5em);
  }
}

/* Presets style the plate, never the numbers. */
:is([data-preset="neon"], .preview-shell[data-preview-preset="neon"]) :is(.goal, .gifter) {
  border: 1px solid color-mix(in srgb, var(--theme-accent, #ff2e63) 55%, transparent);
  box-shadow: 0 0 0.9rem color-mix(in srgb, var(--theme-accent, #ff2e63) 30%, transparent);
}

:is([data-preset="glass"], .preview-shell[data-preview-preset="glass"]) :is(.goal, .gifter) {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(14px) saturate(1.3);
  text-shadow: none;
}

:is([data-preset="bold"], .preview-shell[data-preview-preset="bold"]) :is(.goal, .gifter) {
  background: rgba(0, 0, 0, 0.72);
  border-radius: 0.35em;
  text-shadow: none;
}

/* --- overlays: templates and motion ------------------------------------------- */

/*
 * Every overlay carries `data-preset` / `data-chat-style` / `data-chat-anim` /
 * `data-alert-anim` on <body>, set from the stored config. A preset only changes how
 * the same markup is painted, so switching templates never breaks a layout.
 */

.chat-row {
  animation-duration: 0.42s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.25, 1);
  animation-fill-mode: both;
}

[data-chat-anim="fade"] .chat-row {
  animation-name: chat-in-fade;
}

[data-chat-anim="slide"] .chat-row {
  animation-name: chat-in-slide;
}

[data-chat-anim="pop"] .chat-row {
  animation-name: chat-in-pop;
}

[data-chat-anim="none"] .chat-row {
  animation-name: none;
}

@keyframes chat-in-fade {
  from {
    opacity: 0;
  }
}

@keyframes chat-in-slide {
  from {
    opacity: 0;
    transform: translateX(-1.1em);
  }
}

@keyframes chat-in-pop {
  0% {
    opacity: 0;
    transform: scale(0.82);
  }
  70% {
    opacity: 1;
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

/* --- chat shape --- */

/* Plain text still needs to read over bright gameplay, so it keeps the shadow. */
[data-chat-style="plain"] .chat-row,
.preview-shell[data-preview-chat="plain"] .chat-row {
  padding: 0.15em 0.2em;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

[data-chat-style="bubble"] .chat-row,
.preview-shell[data-preview-chat="bubble"] .chat-row {
  border-radius: 999px;
  padding: 0.32em 0.85em;
}

[data-chat-style="card"] .chat-row,
.preview-shell[data-preview-chat="card"] .chat-row {
  border-radius: 0.45em;
  padding: 0.45em 0.7em;
  border-left: 0.22em solid var(--theme-accent, #ff2e63);
}

/* --- presets --- */

[data-preset="classic"] .chat-row,
.preview-shell[data-preview-preset="classic"] .chat-row {
  backdrop-filter: blur(2px);
}

/*
 * Outline, not border: the chat shape owns the border box, so a preset must never
 * rewrite the edge the shape just drew.
 */
[data-preset="neon"] .chat-row,
.preview-shell[data-preview-preset="neon"] .chat-row {
  outline: 1px solid var(--theme-accent, #ff2e63);
  outline-offset: -1px;
  box-shadow:
    0 0 0.5em color-mix(in srgb, var(--theme-accent, #ff2e63) 55%, transparent),
    inset 0 0 1.2em color-mix(in srgb, var(--theme-accent, #ff2e63) 18%, transparent);
}

[data-preset="neon"] .chat-user,
.preview-shell[data-preview-preset="neon"] .chat-user {
  text-shadow: 0 0 0.5em currentColor;
}

[data-preset="glass"] .chat-row,
.preview-shell[data-preview-preset="glass"] .chat-row {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.18);
  text-shadow: none;
}

[data-preset="bold"] .chat-row,
.preview-shell[data-preview-preset="bold"] .chat-row {
  background: rgba(0, 0, 0, 0.62);
  border-radius: 0.25em;
  font-weight: 600;
  text-shadow: none;
  letter-spacing: 0.01em;
}

[data-preset="neon"] .alert,
[data-preset="glass"] .alert,
[data-preset="bold"] .alert,
.preview-shell[data-preview-preset="neon"] .alert,
.preview-shell[data-preview-preset="glass"] .alert,
.preview-shell[data-preview-preset="bold"] .alert {
  border-color: var(--theme-accent, #ff2e63);
}

[data-preset="neon"] .alert,
.preview-shell[data-preview-preset="neon"] .alert {
  box-shadow:
    0 0 1.6rem color-mix(in srgb, var(--theme-accent, #ff2e63) 60%, transparent),
    inset 0 0 2rem color-mix(in srgb, var(--theme-accent, #ff2e63) 22%, transparent);
}

[data-preset="glass"] .alert,
.preview-shell[data-preview-preset="glass"] .alert {
  background: rgba(16, 18, 26, 0.42);
  backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
}

[data-preset="bold"] .alert,
.preview-shell[data-preview-preset="bold"] .alert {
  background: rgba(0, 0, 0, 0.82);
  border-width: 0.3rem;
  font-size: 2.6rem;
}

/* --- alert motion: the preset picks the look, the config picks the movement --- */

[data-alert-anim="none"] .alert {
  transition: none;
}

[data-alert-anim="pop"] .alert.show {
  animation: alert-pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.35) both;
}

[data-alert-anim="slide"] .alert.show {
  animation: alert-slide 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

[data-alert-anim="bounce"] .alert.show {
  animation: alert-bounce 0.85s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes alert-pop {
  from {
    transform: scale(0.72);
    opacity: 0;
  }
}

@keyframes alert-slide {
  from {
    transform: translateY(4rem);
    opacity: 0;
  }
}

@keyframes alert-bounce {
  0% {
    transform: translateY(6rem) scale(0.9);
    opacity: 0;
  }
  55% {
    transform: translateY(-0.6rem) scale(1.02);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-row,
  .alert,
  .alert.show,
  .goal,
  .goal-fill,
  .gifter {
    animation: none !important;
    transition: none !important;
  }
}

/* --- dashboard ---------------------------------------------------------------- */

body.dashboard {
  background:
    radial-gradient(1100px 520px at 82% -12%, #1b2340 0%, transparent 62%),
    radial-gradient(900px 480px at -10% 8%, #241a33 0%, transparent 58%),
    #0c0e14;
  color: #e7e9ee;
  min-height: 100vh;
  padding: 1.6rem 1.5rem 4rem;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 1240px;
  margin: 0 auto 1.4rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 0 0 auto;
  padding-top: 0.3rem;
}

.topbar-actions #status-line {
  margin: 0;
  max-width: 30ch;
  text-align: right;
}

/* Two columns: settings on the left, a live preview pinned beside them. */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  gap: 1.4rem;
  align-items: start;
  max-width: 1240px;
  margin: 0 auto;
}

.col {
  min-width: 0;
}

.col-title {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7f8b9f;
  margin: 0 0 0.7rem;
  font-weight: 700;
}

.col-title-note {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: none;
  color: #5c6678;
}

.preview-col {
  position: sticky;
  top: 1.4rem;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .preview-col {
    position: static;
    order: -1;
  }
  .topbar {
    flex-direction: column;
  }
  .topbar-actions #status-line {
    text-align: left;
  }
}

.preview-shell {
  border: 1px solid #242a36;
  border-radius: 1rem;
  background: #11141b;
  padding: 0.85rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.preview-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.preview-tabs button {
  background: transparent;
  color: #9aa3b2;
  border-radius: 0.55rem;
  padding: 0.4rem 0.85rem;
  font-weight: 600;
  font-size: 0.86rem;
}

.preview-tabs button[aria-selected="true"] {
  background: #1d2230;
  color: #eef1f7;
}

/*
 * The checkerboard stands in for the stream: the overlay canvas itself must stay
 * transparent, so the preview proves that it does.
 */
.preview-canvas {
  position: relative;
  border-radius: 0.7rem;
  min-height: 260px;
  overflow: hidden;
  background:
    repeating-conic-gradient(#181c25 0% 25%, #12151c 0% 50%) 50% / 26px 26px;
}

.preview-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.6rem;
}

.preview-stage[hidden] {
  display: none;
}

#preview-alerts,
#preview-viewers {
  justify-content: center;
  align-items: center;
}

#preview-alerts .alert,
#preview-viewers .viewers-widget {
  position: static;
  transform: none;
  opacity: 1;
  font-size: 1.15rem;
  padding: 0.8rem 1.2rem;
}

#preview-viewers .viewers-count {
  font-size: var(--preview-viewers-size, 72px);
}

/* The goals and gifters stages share the overlay's own widgets, at preview scale. */
#preview-goals {
  justify-content: flex-end;
}

#preview-goals .goals-widget,
#preview-gifters .gifters-widget {
  font-size: 13px;
  max-width: 100%;
}

#preview-gifters {
  justify-content: flex-start;
}

.preview-shell .viewers-widget {
  color: var(--chat-text, #fff);
}

/* Preview theming mirrors the overlay attributes (data-preview-* on the shell). */
.preview-shell[data-preview-anim="none"] .chat-row {
  animation-name: none;
}
.preview-shell[data-preview-anim="fade"] .chat-row {
  animation-name: chat-in-fade;
}
.preview-shell[data-preview-anim="slide"] .chat-row {
  animation-name: chat-in-slide;
}
.preview-shell[data-preview-anim="pop"] .chat-row {
  animation-name: chat-in-pop;
}

.preview-shell[data-preview-alert="none"] .alert {
  animation: none;
}
.preview-shell[data-preview-alert="pop"] .alert {
  animation: alert-pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.35) both;
}
.preview-shell[data-preview-alert="slide"] .alert {
  animation: alert-slide 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.preview-shell[data-preview-alert="bounce"] .alert {
  animation: alert-bounce 0.85s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.preview-shell .chat-list {
  padding: 0;
}

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.preview-actions button {
  font-size: 0.78rem;
  padding: 0.42rem 0.7rem;
  border-radius: 0.5rem;
}

.preview-actions button.ghost {
  background: transparent;
  color: #8c97aa;
  border: 1px solid #2a3140;
}

/* Template picker */

.preset-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem;
}

.preset-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid #242a36;
  border-radius: 0.75rem;
  background: #12151d;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.preset-card:hover {
  border-color: #37415a;
}

.preset-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.preset-card.active {
  border-color: var(--theme-accent, #ff2e63);
  background: #171b26;
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--theme-accent, #ff2e63) 45%, transparent);
}

.preset-swatch {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  padding: 0.45rem 0.5rem;
  border-radius: 0.45rem;
  background: #0b0d13;
  margin-bottom: 0.15rem;
}

.preset-dot {
  display: block;
  width: 1.6rem;
  height: 0.42rem;
  border-radius: 999px;
  background: var(--theme-accent, #ff2e63);
}

.preset-bar {
  display: block;
  height: 0.28rem;
  border-radius: 999px;
  background: #384154;
}

.preset-bar.short {
  width: 62%;
}

.preset-card[data-preset="neon"] .preset-swatch {
  box-shadow: inset 0 0 18px rgba(0, 240, 255, 0.22);
}

.preset-card[data-preset="glass"] .preset-swatch {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(8px);
}

.preset-card[data-preset="bold"] .preset-bar {
  height: 0.45rem;
  background: #7f8b9f;
}

.preset-name {
  font-weight: 700;
  font-size: 0.88rem;
}

.preset-note {
  font-size: 0.74rem;
  color: #7d8798;
  line-height: 1.35;
}

/* Legacy alias kept for the settings column width. */
.wrap {
  margin: 0 auto;
}

h1 {
  font-size: 1.55rem;
  margin: 0 0 0.3rem;
  letter-spacing: -0.01em;
}

.subtitle {
  color: #8c97aa;
  margin: 0;
  font-size: 0.9rem;
  max-width: 62ch;
}

fieldset {
  border: 1px solid #262b36;
  border-radius: 0.9rem;
  padding: 1rem 1.2rem 1.3rem;
  margin: 0 0 1.2rem;
}

legend {
  padding: 0 0.5rem;
  font-weight: 600;
  color: #c3cad7;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.9rem 1.2rem;
}

label.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.86rem;
  color: #aab3c2;
}

label.check {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  color: #e7e9ee;
}

input,
select,
button {
  font: inherit;
}

input[type="text"],
input[type="number"],
select {
  background: #161a23;
  border: 1px solid #2b3140;
  color: #e7e9ee;
  border-radius: 0.5rem;
  padding: 0.5rem 0.6rem;
  width: 100%;
}

input[type="color"] {
  width: 100%;
  height: 2.3rem;
  background: #161a23;
  border: 1px solid #2b3140;
  border-radius: 0.5rem;
  padding: 0.15rem;
}

input[type="range"] {
  width: 100%;
}

.alert-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #1d222c;
}

.alert-row:last-child {
  border-bottom: 0;
}

.alert-row .name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: capitalize;
}

.goal-row {
  display: grid;
  grid-template-columns: 9.5rem 1fr 6.5rem;
  gap: 0.6rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #1d222c;
}
.goal-row:last-child {
  border-bottom: 0;
}
.goal-row .name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: capitalize;
}

.alert-row input[type="number"] {
  width: 110px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

button {
  background: #2f6df6;
  color: #fff;
  border: 0;
  border-radius: 0.55rem;
  padding: 0.6rem 1.1rem;
  cursor: pointer;
  font-weight: 600;
}

button.secondary {
  background: #232936;
  color: #dbe1ec;
}

button:hover {
  filter: brightness(1.12);
}

button:disabled {
  opacity: 0.55;
  cursor: default;
  filter: none;
}

#status-line {
  margin-top: 1rem;
  font-size: 0.88rem;
  min-height: 1.3em;
  color: #9aa3b2;
}

#status-line.ok {
  color: #58d68d;
}

#status-line.err {
  color: #ff7b7b;
}

.preview {
  margin-top: 0.7rem;
  border: 1px dashed #2b3140;
  border-radius: 0.7rem;
  background: repeating-conic-gradient(#191d26 0% 25%, #141821 0% 50%) 50% / 24px 24px;
  padding: 0.7rem;
  min-height: 90px;
}

.hint {
  color: #7d8798;
  font-size: 0.8rem;
  margin: 0.4rem 0 0;
}

code {
  background: #1b2029;
  border-radius: 0.3rem;
  padding: 0.1rem 0.35rem;
  font-size: 0.85em;
}
