/* Configurable dashboard canvas and shared context actions. */
body.has-redesign-ui .mayak-dashboard-toolbar {
  position: relative;
  z-index: 2;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
  padding: 8px 10px 8px 14px;
  border: 1px solid var(--redesign-line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--redesign-surface) 94%, transparent);
  color: var(--redesign-text);
  box-shadow: 0 7px 24px rgba(28, 39, 73, .045);
  backdrop-filter: blur(16px);
}

body.has-redesign-ui .mayak-dashboard-toolbar > div:first-child > span {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  column-gap: 9px;
}

body.has-redesign-ui .mayak-dashboard-toolbar > div:first-child .mayak-widget-icon {
  grid-row: span 2;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--redesign-accent-soft);
  color: var(--redesign-accent);
}

body.has-redesign-ui .mayak-dashboard-toolbar strong,
body.has-redesign-ui .mayak-dashboard-toolbar small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.has-redesign-ui .mayak-dashboard-toolbar strong {
  font-size: 13px;
  font-weight: 780;
}

body.has-redesign-ui .mayak-dashboard-toolbar small {
  margin-top: 2px;
  color: var(--redesign-muted);
  font-size: 10px;
}

.mayak-dashboard-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

body.has-redesign-ui .mayak-dashboard-toolbar-actions button,
body.has-redesign-ui .mayak-dashboard-board-empty button,
.mayak-widget-library footer button,
.mayak-widget-presets button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--redesign-line);
  border-radius: 10px;
  background: var(--redesign-surface);
  color: var(--redesign-text);
  font: inherit;
  font-size: 11px;
  font-weight: 720;
  cursor: pointer;
}

body.has-redesign-ui .mayak-dashboard-toolbar-actions button:hover,
body.has-redesign-ui .mayak-dashboard-board-empty button:hover,
.mayak-widget-library footer button:hover,
.mayak-widget-presets button:hover {
  border-color: var(--redesign-line-strong);
  background: var(--redesign-hover);
}

body.has-redesign-ui .mayak-dashboard-toolbar-actions button.is-primary,
.mayak-widget-library footer button.is-primary {
  border-color: transparent;
  background: var(--redesign-accent);
  color: #fff;
}

body.has-redesign-ui .mayak-dashboard-toolbar-actions button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--redesign-success) 35%, var(--redesign-line));
  background: var(--redesign-success-soft);
  color: var(--redesign-success);
}

body.has-redesign-ui .mayak-dashboard-toolbar-actions button.is-loading .mayak-widget-icon {
  animation: mayak-widget-spin .8s linear infinite;
}

.mayak-widget-icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
}

.mayak-widget-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

body.has-redesign-ui .redesign-dashboard-header .mayak-dashboard-motivation {
  max-width: 720px;
  margin: 9px 0 0;
  color: var(--redesign-muted);
  font-size: clamp(10px, .82vw, 12px);
  font-weight: 520;
  line-height: 1.45;
  letter-spacing: .005em;
  transition: opacity .18s ease;
}

body.has-redesign-ui .redesign-dashboard-header .mayak-dashboard-motivation.is-loading { opacity: .62; }

body.has-redesign-ui .mayak-dashboard-board {
  --mayak-board-columns: 12;
  display: grid;
  grid-template-columns: repeat(var(--mayak-board-columns), minmax(0, 1fr));
  grid-auto-rows: 72px;
  grid-auto-flow: row dense;
  gap: 12px;
  align-items: stretch;
}

body.has-redesign-ui .mayak-dashboard-widget {
  --mayak-widget-accent: transparent;
  position: relative;
  min-width: 0;
  min-height: 0;
  grid-column: span var(--mayak-widget-cols, 4);
  grid-row: span var(--mayak-widget-rows, 3);
  border-radius: 14px;
  container-name: mayak-widget;
  container-type: size;
  transition: opacity .16s ease, transform .16s ease, box-shadow .16s ease;
}

