:root {
  --bg-1: #0b1020;
  --bg-2: #111a34;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-2: rgba(255, 255, 255, 0.13);
  --surface-solid: #141a2b;
  --text: #f3f5fb;
  --muted: #a8b2cf;
  --border: rgba(255, 255, 255, 0.14);
  --accent: #6d5df6;
  --accent-2: #22d3ee;
  --danger: #fb7185;
  --ok: #34d399;
  --warn: #fbbf24;
  --radius: 16px;
  --blur: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --font: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  --density: 1;
  --bookmark-size: 56px;
  --topbar-h: 68px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-1);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.font-serif {
  --font: "Songti SC", "Noto Serif SC", Georgia, serif;
}

body.font-mono {
  --font: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}

body.font-yahei {
  --font: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}

body.font-segoe {
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.font-songti {
  --font: "Songti SC", "SimSun", "Noto Serif SC", serif;
}

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

select {
  color-scheme: inherit;
}

select option {
  color: var(--text);
  background: var(--surface-solid);
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

/* ---------- Templates ---------- */

body.tpl-aurora {
  --bg-1: #0b1020;
  --bg-2: #17244a;
  --accent: #7c6cff;
  --accent-2: #35e0ff;
  --surface: rgba(255, 255, 255, 0.085);
  --surface-2: rgba(255, 255, 255, 0.14);
  --surface-solid: #141b31;
  --text: #f4f6ff;
  --muted: #aab4d4;
  --border: rgba(255, 255, 255, 0.15);
}

body.tpl-midnight {
  --bg-1: #07090f;
  --bg-2: #121826;
  --accent: #38bdf8;
  --accent-2: #a78bfa;
  --surface: rgba(20, 26, 40, 0.72);
  --surface-2: rgba(37, 45, 64, 0.82);
  --surface-solid: #0d1220;
  --text: #e8edf7;
  --muted: #8d99b5;
  --border: rgba(255, 255, 255, 0.12);
}

body.tpl-glass {
  --bg-1: #eef4fb;
  --bg-2: #dbe8f3;
  --accent: #2563eb;
  --accent-2: #0ea5e9;
  --surface: rgba(255, 255, 255, 0.62);
  --surface-2: rgba(255, 255, 255, 0.8);
  --surface-solid: #ffffff;
  --text: #17233a;
  --muted: #5c6b84;
  --border: rgba(23, 35, 58, 0.13);
  --shadow: 0 16px 40px rgba(30, 55, 90, 0.14);
  color-scheme: light;
}

body.tpl-paper {
  --bg-1: #f7f1e5;
  --bg-2: #efe3cf;
  --accent: #c05a3a;
  --accent-2: #2f7d6b;
  --surface: rgba(255, 252, 246, 0.74);
  --surface-2: rgba(255, 255, 255, 0.86);
  --surface-solid: #fffaf1;
  --text: #2c2620;
  --muted: #776b5d;
  --border: rgba(44, 38, 32, 0.14);
  --shadow: 0 14px 36px rgba(80, 55, 25, 0.13);
  color-scheme: light;
}

body.tpl-terminal {
  --bg-1: #07120a;
  --bg-2: #0b1f12;
  --accent: #46e58a;
  --accent-2: #bfe85a;
  --surface: rgba(8, 26, 15, 0.72);
  --surface-2: rgba(19, 45, 27, 0.82);
  --surface-solid: #0a1910;
  --text: #d7f5df;
  --muted: #7ba787;
  --border: rgba(100, 220, 145, 0.22);
  --radius: 10px;
}

body.tpl-sunset {
  --bg-1: #261023;
  --bg-2: #4b2034;
  --accent: #ff8a5c;
  --accent-2: #ffd166;
  --surface: rgba(60, 25, 42, 0.58);
  --surface-2: rgba(84, 38, 54, 0.68);
  --surface-solid: #351527;
  --text: #fff2ec;
  --muted: #d3a7a0;
  --border: rgba(255, 220, 200, 0.18);
}

body.tpl-ocean {
  --bg-1: #06202d;
  --bg-2: #0b3a4a;
  --accent: #2dd4bf;
  --accent-2: #38bdf8;
  --surface: rgba(8, 40, 52, 0.64);
  --surface-2: rgba(17, 58, 72, 0.76);
  --surface-solid: #0b2834;
  --text: #e7f8f5;
  --muted: #93b9c4;
  --border: rgba(90, 210, 210, 0.2);
}

/* ---------- Background scene ---------- */

.bg-scene {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2));
  transition: background 0.5s ease;
}

