/* ==========================================================================
   Live-parity additions (see GAPS.md)
   Values are read from live's app.css; comments name the live selector.
   ========================================================================== */

/* ---- Sidebar internals (live .sidebar__group / __divider / __title) ---- */
.sidebar__group > * + * {
  margin-top: 0.8333rem;
}

/* live .sidebar__wrap / __container — the dark chrome + a bottom close bar.
   (.sidebar--light swaps the wrap to the panel background, like live.) */
.sidebar__wrap {
  background-color: #1c1c1c;
  color: #fff;
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
  font-size: var(--fs-s);
}
.sidebar--light .sidebar__wrap {
  background-color: var(--panel-bg);
  color: var(--text);
}
.sidebar__container {
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  width: 15.7222rem; /* live --sidebar-width (283px) */
}
.sidebar--overlay .sidebar__container {
  width: 100%;
}
.sidebar__close--bar {
  background: #242424;
  border-radius: 0;
  bottom: 0;
  color: #868686;
  height: var(--ui-toolbar-height);
  justify-content: flex-start;
  left: 0;
  padding: 2px 1.1111rem 0;
  right: auto;
  top: auto;
  width: 100%;
}
.sidebar__close--bar:hover,
.sidebar__close--bar:focus-visible {
  background: #000;
  color: #fff;
}

/* live .ui-segmented-control--dark — the chips used inside the dark sidebars */
.ui-segmented-control--dark {
  --btn-bg: #2c2c2c;
  --btn-color: #868686;
  --btn-hover-bg: hsla(0, 0%, 100%, 0.2);
  --transport-color: #868686;
  --transport-hover-color: #fff;
  --btn-active-bg: #fff;
  --btn-active-color: #2c2c2c;
  --segment-border: #484848;
}
/* live's 1px separators between adjacent segments */
.ui-segmented-control__button {
  position: relative;
}
.ui-segmented-control__button::before {
  background-color: var(--segment-border, #c7c7c7);
  bottom: 0.2778rem;
  content: "";
  left: 0;
  position: absolute;
  top: 0.2778rem;
  width: 1px;
}
.ui-segmented-control > .ui-segmented-control__button:first-child::before,
.ui-segmented-control__button--active::before,
.ui-segmented-control__button:hover::before,
.ui-segmented-control__button--active + .ui-segmented-control__button::before,
.ui-segmented-control__button:hover + .ui-segmented-control__button::before {
  content: none;
}

/* live .tgl-control — the On/Off switch */
.tgl-control {
  align-items: center;
  display: flex;
  gap: 0.2778rem;
  justify-content: flex-end;
}
.tgl-control__label {
  font-size: 0.4444rem;
  text-transform: uppercase;
}
.tgl-control__input {
  appearance: none;
  background: #2c2c2c;
  border: 2px solid #2c2c2c;
  border-radius: 99em;
  cursor: pointer;
  display: block;
  height: 1.3333rem;
  outline: 0;
  position: relative;
  user-select: none;
  width: 2.4444rem;
}
.tgl-control__input::after {
  background: #868686;
  border-radius: 50%;
  content: "";
  display: block;
  height: 1.1111rem;
  left: 0;
  position: relative;
  transition: left 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  width: 1.1111rem;
}
.tgl-control__input:checked {
  background: #fbfbfb;
  border-color: #fbfbfb;
}
.tgl-control__input:checked::after {
  background: #2c2c2c;
  left: 50%;
}

/* Row labels + the palette checkmark, at live's sizes */
.sidebar .ui-segmented-control-set > span {
  font-size: var(--fs-s);
}
.colorpicker__preset .ui-icon {
  height: 80%;
  width: 80%;
}

/* live .sidebar__main — the scrolling body every sidebar needs.
   (The details and recurring panels override this with their own gutters.) */
.sidebar__main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  width: 100%;
  padding: 2.6667rem 1.1111rem 5.5556rem;
}
.sidebar__main--narrow {
  padding-inline-start: clamp(2.7778rem, 7.4074vw, 4.4444rem);
  padding-inline-end: clamp(1.1111rem, 7.4074vw, 4.4444rem);
}
.sidebar__divider {
  border: 0;
  border-top: 1px solid #f2f2f2;
  display: block;
  height: 1px;
  padding: 0;
}
html[theme="dark"] .sidebar__divider {
  border-color: #2c2c2c;
}
.sidebar__title {
  font-family: var(--ff-sans);
  font-size: 0.8889rem;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  margin: 0 0 2.2222rem;
}
.sidebar__sub-heading {
  display: block;
  color: #868686;
  font-size: 0.6667rem;
  margin-bottom: 1.1111rem;
}
.sidebar__sub-heading--mb-s {
  margin-bottom: 0.5556rem;
}
.sidebar__sub-heading--mb-m {
  margin-bottom: 1.1111rem;
}
.sidebar__section {
  margin-bottom: 2.7778rem;
}

