/* The Settings window (settings.js): the studio's own settings, by section. */

.st-overlay {
  z-index: 72;
  animation: pm-fade 0.16s ease-out;
}
.st-scrim {
  position: absolute;
  inset: 0;
}
.st {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(760px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 48px));
  border-radius: 18px;
  background: radial-gradient(600px 200px at 15% -10%, rgba(212, 175, 55, 0.1), transparent 70%), linear-gradient(180deg, #1c1821, #0f0d12);
  border: 1px solid var(--line-3);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.7),
    var(--glow),
    inset 0 1px 0 rgba(255, 240, 200, 0.07);
  overflow: hidden;
  animation: pm-rise 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.st-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 12px 20px;
  border-bottom: 1px solid var(--line);
}
.st-head h2 {
  flex: 1;
  margin: 0;
  font: italic 600 26px/1.1 var(--serif);
  color: var(--gold-hi);
}
.st-main {
  flex: 1;
  min-height: 0;
  display: flex;
}
.st-nav {
  flex: none;
  width: 180px;
  padding: 12px 8px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.st-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: 13px var(--sans, inherit);
  text-align: left;
  cursor: pointer;
}
.st-tab .glyph {
  width: 16px;
  height: 16px;
}
.st-tab:hover {
  color: var(--text);
  background: rgba(212, 175, 55, 0.06);
}
.st-tab.on {
  color: var(--gold-hi);
  background: rgba(212, 175, 55, 0.12);
}
.st-body {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.st-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.st-row-text {
  flex: 1;
  min-width: 0;
}
.st-row-title {
  color: var(--text);
  font-size: 13.5px;
}
.st-row-about {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}
.st-row-ctl {
  flex: none;
}
.st-select {
  min-width: 180px;
}
.st-sub {
  margin: 12px 0 0;
  font: italic 600 17px/1.2 var(--serif);
  color: var(--champagne);
}
.st-note {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}
.st-error {
  color: var(--danger);
}
.st-folders {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.st-folder {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  padding: 2px 6px 2px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}
.st-folder .glyph {
  width: 15px;
  height: 15px;
  color: var(--gold-mid);
}
.st-folder.std {
  background: transparent;
}
.st-format {
  min-width: 36px;
  color: var(--gold-mid);
  font-size: 11px;
}
.st-path {
  flex: 1;
  min-width: 0;
  font: 11.5px var(--mono);
  color: var(--text);
  overflow-wrap: anywhere;
}
.st-empty {
  color: var(--dim);
  font: italic 13px var(--serif);
  padding: 2px 10px;
}
.st-add {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.st-add .st-input {
  flex: 1;
  min-width: 0;
}
.st-file {
  margin-top: 8px;
  color: var(--dim);
  font: 10.5px var(--mono);
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .st-main {
    flex-direction: column;
  }
  .st-nav {
    width: auto;
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  /* A row's control too wide to sit beside its text (Sync's Join: a link, a name, a button) goes
     under it, the whole width, instead of squeezing the text to a word a line. */
  .st-row {
    flex-wrap: wrap;
  }
  .st-row-text {
    flex: 1 1 12em;
  }
  .st-row-ctl {
    flex: 0 1 auto;
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
  }
  .st-row-ctl .st-input {
    flex: 1 1 12em;
    min-width: 0;
  }
  /* Two fields (a link and its name): the first, the long one, has a line of its own. */
  .st-row-ctl:has(.st-input + .st-input) .st-input:first-child {
    flex-basis: 100%;
  }
}

/* Sync (src/ui/sync.js): the link as a QR code, for a phone's camera. */
.sync-qr {
  margin: 8px 0 10px;
}
.sync-qr img {
  display: block;
  width: 180px;
  height: 180px;
  padding: 8px;
  border-radius: 8px;
  background: #fff;
}
