:root {
  color-scheme: dark;
  --bg: #0b0f19;
  --surface: #131a29;
  --surface-2: #182135;
  --panel: #1d273d;
  --text: #f3f6ff;
  --muted: #98a5c0;
  --line: rgba(148, 163, 184, 0.16);
  --accent: #7c6eff;
  --accent-hover: #6c5ce7;
  --accent-soft: rgba(124, 110, 255, 0.15);
  --gold: #f5b942;
  --red: #ff6b81;
  --green: #34d399;
  --shadow: 0 12px 32px rgba(3, 7, 18, 0.45);
  --radius: 16px;
}

html.light {
  color-scheme: light;
  --bg: #f3f5fb;
  --surface: #ffffff;
  --surface-2: #f8faff;
  --panel: #edf1fa;
  --text: #111827;
  --muted: #5b6780;
  --line: rgba(15, 23, 42, 0.10);
  --accent: #5b4ef0;
  --accent-hover: #493cd8;
  --accent-soft: rgba(91, 78, 240, 0.10);
  --gold: #d98a0c;
  --red: #c92a49;
  --green: #0a8765;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 0%, var(--accent-soft), transparent 42%),
    radial-gradient(circle at 88% 100%, rgba(52, 211, 153, 0.05), transparent 40%);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }

button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  padding: 9px 15px;
  min-height: 44px;
}

button:hover { border-color: var(--accent); background: var(--surface-2); }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
button:disabled { opacity: .5; cursor: wait; }

input, textarea, select {
  width: 100%;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  min-height: 46px;
  transition: border-color .15s, box-shadow .15s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea { resize: vertical; min-height: 120px; }
label { display: grid; gap: 7px; margin-bottom: 15px; font-size: .95rem; }
input[type=checkbox] { width: 20px; min-height: 20px; accent-color: var(--accent); }
a { color: inherit; text-decoration: none; }

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: .88rem; }

.primary {
  background: linear-gradient(135deg, var(--accent), #5b4ef0);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(124, 110, 255, 0.28);
}

.primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  border-color: transparent;
}

.danger { color: var(--red); }

#shell {
  display: grid;
  grid-template-columns: 265px minmax(0, 1fr);
  min-height: 100vh;
}

aside {
  background: var(--surface);
  border-left: 1px solid var(--line);
  padding: 28px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.brand {
  font-size: 1.65rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -.01em;
}

aside nav {
  display: grid;
  gap: 5px;
  margin-top: 22px;
  overflow: auto;
}

aside nav button {
  text-align: right;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 500;
}

aside nav button:hover {
  background: var(--panel);
  border-color: transparent;
}

aside nav button.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(124, 110, 255, 0.25);
  font-weight: 700;
}

.sidebottom {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.sidebottom small {
  color: var(--muted);
  font-size: .8rem;
  text-align: center;
}

main {
  max-width: 1100px;
  width: 100%;
  padding: 38px 46px 100px;
  margin: auto;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

h1 {
  font-size: 2rem;
  line-height: 1.35;
  margin: 6px 0 22px;
  font-weight: 700;
}

h2 { font-size: 1.18rem; margin: 0; }

.pill { border-radius: 24px; font-size: .85rem; }
.pill.active { background: var(--accent); color: #fff; }

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--green));
  opacity: .75;
}

.stat strong {
  display: block;
  font-size: 1.75rem;
  line-height: 1.25;
  margin-bottom: 2px;
}

.stat span { font-size: .86rem; color: var(--muted); }

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.toolbar input {
  flex: 1;
  min-width: 0;
  background: var(--surface);
}

.experttools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 14px;
}

.experttools > * {
  flex: 1;
  min-width: 120px;
  min-height: 40px;
  padding: 7px 12px;
}

.sectionlabel {
  color: var(--muted);
  margin: 24px 0 12px;
  font-size: .92rem;
  font-weight: 600;
}

.task {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-right: 3px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}

.task:hover {
  border-color: rgba(124, 110, 255, 0.35);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
}

.task.p1card { border-right-color: var(--red); }
.task.p2card { border-right-color: var(--gold); }
.task.p3card { border-right-color: var(--accent); }

