/* ============================================================
   Start page stylesheet — matches the reference screenshots:
   one white card (header + page + footer) on a grey backdrop,
   grey nav section inside the card, text-only links, centred
   tabs with dark underline on the active tab.
   Written from scratch for this project.
   ============================================================ */

*, :after, :before { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
ul, ol, p, h1, h2, h3 { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; border: 0; margin: 0; padding: 0; appearance: none; -webkit-appearance: none; background: none; }
:focus { outline: none; }
img { display: block; max-width: 100%; }
svg { shape-rendering: geometricPrecision; }

:root {
  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
               Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans", sans-serif;
  --corner-radius: 4px;
  --search-width: 490px;
  --search-height-desktop: 48px;
  --search-height-mobile: 42px;
  --search-submit-width: 60px;

  --primary-color: #2d2d2d;
  --secondary-color: #999;
  --border-color: #d8d8d8;
  --light-color: #f6f6f6;
  --mid-color: #e3e3e3;
  --dark-color: #4c4c4c;
  --white-color: #fff;
  --danger-color: #de8971;
  --success-color: #96bb7c;
  --highlight-color: var(--dark-color);
  --base-background: #e9e9e9;
  --main-background: var(--white-color);
  --block-background: #f5f5f5;
  --input-background: var(--white-color);
  --focus-background: #ececec;
  --search-background: #f2f2f2;
  --setting-background: #fafafa;
}

html[data-color-mode="dark"] {
  --primary-color: #ddd;
  --secondary-color: #8d8d8d;
  --border-color: #3a3a3a;
  --light-color: #3d3d3d;
  --mid-color: #333;
  --dark-color: #c9c9c9;
  --highlight-color: #4a4a4a;
  --base-background: #111;
  --main-background: #1e1e1e;
  --block-background: #262626;
  --input-background: #333;
  --focus-background: #2b2b2b;
  --search-background: #2b2b2b;
  --setting-background: #232323;
}

/* ---- theme backdrops (page colour around the card) ------------ */
html[data-theme="pure"] {
  --dark-color: #5d5d5d;
  --base-background: #f2f2f2;
  --block-background: #fafafa;
  --setting-background: #f7f7f7;
}
html[data-theme="pure"][data-color-mode="dark"] {
  --base-background: #0d0d0d;
  --block-background: #1a1a1a;
  --setting-background: #191919;
}
html[data-theme="cyan"] {
  --primary-color: #26565e;
  --secondary-color: #7d9a97;
  --base-background: #a8c3c0;
  --block-background: #eef0ef;
  --search-background: #e8ebeb;
  --setting-background: #f2f4f3;
}
html[data-theme="cyan"][data-color-mode="dark"] {
  --primary-color: #47a4b6;
  --secondary-color: #5d7a7d;
  --base-background: #10191a;
  --block-background: #1d2425;
  --search-background: #283031;
  --setting-background: #1b2223;
}
html[data-theme="lychee"] {
  --primary-color: #461111;
  --secondary-color: #a9827c;
  --base-background: #c9a9a4;
  --block-background: #f4efed;
  --search-background: #eee7e5;
  --setting-background: #f8f3f1;
}
html[data-theme="lychee"][data-color-mode="dark"] {
  --primary-color: #c8a291;
  --secondary-color: #7a5f55;
  --base-background: #241a18;
  --block-background: #2b2220;
  --search-background: #332926;
  --setting-background: #261e1c;
}
html[data-theme="ocean"] {
  --primary-color: #293b5f;
  --secondary-color: #7b89a3;
  --base-background: #93a5c4;
  --block-background: #eef0f4;
  --search-background: #e7eaf0;
  --setting-background: #f3f4f7;
}
html[data-theme="ocean"][data-color-mode="dark"] {
  --primary-color: #8aa6c4;
  --secondary-color: #5f6f88;
  --base-background: #131a29;
  --block-background: #1c2333;
  --search-background: #272f42;
  --setting-background: #1a2130;
}
html[data-theme="ink"]    { --base-background: #b9beb9; }
html[data-theme="ink"][data-color-mode="dark"] { --base-background: #171917; }
html[data-theme="charcoal"] { --base-background: #b5aca9; }
html[data-theme="charcoal"][data-color-mode="dark"] { --base-background: #191616; }
html[data-theme="moonlit"] { --base-background: #a9b7b3; }
html[data-theme="moonlit"][data-color-mode="dark"] { --base-background: #121716; }

/* wave / mountain scenes: the card goes transparent so the
   canvas along the bottom edge shows through */
html[data-theme="wave"], html[data-theme="mountain"] { --base-background: #dfe3e2; }
html[data-theme="wave"][data-color-mode="dark"],
html[data-theme="mountain"][data-color-mode="dark"] { --base-background: #121514; }

/* ---- page scaffold -------------------------------------------- */
body {
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 24px;
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.25;
  color: var(--primary-color);
  background: var(--base-background);
  transition: background .2s ease-out;
  -webkit-font-smoothing: antialiased;
}
@media (max-width: 1200px) { body { padding: 32px 16px; } }
@media (max-width: 834px)  { body { padding: 16px; } }
@media (max-width: 600px)  { body { padding: 0; } }

.card {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 80px);
  border-radius: var(--corner-radius);
  background: var(--main-background);
  overflow: hidden;
  transition: background .2s ease-out;
}
.page-main { flex: 1; }

@media (max-width: 600px) { .card { min-height: 100vh; border-radius: 0; } }

/* ---- header (inside the card) ---------------------------------- */
.site-header {
  display: flex;
  height: 150px;
  padding: 0 84px;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--primary-color);
}
.logo:hover { opacity: .78; }
.customize {
  padding: 8px;
  margin-right: -8px;
  color: var(--secondary-color);
  transition: color .1s ease;
}
.customize:hover { color: var(--primary-color); }
@media (max-width: 834px) { .site-header { height: 108px; padding: 0 48px; } }
@media (max-width: 600px) { .site-header { height: 80px; padding: 0 20px; } }

/* ---- search ---------------------------------------------------- */
.search-area { position: relative; padding: 48px 0 76px; }
.search-box {
  position: relative;
  display: flex;
  max-width: var(--search-width);
  height: var(--search-height-desktop);
  margin: 0 auto;
  border-radius: 6px;
  background: var(--search-background);
  transition: background .2s ease-out;
}
.engine-btn {
  display: flex;
  flex: none;
  height: 100%;
  padding: 0 12px 0 14px;
  color: var(--dark-color);
  opacity: .78;
  cursor: pointer;
  align-items: center;
  transition: opacity .1s ease;
}
.engine-btn:hover { opacity: 1; }
.engine-icon { width: 24px; height: 24px; object-fit: contain; }
.engine-btn .caret { margin-left: 5px; color: var(--secondary-color); }
.search-input {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding-left: 18px;
  padding-right: 8px;
  line-height: 1.5;
  color: var(--primary-color);
  background: none;
}
.search-input::placeholder { color: var(--secondary-color); }
.search-submit {
  display: flex;
  flex: none;
  width: var(--search-submit-width);
  color: var(--dark-color);
  cursor: pointer;
  border-radius: 0 6px 6px 0;
  align-items: center;
  justify-content: center;
  transition: color .1s ease, background .1s ease-in-out;
}
.search-submit:hover, .search-submit:focus { color: var(--white-color); background: var(--highlight-color); }

.dropdown {
  position: absolute;
  z-index: 100;
  margin-top: 6px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--primary-color);
  background: var(--main-background);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .08);
}
.dropdown[hidden] { display: none; }

.engine-menu {
  left: 50%;
  transform: translateX(-235px);
  min-width: 210px;
  letter-spacing: .02em;
  overflow: hidden;
}
.engine-item {
  display: flex;
  padding: 9px 14px;
  cursor: pointer;
  align-items: center;
  font-size: 15px;
}
.engine-item img { width: 20px; height: 20px; margin-right: 10px; object-fit: contain; }
.engine-item .e-name { overflow: hidden; max-width: 140px; text-overflow: ellipsis; white-space: nowrap; }
.engine-item .e-host { margin-left: auto; padding-left: 16px; overflow: hidden; max-width: 110px; color: var(--secondary-color); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.engine-item:hover, .engine-item.active { background: var(--focus-background); }

.suggest-menu {
  left: 50%;
  transform: translateX(-50%);
  width: var(--search-width);
  padding: 6px 0;
  font-size: 15px;
}
.suggest-scroll { max-height: 290px; overflow-y: auto; overscroll-behavior: contain; }
.suggest-scroll::-webkit-scrollbar { width: 8px; }
.suggest-scroll::-webkit-scrollbar-track { background: transparent; }
.suggest-scroll::-webkit-scrollbar-thumb { background: var(--mid-color); border-radius: 4px; }
.suggest-item {
  display: flex;
  padding: 9px 20px;
  cursor: pointer;
  align-items: center;
}
.suggest-item img { width: 18px; height: 18px; margin-right: 12px; opacity: .7; object-fit: contain; }
.suggest-item .s-text { overflow: hidden; max-width: 330px; text-overflow: ellipsis; white-space: nowrap; }
.suggest-item .s-engine { margin-left: auto; padding-left: 16px; color: var(--secondary-color); font-size: 12px; }
.suggest-item:hover, .suggest-item.active { background: var(--focus-background); }
.search-tips {
  display: flex;
  justify-content: space-around;
  margin-top: 4px;
  padding: 6px 0;
  border-top: 1px solid var(--border-color);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .05em;
  text-align: center;
  color: var(--secondary-color);
}
@media (max-width: 834px) {
  .search-area { padding: 32px 0 56px; }
  .search-box { max-width: 80%; }
  .engine-menu { transform: none; left: auto; right: 0; }
  .suggest-menu { transform: none; }
}
@media (max-width: 600px) {
  .search-area { padding: 16px 0 48px; }
  .search-box { max-width: 100%; height: var(--search-height-mobile); margin: 0 20px; }
  .engine-icon { width: 22px; height: 22px; }
  .search-submit { width: 48px; }
  .suggest-menu { width: calc(100% - 40px); }
  .search-tips { display: none; }
}

/* ---- nav section (grey block inside the card) ------------------ */
.nav-panel { color: var(--primary-color); background: var(--block-background); }
.nav-wrap {
  position: relative;
  max-width: 1210px;
  padding: 0 40px;
  margin: 0 auto;
  overflow: hidden;
}
.nav-tabs-wrap:before, .nav-tabs-wrap:after {
  content: "";
  position: absolute;
  top: 32px;
  height: 42px;
  padding-right: 16px;
  z-index: 10;
}
.nav-tabs-wrap:before { left: 40px; box-shadow: inset 8px 0 8px -4px var(--block-background); }
.nav-tabs-wrap:after { right: 40px; box-shadow: inset -8px 0 8px -4px var(--block-background); }
.nav-tabs {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 36px 0 24px;
  font-size: 0;
  text-align: center;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
  display: inline-block;
  flex: none;
  margin: 0 24px;
  padding: 6px 2px 12px;
  border-bottom: 2px solid transparent;
  color: var(--secondary-color);
  font-size: 16px;
  cursor: pointer;
  transition: color .1s ease, border-color .1s ease;
}
.nav-tab:hover { color: var(--primary-color); }
.nav-tab.active { color: var(--primary-color); border-bottom-color: var(--dark-color); }

.nav-list { padding: 24px 0 72px; }
.group-row {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.group-row:last-child { margin-bottom: 0; }
.group-head {
  position: relative;
  display: flex;
  max-width: 12%;
  overflow: hidden;
  color: var(--secondary-color);
  font-size: 15px;
  align-items: center;
  flex: 0 0 12%;
}
.group-head:after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 24px; height: 100%;
  background: linear-gradient(90deg, transparent, var(--block-background));
  pointer-events: none;
}
.group-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-cells { display: flex; max-width: 88%; flex: 0 0 88%; }
.link-cell {
  max-width: 16.666667%;
  flex: 0 0 16.666667%;
  min-width: 0;
  text-align: center;
}
.link-chip {
  display: inline-flex;
  max-width: 100%;
  padding: 9px 14px;
  overflow: hidden;
  border-radius: var(--corner-radius);
  font-size: 15px;
  cursor: pointer;
  transition: background .1s ease-out;
}
.link-chip:hover { background: var(--mid-color); }
.chip-icon { width: 20px; height: 20px; margin-right: 8px; object-fit: contain; flex: none; }
html[data-siteicon="fade"] .chip-icon { opacity: .9; filter: saturate(80%); }
html[data-siteicon="gray"] .chip-icon { opacity: .7; filter: grayscale(72%); }
html[data-siteicon="none"] .chip-icon { display: none; }
html[data-siteicon="none"] .link-chip { justify-content: center; }
.chip-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more-arrow {
  position: absolute;
  top: 0; bottom: 0; right: -1em;
  margin: auto 0;
  display: flex;
  align-items: center;
  color: var(--secondary-color);
  cursor: pointer;
}
.more-arrow:hover { color: var(--primary-color); }
.group-row.expanded .link-cells { flex-wrap: wrap; }
.group-row.expanded .link-cell { margin-top: 8px; }
.nav-empty {
  padding: 48px 0 64px;
  text-align: center;
  color: var(--secondary-color);
  font-size: 15px;
}
.nav-empty a { color: var(--primary-color); }

@media (max-width: 834px) {
  .nav-wrap { max-width: 100%; padding: 0 32px; }
  .nav-tabs-wrap:before { left: 32px; }
  .nav-tabs-wrap:after { right: 32px; }
  .nav-list { padding-bottom: 48px; }
}
@media (max-width: 600px) {
  .nav-wrap { padding: 0 20px; }
  .nav-tabs { justify-content: flex-start; padding: 16px 0; margin: 0 -20px; }
  .nav-tabs-wrap:before, .nav-tabs-wrap:after { top: 16px; height: 34px; }
  .nav-tabs-wrap:before { left: 0; }
  .nav-tabs-wrap:after { right: 0; }
  .nav-tab { margin: 0 16px; padding: 4px 2px 8px; font-size: 15px; }
  .nav-list { padding: 8px 0 32px; font-size: 15px; }
  .group-row { margin-bottom: 6px; }
  .group-head { max-width: 18%; flex: 0 0 18%; font-size: 13px; }
  .link-cells { max-width: 82%; flex: 0 0 82%; flex-wrap: wrap; }
  .link-cell { max-width: 33.333333%; flex: 0 0 33.333333%; text-align: center; }
  .link-chip { padding: 7px 6px; }
  .more-arrow { display: none; }
}

/* ---- footer (inside the card) ----------------------------------- */
.site-footer {
  display: flex;
  height: 160px;
  padding: 0 84px;
  font-size: 14px;
  color: var(--secondary-color);
  align-items: center;
  justify-content: space-between;
}
.site-footer a { transition: color .1s ease; }
.site-footer a:hover { color: var(--primary-color); }
.footer-links { display: flex; align-items: center; }
.footer-links #f-about { margin-right: 20px; }
.footer-links #f-setting { margin-right: 32px; }
.colormode-toggle { display: flex; align-items: center; }
.colormode-toggle svg { margin-right: 5px; }
.explain { font-size: 12px; opacity: .55; }
@media (max-width: 834px) { .site-footer { height: 108px; padding: 0 48px; } }
@media (max-width: 600px) {
  .site-footer { height: auto; padding: 28px 20px; flex-direction: column; }
  .footer-links { order: -1; margin-bottom: 14px; }
  .explain { margin-top: 10px; text-align: center; }
}

/* wave/mountain scenes: transparent card, quiet fixed footer */
#wave-canvas {
  position: fixed;
  z-index: 10;
  bottom: 0;
  left: 0;
  display: none;
  pointer-events: none;
}
html[data-scene="on"] #wave-canvas { display: block; }
@media (min-width: 601px) {
  html[data-scene="on"] body { min-height: 100vh; }
  html[data-scene="on"] .card {
    min-height: calc(100vh - 80px);
    background: transparent;
    box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .12);
  }
  html[data-scene="on"] .nav-panel { background: transparent; }
  html[data-scene="on"] .site-footer {
    position: fixed;
    bottom: 24px; left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1392px;
    height: 80px;
    opacity: .55;
    transition: opacity .1s ease-out;
  }
  html[data-scene="on"] .site-footer:hover { opacity: 1; }
}

/* ================================================================
   Settings page
   ================================================================ */
.setting-page { background: var(--setting-background); }
.setting-inner { max-width: 1130px; padding: 56px 40px; margin: 0 auto; }
.settings-grid { display: flex; margin: -16px -40px; flex-wrap: wrap; }
.setting-field { max-width: calc(25% - 80px); margin: 16px 40px; flex: 0 0 calc(25% - 80px); }
.setting-label { display: block; margin-bottom: 8px; font-size: 15px; color: var(--primary-color); }
.setting-select {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--corner-radius);
  text-align: center;
  text-align-last: center;
  color: var(--primary-color);
  font-size: 15px;
  background: var(--input-background);
  cursor: pointer;
  transition: background .1s ease-out;
}
.setting-select:hover { background: var(--focus-background); }

.sync-block { display: flex; margin-top: 48px; align-items: center; }
.sync-statusbox {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
  padding: 10px 20px;
  border-radius: var(--corner-radius);
  background: var(--search-background);
  align-items: center;
  justify-content: space-evenly;
  flex-wrap: wrap;
}
.sync-cloud {
  display: flex;
  min-width: 180px;
  margin: 10px 12px;
  color: var(--primary-color);
  font-size: 17px;
  align-items: center;
  flex: 1;
}
.sync-cloud.off { color: var(--secondary-color); }
.sync-cloud svg { width: 30px; height: 30px; margin-right: 18px; flex: none; }
.sync-key { font-family: ui-monospace, Menlo, Consolas, monospace; }
.sync-input {
  flex: 1;
  max-width: 240px;
  min-width: 120px;
  margin: 10px 12px;
  padding: 9px 16px;
  border-radius: var(--corner-radius);
  color: var(--primary-color);
  font-size: 15px;
  background: var(--input-background);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.sync-btn {
  margin: 10px 0 10px 12px;
  padding: 9px 28px;
  border-radius: var(--corner-radius);
  color: var(--primary-color);
  font-size: 15px;
  background: var(--mid-color);
  cursor: pointer;
  transition: opacity .1s ease-out;
  flex: none;
}
.sync-btn.primary { background: var(--highlight-color); color: var(--white-color); }
.sync-btn:hover { opacity: .82; }
.sync-btn[disabled] { opacity: .45; cursor: default; }
.sync-alert { width: 100%; margin: 8px 12px 2px; font-size: 13px; text-align: left; }
.sync-alert.err { color: var(--danger-color); }
html[data-color-mode="dark"] .sync-alert.err { color: #e8927f; }
.sync-alert.ok { color: var(--success-color); }
html[data-color-mode="dark"] .sync-alert.ok { color: #a5cc8d; }

.actions-row { display: flex; margin-top: 48px; align-items: center; justify-content: flex-end; }
.reset-link {
  margin-right: 40px;
  color: var(--secondary-color);
  font-size: 15px;
  cursor: pointer;
  transition: color .1s ease-out;
}
.reset-link:hover { color: var(--primary-color); }

/* edit mode */
.editbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.edit-hint { font-size: 13px; color: var(--secondary-color); }
.edit-tabs {
  display: flex;
  justify-content: center;
  padding: 8px 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}
.edit-tabs::-webkit-scrollbar { display: none; }
.edit-tab {
  display: inline-block;
  flex: none;
  margin: 0 8px;
  padding: 7px 18px;
  overflow: hidden;
  border: 1px dashed var(--secondary-color);
  border-radius: var(--corner-radius);
  color: var(--secondary-color);
  font-size: 15px;
  background: transparent;
  cursor: pointer;
  user-select: none;
  touch-action: none;
  transition: color .1s ease, background .1s ease;
}
.edit-tab.active, .edit-tab:hover { color: var(--primary-color); background: var(--mid-color); }
.edit-tab.dragging { opacity: .4; }
.edit-grid-rows { padding-bottom: 32px; }
.edit-row { position: relative; display: flex; }
.edit-cells { display: flex; max-width: 100%; flex: 1; flex-wrap: wrap; gap: 10px 6px; }
.edit-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  max-width: calc(16.66667% - 12px);
  margin: 0 6px;
  padding: 10px 8px;
  overflow: visible;
  border: 1px dashed var(--secondary-color);
  border-radius: var(--corner-radius);
  background: transparent;
  font-size: 15px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: background .1s ease-out;
}
.edit-item.selected { background: var(--mid-color); border-style: solid; color: var(--primary-color); }
.edit-item.dragging { opacity: .35; }
.edit-item .chip-icon { width: 20px; height: 20px; margin: 0 0 3px; }
.edit-item input.e-name,
.edit-item input.e-url {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 2px 4px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--primary-color);
  font-size: 12.5px;
  line-height: 1.35;
  text-align: center;
  cursor: text;
}
.edit-item input.e-url { color: var(--secondary-color); font-size: 11px; }
.edit-item input.e-name:hover, .edit-item input.e-url:hover { border-color: var(--border-color); }
.edit-item input.e-name:focus, .edit-item input.e-url:focus {
  border-color: var(--dark-color);
  background: var(--input-background);
  outline: none;
}
.cell-del {
  position: absolute;
  top: -7px; right: -7px;
  z-index: 2;
  display: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  line-height: 16px;
  text-align: center;
  color: var(--secondary-color);
  font-size: 12px;
  background: var(--mid-color);
  cursor: pointer;
}
.edit-item:hover .cell-del, .edit-item.selected .cell-del { display: block; }
.cell-del:hover { color: #fff; background: var(--danger-color); }
.edit-item.drag-over { border-style: solid; color: var(--primary-color); }

.edit-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  margin-bottom: 6px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--secondary-color);
}
.edit-toolbar .tb-label { overflow: hidden; max-width: 260px; text-overflow: ellipsis; white-space: nowrap; }

.edit-form {
  display: flex;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px dashed var(--mid-color);
  border-radius: var(--corner-radius);
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}
.edit-form label { min-width: 56px; font-size: 14px; color: var(--secondary-color); }
.edit-form input[type="text"] {
  flex: 1;
  min-width: 140px;
  padding: 8px 12px;
  border-radius: var(--corner-radius);
  color: var(--primary-color);
  font-size: 14px;
  background: var(--input-background);
}
.edit-actions { display: flex; gap: 10px; margin-left: auto; }
.mini-btn {
  padding: 6px 14px;
  border-radius: var(--corner-radius);
  color: var(--white-color);
  font-size: 14px;
  background: var(--highlight-color);
  cursor: pointer;
}
.mini-btn.ghost { color: var(--primary-color); background: var(--mid-color); }
.mini-btn.danger { background: var(--danger-color); }
.add-buttons { display: flex; gap: 12px; }
.plain-btn {
  padding: 7px 16px;
  border: 1px dashed var(--secondary-color);
  border-radius: var(--corner-radius);
  color: var(--secondary-color);
  font-size: 14px;
  background: transparent;
  cursor: pointer;
  transition: color .1s ease, background .1s ease;
}
.plain-btn:hover { color: var(--primary-color); background: var(--mid-color); }

@media (max-width: 1200px) {
  .settings-grid { margin: -16px -24px; }
  .setting-field { max-width: calc(33.33333% - 48px); margin: 16px 24px; flex: 0 0 calc(33.33333% - 48px); }
}
@media (max-width: 834px) {
  .setting-inner { max-width: 100%; padding: 32px 48px; }
  .settings-grid { margin: -12px -24px; }
  .setting-field { max-width: calc(50% - 48px); margin: 12px 24px; flex: 0 0 calc(50% - 48px); }
  .sync-block { display: block; }
  .actions-row { margin-top: 32px; }
}
@media (max-width: 600px) {
  .setting-inner { padding: 24px 20px; }
  .settings-grid { margin: -8px -12px; }
  .setting-field { max-width: calc(50% - 24px); margin: 8px 12px; flex: 0 0 calc(50% - 24px); }
  .setting-label, .setting-select { font-size: 13px; }
  .setting-select { padding: 6px 18px; }
  .sync-cloud { font-size: 15px; }
  .sync-cloud svg { width: 20px; height: 20px; margin-right: 6px; }
  .sync-input, .sync-btn { font-size: 13px; padding: 6px 14px; margin: 8px; }
  .reset-link { font-size: 13px; margin: 0; }
  .edit-item { max-width: calc(33.33333% - 12px); }
  .edit-item input.e-name { font-size: 11px; }
  .edit-item input.e-url { font-size: 10px; }
}

/* ================================================================
   About page
   ================================================================ */
.about-page { color: var(--secondary-color); background: var(--block-background); }
.about-inner { max-width: 1130px; padding: 56px 40px; margin: 0 auto; }
.about-inner h1 { margin: 0 0 20px; color: var(--primary-color); font-size: 30px; font-weight: 500; line-height: 1.25; }
.about-inner p { margin-bottom: 1em; font-size: 15px; line-height: 22px; }
.about-inner p:last-child { margin-bottom: 0; }
.about-inner a { color: var(--primary-color); }
.about-back { display: inline-block; margin-top: 16px; }
@media (max-width: 834px) { .about-inner { max-width: 100%; padding: 40px 48px; } }
@media (max-width: 600px) {
  .about-inner { padding: 28px 20px; }
  .about-inner h1 { font-size: 24px; }
  .about-inner p { font-size: 14px; line-height: 20px; }
}