body.has-redesign-ui .mayak-dashboard-widget[data-mayak-widget-color="blue"] { --mayak-widget-accent: #4564e8; }
body.has-redesign-ui .mayak-dashboard-widget[data-mayak-widget-color="teal"] { --mayak-widget-accent: #168b91; }
body.has-redesign-ui .mayak-dashboard-widget[data-mayak-widget-color="green"] { --mayak-widget-accent: #2f9a6d; }
body.has-redesign-ui .mayak-dashboard-widget[data-mayak-widget-color="amber"] { --mayak-widget-accent: #c47c17; }
body.has-redesign-ui .mayak-dashboard-widget[data-mayak-widget-color="violet"] { --mayak-widget-accent: #7856d8; }
body.has-redesign-ui .mayak-dashboard-widget[data-mayak-widget-color="graphite"] { --mayak-widget-accent: #687086; }

body.has-redesign-ui .mayak-dashboard-widget:not([data-mayak-widget-color="default"]) > :where(.redesign-dashboard-card, .redesign-metric-card) {
  border-color: color-mix(in srgb, var(--mayak-widget-accent) 32%, var(--redesign-line)) !important;
  background: color-mix(in srgb, var(--mayak-widget-accent) 7%, var(--redesign-surface)) !important;
  box-shadow: inset 0 3px 0 color-mix(in srgb, var(--mayak-widget-accent) 78%, transparent), var(--redesign-shadow) !important;
}

body.has-redesign-ui .mayak-dashboard-widget[hidden] {
  display: none !important;
}

body.has-redesign-ui .mayak-dashboard-widget.is-dragging {
  opacity: .42;
  transform: scale(.985);
}

body.has-redesign-ui .mayak-dashboard-widget.is-drop-target {
  box-shadow: 0 0 0 3px var(--redesign-focus);
}

body.has-redesign-ui .mayak-dashboard-widget.is-resizing {
  z-index: 5;
  box-shadow: 0 0 0 3px var(--redesign-focus), var(--redesign-shadow-strong);
}

body.has-redesign-ui .mayak-dashboard-widget > :where(.redesign-dashboard-card, .redesign-metric-card) {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: auto;
  box-sizing: border-box;
  scrollbar-width: none;
}

body.has-redesign-ui .mayak-dashboard-widget > .redesign-dashboard-card {
  display: flex;
  flex-direction: column;
}

body.has-redesign-ui .mayak-dashboard-widget > .redesign-dashboard-card > header {
  flex: 0 0 auto;
  padding-right: 28px;
}

body.has-redesign-ui .mayak-dashboard-widget .mayak-widget-live-body {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  scrollbar-width: none;
}

/* dashboard-widget-scrollbar-hidden-20260907-1
   Scrolling stays enabled; only the native indicator is hidden inside Home widgets. */
body.has-redesign-ui .mayak-dashboard-widget,
body.has-redesign-ui .mayak-dashboard-widget * {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.has-redesign-ui .mayak-dashboard-widget::-webkit-scrollbar,
body.has-redesign-ui .mayak-dashboard-widget *::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

body.has-redesign-ui .mayak-dashboard-widget:is([data-mayak-dashboard-widget="clock"], [data-mayak-dashboard-widget="weather"]) > .redesign-dashboard-card,
body.has-redesign-ui .mayak-dashboard-widget:is([data-mayak-dashboard-widget="clock"], [data-mayak-dashboard-widget="weather"]) .mayak-widget-live-body {
  overflow: hidden;
}

.mayak-widget-controls {
  position: absolute;
  z-index: 8;
  inset: 8px 8px auto auto;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px;
  border: 1px solid var(--redesign-line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--redesign-surface) 96%, transparent);
  box-shadow: 0 5px 18px rgba(28, 39, 73, .11);
  opacity: 0;
  pointer-events: none;
  transform: none;
  transition: opacity .15s ease;
  backdrop-filter: blur(12px);
}

/* dashboard-widget-controls-stable-20260908-1
   Keep the hover target stationary: moving it during the actionability window
   can drop :hover and route the click to the card or fixed account header. */

.mayak-dashboard-widget:hover .mayak-widget-controls,
.redesign-dashboard[data-mayak-customizing="1"] .mayak-widget-controls,
.mayak-widget-controls:focus-within {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.mayak-widget-controls button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 4px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--redesign-muted);
  cursor: pointer;
}

.mayak-widget-controls button:hover,
.mayak-widget-controls button:focus-visible {
  background: var(--redesign-hover);
  color: var(--redesign-accent);
  outline: none;
}

.mayak-widget-controls .mayak-widget-drag {
  display: grid;
  cursor: grab;
}

.mayak-widget-controls .mayak-widget-drag:active { cursor: grabbing; }

.mayak-dashboard-widget.is-pinned .mayak-widget-controls .mayak-widget-drag {
  cursor: not-allowed;
  opacity: .38;
}

.mayak-widget-pin-indicator {
  position: absolute;
  z-index: 6;
  top: -7px;
  left: 12px;
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--redesign-accent) 28%, var(--redesign-line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--redesign-surface) 94%, transparent);
  color: var(--redesign-accent);
  box-shadow: 0 4px 12px rgba(28, 39, 73, .08);
  pointer-events: none;
}

.mayak-widget-pin-indicator[hidden] { display: none; }
.mayak-widget-pin-indicator .mayak-widget-icon { width: 14px; height: 14px; }

body.is-mayak-widget-resizing {
  cursor: default;
  user-select: none;
}

.mayak-widget-resize {
  position: absolute;
  z-index: 7;
  opacity: 0;
  touch-action: none;
  transition: opacity .12s ease, background-color .12s ease;
}

.mayak-dashboard-widget:hover:not(.is-pinned) .mayak-widget-resize,
.mayak-dashboard-widget.is-resizing .mayak-widget-resize,
.redesign-dashboard[data-mayak-customizing="1"] .mayak-dashboard-widget:not(.is-pinned) .mayak-widget-resize {
  opacity: .76;
}

.mayak-dashboard-widget.is-pinned .mayak-widget-resize { pointer-events: none; }
.mayak-widget-resize[data-mayak-widget-resize="n"],
.mayak-widget-resize[data-mayak-widget-resize="s"] { left: 16px; right: 16px; height: 9px; cursor: ns-resize; }
.mayak-widget-resize[data-mayak-widget-resize="n"] { top: -3px; }
.mayak-widget-resize[data-mayak-widget-resize="s"] { bottom: -3px; }
.mayak-widget-resize[data-mayak-widget-resize="e"],
.mayak-widget-resize[data-mayak-widget-resize="w"] { top: 16px; bottom: 16px; width: 9px; cursor: ew-resize; }
.mayak-widget-resize[data-mayak-widget-resize="e"] { right: -3px; }
.mayak-widget-resize[data-mayak-widget-resize="w"] { left: -3px; }
.mayak-widget-resize[data-mayak-widget-resize="ne"],
.mayak-widget-resize[data-mayak-widget-resize="se"],
.mayak-widget-resize[data-mayak-widget-resize="sw"],
.mayak-widget-resize[data-mayak-widget-resize="nw"] { width: 17px; height: 17px; }
.mayak-widget-resize[data-mayak-widget-resize="ne"] { top: -3px; right: -3px; cursor: nesw-resize; }
.mayak-widget-resize[data-mayak-widget-resize="se"] { right: -3px; bottom: -3px; cursor: nwse-resize; }
.mayak-widget-resize[data-mayak-widget-resize="sw"] { bottom: -3px; left: -3px; cursor: nesw-resize; }
.mayak-widget-resize[data-mayak-widget-resize="nw"] { top: -3px; left: -3px; cursor: nwse-resize; }
.mayak-widget-resize[data-mayak-widget-resize="n"]::after,
.mayak-widget-resize[data-mayak-widget-resize="s"]::after { content: ""; position: absolute; right: 34%; left: 34%; height: 2px; border-radius: 2px; background: var(--redesign-accent); }
.mayak-widget-resize[data-mayak-widget-resize="n"]::after { top: 3px; }
.mayak-widget-resize[data-mayak-widget-resize="s"]::after { bottom: 3px; }
.mayak-widget-resize[data-mayak-widget-resize="e"]::after,
.mayak-widget-resize[data-mayak-widget-resize="w"]::after { content: ""; position: absolute; top: 34%; bottom: 34%; width: 2px; border-radius: 2px; background: var(--redesign-accent); }
.mayak-widget-resize[data-mayak-widget-resize="e"]::after { right: 3px; }
.mayak-widget-resize[data-mayak-widget-resize="w"]::after { left: 3px; }
.mayak-widget-resize[data-mayak-widget-resize="se"]::after { content: ""; position: absolute; right: 3px; bottom: 3px; width: 9px; height: 9px; border-right: 2px solid var(--redesign-accent); border-bottom: 2px solid var(--redesign-accent); border-radius: 0 0 5px; }
.mayak-widget-resize[data-mayak-widget-resize="ne"]::after { content: ""; position: absolute; top: 3px; right: 3px; width: 9px; height: 9px; border-top: 2px solid var(--redesign-accent); border-right: 2px solid var(--redesign-accent); border-radius: 0 5px 0 0; }
.mayak-widget-resize[data-mayak-widget-resize="sw"]::after { content: ""; position: absolute; bottom: 3px; left: 3px; width: 9px; height: 9px; border-bottom: 2px solid var(--redesign-accent); border-left: 2px solid var(--redesign-accent); border-radius: 0 0 0 5px; }
.mayak-widget-resize[data-mayak-widget-resize="nw"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 9px; height: 9px; border-top: 2px solid var(--redesign-accent); border-left: 2px solid var(--redesign-accent); border-radius: 5px 0 0; }

.redesign-dashboard[data-mayak-customizing="1"] .mayak-dashboard-widget {
  outline: 1px dashed color-mix(in srgb, var(--redesign-accent) 45%, var(--redesign-line));
  outline-offset: -4px;
}

.mayak-dashboard-board-empty {
  grid-column: 1 / -1;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 32px;
  border: 1px dashed var(--redesign-line-strong);
  border-radius: 16px;
  background: var(--redesign-surface-soft);
  color: var(--redesign-muted);
  text-align: center;
}

.mayak-dashboard-board-empty[hidden] { display: none; }
.mayak-dashboard-board-empty > .mayak-widget-icon { width: 38px; height: 38px; color: var(--redesign-accent); }
.mayak-dashboard-board-empty strong { color: var(--redesign-text); font-size: 17px; }
.mayak-dashboard-board-empty span { font-size: 12px; }

.mayak-widget-empty {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px dashed var(--redesign-line);
  border-radius: 10px;
  background: var(--redesign-surface-soft);
  color: var(--redesign-muted);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.mayak-widget-list,
.mayak-widget-plan-list,
.mayak-widget-focus,
.mayak-widget-bars,
.mayak-readiness-list {
  display: grid;
  gap: 5px;
}

.mayak-widget-list > button,
.mayak-widget-focus > button,
.mayak-widget-plan-list > button,
.mayak-widget-bars > button,
.mayak-readiness-list > button,
.mayak-favorites-list > div > button:first-child {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--redesign-text);
  cursor: pointer;
  text-align: left;
}

.mayak-widget-list > button:hover,
.mayak-widget-focus > button:hover,
.mayak-widget-plan-list > button:hover,
.mayak-widget-bars > button:hover,
.mayak-readiness-list > button:hover,
.mayak-favorites-list > div > button:first-child:hover {
  border-color: var(--redesign-line);
  background: var(--redesign-hover);
}

.mayak-widget-list button > span:nth-child(2),
.mayak-widget-focus button > span:nth-child(2),
.mayak-favorites-list button > span:nth-child(2) {
  min-width: 0;
}

.mayak-widget-list strong,
.mayak-widget-list small,
.mayak-widget-focus strong,
.mayak-widget-focus small,
.mayak-widget-plan-list strong,
.mayak-widget-plan-list small,
.mayak-widget-bars strong,
.mayak-widget-bars small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mayak-widget-list strong,
.mayak-widget-focus strong,
.mayak-widget-plan-list strong,
.mayak-widget-bars strong {
  font-size: 11px;
  font-weight: 720;
}

.mayak-widget-list small,
.mayak-widget-focus small,
.mayak-widget-plan-list small,
.mayak-widget-bars small {
  margin-top: 3px;
  color: var(--redesign-muted);
  font-size: 9px;
}

.mayak-widget-list time {
  color: var(--redesign-muted);
  font-size: 9px;
  white-space: nowrap;
}

.mayak-widget-row-icon,
.mayak-widget-focus > button > span:first-child {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--redesign-accent-soft);
  color: var(--redesign-accent);
}

.mayak-widget-row-icon .mayak-widget-icon,
.mayak-widget-focus > button > span:first-child .mayak-widget-icon {
  width: 16px;
  height: 16px;
}

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

.mayak-widget-summary > span {
  min-width: 0;
  padding: 8px 9px;
  border-radius: 9px;
  background: var(--redesign-surface-soft);
}

.mayak-widget-summary small,
.mayak-widget-summary strong {
  display: block;
}

.mayak-widget-summary small { color: var(--redesign-muted); font-size: 8px; }
.mayak-widget-summary strong { margin-top: 3px; color: var(--redesign-text); font-size: 16px; }
.mayak-widget-summary .is-warning strong { color: var(--redesign-warning); }
.mayak-widget-summary .is-success strong { color: var(--redesign-success); }

.mayak-widget-plan-list > button {
  grid-template-columns: minmax(0, 1.5fr) minmax(80px, 1fr) 36px;
}

.mayak-widget-progress,
.mayak-widget-bars button > i,
.mayak-readiness-list button > i {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--redesign-line);
}

.mayak-widget-progress i,
.mayak-widget-bars button > i b,
.mayak-readiness-list button > i b {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--redesign-accent), #7666ff);
}