.check {
  padding: 0;
  min-height: 26px;
  width: 26px;
  min-width: 26px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  margin-top: 3px;
  background: transparent;
  line-height: 22px;
  font-size: .85rem;
}

.check.p1 { border-color: var(--red); }
.check.p2 { border-color: var(--gold); }
.check.p3 { border-color: var(--accent); }
.task.done { opacity: .62; }
.task.done .tasktitle { text-decoration: line-through; }
.task.done .check { background: var(--green); border-color: var(--green); color: #0b0f19; font-weight: bold; }

.taskinfo { flex: 1; min-width: 0; }

.tasktitle {
  border: 0;
  background: none;
  text-align: right;
  padding: 0;
  min-height: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
  font-size: 1rem;
}

.tasktitle:hover { background: none; color: var(--accent); }

.taskmeta {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--muted);
  font-size: .8rem;
  align-items: center;
}

.meta-pill, .projectbadge, .tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
}

.overdue {
  color: var(--red);
  border-color: rgba(255, 107, 129, 0.35);
  background: rgba(255, 107, 129, 0.10);
}

.taskmenu {
  background: none;
  border: 0;
  min-width: 36px;
  min-height: 36px;
  padding: 3px 8px;
  color: var(--muted);
}

.subtasks {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 6px;
}

.subtasks label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: .88rem;
  color: var(--muted);
}

.notesgrid, .projectsgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.note, .projectcard {
  display: block;
  text-align: right;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 20px;
  border-radius: 18px;
  width: 100%;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s;
}

.note:hover, .projectcard:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.projectcard {
  border-top: 4px solid var(--pcolor, var(--accent));
}

.projecthead, .projectbannerhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.projecttitle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.08rem;
}

.projectpct {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: .78rem;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.projectdesc {
  margin: 4px 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.projectbanner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--pcolor, var(--accent));
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.note h2 { margin-bottom: 8px; }
.note p { white-space: pre-wrap; color: var(--muted); font-size: .92rem; max-height: 160px; overflow: hidden; overflow-wrap: anywhere; }

.empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--muted);
  border: 1px dashed var(--line);
  background: var(--surface);
  border-radius: 20px;
}

.empty strong { display: block; font-size: 1.2rem; color: var(--text); margin-bottom: 8px; }

.notice {
  background: var(--panel);
  border-right: 3px solid var(--gold);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: .88rem;
}

.fab { display: none; }
.bottomnav { display: none; }