.bg-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.06), transparent 36%),
    radial-gradient(circle at 82% 70%, rgba(255, 255, 255, 0.05), transparent 34%);
  pointer-events: none;
}

.bg-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--text) 7%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--text) 7%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.65;
  pointer-events: none;
}

.bg-image {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.bg-image.show {
  opacity: 0.9;
}

.bg-glow {
  position: absolute;
  width: 46vw;
  height: 46vw;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.24;
  animation: glowDrift 16s ease-in-out infinite alternate;
  pointer-events: none;
}

.glow-1 {
  left: -12vw;
  top: -14vw;
  background: var(--accent);
}

.glow-2 {
  right: -14vw;
  bottom: -16vw;
  background: var(--accent-2);
  animation-delay: -8s;
}

@keyframes glowDrift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(4vw, 3vw, 0) scale(1.14);
  }
}

/* ---------- App shell ---------- */

.app-shell {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 0 34px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  height: var(--topbar-h);
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  background: var(--surface);
  backdrop-filter: blur(var(--blur)) saturate(1.35);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.35);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
}

.brand-name {
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.topbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-width: 0;
}

.top-clock {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.top-time {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.top-date {
  color: var(--muted);
  font-size: 13px;
}

.mini-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(520px, 44vw);
  padding: 0 12px;
  height: 38px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.mini-search:focus-within {
  border-color: var(--accent-2);
}

.mini-search svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex: none;
}

.mini-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.mini-search input::placeholder {
  color: var(--muted);
}

.autofill-honeypot {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  border: 0;
  padding: 0;
  pointer-events: none;
}

.engine-switch {
  position: relative;
  flex: none;
}

.engine-current {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 28px;
  padding: 0 4px 0 3px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
}

.engine-current:hover {
  background: var(--surface);
}

.engine-current svg {
  width: 13px;
  height: 13px;
  color: var(--muted);
}

.engine-badge {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  flex: none;
}

.engine-menu {
  position: absolute;
  top: 34px;
  left: 0;
  z-index: 60;
  width: 150px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-solid);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.32);
  animation: modalIn 0.18s ease both;
}

.engine-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 36px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.engine-menu-item:hover,
.engine-menu-item.active {
  background: var(--surface-2);
}

.engine-menu-item .engine-badge {
  width: 20px;
  height: 20px;
  font-size: 11px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.icon-btn,
.mini-icon-btn {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
}

.icon-btn svg,
.mini-icon-btn svg {
  width: 18px;
  height: 18px;
}

.mini-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: transparent;
  border-color: transparent;
}

.icon-btn:hover,
.mini-icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--border);
  transform: translateY(-1px);
}

.icon-btn:active,
.mini-icon-btn:active {
  transform: scale(0.94);
}

.sync-btn.spinning svg {
  animation: spin 0.9s linear infinite;
}

.sync-btn.synced {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 45%, transparent);
}

.user-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  transition: transform 0.18s ease, background 0.18s ease;
}

.user-btn:hover {
  background: var(--surface-2);
  transform: translateY(-1px);
}

.user-btn svg {
  width: 17px;
  height: 17px;
}

.user-btn span {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Content ---------- */

.content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 18px;
}

.widgets-zone {
  display: grid;
  --widget-row-h: 130px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: minmax(var(--widget-row-h, 130px), auto);
  gap: 16px;
  align-items: stretch;
}

.widgets-zone [data-widget="clock"] {
  grid-column: span 6;
  grid-row: span 2;
}

.widgets-zone [data-widget="weather"],
.widgets-zone [data-widget="todo"],
.widgets-zone [data-widget="notes"],
.widgets-zone [data-widget="pomodoro"],
.widgets-zone [data-widget="calculator"] {
  grid-column: span 3;
  grid-row: span 1;
}