.mayak-widget-plan-list > button > b,
.mayak-widget-bars button > em,
.mayak-readiness-list button > em {
  color: var(--redesign-muted);
  font-size: 9px;
  font-style: normal;
  text-align: right;
}

.mayak-widget-bars > button,
.mayak-readiness-list > button {
  min-height: 37px;
  grid-template-columns: minmax(100px, 1fr) minmax(70px, 1fr) 34px;
}

.mayak-readiness-total {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--redesign-accent-soft);
}

.mayak-readiness-total strong { color: var(--redesign-accent); font-size: 22px; }
.mayak-readiness-total span { color: var(--redesign-muted); font-size: 9px; }

.mayak-favorites-list > div {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
}

.mayak-favorites-list > div > button:last-child {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--redesign-muted);
  cursor: pointer;
}

.mayak-favorites-list > div > button:last-child:hover {
  background: var(--redesign-danger-soft);
  color: var(--redesign-danger);
}

.mayak-widget-notes {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(74px, 1fr) auto;
  gap: 7px;
}

.mayak-widget-notes > span,
.mayak-widget-notes > small {
  color: var(--redesign-muted);
  font-size: 9px;
  line-height: 1.4;
}

.mayak-widget-notes textarea {
  width: 100%;
  min-height: 74px;
  resize: none;
  padding: 10px 11px;
  border: 1px solid var(--redesign-line);
  border-radius: 10px;
  outline: none;
  background: var(--redesign-surface-soft);
  color: var(--redesign-text);
  font: inherit;
  font-size: 11px;
  line-height: 1.5;
  box-sizing: border-box;
}

