/* App layout: rail, sidebar, chat pane, settings and feature screens covering the chat. */
/* Settings must fully cover chat chrome (same idea as rail features). */
.app.settings-open .thread,
.app.settings-open .composer-wrap,
.app.settings-open .channel-header,
.app.settings-open.rail-feature-open .channel-header,
.app.settings-open.feature-chrome-open .channel-header,
.app.settings-open.mail-mode .channel-header,
.app.settings-open .pinned-banner,
.app.settings-open .banner,
.app.settings-open #feature-screen,
.app.settings-open #mail-dialog-overlay,
.app.settings-open #dialogue-overlay.dialogue-overlay:not(.hidden) { display: none !important; }
.feature-screen {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 5;
  background: transparent;
  justify-content: center;
  overflow: auto;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 20px calc(40px + var(--sab));
  box-sizing: border-box;
}
.feature-card {
  width: min(720px, 100%);
  background: var(--glass-tools-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: var(--glass-border);
  border-radius: 16px;
  padding: 16px 28px 32px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
  align-self: flex-start;
}
.feature-back {
  display: grid; place-items: center;
  width: 40px; height: 40px; margin: 0 0 4px -10px; padding: 0;
  color: #1a1d26; border-radius: 10px; flex: none;
}
.feature-back:hover { background: #f2f2f2; }
.feature-back svg { display: block; }
.feature-card h1 { margin: 0 0 8px; font-size: calc(24px * var(--text-scale, 1)); color: #1a1d26; }
.feature-lead { margin: 0 0 22px; color: #6b7080; font-size: calc(15px * var(--text-scale, 1)); line-height: 1.45; }
.feature-toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0 0 16px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.feature-toolbar::-webkit-scrollbar { display: none; }
.feature-toolbar.hidden { display: none !important; }
.feature-tab {
  appearance: none; border: 1px solid #e4e7ec; background: #fff; color: #5c6270;
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
  flex: 0 0 auto;
  white-space: nowrap;
}
.feature-tab:hover { background: #f3f5f8; }
.feature-tab.is-active {
  color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, #fff);
  background: var(--accent-soft);
}
[data-storage-tab] { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.storage-tabs-dragging { cursor: grabbing; }
.feature-tab.is-tab-drag-source { opacity: .3; }
.feature-tab.storage-tab-ghost {
  position: fixed; z-index: 20010; pointer-events: none; margin: 0; box-sizing: border-box;
  transform: translate(-50%, -50%); cursor: grabbing; opacity: .95;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .24);
}
.feature-body { min-height: 160px; }
.feature-empty {
  border: 1px dashed #d0d4dc; border-radius: 12px; padding: 36px 20px;
  text-align: center; color: #8b8e98; font-size: calc(14px * var(--text-scale, 1));
  background: #fafbfc;
}
.notes-list { display: flex; flex-direction: column; gap: 8px; }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; align-items: start; padding: 4px 2px 8px; }
.feature-group-title {
  margin: 10px 0 4px; padding: 2px 2px;
  font-size: calc(12px * var(--text-scale, 1)); font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: #8b8e98;
}
.feature-group-title:first-child { margin-top: 0; }
button.feature-group-title {
  appearance: none; border: 0; background: transparent; width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  cursor: pointer; font: inherit; text-align: left;
  font-size: calc(12px * var(--text-scale, 1)); font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: #8b8e98;
}
.feature-group-label {
  min-width: 0; flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.feature-group-chevron {
  width: 22px; height: 22px; flex: none; position: relative;
}
.feature-group-chevron::before {
  content: "";
  position: absolute; left: 5px; top: 5px;
  width: 10px; height: 10px;
  border-right: 2.5px solid #6b7080; border-bottom: 2.5px solid #6b7080;
  transform: rotate(45deg); transition: transform .15s ease;
}
button.feature-group-title.is-collapsed .feature-group-chevron::before {
  top: 7px; transform: rotate(-45deg);
}
.polls-group-items {
  display: flex; flex-direction: column; gap: 12px;
}
.notes-item {
  appearance: none; width: 100%; border: 1px solid #e8eaef; background: #fff;
  border-radius: 12px; padding: 14px 16px; text-align: left; cursor: pointer;
  font: inherit; color: inherit; display: flex; flex-direction: column; gap: 4px;
}
.notes-item:hover { border-color: #d5d9e2; background: #fafbfc; }
.notes-item-title {
  font-weight: 700; font-size: calc(15px * var(--text-scale, 1)); color: #1a1d26;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notes-item-preview {
  color: #6b7080; font-size: calc(13px * var(--text-scale, 1)); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.notes-item-meta {
  color: #9aa0ab; font-size: calc(12px * var(--text-scale, 1)); margin-top: 2px;
}
.notes-editor { display: flex; flex-direction: column; gap: 10px; }
.notes-editor-title {
  width: 100%; box-sizing: border-box; border: 1px solid #e4e7ec; border-radius: 10px;
  padding: 10px 12px; font: inherit; font-size: calc(16px * var(--text-scale, 1)); font-weight: 700;
  color: #1a1d26; background: #fff;
}
.notes-editor-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.notes-editor-body {
  width: 100%; box-sizing: border-box; border: 1px solid #e4e7ec; border-radius: 10px;
  padding: 12px; font: inherit; font-size: calc(15px * var(--text-scale, 1)); line-height: 1.45;
  color: #1a1d26; background: #fff; min-height: 220px; resize: vertical;
}
.notes-editor-rich {
  resize: none; overflow: auto; white-space: pre-wrap; word-break: break-word;
  outline: none; min-height: 240px;
}
.notes-editor-rich.is-empty:before {
  content: attr(data-placeholder);
  color: #9aa0ab; pointer-events: none;
}
.notes-inline-img-wrap {
  display: block; position: relative; margin: 8px 0; max-width: 100%;
  width: fit-content;
}
.notes-inline-img {
  display: block; max-width: 100%; max-height: 360px; width: auto; height: auto;
  border-radius: 10px; border: 1px solid #e8eaef; background: #fafbfc;
  object-fit: contain;
}
.notes-inline-img-remove {
  appearance: none; position: absolute; top: 6px; right: 6px;
  width: 28px; height: 28px; border-radius: 8px; border: 0;
  background: rgba(26, 29, 38, .72); color: #fff;
  font: inherit; font-size: 18px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; padding: 0;
}
.notes-inline-img-remove:hover { background: #b42318; }
.notes-editor-title:focus, .notes-editor-body:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 35%, #fff); outline-offset: 1px;
  border-color: color-mix(in srgb, var(--accent) 40%, #d0d4dc);
}
.notes-editor-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.notes-btn {
  appearance: none; border: 1px solid #e4e7ec; background: #fff; color: #5c6270;
  border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.notes-btn:hover { background: #f3f5f8; color: #1f2430; }
.notes-btn.primary {
  background: var(--action); border-color: var(--action); color: var(--action-text, #fff);
}
.notes-btn.primary:hover { filter: brightness(1.05); color: var(--action-text, #fff); }
.notes-btn.danger { color: #b42318; border-color: #f3c4c0; }
.notes-btn.danger:hover { background: #fef3f2; }
.notes-btn:disabled { opacity: .55; cursor: default; }
.tasks-composer {
  display: flex; gap: 8px; align-items: center; margin-bottom: 14px;
  justify-content: flex-end;
}
.tasks-composer input {
  flex: 1; min-width: 0; box-sizing: border-box; border: 1px solid #e4e7ec; border-radius: 10px;
  padding: 10px 12px; font: inherit; font-size: calc(15px * var(--text-scale, 1));
  color: #1a1d26; background: #fff;
}
.tasks-composer input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 35%, #fff); outline-offset: 1px;
  border-color: color-mix(in srgb, var(--accent) 40%, #d0d4dc);
}
.tasks-panel { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tasks-list { display: flex; flex-direction: column; gap: 6px; }
.tasks-date-filters {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.tasks-date-stack { display: flex; flex-direction: column; gap: 10px; }
.tasks-date-card {
  margin: 0;
  padding: 14px;
  border: 1px solid #ebebeb;
  border-radius: 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.tasks-date-disclose {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
  box-sizing: border-box;
}
.tasks-date-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tasks-date-text strong {
  font-size: calc(16px * var(--text-scale, 1));
  color: var(--text-strong, #1a1d26);
}
.tasks-date-hint {
  font-size: calc(13px * var(--text-scale, 1));
  color: #6b7080;
  line-height: 1.35;
}
.tasks-date-disclose .chevron {
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: .55;
}
.tasks-date-disclose[aria-expanded="false"] .chevron { transform: rotate(-45deg); }
.tasks-date-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f1f4;
}
.tasks-date-panel.hidden { display: none !important; }
.calendar-nav {
  display: flex; align-items: center; gap: 8px; margin: 0 0 12px; flex-wrap: wrap;
}
.calendar-nav-title {
  flex: 1; min-width: 0; text-align: center;
  font-size: calc(16px * var(--text-scale, 1)); font-weight: 700; color: #1a1d26;
}
.calendar-nav-btn {
  appearance: none; border: 1px solid #e8eaef; background: #fff; color: #5c6270;
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  display: grid; place-items: center; padding: 0; font: inherit;
}
.calendar-nav-btn:hover { background: #f3f5f8; color: #1a1d26; }
.calendar-today-btn {
  appearance: none; border: 1px solid #e8eaef; background: #fff; color: #5c6270;
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.calendar-today-btn:hover { background: #f3f5f8; }
.calendar-sheet {
  background: #fff; border: 1px solid #e8eaef; border-radius: 18px;
  overflow: hidden; margin: 0 0 16px;
}
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  margin: 0;
}
.calendar-day {
  appearance: none; border: 0; border-right: 1px solid #ebebeb; border-bottom: 1px solid #ebebeb;
  background: #fff; color: #1a1d26; cursor: pointer; font: inherit;
  min-height: 78px; padding: 10px 4px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border-radius: 0; box-sizing: border-box;
}
.calendar-day.is-first-week { min-height: 96px; padding-top: 8px; gap: 6px; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-grid .calendar-day:nth-last-child(-n+7) { border-bottom: 0; }
.calendar-day:hover { background: #fafbfc; }
.calendar-day.is-holiday {
  background: color-mix(in srgb, var(--cal-holiday, #e88a8a) 18%, #fff);
}
.calendar-day.is-holiday:hover {
  background: color-mix(in srgb, var(--cal-holiday, #e88a8a) 26%, #fff);
}
.calendar-dow {
  font-size: 12px; font-weight: 600; color: #8b8e98;
  letter-spacing: .02em; line-height: 1; text-transform: none;
}
.calendar-dow.is-sunday { color: var(--cal-weekend, #d15d4d); }
.calendar-day.is-sunday { color: var(--cal-weekend, #d15d4d); }
.calendar-day.is-sunday .calendar-day-num { color: var(--cal-weekend, #d15d4d); }
.calendar-day.is-outside { color: #c0c4cc; }
.calendar-day.is-outside .calendar-day-num { color: #c0c4cc; font-weight: 500; }
.calendar-day.is-selected .calendar-day-num,
.calendar-day.is-today.is-selected .calendar-day-num,
.calendar-day.is-sunday.is-selected .calendar-day-num {
  background: var(--action, #1c58d9); color: var(--action-text, #fff);
}
.calendar-day.is-today:not(.is-selected) .calendar-day-num {
  box-shadow: inset 0 0 0 1.5px var(--action, #1c58d9); color: var(--action, #1c58d9);
}
.calendar-day.is-sunday.is-today:not(.is-selected) .calendar-day-num {
  box-shadow: inset 0 0 0 1.5px var(--cal-weekend, #d15d4d);
  color: var(--cal-weekend, #d15d4d);
}
.calendar-day-num {
  width: 28px; height: 28px; border-radius: 999px;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 600; line-height: 1; color: inherit;
}
.calendar-day-num.calendar-day-label {
  width: auto; min-width: 0; height: auto; padding: 2px 0;
  border-radius: 0; font-size: 12px; font-weight: 500;
  background: transparent !important; box-shadow: none !important; color: #c0c4cc !important;
}
.calendar-day-label {
  font-size: 11px; font-weight: 500; color: inherit; white-space: nowrap;
}
.calendar-day-marks {
  display: flex; flex-direction: column; gap: 3px; min-height: 8px;
  align-items: stretch; justify-content: flex-end;
  width: 70%; max-width: 36px; margin-top: auto;
}
.calendar-mark {
  display: block; height: 4px; border-radius: 999px; background: var(--cal-task, #9ec9ea);
}
.calendar-mark.is-alert { background: var(--cal-holiday, #e88a8a); }
.calendar-mark.is-done { background: #12b76a; }
.settings-card select.cal-week-select,
.cal-week-select {
  flex: 0 1 auto;
  width: auto !important;
  min-width: 140px;
  max-width: 180px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #d8dbe3;
  border-radius: 10px;
  background: #fff;
  color: var(--text-strong);
  font: inherit;
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 600;
  line-height: 1.3;
  box-sizing: border-box;
  cursor: pointer;
}
.cal-pref-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  column-gap: 8px;
  margin-top: 12px;
  align-items: center;
}
.cal-pref-line > .cal-pref-row {
  margin-top: 0;
  min-width: 0;
}
.cal-pref-line > .for-all-toggle {
  width: 64px;
  align-self: center;
  justify-self: center;
  display: grid;
  place-items: center;
  margin: 0 !important;
  padding: 0;
  min-height: 26px;
}
.cal-pref-line-top > .for-all-toggle {
  align-self: start;
  margin-top: 18px !important;
}
