/* beta.6 UI adjustments layered over the existing theme. */
.settings-dialog {
  width: min(680px, calc(100vw - 24px));
  height: min(720px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  font-family: Meiryo, "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-stretch: normal;
  letter-spacing: 0;
}

.settings-dialog > form {
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
}

.settings-dialog button,
.settings-dialog input {
  font-family: inherit;
  font-stretch: normal;
  letter-spacing: 0;
}

.settings-dialog .settings-panel {
  box-sizing: border-box;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  font-size: 1rem;
  line-height: 1.5;
}

/* Keep validation messages inside the active modal, above its backdrop. */
.dialog-inline-message {
  position: sticky;
  top: 0;
  z-index: 20;
  box-sizing: border-box;
  margin: 0 0 14px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 112, 112, .72);
  border-radius: 10px;
  background: #3a171b;
  color: #ffd9dc;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}

/* Slightly larger settings copy without changing the fixed dialog size. */
.settings-dialog .settings-intro,
.settings-dialog .settings-footnote,
.settings-dialog .sync-description p,
.settings-dialog .beta-box p {
  font-size: .98rem;
  line-height: 1.5;
}

.developer-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(128, 151, 184, .24);
  border-radius: 12px;
  background: rgba(18, 27, 39, .72);
}

.developer-box p {
  margin: 6px 0 0;
  font-size: .98rem;
  line-height: 1.5;
}

.developer-box .secondary-button {
  flex: 0 0 auto;
  text-decoration: none;
}

.uninstall-guide {
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid rgba(128, 151, 184, .18);
  border-radius: 10px;
  background: rgba(18, 27, 39, .38);
  color: #aeb9c9;
}

.uninstall-guide summary {
  padding: 10px 0;
  color: #cbd5e3;
  font-size: .86rem;
  font-weight: 650;
  cursor: pointer;
}

.uninstall-guide p {
  margin: 0 0 7px;
  font-size: .84rem;
  line-height: 1.55;
}

.uninstall-guide small {
  display: block;
  margin: 0 0 11px;
  color: #91a0b5;
  font-size: .78rem;
  line-height: 1.5;
}

.uninstall-guide code {
  padding: 1px 5px;
  border: 1px solid rgba(128, 151, 184, .2);
  border-radius: 5px;
  background: rgba(7, 12, 18, .28);
  color: inherit;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: .76rem;
}

.sync-conflict-dialog {
  box-sizing: border-box;
  width: min(620px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
}

.sync-conflict-dialog .dialog-form {
  display: block;
}

.sync-conflict-lead {
  margin: 0 0 16px;
  color: #cbd5e3;
  font-size: .92rem;
  line-height: 1.55;
}

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

.sync-compare-card {
  position: relative;
  display: grid;
  gap: 5px;
  box-sizing: border-box;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(128, 151, 184, .25);
  border-radius: 12px;
  background: rgba(18, 27, 39, .64);
}

.sync-compare-card.recommended {
  border-color: rgba(93, 214, 177, .48);
  background: rgba(31, 64, 57, .34);
}

.sync-source-label {
  width: max-content;
  color: #8df0b9;
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .08em;
}

.sync-compare-card strong {
  overflow: hidden;
  color: #f4f7fb;
  font-size: 1.08rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-compare-card small {
  color: #b5c0cf;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}

.sync-compare-card em {
  margin-top: 3px;
  color: #8391a5;
  font-size: .75rem;
  font-style: normal;
  line-height: 1.4;
}

.sync-conflict-note {
  margin: 12px 2px 0;
  color: #91a0b5;
  font-size: .78rem;
  line-height: 1.5;
}

.sync-conflict-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 18px;
}

.sync-conflict-actions > button:not(.sync-choice-cancel) {
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 10px 12px;
  text-align: left;
}

.sync-conflict-actions button strong {
  font-size: .91rem;
}

.sync-conflict-actions button span {
  font-size: .72rem;
  font-weight: 500;
  opacity: .78;
}

.sync-choice-cancel {
  grid-column: 1 / -1;
  justify-self: center;
  margin-top: 2px;
}

.sync-overwrite-confirm {
  box-sizing: border-box;
  padding: 18px 4px 2px;
  text-align: center;
}

.warning-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 140, 145, .55);
  border-radius: 50%;
  background: rgba(130, 40, 47, .22);
  color: #ff9a9f;
  font-size: 1.1rem;
  font-weight: 800;
}

.sync-overwrite-confirm h3 {
  margin: 12px 0 7px;
  color: #f4f7fb;
  font-size: 1.08rem;
}

.sync-overwrite-confirm p {
  max-width: 470px;
  margin: 0 auto;
  color: #aeb9c9;
  font-size: .86rem;
  line-height: 1.6;
}