.mayak-widget-notes textarea:focus {
  border-color: var(--redesign-accent);
  box-shadow: 0 0 0 3px var(--redesign-focus);
  background: var(--redesign-surface);
}

.mayak-clock-widget {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 2px 4px 4px;
}

.mayak-clock-widget > strong {
  color: var(--redesign-text);
  font-size: clamp(24px, 2.3vw, 36px);
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  letter-spacing: -.045em;
  line-height: 1;
}

.mayak-clock-widget > span {
  overflow: hidden;
  color: var(--redesign-text);
  font-size: 11px;
  font-weight: 660;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mayak-clock-widget > small {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  color: var(--redesign-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mayak-clock-widget > small .mayak-widget-icon { width: 13px; height: 13px; }

.mayak-weather-widget {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 8px;
}

.mayak-weather-primary {
  min-width: 0;
  display: grid;
  grid-template-columns: 32px auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.mayak-weather-primary > span:first-child {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--mayak-widget-accent) 15%, var(--redesign-surface));
  color: color-mix(in srgb, var(--mayak-widget-accent) 82%, var(--redesign-text));
}

.mayak-weather-primary > span:first-child .mayak-widget-icon { width: 21px; height: 21px; }
.mayak-weather-primary > strong { color: var(--redesign-text); font-size: 25px; font-weight: 760; letter-spacing: -.04em; }
.mayak-weather-primary > span:last-child { min-width: 0; }
.mayak-weather-primary b,
.mayak-weather-primary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mayak-weather-primary b { color: var(--redesign-text); font-size: 10px; }
.mayak-weather-primary small { margin-top: 2px; color: var(--redesign-muted); font-size: 8px; }

.mayak-weather-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.mayak-weather-details > span {
  min-width: 0;
  padding: 6px 7px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--mayak-widget-accent) 7%, var(--redesign-surface-soft));
}

