.settings-link {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f9f6;
  color: var(--muted);
  transition: .18s;
}

.settings-link:hover,
.settings-link.active {
  border-color: #9ebbad;
  background: var(--mint);
  color: var(--green);
}

.settings-link svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-nav {
  width: fit-content;
  height: auto;
  display: flex;
  gap: 5px;
  margin-bottom: 34px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #eef2ee;
}

.settings-nav a {
  padding: 8px 14px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.settings-nav a.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(23, 34, 31, .1);
}

.settings-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  padding: 0;
  overflow: hidden;
  background: var(--line);
}

.settings-form .review-card {
  min-width: 0;
  padding: 22px;
  background: #fff;
}

.settings-form select {
  width: 100%;
  margin-top: 12px;
  padding: 11px;
  border: 1px solid #cbd5ce;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: 14px Manrope, sans-serif;
}

.field-help {
  min-height: 42px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.multi-select {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.multi-select label,
.theme-option {
  cursor: pointer;
}

.multi-select input,
.theme-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.multi-select span {
  display: block;
  padding: 9px 12px;
  border: 1px solid #cbd5ce;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  transition: .18s ease;
}

.multi-select input:checked + span {
  border-color: var(--green);
  background: var(--mint);
  color: var(--green);
}

.multi-select input:focus-visible + span,
.theme-option input:focus-visible + .theme-preview {
  outline: 3px solid rgba(18, 116, 81, .2);
  outline-offset: 2px;
}

.settings-form .content-type-row,
.settings-form .image-theme-row,
.settings-form .title-image-row {
  grid-column: 1 / -1;
}

.toggle-card {
  display: flex;
  align-items: center;
}

.setting-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
  cursor: pointer;
}

.setting-toggle > span {
  display: grid;
  flex: 1;
  gap: 4px;
}

.setting-toggle strong {
  font-size: 16px;
}

.setting-toggle small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.setting-toggle input,
.featured-style-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.setting-toggle > i {
  position: relative;
  width: 44px;
  height: 25px;
  flex: 0 0 44px;
  border: 1px solid #aeb9b2;
  border-radius: 999px;
  background: #dfe5e0;
  transition: .18s ease;
}

.setting-toggle > i::after {
  position: absolute;
  width: 19px;
  height: 19px;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(23, 34, 31, .24);
  content: "";
  transition: .18s ease;
}

.setting-toggle input:checked + i {
  border-color: var(--green);
  background: var(--green);
}

.setting-toggle input:checked + i::after {
  transform: translateX(19px);
}

.setting-toggle input:focus-visible + i {
  outline: 3px solid rgba(18, 116, 81, .2);
  outline-offset: 2px;
}

.title-image-toggle {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.featured-style-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.featured-style-option {
  min-width: 0;
  cursor: pointer;
}

.featured-style-preview {
  position: relative;
  display: grid;
  place-items: center;
  height: 130px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #f3eee5;
  transition: .18s ease;
}

.featured-style-option:hover .featured-style-preview,
.featured-style-option input:checked + .featured-style-preview {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(18, 116, 81, .1);
}

.featured-style-option input:focus-visible + .featured-style-preview {
  outline: 3px solid rgba(18, 116, 81, .2);
  outline-offset: 2px;
}

.featured-style-preview b {
  position: relative;
  z-index: 2;
  color: #17221f;
  font: 800 18px/1.05 Georgia, serif;
  text-align: center;
}

.featured-style-preview i,
.featured-style-preview::before,
.featured-style-preview::after {
  position: absolute;
  content: "";
}

.featured-style-preview-1 {
  background: #f9eee8;
}

.featured-style-preview-1::before,
.featured-style-preview-1::after {
  width: 74px;
  height: 74px;
  border: 2px solid #d6526f;
  transform: rotate(18deg);
}

.featured-style-preview-1::before { top: -34px; left: -25px; }
.featured-style-preview-1::after { right: -22px; bottom: -35px; }

.featured-style-preview-2 {
  background: linear-gradient(140deg, #ffd04f, #fff5db 38%, #efa53f 76%, #fff);
}

.featured-style-preview-2 i {
  width: 150%;
  height: 44px;
  left: -25%;
  top: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  transform: rotate(-8deg);
}

.featured-style-preview-3 {
  background: linear-gradient(120deg, #f0eee9 0 68%, #8153de 68%);
}

.featured-style-preview-3::before {
  width: 44px;
  height: 70px;
  left: 10px;
  bottom: -15px;
  border-radius: 50% 50% 12px 12px;
  background: #d8b49f;
}

.featured-style-preview-4 {
  background: linear-gradient(135deg, #e1f3e8, #f8ead7);
}

.featured-style-preview-4::before,
.featured-style-preview-4::after {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(18, 116, 81, .22);
}

.authors-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: 20px;
  align-items: start;
  margin-top: 30px;
}

.author-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.author-panel h2 { margin-bottom: 18px; }
.author-form { display: grid; gap: 20px; }
.author-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.author-form label { display: grid; gap: 7px; color: #495750; font-size: 12px; font-weight: 800; }
.author-form label small { color: var(--muted); font-weight: 500; }
.author-wide { grid-column: 1 / -1; }
.author-photo-field { justify-items: start; }
.author-photo-preview { width: 84px; height: 84px; object-fit: cover; border: 1px solid var(--line); border-radius: 50%; }
.author-form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.author-list-head p { margin: -12px 0 16px; color: var(--muted); font-size: 12px; }
.author-list { display: grid; gap: 8px; }
.author-list-card { display: grid; grid-template-columns: 48px 1fr auto; gap: 13px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); text-decoration: none; }
.author-list-card:hover { border-color: #9ebbad; background: #f8faf8; }
.author-list-card img,.author-avatar { width: 48px; height: 48px; border-radius: 50%; }
.author-list-card img { object-fit: cover; }
.author-avatar { display: grid; place-items: center; background: var(--mint); color: var(--green); font-size: 18px; font-weight: 800; }
.author-list-card>span:not(.author-avatar) { display: grid; }
.author-list-card small,.author-assigned-list small { color: var(--muted); font-size: 11px; }
.author-list-card>b { color: var(--green); }
.author-empty { padding: 24px; }
.author-empty p,.author-muted { margin: 0; color: var(--muted); }
.author-assigned-list { display: grid; }
.author-assigned-list>a { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.author-assigned-list>a>span { display: grid; }
.author-assigned-list>a>b { color: var(--green); font-size: 12px; }
.author-delete-form { display: flex; align-items: center; gap: 12px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); }
.author-delete-form .danger { background: #a33d35; }
.author-delete-form button:disabled { cursor: not-allowed; opacity: .45; }
.author-delete-form small { color: var(--muted); }

@media(max-width:800px) {
  .authors-layout { grid-template-columns: 1fr; }
}

@media(max-width:560px) {
  .settings-nav { width: 100%; overflow-x: auto; }
  .settings-nav a { flex: none; }
  .author-form-grid { grid-template-columns: 1fr; }
  .author-wide { grid-column: auto; }
}

.featured-style-preview-4::before { top: -18px; right: -10px; }
.featured-style-preview-4::after { bottom: -20px; left: -12px; }

.custom-preset-field {
  display: grid;
  gap: 6px;
  margin-top: 20px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.custom-preset-field small {
  color: var(--muted);
  font-weight: 500;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.theme-option {
  min-width: 0;
}

.theme-preview {
  position: relative;
  display: block;
  height: 118px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #e8eee9;
  box-shadow: inset 0 0 0 1px rgba(23, 34, 31, .09);
  transition: .18s ease;
}

.theme-option:hover .theme-preview,
.theme-option input:checked + .theme-preview {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(18, 116, 81, .1);
}

.theme-name {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.theme-preview::before,
.theme-preview::after,
.theme-preview i {
  position: absolute;
  content: "";
  display: block;
}

.theme-preview-1 {
  background: linear-gradient(145deg, #f3e8cf, #d9e9df);
}

.theme-preview-1::before {
  width: 76px;
  height: 76px;
  top: 21px;
  left: 22px;
  border-radius: 18px 42px 20px 38px;
  background: #167451;
  transform: rotate(-9deg);
}

.theme-preview-1::after {
  width: 62px;
  height: 62px;
  right: 18px;
  bottom: -14px;
  border-radius: 50%;
  background: #ec9d65;
}

.theme-preview-1 i {
  width: 42px;
  height: 6px;
  top: 28px;
  right: 22px;
  border-radius: 4px;
  background: #17221f;
  box-shadow: 0 14px 0 #17221f, 0 28px 0 #17221f;
}

.theme-preview-2 {
  background: #f6f7f3;
}

.theme-preview-2::before {
  width: 74px;
  height: 74px;
  top: 21px;
  left: calc(50% - 37px);
  border: 2px solid #17221f;
  border-radius: 50%;
}

.theme-preview-2::after {
  width: 90px;
  height: 44px;
  left: calc(50% - 45px);
  bottom: 19px;
  border: 2px solid #167451;
  border-radius: 50%;
  transform: rotate(-12deg);
}

.theme-preview-2 i {
  width: 7px;
  height: 7px;
  top: 45px;
  left: calc(50% - 3px);
  border-radius: 50%;
  background: #ec9d65;
}

.theme-preview-3 {
  background: linear-gradient(180deg, #b9d6dc 0 55%, #738b64 55%);
}

.theme-preview-3::before {
  width: 68px;
  height: 68px;
  right: 20px;
  top: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #fff5c9 0 8%, #e9bd6c 9% 100%);
  box-shadow: 0 8px 22px rgba(45, 54, 38, .25);
}

.theme-preview-3::after {
  left: -10%;
  right: -10%;
  bottom: -35px;
  height: 80px;
  border-radius: 50% 50% 0 0;
  background: #425c3d;
}

.theme-preview-3 i {
  left: 18px;
  bottom: 28px;
  width: 18px;
  height: 35px;
  border-radius: 12px 12px 3px 3px;
  background: #d7c2a0;
}

.theme-preview-4 {
  background: linear-gradient(135deg, #e8dfff, #c9edf0 48%, #ffe8cf);
}

.theme-preview-4::before {
  width: 90px;
  height: 90px;
  top: -22px;
  left: -14px;
  border-radius: 50%;
  background: rgba(132, 102, 205, .45);
  filter: blur(2px);
}

.theme-preview-4::after {
  width: 88px;
  height: 88px;
  right: -10px;
  bottom: -30px;
  border-radius: 50%;
  background: rgba(244, 143, 111, .5);
}

.theme-preview-4 i {
  width: 54px;
  height: 54px;
  left: calc(50% - 27px);
  top: 32px;
  border: 1px solid rgba(23, 34, 31, .35);
  border-radius: 16px;
  background: rgba(255, 255, 255, .42);
  backdrop-filter: blur(8px);
}

@media (max-width: 560px) {
  .app-header { gap: 14px; }
  .profile-link small { display: none; }
  .settings-form { grid-template-columns: 1fr; }
  .field-help { min-height: 0; }
  .theme-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featured-style-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