.widgets-zone [data-widget="system"] {
  grid-column: span 4;
  grid-row: span 1;
}

.widget {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(var(--blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.3);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  animation: fadeUp 0.45s ease both;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.widget:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.18);
}

.widget.dragging {
  opacity: 0.4;
  transform: scale(0.98);
}

.widget.drop-target {
  outline: 2px dashed var(--accent-2);
  outline-offset: -2px;
}

.widget.resizing {
  user-select: none;
}

.widget-resize {
  position: absolute;
  right: 3px;
  bottom: 3px;
  z-index: 5;
  width: 15px;
  height: 15px;
  cursor: nwse-resize;
  opacity: 0;
  touch-action: none;
  transition: opacity 0.16s ease;
}

.widget-resize::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  border-radius: 1px;
}

.widget:hover .widget-resize,
.widget.resizing .widget-resize {
  opacity: 1;
}

.widget-head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px 0 10px;
  border-bottom: 1px solid var(--border);
  user-select: none;
}

.widget-head[draggable="true"] {
  cursor: grab;
}

.widget-head[draggable="true"]:active {
  cursor: grabbing;
}

.drag-handle {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--muted);
  cursor: grab;
  border-radius: 7px;
  touch-action: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle:hover {
  color: var(--text);
  background: var(--surface-2);
}

.drag-handle svg {
  width: 18px;
  height: 18px;
}

.widget-title {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.widget-actions {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.widget-body {
  padding: 14px;
}

[data-widget="clock"] .widget-body,
[data-widget="pomodoro"] .widget-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Layout presets */

.layout-focus .widgets-zone {
  max-width: 1080px;
  margin: 0 auto;
}

.layout-dashboard .widgets-zone {
  max-width: none;
}

.layout-compact .widgets-zone {
  max-width: none;
}

.layout-compact .widgets-zone [data-widget] {
  grid-column: span 2;
  grid-row: span 1;
}

.layout-compact .widgets-zone [data-widget="clock"] {
  grid-column: span 4;
}

.layout-compact .widget-body {
  padding: 10px;
}

/* ---------- Clock ---------- */

.clock-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 168px;
  text-align: center;
  padding: 18px 14px;
}

.clock-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1;
}

.clock-main #clockTime {
  font-size: clamp(42px, 5.5vw, 76px);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.clock-seconds {
  font-size: 18px;
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.clock-date {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.clock-greeting {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 600;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Weather ---------- */

.weather-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.weather-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.weather-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: none;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.weather-icon svg {
  width: 34px;
  height: 34px;
  stroke: var(--accent-2);
}

.weather-temp {
  font-size: 42px;
  font-weight: 750;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.weather-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.weather-location {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.weather-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.meta-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 6px;
  border-radius: 10px;
  background: var(--surface-2);
  text-align: center;
}

.meta-cell span {
  color: var(--muted);
  font-size: 11px;
}

.meta-cell b {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* ---------- Search ---------- */

.search-body {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-body select {
  width: 130px;
  height: 42px;
  padding: 0 10px;
  flex: none;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: border-color 0.2s ease;
}

.search-field:focus-within {
  border-color: var(--accent-2);
}

.search-field svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex: none;
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-field input::placeholder {
  color: var(--muted);
}

/* ---------- Todo / Notes ---------- */

.todo-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.todo-form input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.todo-form input:focus {
  border-color: var(--accent-2);
  outline: 0;
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 240px;
  overflow: auto;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  animation: fadeUp 0.3s ease both;
  transition: background 0.18s ease, opacity 0.18s ease;
}

.todo-item:hover {
  background: var(--surface-2);
  filter: brightness(1.04);
}

.todo-item.done .todo-text {
  text-decoration: line-through;
  opacity: 0.55;
}

.todo-check {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: transparent;
  transition: all 0.18s ease;
}

.todo-check svg {
  width: 13px;
  height: 13px;
}

.todo-item.done .todo-check {
  background: var(--ok);
  border-color: var(--ok);
  color: #062b1d;
}

.todo-text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.todo-delete {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 7px;
}

.todo-delete:hover {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 16%, transparent);
}

.todo-delete svg {
  width: 15px;
  height: 15px;
}

#notesInput {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  line-height: 1.55;
}

#notesInput:focus {
  border-color: var(--accent-2);
  outline: 0;
}

.system-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
}

.system-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 8px 9px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.system-row-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 7px;
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 14%, transparent);
}