.mayak-weather-details small,
.mayak-weather-details b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mayak-weather-details small { color: var(--redesign-muted); font-size: 7px; }
.mayak-weather-details b { margin-top: 2px; color: var(--redesign-text); font-size: 9px; }

.mayak-weather-footer {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto;
  align-items: center;
  gap: 7px;
}

.mayak-weather-footer > small {
  overflow: hidden;
  color: var(--redesign-muted);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mayak-weather-city {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px;
  align-items: center;
  gap: 4px;
}

.mayak-weather-city label { min-width: 0; }

.mayak-weather-city input {
  width: 100%;
  height: 27px;
  padding: 4px 8px;
  border: 1px solid var(--redesign-line);
  border-radius: 8px;
  outline: none;
  background: var(--redesign-surface);
  color: var(--redesign-text);
  font: inherit;
  font-size: 9px;
  box-sizing: border-box;
}

.mayak-weather-city input:focus {
  border-color: var(--redesign-accent);
  box-shadow: 0 0 0 2px var(--redesign-focus);
}

.mayak-weather-city button {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--redesign-line);
  border-radius: 8px;
  background: var(--redesign-surface);
  color: var(--redesign-accent);
  cursor: pointer;
}

.mayak-weather-city button:hover {
  border-color: var(--redesign-accent);
  background: var(--redesign-accent-soft);
  transform: rotate(8deg);
}

.mayak-weather-city button .mayak-widget-icon { width: 14px; height: 14px; transition: transform .18s ease; }
.mayak-weather-city button:hover .mayak-widget-icon { transform: rotate(45deg); }

.mayak-weather-state {
  min-height: calc(100% - 34px);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  color: var(--redesign-muted);
  font-size: 9px;
  text-align: center;
}

.mayak-weather-state > .mayak-widget-icon { width: 30px; height: 30px; color: var(--redesign-accent); }