dialog {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 22px;
  width: min(620px, calc(100% - 24px));
  padding: 24px;
  max-height: 90dvh;
  overflow: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

dialog::backdrop {
  background: rgba(5, 8, 18, 0.72);
  backdrop-filter: blur(8px);
}

.dialoghead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.dialoghead button { background: none; border: 0; min-width: 40px; }

.dialogactions {
  display: flex;
  gap: 10px;
  position: sticky;
  bottom: -24px;
  background: var(--surface);
  padding: 16px 0 6px;
  border-top: 1px solid var(--line);
  margin-top: 10px;
}

.fieldrow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settinglist { display: grid; gap: 10px; }
.settinglist button { text-align: right; }
.importlabel { background: var(--panel); border-radius: 12px; padding: 12px; border: 1px solid var(--line); cursor: pointer; }

#toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  max-width: 90%;
  padding: 12px 22px;
  border-radius: 14px;
  z-index: 50;
  display: none;
  font-size: .92rem;
  font-weight: 600;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.loginbox {
  max-width: 400px;
  width: 100%;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 32px 26px;
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.loginbox label { text-align: right; }
.loginbox .primary { width: 100%; }
#loginerror { color: var(--red); }

.calendarhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.calendar .day { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-height: 92px; padding: 8px; }
.day.selected { border-color: var(--accent); background: var(--accent-soft); }
.day .dot { display: block; color: var(--accent); font-size: .76rem; font-weight: 600; }
.weekday { font-size: .78rem; color: var(--muted); text-align: center; font-weight: 600; }

.progressbar { height: 8px; background: var(--panel); border-radius: 999px; overflow: hidden; margin: 12px 0; }
.progressbar div { height: 100%; background: var(--green); border-radius: 999px; transition: width .25s ease; }

.menuitems { display: grid; gap: 10px; }
.menuitems button { text-align: right; }
.filterchips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filterchips button { font-size: .85rem; min-height: 36px; padding: 6px 12px; border-radius: 999px; }

.projectcolor { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

@media (max-width: 760px) {
  #shell { display: block; }
  aside { display: none; }
  main { padding: 22px 16px 125px; }
  h1 { font-size: 1.65rem; margin-bottom: 18px; }
  .summary { gap: 8px; margin-bottom: 18px; }
  .stat { padding: 12px; border-radius: 14px; }
  .stat strong { font-size: 1.35rem; }
  .stat span { font-size: .76rem; }
  .toolbar button { white-space: nowrap; }
  .notesgrid, .projectsgrid { grid-template-columns: 1fr; }
  .bottomnav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 7px 10px calc(8px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
    z-index: 5;
  }
  .bottomnav button { background: none; border: 0; display: grid; justify-items: center; padding: 3px 6px; color: var(--muted); font-size: 1.2rem; }
  .bottomnav span { font-size: .76rem; }
  .bottomnav .active { color: var(--accent); font-weight: 700; }
  .fab {
    display: block;
    position: fixed;
    left: 18px;
    bottom: calc(88px + env(safe-area-inset-bottom));
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent), #5b4ef0);
    color: white;
    border: 0;
    border-radius: 18px;
    font-size: 1.7rem;
    box-shadow: 0 10px 26px rgba(124, 110, 255, 0.45);
  }
  .calendar { gap: 3px; }
  .calendar .day { min-height: 65px; padding: 4px; font-size: .85rem; }
  .day .dot { font-size: .7rem; }
  .fieldrow { grid-template-columns: 1fr; gap: 0; }
  .task { padding: 14px 12px; }
  .dialogactions { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: no-preference) {
  button { transition: background .15s, border-color .15s, transform .12s; }
  .task { animation: appear .18s ease-out; }
  @keyframes appear {
    from { opacity: .4; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

.breadcrumbs, .projectactions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.breadcrumbs button { font-size: .85rem; background: none; border: 0; padding: 5px 8px; color: var(--muted); }
.breadcrumbs button:last-child { color: var(--text); font-weight: 700; }
.projectactions { margin-bottom: 0; margin-top: 12px; }
.projectactions button { font-size: .86rem; min-height: 40px; padding: 7px 14px; }

#reportbody { white-space: normal; overflow-wrap: anywhere; }

.smartresult {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: 14px;
  line-height: 1.9;
}
.smartresult:empty { display: none; }

.googlebutton { background: #fff; color: #25304a; width: 100%; font-weight: bold; }
.googlebutton:disabled { opacity: .65; }

.brand, .mobilebrand { display: inline-flex; align-items: center; gap: 10px; }
.brand img, .mobilebrand img { display: block; flex: none; }
.mobilebrand { display: none; color: var(--accent); font-size: .95rem; margin-bottom: 4px; }
@media (max-width: 760px) { .mobilebrand { display: inline-flex; } }

.finance-report { direction: rtl; text-align: right; }
.finance-report .finance-total, .finance-report .finance-entry { direction: rtl; text-align: right; }
.finance-report .finance-entry { width: 100%; margin: 0 0 8px; }
.finance-report .finance-entry p { margin-bottom: 0; }
.money { display: inline-block; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
input[name=amount] { direction: ltr; text-align: left; unicode-bidi: plaintext; }


/* Enhanced Settings Panel & Sync Status */
.syncstatus {
  display: block;
  text-align: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
}

dialog.settingsdialog {
  width: min(560px, calc(100% - 24px));
  padding: 0;
  overflow: hidden;
}

dialog.settingsdialog[open] {
  display: flex;
  flex-direction: column;
}

.settingsdialog .dialoghead {
  flex: none;
  margin: 0;
  padding: 16px 20px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.settingsbody {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px 24px;
}

.profilecard {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  background: linear-gradient(135deg, var(--panel), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px 16px;
}

.avatar {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  font-weight: 700;
  flex: none;
  box-shadow: 0 6px 16px var(--accent-soft);
}

.profileinfo {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profileinfo strong {
  font-size: 1.05rem;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.profilestats {
  font-size: .8rem;
  color: var(--muted);
  margin-top: 3px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.settingsection {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.settingsection h3 {
  margin: 0 0 2px;
  font-size: .82rem;
  color: var(--muted);
  font-weight: 600;
  padding-right: 4px;
}

.themepicker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 5px;
}

.themepicker button {
  border: 1px solid transparent;
  background: transparent;
  min-height: 40px;
  padding: 8px 6px;
  border-radius: 10px;
  font-size: .86rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.themepicker button:hover {
  color: var(--text);
  background: var(--panel);
  border-color: transparent;
}

.themepicker button.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px var(--accent-soft);
}

.accentpicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
}

.accentswatches {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.accentdot {
  width: 30px;
  height: 30px;
  min-height: 30px;
  min-width: 30px;
  padding: 0;
  flex: none;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--swatch, #7c6eff);
  transition: transform .15s, box-shadow .15s;
}

.accentdot:hover {
  background: var(--swatch, #7c6eff);
  transform: scale(1.1);
}

.accentdot.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--swatch, #7c6eff);
  transform: scale(1.1);
}

.settingrow, .settinglink {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  text-align: right;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  min-height: 56px;
  color: var(--text);
}

.settingrow:hover, .settinglink:hover {
  border-color: var(--accent);
  background: var(--panel);
}

.settingicon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  flex: none;
}

.settingtext {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settingtext strong {
  font-size: .94rem;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: break-word;
  line-height: 1.35;
}

.settingtext small {
  font-size: .78rem;
  color: var(--muted);
  white-space: normal;
  overflow-wrap: break-word;
  line-height: 1.35;
}

.statuspill {
  flex: none;
  font-size: .74rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
  font-weight: 600;
}

.statuspill:empty {
  display: none;
}

.statuspill.ok {
  color: var(--green);
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.12);
}

.statuspill.warn {
  color: var(--red);
  border-color: rgba(255, 107, 129, 0.35);
  background: rgba(255, 107, 129, 0.12);
}

.statuspill.accent {
  color: var(--accent);
  border-color: rgba(124, 110, 255, 0.35);
  background: var(--accent-soft);
}

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

.settingtile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 10px;
  min-height: 92px;
  min-width: 0;
  width: 100%;
  margin: 0;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.settingtile:hover {
  border-color: var(--accent);
  background: var(--panel);
}

.settingtile .settingtext {
  align-items: center;
}

.sr-only {
  position: absolute;
  inset: 0;
  width: 1px;
  height: 1px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.dangerrow {
  border-color: rgba(255, 107, 129, 0.25);
}

.dangerrow:hover {
  border-color: var(--red);
  background: rgba(255, 107, 129, 0.08);
}

.dangerrow .settingtext strong {
  color: var(--red);
}

.settingsfooter {
  display: block;
  text-align: center;
  padding-top: 6px;
}

@media (max-width: 760px) {
  dialog.settingsdialog {
    width: 100%;
    max-width: 100%;
    max-height: 92dvh;
    margin: auto 0 0 0;
    border-radius: 22px 22px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }
  .settingsdialog .dialoghead { padding: 14px 16px 12px; }
  .settingsbody { padding: 14px 14px calc(24px + env(safe-area-inset-bottom)); gap: 14px; }
  .profilecard { padding: 13px 14px; gap: 12px; }
  .avatar { width: 44px; height: 44px; font-size: 1.2rem; border-radius: 13px; }
  .themepicker button { font-size: .82rem; padding: 7px 4px; min-height: 38px; }
  .settingrow, .settinglink { padding: 10px 11px; gap: 10px; min-height: 54px; }
  .settingicon { width: 34px; height: 34px; font-size: 1rem; border-radius: 10px; }
  .settingtext strong { font-size: .9rem; }
  .settingtext small { font-size: .75rem; }
  .statuspill { font-size: .7rem; padding: 2px 8px; }
}

.in-app .web-only { display: none !important; }