.system-row-label {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-row b {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  text-align: right;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* ---------- Pomodoro ---------- */

.pomodoro-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 22px 14px;
  min-height: 190px;
}

.pomodoro-ring {
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--progress, 0%), var(--surface-2) 0);
  box-shadow: 0 0 34px color-mix(in srgb, var(--accent) 26%, transparent);
  transition: background 0.3s ease;
}

.pomodoro-ring::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--surface-solid);
}

.pomodoro-time,
.pomodoro-mode {
  position: relative;
  z-index: 1;
}

.pomodoro-time {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.pomodoro-mode {
  position: absolute;
  top: calc(50% + 18px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--muted);
}

.pomodoro-controls {
  display: flex;
  gap: 8px;
  width: 76%;
  max-width: 240px;
  margin: 0 auto;
}

.pomodoro-controls button {
  flex: 1;
}

/* ---------- Calculator ---------- */

.calc-screen {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 14px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  white-space: nowrap;
}

.calc-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.calc-keys button {
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.12s ease, background 0.15s ease;
}

.calc-keys button:hover {
  background: var(--surface-2);
  filter: brightness(1.08);
}

.calc-keys button:active {
  transform: scale(0.94);
}

.calc-keys .op-key {
  color: var(--accent-2);
}

.calc-keys .eq-key {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
}

/* ---------- Bookmarks ---------- */

.bookmarks-panel {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  background: var(--surface);
  backdrop-filter: blur(var(--blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.3);
  box-shadow: var(--shadow);
  padding: 16px 18px 20px;
  animation: fadeUp 0.5s ease 0.08s both;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
}

.panel-title svg {
  width: 19px;
  height: 19px;
  color: var(--accent);
}

.panel-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.group-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.group-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.group-tab:hover {
  color: var(--text);
  background: var(--surface-2);
}

.group-tab.active {
  color: var(--text);
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.group-tab svg {
  width: 15px;
  height: 15px;
}

.group-tab .letter {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-2);
}

.group-tab .tab-edit {
  display: none;
  width: 18px;
  height: 18px;
  margin-left: 3px;
  border-radius: 50%;
}

.group-tab:hover .tab-edit {
  display: grid;
  place-items: center;
}

.bookmark-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 14px 12px;
  min-height: 84px;
}

.bookmark-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 0;
  padding: 12px 6px 10px;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  animation: fadeUp 0.32s ease both;
}

.bookmark-card:hover {
  background: var(--surface-2);
  border-color: var(--border);
  transform: translateY(-3px);
}

.bookmark-card.dragging {
  opacity: 0.35;
  transform: scale(0.96);
}

.bookmark-card.drop-target {
  border-color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 10%, transparent);
}

.bookmark-icon {
  display: grid;
  place-items: center;
  width: var(--bookmark-size);
  height: var(--bookmark-size);
  flex: none;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
  overflow: hidden;
  transition: border-radius 0.22s ease;
}

.bookmark-card:hover .bookmark-icon {
  border-radius: 14px;
}

.bookmark-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bookmark-icon .letter {
  font-size: calc(var(--bookmark-size) * 0.42);
  font-weight: 750;
  color: var(--text);
}

.bookmark-title {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 600;
}

.bookmark-menu {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: transparent;
  opacity: 0;
  transition: opacity 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.bookmark-card:hover .bookmark-menu {
  opacity: 1;
  color: var(--muted);
}

.bookmark-menu:hover {
  color: var(--text);
  background: var(--surface-2);
}

.bookmark-menu svg {
  width: 15px;
  height: 15px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 220px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  width: 52px;
  height: 52px;
  opacity: 0.6;
}

.vault-lock-card {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 220px;
  color: var(--muted);
}

.vault-lock-card button {
  flex: none;
}

/* ---------- Buttons ---------- */

.primary-btn,
.ghost-btn,
.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 650;
  transition: transform 0.16s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.primary-btn {
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 36%, transparent);
}