.mayak-system-health-list {
  display: grid;
  gap: 4px;
}

.mayak-system-health-list > div {
  min-width: 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 4px 7px;
  border-radius: 8px;
  background: var(--redesign-surface-soft);
}

.mayak-system-health-list > div > span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--redesign-line);
  color: var(--redesign-muted);
}

.mayak-system-health-list > div[data-status="ready"] > span { background: var(--redesign-success-soft); color: var(--redesign-success); }
.mayak-system-health-list > div[data-status="error"] > span { background: var(--redesign-danger-soft); color: var(--redesign-danger); }
.mayak-system-health-list .mayak-widget-icon { width: 14px; height: 14px; }
.mayak-system-health-list strong { overflow: hidden; color: var(--redesign-text); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.mayak-system-health-list small { color: var(--redesign-muted); font-size: 8px; }

.mayak-widget-library-backdrop {
  position: fixed;
  z-index: 16000;
  inset: 56px 0 0 var(--redesign-sidebar-width, 208px);
  display: flex;
  justify-content: flex-end;
  padding: 12px;
  background: rgba(15, 24, 46, .22);
  backdrop-filter: blur(3px);
}

.mayak-widget-library-backdrop[hidden] { display: none; }

.mayak-widget-library {
  width: min(440px, 100%);
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--redesign-line-strong);
  border-radius: 18px;
  background: var(--redesign-surface);
  color: var(--redesign-text);
  box-shadow: var(--redesign-shadow-strong);
  animation: mayak-library-enter .18s ease-out;
}

@keyframes mayak-library-enter {
  from { opacity: 0; transform: translateX(18px); }
}

.mayak-widget-library > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--redesign-line);
}

.mayak-widget-library h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.mayak-widget-library header p { margin: 5px 0 0; color: var(--redesign-muted); font-size: 11px; line-height: 1.45; }
.mayak-widget-library header > button {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: var(--redesign-surface-soft);
  color: var(--redesign-muted);
  cursor: pointer;
  font-size: 22px;
}

.mayak-widget-library-search {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 18px 8px;
  padding: 0 11px;
  border: 1px solid var(--redesign-line);
  border-radius: 11px;
  background: var(--redesign-surface-soft);
  color: var(--redesign-muted);
}

.mayak-widget-library-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--redesign-text);
  font: inherit;
  font-size: 12px;
}

.mayak-widget-presets {
  display: flex;
  gap: 5px;
  padding: 0 18px 10px;
  overflow-x: auto;
}

.mayak-widget-presets button {
  min-height: 30px;
  padding: 5px 9px;
  white-space: nowrap;
}

.mayak-widget-library-list {
  min-height: 0;
  padding: 5px 18px 18px;
  overflow: auto;
}

.mayak-widget-library-list > section + section { margin-top: 17px; }
.mayak-widget-library-list h3 { margin: 0 0 7px; color: var(--redesign-muted); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.mayak-widget-library-list section > div { display: grid; gap: 6px; }

.mayak-widget-library-list article {
  min-width: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--redesign-line);
  border-radius: 12px;
  background: var(--redesign-surface);
}

.mayak-widget-library-list article.is-visible {
  border-color: color-mix(in srgb, var(--redesign-accent) 32%, var(--redesign-line));
  background: var(--redesign-selected);
}

.mayak-widget-library-list article.is-unavailable { opacity: .68; }
.mayak-widget-catalog-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--redesign-accent-soft); color: var(--redesign-accent); }
.mayak-widget-catalog-icon .mayak-widget-icon { width: 19px; height: 19px; }
.mayak-widget-library-list article > span:nth-child(2) { min-width: 0; }
.mayak-widget-library-list article strong,
.mayak-widget-library-list article small,
.mayak-widget-library-list article em { display: block; }
.mayak-widget-library-list article strong { font-size: 11px; }
.mayak-widget-library-list article small { margin-top: 3px; color: var(--redesign-muted); font-size: 9px; line-height: 1.35; }
.mayak-widget-library-list article em { margin-top: 4px; color: var(--redesign-accent); font-size: 8px; font-style: normal; font-weight: 700; }
.mayak-widget-library-list article > button {
  min-width: 68px;
  min-height: 31px;
  padding: 5px 8px;
  border: 1px solid var(--redesign-line-strong);
  border-radius: 9px;
  background: var(--redesign-surface);
  color: var(--redesign-accent);
  cursor: pointer;
  font: inherit;
  font-size: 9px;
  font-weight: 750;
}
.mayak-widget-library-list article > button:hover { background: var(--redesign-accent-soft); }
.mayak-widget-library-list article > button:disabled { cursor: default; color: var(--redesign-muted); }

