/* Full-height settings navigation. Native mobile follows the same section map. */
#history-cloud-notice {
  position: fixed;
  z-index: 100;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(600px, calc(100vw - 28px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border: 1px solid #a47a43;
  background: #332d29;
  color: #f5dfbd;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 8px 24px #0006;
}
#history-cloud-notice span {
  flex: 1;
}
#history-cloud-notice button {
  flex-shrink: 0;
}
#settings-dialog {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #222229;
  color: #eeeef2;
  box-shadow: none;
  overflow: hidden;
}
#settings-dialog[open] {
  display: grid;
  grid-template-columns: minmax(220px, calc((100vw - 980px) / 2 + 238px)) minmax(0, 1fr);
}
#settings-dialog .settings-sidebar {
  background: #19191f;
  padding: 38px 20px 22px max(20px, calc((100vw - 980px) / 2));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.settings-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
}
.settings-brand img {
  width: 28px;
  height: 28px;
}
#settings-search {
  background: #101014;
  border: 1px solid #383840;
  color: inherit;
  padding: 10px 12px;
  border-radius: 7px;
  width: 100%;
  font: inherit;
  font-size: 13px;
}
.settings-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.settings-sidebar nav h3 {
  color: #91919f;
  font-size: 10px;
  letter-spacing: 0.09em;
  margin: 20px 10px 6px;
}
#settings-dialog .settings-nav-item {
  border: 0;
  text-align: left;
  justify-content: flex-start;
  background: transparent;
  color: #bcbcc7;
  padding: 11px 12px;
  font: inherit;
  font-size: 14px;
  border-radius: 6px;
  min-height: 42px;
}
#settings-dialog .settings-nav-item:hover {
  background: #ffffff08;
  color: white;
}
#settings-dialog .settings-nav-item.active {
  background: #37373f;
  color: white;
  font-weight: 600;
  box-shadow: inset 3px 0 #e33163;
}
.settings-version {
  margin-top: auto;
  padding: 22px 10px 0;
  color: #787887;
  font-size: 11px;
}
#settings-dialog .settings-main {
  position: relative;
  padding: 48px 80px 50px 44px;
  overflow-y: auto;
}
.settings-main > * {
  max-width: 700px;
}
.settings-header {
  margin-bottom: 30px;
}
#settings-dialog h2 {
  font-size: 25px;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
}
.settings-description,
.settings-panel > p {
  color: #a5a5b3;
  font-size: 14px;
  line-height: 1.6;
}
.settings-panel label {
  font-size: 13px;
  color: #c6c6d1;
  margin-top: 20px;
}
.settings-panel input:not([type='checkbox']):not([type='range']),
.settings-panel select {
  background: #17171d;
  border: 1px solid #3b3b46;
  border-radius: 7px;
  color: #f3f3f8;
  min-height: 42px;
}
.settings-panel .check-label {
  padding: 16px 0;
  border-bottom: 1px solid #ffffff0b;
  justify-content: space-between;
  flex-direction: row-reverse;
}
.settings-panel .check-label input {
  flex-shrink: 0;
}
#settings-dialog .settings-close {
  position: fixed;
  right: 28px;
  top: 28px;
  width: 38px;
  height: 38px;
  border: 1px solid #555563;
  border-radius: 50%;
  background: transparent;
  z-index: 2;
}
#settings-dialog .settings-close:after {
  content: 'ESC';
  position: absolute;
  top: 42px;
  left: 6px;
  font-size: 10px;
  color: #9292a1;
}
.settings-account-card,
.settings-storage-card {
  background: #2b2b34;
  border: 1px solid #3a3a45;
  border-radius: 12px;
  padding: 24px;
  margin: 12px 0 24px;
}
.settings-account-card h3,
.settings-storage-card h3 {
  margin: 10px 0;
  font-size: 20px;
}
.settings-account-card p,
.settings-storage-card p {
  color: #b3b3bf;
  line-height: 1.6;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.settings-eyebrow {
  color: #b2b2c2;
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 700;
}
.settings-cloud-state {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 24px 0 14px;
  font-size: 13px;
  line-height: 1.5;
}
.settings-state-dot {
  width: 8px;
  height: 8px;
  background: #9d9dac;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
[data-state='saved'] .settings-state-dot {
  background: #73cba2;
}
[data-state='attention'] .settings-state-dot {
  background: #e3b86d;
}
[data-state='saving'] .settings-state-dot {
  background: #d67b9e;
}
#settings-cloud-usage {
  width: 100%;
  height: 6px;
  accent-color: #dd3465;
}
#settings-cloud-size {
  display: block;
  margin-top: 10px;
  color: #a5a5b3;
  font-size: 12px;
}
.settings-advanced,
.settings-panel .text-key-settings {
  border-top: 1px solid #3a3a45;
  padding: 18px 0;
  margin-top: 18px;
  font-size: 14px;
}
.settings-advanced summary,
.settings-panel summary {
  cursor: pointer;
  color: #c2c2ce;
}
.settings-links {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.settings-links a {
  padding: 16px 0;
  border-bottom: 1px solid #35353e;
  color: #c3c3d2;
  text-decoration: none;
}
#settings-dialog .settings-back {
  display: none;
}
#settings-dialog [hidden] {
  display: none !important;
}
#settings-dialog :focus-visible {
  outline: 2px solid #e78ba6;
  outline-offset: 3px;
}
#settings-status {
  min-height: 20px;
  margin-top: 24px;
}
@media (max-width: 720px) {
  #settings-dialog[open] {
    display: block;
  }
  #settings-dialog .settings-sidebar {
    height: 100%;
    padding: 26px 20px 32px;
    gap: 16px;
  }
  #settings-dialog .settings-brand {
    margin-right: 44px;
  }
  #settings-dialog .settings-nav-item {
    padding: 15px 14px;
    font-size: 15px;
    min-height: 50px;
    background: #24242c;
    border-radius: 7px;
  }
  .settings-sidebar nav {
    gap: 6px;
  }
  #settings-dialog .settings-main {
    display: none;
    height: 100%;
    padding: 22px 20px 40px;
  }
  #settings-dialog.settings-detail .settings-sidebar {
    display: none;
  }
  #settings-dialog.settings-detail .settings-main {
    display: block;
  }
  #settings-dialog .settings-back {
    display: block;
    padding: 4px 0 24px;
    background: transparent;
    border: 0;
    color: #c7c7d2;
    font-size: 14px;
  }
  #settings-dialog .settings-close {
    top: 19px;
    right: 18px;
    width: 34px;
    height: 34px;
  }
  #settings-dialog .settings-close:after {
    display: none;
  }
  #settings-dialog h2 {
    font-size: 23px;
    padding-right: 25px;
  }
  .settings-header {
    margin-bottom: 24px;
  }
  .settings-account-card,
  .settings-storage-card {
    padding: 20px;
  }
}