.danger-button {
  padding: 10px 15px;
  border: 1px solid #d25c66;
  border-radius: 9px;
  background: #a93641;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.danger-button:hover { background: #bc404c; }

.settings-dialog .notification-modes strong,
.settings-dialog .sync-description > strong,
.settings-dialog .sync-box strong,
.settings-dialog .install-box strong,
.settings-dialog .beta-box strong {
  font-size: 1rem;
}

.settings-dialog small {
  font-size: .9rem;
  line-height: 1.5;
}

.settings-tab {
  font-size: .98rem;
}

.supported-sites,
.supported-sites > span {
  font-size: .9rem;
  line-height: 1.35;
}

.supported-sites > b {
  font-size: .81rem;
  line-height: 1.35;
}

.supported-sites > b > a {
  color: inherit;
  text-decoration: none;
}

.supported-sites > b > a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.supported-sites > b > a:focus-visible {
  border-radius: 4px;
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Compact identity bar: keep the product name, remove the redundant live-status sentence. */
.widget .titlebar {
  min-height: 52px;
  padding-block: 8px;
}

.widget .brand-mark {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 5px;
  border: 1px solid rgba(124, 240, 176, .25);
  border-radius: 11px;
  background: #183226;
  box-shadow: none;
}

.widget .brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.widget .brand-mark .signal {
  fill: none;
  stroke: #8de6bf;
  stroke-width: 2;
  stroke-linecap: round;
}

.widget .brand-mark .signal.outer { opacity: .64; }
.widget .brand-mark .signal.inner { opacity: .88; }
.widget .brand-mark .lamp { fill: #7cf0b0; }

.status-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}

.connection-alert {
  padding: 3px 7px;
  border: 1px solid rgba(255, 126, 134, .38);
  border-radius: 999px;
  background: rgba(147, 47, 55, .14);
  color: #ff9a9f;
  font-size: .72rem;
  font-weight: 700;
}

.connection-alert[hidden] { display: none; }

/* Keep card columns fixed when the All/Favorites result count changes. */
.widget .tab-toolbar {
  box-sizing: border-box;
  min-height: 44px;
}

.widget .streamer-list {
  grid-auto-rows: 132px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  align-content: start;
}

.widget .streamer-card {
  height: 132px;
}

.streamer-main {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 68px;
  grid-template-rows: 34px 18px 25px;
  grid-template-areas:
    "avatar copy actions"
    "avatar elapsed elapsed"
    "platforms platforms platforms";
  align-content: center;
  align-items: center;
  row-gap: 6px;
  column-gap: 10px;
  padding: 10px;
  min-width: 0;
}

.streamer-main > .avatar { grid-area: avatar; }
.streamer-main > .streamer-copy { grid-area: copy; min-width: 0; }
.streamer-main > .elapsed-time { grid-area: elapsed; min-width: 0; }
.streamer-main > .platform-row {
  grid-area: platforms;
  align-self: center;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.streamer-main > .card-actions {
  grid-area: actions;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  position: static;
  transform: none;
}

.streamer-copy > strong {
  font-size: .96rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .01em;
}

/* Let the elapsed clock wrap as a unit instead of being clipped. */
.streamer-copy small {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  min-width: 0;
  overflow: visible;
  line-height: 1.45;
}

.streamer-copy .status-text {
  flex: 1 1 12rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #cbd5e3;
  font-size: .87rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .01em;
}

.streamer-copy .status-text:empty {
  display: none;
}

.streamer-main > .elapsed-time {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  color: #8df0b9;
  font-size: .82rem;
  font-weight: 650;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  letter-spacing: .035em;
}

.streamer-card:not(.is-live) .streamer-copy {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
}

.streamer-card:not(.is-live) .streamer-copy .status-text {
  color: #aeb9c9;
}

.streamer-main .platform-link,
.streamer-main .platform-link.online {
  box-sizing: border-box;
  flex: 0 0 30px;
  width: 30px;
  min-width: 30px;
  height: 25px;
  padding: 0;
  font-size: 9px;
  letter-spacing: .035em;
}

.streamer-main .add-platform-button {
  flex: 0 0 auto;
  height: 25px;
  padding-inline: 7px;
  font-size: 8px;
}

.streamer-main .edit-sites-button {
  display: inline-grid;
  place-items: center;
  flex-basis: 25px;
  width: 25px;
  min-width: 25px;
  padding: 0;
}

.streamer-main .edit-sites-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.site-dialog .streamer-delete-button {
  margin-right: auto;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: #ff9a9f;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
}

.site-dialog .streamer-delete-button:hover {
  color: #ffc3c6;
  text-decoration: underline;
}

.duplicate-choice-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.duplicate-choice-list .duplicate-choice {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
}

.duplicate-choice strong {
  font-size: .96rem;
}

.duplicate-choice span {
  color: #aeb9c9;
  font-size: .86rem;
}

.widget .tab-toolbar p,
.widget #updatedAt {
  color: #91a0b5;
  font-size: .84rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .01em;
}

.widget .brand h1,
.widget .live-summary strong,
.widget .view-tab,
.widget .footer-actions button {
  letter-spacing: .01em;
}

.notify-button,
.pin-button,
.icon-button,
.footer-actions svg {
  box-sizing: border-box;
  flex: 0 0 auto;
}

.notify-button,
.pin-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 6px;
  margin: 0;
}

.notify-button svg,
.pin-button svg,
.footer-actions svg,
.icon-button svg {
  display: block;
  width: 18px;
  height: 18px;
}

/* Use more of a large display while keeping the compact window layout unchanged. */
@media (min-width: 1200px) and (min-height: 760px) {
  .widget {
    width: min(1180px, calc(100vw - 64px));
    max-width: 1180px;
    height: min(820px, calc(100dvh - 64px));
    max-height: calc(100dvh - 64px);
  }
}

@media (max-width: 560px) {
  .settings-dialog {
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
  }

  .streamer-main {
    grid-template-columns: 38px minmax(0, 1fr) 68px;
    row-gap: 6px;
    column-gap: 8px;
  }

  .notify-button,
  .pin-button {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 6px;
  }

  .developer-box {
    align-items: stretch;
    flex-direction: column;
  }

  .sync-compare-grid,
  .sync-conflict-actions {
    grid-template-columns: 1fr;
  }

  .sync-choice-cancel { grid-column: auto; }

  .streamer-copy > strong { font-size: .94rem; }

  .streamer-copy .status-text,
  .streamer-main > .elapsed-time { font-size: .8rem; }
}