.mayak-widget-library footer {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  padding: 12px 18px;
  border-top: 1px solid var(--redesign-line);
  background: var(--redesign-surface-soft);
}

.mayak-context-menu {
  position: fixed;
  z-index: 24000;
  width: min(272px, calc(100vw - 16px));
  max-height: min(520px, calc(100vh - 16px));
  padding: 6px;
  overflow: auto;
  border: 1px solid var(--redesign-line-strong);
  border-radius: 13px;
  background: color-mix(in srgb, var(--redesign-surface) 97%, transparent);
  color: var(--redesign-text);
  box-shadow: var(--redesign-shadow-strong);
  font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  backdrop-filter: blur(18px);
  animation: mayak-context-enter .12s ease-out;
}

.mayak-context-menu[hidden] { display: none; }

@keyframes mayak-context-enter {
  from { opacity: 0; transform: translateY(-4px) scale(.985); }
}

.mayak-context-menu-title {
  padding: 7px 9px 6px;
  overflow: hidden;
  color: var(--redesign-muted);
  font-size: 9px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mayak-context-menu hr {
  height: 1px;
  margin: 5px 4px;
  border: 0;
  background: var(--redesign-line);
}

.mayak-context-menu button {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--redesign-text);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 640;
  text-align: left;
}

.mayak-context-menu button:hover,
.mayak-context-menu button:focus-visible {
  background: var(--redesign-hover);
  outline: none;
}

.mayak-context-menu button.is-danger { color: var(--redesign-danger); }
.mayak-context-menu button.is-danger:hover { background: var(--redesign-danger-soft); }
.mayak-context-menu button:disabled { cursor: default; opacity: .5; }
.mayak-context-menu button small { color: var(--redesign-muted); font-size: 8px; }

.mayak-context-palette {
  display: grid;
  gap: 8px;
  padding: 8px 9px 10px;
}

.mayak-context-palette > span {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--redesign-text);
}

.mayak-context-palette > span .mayak-widget-icon { width: 20px; height: 20px; color: var(--redesign-muted); }
.mayak-context-palette > span strong { font-size: 11px; font-weight: 640; }
.mayak-context-palette > div { display: flex; align-items: center; gap: 7px; padding-left: 29px; }

.mayak-context-menu .mayak-context-palette button {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--redesign-line-strong);
  border-radius: 50%;
}

.mayak-context-menu .mayak-context-palette button:hover,
.mayak-context-menu .mayak-context-palette button:focus-visible,
.mayak-context-menu .mayak-context-palette button.is-selected {
  border-color: var(--redesign-accent);
  background: var(--redesign-accent-soft);
  box-shadow: 0 0 0 2px var(--redesign-surface), 0 0 0 4px color-mix(in srgb, var(--redesign-accent) 34%, transparent);
}

.mayak-context-palette button i {
  width: 14px;
  height: 14px;
  display: block;
  border: 1px solid color-mix(in srgb, var(--mayak-swatch) 74%, var(--redesign-line-strong));
  border-radius: 50%;
  background: var(--mayak-swatch);
}

.mayak-context-palette button[data-color="default"] i {
  position: relative;
  background: var(--redesign-surface);
}

.mayak-context-palette button[data-color="default"] i::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 1px;
  left: 1px;
  height: 1px;
  background: var(--redesign-danger);
  transform: rotate(-45deg);
}

@container mayak-widget (max-width: 360px) {
  .redesign-dashboard-card {
    padding-inline: 12px;
  }

  .redesign-dashboard-card > header { gap: 7px; }
  .redesign-dashboard-card h2 { font-size: clamp(11px, 4.5cqw, 14px); }
  .redesign-card-kicker { font-size: clamp(7px, 2.6cqw, 9px); }
  .redesign-dashboard-card .redesign-text-button { padding-inline: 7px; font-size: 9px; }

  .mayak-widget-summary {
    gap: 4px;
  }

  .mayak-widget-summary > span { padding: 6px; }
  .mayak-widget-summary small { font-size: clamp(6px, 2.3cqw, 8px); }
  .mayak-widget-summary strong { font-size: clamp(12px, 5cqw, 16px); }

  .mayak-widget-list > button,
  .mayak-widget-focus > button,
  .mayak-widget-plan-list > button,
  .mayak-widget-bars > button,
  .mayak-readiness-list > button,
  .mayak-favorites-list > div > button:first-child {
    gap: 6px;
    padding-inline: 6px;
  }

  .mayak-widget-list strong,
  .mayak-widget-focus strong,
  .mayak-widget-plan-list strong,
  .mayak-widget-bars strong { font-size: clamp(8px, 3.2cqw, 10px); }

  .mayak-widget-list small,
  .mayak-widget-focus small,
  .mayak-widget-plan-list small,
  .mayak-widget-bars small { font-size: clamp(7px, 2.7cqw, 9px); }

  .mayak-widget-plan-list > button { grid-template-columns: minmax(0, 1fr) 34px; }
  .mayak-widget-plan-list > button .mayak-widget-progress { display: none; }
  .mayak-weather-footer { grid-template-columns: minmax(0, 1fr); }
  .mayak-weather-footer > small { display: none; }
}