.settings-startup-card {
  padding: 28px;
  border: 1px solid #49404f;
  border-radius: 16px;
  background: linear-gradient(130deg, #312c38, #26262e 72%);
}
.settings-startup-card h3 {
  margin: 12px 0;
  font-size: 23px;
  letter-spacing: -0.025em;
}
.settings-startup-card > p {
  color: #bcb8c6;
  font-size: 14px;
  line-height: 1.65;
}
#settings-dialog .settings-startup-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 28px 0 14px;
  padding: 20px 0;
  border-top: 1px solid #ffffff10;
  border-bottom: 1px solid #ffffff10;
  cursor: pointer;
}
.settings-startup-toggle strong,
.settings-startup-toggle small {
  display: block;
}
.settings-startup-toggle strong {
  color: #f1edf5;
  font-size: 14px;
  line-height: 1.5;
}
.settings-startup-toggle small {
  color: #a49ead;
  margin-top: 6px;
  line-height: 1.5;
  font-size: 12px;
}
#desktop-autostart {
  appearance: none;
  position: relative;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  padding: 0;
  min-height: 25px;
  margin: 0;
  border: 1.5px solid #777080;
  border-radius: 8px;
  background: #211e28;
  cursor: pointer;
}
#desktop-autostart:checked {
  background: #df3b6a;
  border-color: #eb688e;
  box-shadow: 0 2px 12px #df3b6a22;
}
#desktop-autostart:checked::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 8px;
  width: 6px;
  height: 11px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
#desktop-autostart:disabled {
  opacity: 0.55;
  cursor: wait;
}
#desktop-autostart-status {
  min-height: 40px;
  margin: 0;
  font-size: 12px;
}
@media (max-width: 720px) {
  .settings-startup-card {
    padding: 22px;
  }
}