.ghost-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.danger-btn {
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  color: var(--danger);
}

.primary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:active,
.ghost-btn:active,
.danger-btn:active {
  transform: scale(0.97);
}

.primary-btn svg,
.ghost-btn svg,
.danger-btn svg {
  width: 16px;
  height: 16px;
}

.compact {
  height: 34px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 13px;
}

.block {
  width: 100%;
}

.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Modals ---------- */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 8, 18, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease both;
}

.modal {
  width: min(480px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface-solid);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  padding: 20px;
  animation: modalIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.modal-head h2 {
  margin: 0;
  font-size: 19px;
}

.close-btn {
  flex: none;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field > span {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text);
  transition: border-color 0.18s ease;
}

.field textarea {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent-2);
  outline: 0;
}

.field input[type="range"] {
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--accent);
}

.form-hint {
  margin: -6px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.form-error {
  min-height: 18px;
  margin: -6px 0 0;
  font-size: 13px;
  color: var(--danger);
}

.password-wrap,
.icon-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.password-wrap input,
.icon-picker-row input {
  flex: 1;
  min-width: 0;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--surface-2);
}

.auth-tab {
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 650;
  transition: all 0.18s ease;
}

.auth-tab.active {
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.bookmark-icon-preview {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
  font-weight: 750;
}

.bookmark-icon-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bookmark-icon-preview .letter {
  font-size: 16px;
  font-weight: 750;
  color: var(--text);
}

.icon-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 7px;
  margin-top: 9px;
}

.icon-option {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.icon-option:hover {
  transform: translateY(-1px);
  border-color: var(--accent-2);
}

.icon-option.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-2));
}

.icon-option svg {
  width: 18px;
  height: 18px;
}

.icon-option .letter {
  font-size: 12px;
  font-weight: 750;
  color: var(--text);
}

/* ---------- Settings drawer ---------- */

.settings-layer {
  display: block;
  padding: 0;
}

.settings-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(640px, 100%);
  display: grid;
  grid-template-rows: auto auto 1fr;
  background: var(--surface-solid);
  border-left: 1px solid var(--border);
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.35);
  animation: drawerIn 0.32s cubic-bezier(0.22, 0.9, 0.3, 1) both;
  overflow: hidden;
}

.settings-drawer .modal-head {
  margin: 0;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.settings-nav {
  display: flex;
  gap: 6px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.settings-nav-item {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.settings-nav-item.active {
  background: var(--surface-2);
  color: var(--text);
}

.settings-content {
  padding: 20px 22px 40px;
  overflow-y: auto;
}

.settings-section {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.22s ease both;
}

.settings-section.active {
  display: flex;
}

.settings-section h3 {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  text-transform: none;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
}

.template-item {
  position: relative;
  height: 74px;
  border-radius: 13px;
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.template-item:hover {
  transform: translateY(-2px);
}

.template-item.active {
  border-color: var(--accent-2);
}

.template-item .tpl-preview {
  position: absolute;
  inset: 0;
}

.template-item .tpl-label {
  position: absolute;
  left: 8px;
  bottom: 7px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.36);
  color: #fff;
  font-size: 11px;
  font-weight: 650;
  backdrop-filter: blur(6px);
}

.color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.color-swatch {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.color-swatch:hover {
  transform: scale(1.08);
}

.color-swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
}

.layout-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.layout-option {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  padding: 10px;
  border-radius: 13px;
  border: 2px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.layout-option:hover {
  transform: translateY(-2px);
}

.layout-option.active {
  border-color: var(--accent-2);
}

.layout-option .layout-thumb {
  display: block;
  width: 100%;
  height: 62px;
  border-radius: 9px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
}

.layout-option .layout-thumb svg {
  display: block;
  width: 100%;
  height: 100%;
  color: var(--text);
}

.layout-option span {
  font-size: 12px;
  font-weight: 650;
}

.widget-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.range-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.group-manage-list,
.vault-manage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.manage-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.manage-item .manage-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
}

.manage-item .manage-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.manage-item .manage-icon .letter {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-2);
}

.manage-item .manage-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
}

.manage-item .manage-actions {
  display: flex;
  gap: 4px;
}

.account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.account-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.account-panel h3 {
  margin: 0;
}

.account-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 240px;
  padding: 24px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
}