@container mayak-widget (max-width: 250px) {
  .redesign-metric-card {
    min-height: 0;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
    padding: 11px;
  }

  .redesign-metric-icon { width: 30px; height: 30px; border-radius: 8px; }
  .redesign-metric-card small { padding-right: 0; font-size: 8px; }
  .redesign-metric-card strong { margin-top: 4px; font-size: 20px; }
  .redesign-metric-card em { margin-top: 4px; font-size: 7px; }

  .mayak-weather-primary { grid-template-columns: 28px auto minmax(0, 1fr); gap: 5px; }
  .mayak-weather-primary > span:first-child { width: 28px; height: 28px; }
  .mayak-weather-primary > strong { font-size: 21px; }
  .mayak-weather-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mayak-weather-details > span:last-child { display: none; }
}

@container mayak-widget (max-height: 210px) {
  .redesign-dashboard-card {
    padding-block: 10px;
  }

  .redesign-dashboard-card > header {
    min-height: 0;
    margin-bottom: 7px;
  }

  .redesign-card-kicker { margin-bottom: 1px; }
  .redesign-dashboard-card h2 { font-size: clamp(11px, 3.5cqw, 14px); }
  .mayak-widget-live-body { font-size: 9px; }
  .mayak-widget-list,
  .mayak-widget-plan-list,
  .mayak-widget-focus,
  .mayak-widget-bars,
  .mayak-readiness-list { gap: 3px; }

  .mayak-widget-list > button,
  .mayak-widget-focus > button,
  .mayak-widget-plan-list > button,
  .mayak-widget-bars > button,
  .mayak-readiness-list > button,
  .mayak-favorites-list > div > button:first-child { min-height: 34px; padding-block: 4px; }

  .mayak-clock-widget { gap: 2px; padding-block: 0; }
  .mayak-clock-widget > strong { font-size: clamp(20px, 10cqw, 30px); }
  .mayak-clock-widget > span { font-size: clamp(8px, 3.2cqw, 10px); }
  .mayak-clock-widget > small { font-size: clamp(7px, 2.7cqw, 8px); }
}

@container mayak-widget (max-height: 165px) {
  .redesign-dashboard-card { padding-block: 8px; }
  .redesign-dashboard-card > header { margin-bottom: 4px; }
  .redesign-dashboard-card > header .redesign-card-kicker { display: none; }
  .redesign-dashboard-card > header .redesign-text-button { min-height: 24px; padding-block: 3px; }
  .mayak-widget-empty { padding: 8px; font-size: 8px; }
  .mayak-widget-list > :nth-child(n+3),
  .mayak-widget-plan-list > :nth-child(n+3),
  .mayak-widget-focus > :nth-child(n+3),
  .mayak-widget-bars > :nth-child(n+3),
  .mayak-readiness-list > :nth-child(n+3) { display: none; }
  .mayak-weather-details { gap: 3px; }
  .mayak-weather-details > span { padding-block: 4px; }
}

@media (max-width: 920px) {
  body.has-redesign-ui .mayak-dashboard-toolbar { align-items: stretch; flex-direction: column; }
  .mayak-dashboard-toolbar-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.has-redesign-ui .mayak-dashboard-toolbar-actions button { min-width: 0; }
  .mayak-widget-library-backdrop { left: var(--redesign-sidebar-width, 72px); }
}

@media (max-width: 760px) {
  body.has-redesign-ui .mayak-dashboard-board { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
  body.has-redesign-ui .mayak-dashboard-widget { grid-column: 1 !important; grid-row: auto !important; min-height: 210px; }
  body.has-redesign-ui .mayak-dashboard-widget:has(.redesign-metric-card) { min-height: 118px; }
  .mayak-widget-library-backdrop { inset: 54px 0 0; padding: 6px; }
  .mayak-widget-library { width: 100%; border-radius: 16px; }
  .mayak-dashboard-toolbar-actions button span:last-child { display: none; }
  .mayak-widget-controls { opacity: 1; pointer-events: auto; }
  .mayak-widget-controls .mayak-widget-drag,
  .mayak-widget-resize { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .mayak-dashboard-widget,
  .mayak-widget-library,
  .mayak-context-menu { animation: none !important; transition: none !important; }
}
