/* AMOSHA UI runtime fixes — collapsed workspace, semantic statuses, planner boundaries and habit day states. */

@media (min-width: 901px) {
  .app.sidebar-collapsed .topbar {
    padding-left: 20px;
    padding-right: 24px;
  }

  /* Collapsing the rail should actually reclaim horizontal space. The normal
     route profile caps still apply while the sidebar is expanded. */
  .app.sidebar-collapsed .content[data-workspace-layout="standard"],
  .app.sidebar-collapsed .content[data-workspace-layout="wide"],
  .app.sidebar-collapsed .content[data-workspace-layout="fluid"] {
    width: 100%;
    max-width: none !important;
    padding-left: 20px;
    padding-right: 24px;
  }
}

/* Native select arrows sit too close to the field edge and vary by browser.
   Keep native select behavior, but normalize chevron geometry and spacing. */
select:not([multiple]) {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236f7e94' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
}

/* Replace the legacy text magnifier with the same outline language as the
   semantic icon set, while preserving the existing search input markup. */
.search::before {
  content: "";
  top: 50%;
  left: 13px;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") center / contain no-repeat;
}

.search input {
  padding-left: 39px;
}

/* Text actions keep their label, but use an actual semantic icon for +, arrows,
   stars and other control glyphs. */
.ui-icon-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.button-leading-icon,
.button-trailing-icon,
.semantic-inline-icon,
.account-export-warning-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
}

.ui-icon-label .app-icon,
.semantic-inline-icon .app-icon,
.account-export-warning-icon .app-icon {
  display: block;
}

.check-button.task-status-control {
  width: 24px;
  height: 24px;
  min-width: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.check-button.task-status-control[data-task-status="TODO"] {
  color: color-mix(in srgb, var(--muted) 88%, var(--text));
}

.check-button.task-status-control[data-task-status="IN_PROGRESS"] {
  background: color-mix(in srgb, var(--accent-soft) 72%, transparent);
  color: var(--accent);
}

.check-button.task-status-control[data-task-status="DONE"] {
  background: color-mix(in srgb, var(--success) 10%, transparent);
  color: var(--success);
}

.check-button.task-status-control:hover {
  background: color-mix(in srgb, currentColor 9%, transparent);
}

.check-button.task-status-control .app-icon {
  width: 20px;
  height: 20px;
}

.check-button.habit-status-control {
  width: 24px;
  height: 24px;
  min-width: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
}

.check-button.habit-status-control[data-habit-checked="true"] {
  background: color-mix(in srgb, var(--success) 10%, transparent);
  color: var(--success);
  opacity: 1;
}

/* Primary-habit markers use semantic SVG stars instead of font glyphs. */
.habit-primary-label,
.habit-primary-badge,
[data-habit-primary]:not(.habit-star-button) {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.habit-primary-label .habit-primary-icon,
.habit-primary-badge .habit-primary-icon,
[data-habit-primary] .habit-primary-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
}

.habit-star-button .app-icon,
.habit-primary-icon .app-icon {
  display: block;
}

/* Habit week states: larger weekday labels and clearer day markers. */
.habit-week-inline {
  display: grid;
  gap: 8px;
}

.habit-dashboard .habit-week-inline {
  margin: 10px 0 12px;
}

.habit-week-label {
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
}

.habit-library-day {
  gap: 7px;
}

.habit-library-day b {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
}

.habit-library-day i {
  position: relative;
  width: 10px;
  height: 10px;
  border: 1px solid transparent;
  background: var(--surface-3);
  transition: width var(--motion-fast) var(--ease-ui), height var(--motion-fast) var(--ease-ui), background var(--motion-fast) var(--ease-ui), border-color var(--motion-fast) var(--ease-ui), box-shadow var(--motion-fast) var(--ease-ui);
}

.habit-library-day.scheduled i {
  width: 11px;
  height: 11px;
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border-strong));
  background: var(--surface-solid);
}

.habit-library-day.today {
  color: var(--accent);
}

.habit-library-day.today i {
  width: 13px;
  height: 13px;
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 10%, transparent);
}

.habit-library-day.checked i {
  width: 14px;
  height: 14px;
  border-color: var(--success);
  background: var(--success);
}

.habit-library-day.checked i::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 2px;
  width: 3px;
  height: 6px;
  border-right: 1.5px solid white;
  border-bottom: 1.5px solid white;
  transform: rotate(45deg);
}

.habit-library-day.today.checked i {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 24%, transparent);
}

.legal-settings-links a {
  gap: 7px;
}

.legal-settings-links .semantic-inline-icon {
  margin-left: 1px;
}

#account-export-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

#account-export-warning .account-export-warning-icon {
  margin-top: 1px;
  color: var(--warning, #d89a4a);
}

.planner-time-label.planner-boundary-start {
  transform: translateY(3px);
}

.planner-time-label.planner-boundary-end {
  top: calc(var(--planner-height) - 1px) !important;
  transform: translateY(-100%);
  color: color-mix(in srgb, var(--muted) 90%, transparent);
}

.planner-day-column::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  height: 1px;
  pointer-events: none;
  background: color-mix(in srgb, var(--border) 76%, transparent);
}