.account-empty svg {
  width: 52px;
  height: 52px;
  color: var(--muted);
}

.account-empty p {
  margin: 0;
  color: var(--muted);
}

.account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 20px;
  font-weight: 750;
}

.account-card div:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.account-card span {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sync-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  margin-top: 4px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.sync-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sync-row svg {
  width: 22px;
  height: 22px;
  color: var(--accent-2);
}

.sync-row div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sync-row span {
  color: var(--muted);
  font-size: 12px;
}

.security-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--ok) 12%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent);
}

.security-banner svg {
  width: 26px;
  height: 26px;
  flex: none;
  color: var(--ok);
}

.security-banner div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.security-banner span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.confirm-modal {
  width: min(400px, 100%);
}

.confirm-modal p {
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Toast ---------- */

.toast-wrap {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 220px;
  max-width: 340px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
  font-size: 13px;
  font-weight: 600;
  animation: toastIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
  pointer-events: auto;
}

.toast.out {
  animation: toastOut 0.24s ease both;
}

.toast .toast-dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-2);
}

.toast.success .toast-dot {
  background: var(--ok);
}

.toast.error .toast-dot {
  background: var(--danger);
}

.bookmark-popover {
  position: fixed;
  z-index: 180;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 112px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-solid);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.32);
  animation: modalIn 0.18s ease both;
}

.bookmark-popover button {
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 13px;
  font-weight: 600;
}

.bookmark-popover button:hover {
  background: var(--surface-2);
}

/* ---------- Animations ---------- */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes drawerIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

.pulse {
  animation: pulse 1.4s ease-in-out infinite;
}

/* ---------- Scrollbars ---------- */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 42%, transparent);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topbar-center {
    display: none;
  }

  .layout-compact .widgets-zone [data-widget="clock"],
  .layout-compact .widgets-zone [data-widget="weather"],
  .layout-compact .widgets-zone [data-widget="search"],
  .layout-compact .widgets-zone [data-widget="todo"],
  .layout-compact .widgets-zone [data-widget="notes"],
  .layout-compact .widgets-zone [data-widget="pomodoro"],
  .layout-compact .widgets-zone [data-widget="calculator"] {
    grid-column: span 4;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1500px);
    padding-top: 10px;
  }

  .topbar {
    top: 8px;
    padding: 0 10px;
    gap: 8px;
  }

  .brand-name {
    display: none;
  }

  .topbar-actions {
    gap: 5px;
  }

  .user-btn {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  .user-btn span {
    display: none;
  }

  .widgets-zone {
    grid-template-columns: repeat(2, 1fr);
  }

  .widgets-zone [data-widget] {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
  }

  .layout-compact .widgets-zone {
    grid-template-columns: repeat(2, 1fr);
  }

  .widgets-zone [data-widget="clock"] {
    grid-column: span 2 !important;
  }

  .system-body {
    grid-template-columns: 1fr;
  }

  .clock-body {
    min-height: 150px;
  }

  .weather-meta {
    grid-template-columns: repeat(2, 1fr);
  }

  .bookmarks-panel {
    padding: 14px 12px 16px;
  }

  .panel-actions {
    width: 100%;
    margin-left: 0;
  }

  .panel-actions .compact {
    flex: 1;
  }

  .bookmark-grid {
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 12px 8px;
  }

  .range-grid {
    grid-template-columns: 1fr;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 16px;
  }

  .settings-nav {
    padding: 8px 14px;
  }

  .settings-content {
    padding: 16px 14px 32px;
  }
}

@media (max-width: 440px) {
  .widgets-zone {
    grid-template-columns: 1fr;
  }

  .widgets-zone [data-widget] {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
  }

  .icon-option-grid {
    grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  }

  .search-body {
    flex-direction: column;
    align-items: stretch;
  }

  .search-body select {
    width: 100%;
  }

  .modal-foot {
    flex-wrap: wrap;
  }

  .modal-foot button {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