/* live .ui-segmented-control-set — label left, control right */
.ui-segmented-control-set {
  align-items: center;
  display: flex;
  gap: var(--spacing-xs);
  justify-content: space-between;
}

/* ---- Colour picker (live .colorpicker / .react-colorful) ---- */
.colorpicker {
  margin-bottom: 2.2222rem;
}
.colorpicker__palette {
  column-gap: 0.2778rem;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  justify-content: space-between;
  row-gap: 0.2778rem;
}
.colorpicker__preset {
  display: block;
  height: 0;
  padding-bottom: 100%;
  position: relative;
}
.colorpicker__button {
  border-radius: 50%;
  height: 100%;
  left: 0;
  overflow: hidden;
  position: absolute;
  text-indent: -9999px;
  top: 0;
  transition: transform 0.2s;
  white-space: nowrap;
  width: 100%;
}
.colorpicker__preset--custom .colorpicker__button {
  background-color: transparent !important;
}
.colorpicker__button > svg {
  height: 80%;
  opacity: 0;
  transition: opacity 0.25s ease-in-out;
  width: 80%;
}
.colorpicker__button:hover > svg,
.colorpicker__preset--selected > .colorpicker__button > svg {
  left: 50%;
  opacity: 1;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}
.colorpicker__rainbow {
  background: conic-gradient(#e6df04, #99ca0f, #00d2a3, #00cf58, #65c7ff, #171717, #e10061, #ed0c00, #fc0);
  border-radius: 50%;
  bottom: 0;
  content: "";
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}
.colorpicker__header {
  color: #828282;
  display: block;
  font-size: 0.4444rem;
  margin: 0.8889rem 0;
}
.colorpicker__footer {
  font-size: 0.6667rem;
  margin-top: 0.8889rem;
}
/* live's react-colorful layout: a saturation area, a hue bar, a hex input */
.colorpicker__picker {
  margin-top: 2.2222rem;
}
.colorpicker__saturation {
  border-radius: 8px 8px 0 0;
  height: 150px;
  position: relative;
  touch-action: none;
  width: 100%;
  background: linear-gradient(to top, #000, rgba(0, 0, 0, 0)),
    linear-gradient(to right, #fff, rgba(255, 255, 255, 0));
}
.colorpicker__hue {
  background: linear-gradient(90deg, red 0, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, red);
  border-radius: 0 0 8px 8px;
  height: 24px;
  position: relative;
  touch-action: none;
}
.colorpicker__pointer {
  background-color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  box-sizing: border-box;
  height: 28px;
  position: absolute;
  transform: translate(-50%, -50%);
  width: 28px;
  z-index: 1;
  pointer-events: none;
}
.app-options__input--preferences {
  border: 1px solid #c9c9c9; /* live .app-options__input[type=text] */
  border-radius: 5px;
  display: block;
  height: 3.3333rem;
  margin: 1.1111rem 0 0;
  padding: 0 0.8333rem;
  width: 100%;
  background: transparent;
  color: inherit;
}

/* ---- Emoji picker (live .emoji-list) ---- */
.emoji-list {
  display: grid;
  gap: 0.2222rem;
  grid-template-columns: repeat(8, 1fr);
  max-height: 12rem;
  overflow-y: auto;
  padding: 0.5556rem;
  width: 16rem;
}
.emoji-list__button {
  background: transparent;
  border-radius: 0.2222rem;
  font-size: 1rem;
  height: 1.6667rem;
  line-height: 1;
}
.emoji-list__button:hover {
  background: var(--btn-hover-bg);
}

/* ---- Day-label list / accordion (live .day-label-list / -accordion) ---- */
.day-label-list {
  list-style: none;
}
.day-label-list__item {
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  gap: 0.5556rem;
  padding: 0.5556rem 0;
}
.day-label-list__item:last-child {
  border-bottom: 0;
}
.day-label-list__name {
  flex: 1 1 auto;
}
.day-label-list__delete {
  color: var(--text-muted);
}
.day-label-accordion__btn {
  align-items: center;
  display: flex;
  gap: 0.4444rem;
  font-size: var(--fs-s);
  width: 100%;
  text-align: start;
}
.day-label-accordion__select-all {
  color: var(--text-muted);
  font-size: 0.6667rem;
}
.day-label-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3333rem;
}
.day-label-sub {
  color: var(--text-muted);
  font-size: 0.6667rem;
}

/* ---- Pomodoro timer (live .pomodoro-timer) ---- */
.pomodoro-timer {
  align-items: center;
  display: flex;
  gap: 0.2222rem;
  justify-content: flex-end;
}
.pomodoro-timer__presets {
  align-items: center;
  display: flex;
  gap: 0.2222rem;
}
.pomodoro-timer__presets--hidden {
  display: none;
}
.pomodoro-timer__preset,
.pomodoro-timer__toggle {
  background: var(--btn-bg);
  border-radius: 0.3333rem;
  color: var(--btn-color);
  font-family: var(--ff-mono);
  font-size: 0.6667rem;
  padding: 0.3333em 0.6667em;
}
.pomodoro-timer__preset:hover {
  background: var(--btn-hover-bg);
}
.pomodoro-timer__preset--selected,
.pomodoro-timer__toggle {
  background: var(--btn-active-bg) !important;
  color: var(--btn-active-color);
}
.pomodoro-timer__toggle {
  align-items: center;
  display: flex;
  gap: 0.2222rem;
}
.pomodoro-timer .timer {
  color: var(--text-muted);
  font-family: var(--ff-mono);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  padding-inline-end: 0.4444rem;
}

/* ---- Workspaces switcher (live .workspaces-switcher) ---- */
.workspaces-switcher {
  align-items: center;
  display: flex;
  flex: 1;
}
.workspaces-switcher__title {
  flex: 1;
  margin: 0 0.8889rem 0 0.4444rem;
}
.workspaces-switcher__details {
  align-items: center;
  display: flex;
  flex: 1;
  justify-content: space-between;
}
.workspaces-switcher__indicator {
  visibility: hidden;
}
.dropdown-menu__action--active .workspaces-switcher__indicator {
  visibility: visible;
}

/* ---- Buttons / rows (live .btn, .btn-row, .ui-button--add-list) ---- */
.btn {
  background-color: var(--btn-bg);
  border: 0;
  border-radius: var(--radius-s);
  color: var(--btn-color);
  font-size: var(--fs-s);
  padding: 0.2778rem 0.5556rem;
  transition: all 0.25s ease-in-out;
}
.btn--primary {
  --btn-bg: #2c2c2c;
  --btn-color: #fff;
}
.btn--primary:hover {
  --btn-bg: #000;
}
.btn--secondary {
  --btn-bg: #f2f2f2;
  --btn-color: #2c2c2c;
}
html[theme="dark"] .btn--primary {
  --btn-bg: #f2f2f2;
  --btn-color: #2c2c2c;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5556rem;
}
.btn-row--center {
  justify-content: center;
}
.ui-button--add-list,
.ui-button--cta {
  font-size: 0.5556rem; /* live: .ui-button--add-list,.ui-button--cta */
  font-weight: 700;
  text-transform: uppercase;
}
.ui-button--add-list {
  color: #707070;
  gap: 0.1111rem;
  letter-spacing: 0.05em;
  margin-inline-start: 1.1111rem;
  padding-inline-start: 0.3333rem;
  padding-inline-end: 0.5556rem;
  position: relative;
  z-index: 5;
}

/* ---- Grid / row internals (live .grid__item-padding, .todo__label) ---- */
.grid__item-padding {
  display: flex;
  flex: 1 1 100%;
  flex-direction: column;
  height: 100%;
  position: relative;
}
.todo__label {
  left: -100%;
  opacity: 0;
  position: absolute;
}
.is-editing .todo__label {
  display: flex;
  flex: 1 1 1px;
  height: 100%;
  max-width: 100%;
  opacity: 1;
  overflow: hidden;
  position: static;
}
.todo-input-wrap {
  display: flex;
  width: 100%;
}
.todo-content--create .todo__label {
  z-index: 5;
}
.todo-content--create .todo-input-wrap {
  display: flex;
  margin-inline-start: 0.5em;
  width: 100%;
}
.todo-content--create .todo-input-wrap--is-focused {
  margin-inline-start: 0.4286em;
}

/* ---- Someday actions (live .someday-actions) ---- */
.someday-actions {
  display: flex;
  justify-content: space-between;
  padding: 0.1667rem 0.5556rem 0.1667rem 0.1667rem;
  position: relative;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.25s ease-in-out;
}
.ui-button--someday-actions {
  opacity: 0;
  transition: opacity 0.25s ease-in-out;
}
.grid__item.draggable--clone .ui-button--someday-actions,
.todo__header-wrapper--secondary:hover .someday-actions,
.todo__header-wrapper--secondary:hover .ui-button--someday-actions {
  opacity: 1;
}
.someday-actions__handle {
  flex: 1;
}
.someday-actions__button {
  align-items: center;
  border-radius: 0.1667rem;
  color: var(--text-muted);
  display: flex;
  height: 1.3333rem;
  justify-content: center;
  padding: 0;
  transition: background-color 0.25s ease-in-out;
  width: 1.3333rem;
}
.someday-actions__button:hover {
  background-color: var(--btn-hover-bg);
}
.someday-list-section {
  background-color: var(--surface-muted);
  position: relative;
}

/* ---- Notes history (live .rteditor__history) ---- */
.rteditor__history {
  margin: 2.7778rem 1.1111rem 0;
}
.rteditor__history-text {
  color: var(--text-muted);
  font-size: 0.6667rem;
  position: relative;
}
.rteditor__history-text > .ui-button {
  position: absolute;
  right: 0;
  top: -1.7222rem;
}
.rteditor__history-text > .ui-button:last-child {
  top: -1.7222rem;
}

/* ---- Recurring config (live .recurring-todo-config) ---- */
.recurring-todo-config {
  column-gap: 2.5rem;
  display: grid;
  font-size: var(--fs-xs);
  grid-template-columns: 1fr 2fr;
  justify-content: flex-start;
  margin-bottom: 2.2222rem;
  margin-top: 2.2222rem;
  row-gap: 0.5556rem;
}
.recurring-todo-config__label {
  color: var(--text-muted);
}

/* ---- Toasts (live .toast-dialog) ---- */
.toast-dialog-wrapper {
  bottom: 0.8333rem;
  display: grid;
  left: 0.8333rem;
  place-items: center;
  position: fixed;
  right: 0.8333rem;
  z-index: 500;
}
.toast-dialog {
  --toast-bg: #fff;
  --toast-bg-alt: #edeef0;
  --toast-color: #000;
  --toast-color-alt: #707070;
  --toast-border-color: #f2f2f2;
  background-color: var(--toast-bg);
  border-radius: 0.3333rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  color: var(--toast-color);
  font-size: 0.8889rem;
  min-width: 13.6111rem;
}
html[theme="dark"] .toast-dialog {
  --toast-bg: #1b1c20;
  --toast-bg-alt: #0d0d0d;
  --toast-color: #fff;
}
.toast-dialog--inline {
  align-items: center;
  color: var(--toast-color-alt);
  display: flex;
  flex-wrap: wrap;
  padding: 0.4444rem 0.5556rem;
}
.toast-dialog__text {
  font-size: 0.7778rem;
  margin-inline-start: auto;
  margin-inline-end: auto;
  max-width: none;
  padding: 0.3889rem 1.1111rem 0.4444rem;
  text-align: center;
}
.toast-dialog__button {
  align-items: center;
  background-color: var(--toast-bg-alt);
  border-radius: 0.3333rem;
  color: inherit;
  display: inline-flex;
  font-size: 0.6667rem;
  font-weight: 700;
  gap: 0.2778rem;
  justify-content: center;
  letter-spacing: 0.04em;
  padding: 0.5556rem 0.8333rem;
  text-transform: uppercase;
}
.toast-dialog__button:hover {
  background-color: var(--btn-hover-bg);
  color: var(--text);
}
.toast-dialog__button-row {
  display: flex;
  gap: 0.5556rem;
}

/* ---- Search (live .search__*) ---- */
.search-panel {
  background: var(--panel-bg);
  border-radius: 0.3333rem;
  box-shadow: var(--shadow-menu);
  max-width: 60rem;
  padding: 1.1111rem;
  width: 90vw;
}
.search-panel__input-row {
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  gap: 0.5556rem;
  padding-bottom: 0.5556rem;
}
.search-panel__input,
.search__input {
  background-color: transparent;
  border: 0;
  color: inherit;
  font-size: var(--fs-s);
  outline: none;
  width: 100%;
}
.search__results {
  font-size: var(--fs-xs);
  padding: 1.1111rem 0;
}
.search__results > p,
.search__note {
  color: var(--text-muted);
}
.search__list {
  display: grid;
  gap: 0 1.3333rem;
  grid-template-columns: 1fr 1fr auto;
  margin: 0 -0.2778rem;
}
.search__item {
  align-items: baseline;
  cursor: pointer;
  display: grid;
  gap: 0.6667rem;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  padding: 0.2778rem;
}
.search__item:hover {
  background-color: var(--btn-hover-bg);
}
.search__content {
  font-size: var(--fs-xs);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search__content:not(.search__content--has-note) {
  grid-column-end: span 2;
}
.search__context {
  align-self: center;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  min-width: 5.5556rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search__term {
  background-color: var(--accent-light, #f3eafc);
  border-radius: 2px;
}
.search__meta {
  align-items: center;
  color: #868686;
  display: flex;
  flex-direction: row;
  font-size: var(--fs-xxs);
  gap: 0.2778rem;
  grid-column: 3;
  justify-content: flex-end;
  padding-top: 0.0556rem;
  white-space: nowrap;
}
.search__item--is-list .search__meta > span:first-child,
.search__item--is-someday .search__meta > span:first-child {
  background-color: #dee1e3;
  border-radius: 0.1111rem;
  color: #000;
  font-size: 0.4444rem;
  font-weight: 700;
  padding: 0.1667rem 0.2222rem;
  text-transform: uppercase;
}
html[theme="dark"] .search__item--is-list .search__meta > span:first-child,
html[theme="dark"] .search__item--is-someday .search__meta > span:first-child {
  background-color: #404040;
  color: #fff;
}
.search__item--is-recurring .search__meta {
  text-transform: capitalize;
}
.search__item--is-someday .search__content {
  text-transform: uppercase;
}
.search__item--is-done .search__content {
  color: var(--text-dim);
  text-decoration: line-through;
}
.search__empty,
.search-panel__empty {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  padding: 1.1111rem 0;
}

/* ---- Print (live print.css) ---- */
@media print {
  .app-footer,
  .arrow-nav,
  .app-header__item:not(.app-header__item--logo),
  .someday-actions,
  .someday-toolbar {
    display: none;
  }
  .app-header {
    position: relative;
  }
  .app,
  .app--secondary {
    display: block;
    margin-top: 0;
  }
  .todo__list-item .todo__checkbox {
    border: 1px solid;
    border-radius: 3px;
    height: 0.8em;
    opacity: 1;
    width: 0.8em;
  }
}
