@layer ios-workspace {
  .ios-web-actions { display: none !important; }

  @media (min-width: 1100px) {
    #shell:not([hidden]) {
      display: grid !important;
      grid-template-columns: 196px minmax(0, 1fr) !important;
      align-items: start !important;
      gap: 20px !important;
      max-width: 1520px;
      margin-inline: auto !important;
      padding: 20px clamp(20px, 2.5vw, 36px);
    }
    #shell .content { grid-column: 2; grid-row: 1; min-width: 0; padding: 0 !important; }
    #shell main {
      max-width: none !important;
      min-height: calc(100dvh - 40px);
      padding: 0 0 32px !important;
      font: 400 15px/1.4 var(--ios-font) !important;
    }
    #shell .sidebar:has(#navigation) {
      position: sticky !important;
      inset: 20px auto auto !important;
      display: flex !important;
      flex-direction: column !important;
      align-items: stretch !important;
      justify-content: flex-start !important;
      gap: 18px !important;
      width: auto !important;
      grid-column: 1;
      grid-row: 1;
      height: auto !important;
      min-height: min(520px, calc(100dvh - 40px));
      max-height: calc(100dvh - 40px);
      overflow: auto;
      margin: 0 !important;
      padding: 14px 10px !important;
      background: var(--ios-glass) !important;
      border: 1px solid var(--ios-line) !important;
      border-radius: 20px !important;
      box-shadow: 0 5px 20px #18243a12 !important;
    }
    #shell .sidebar .brand {
      display: flex !important;
      align-items: center;
      gap: 8px;
      padding: 5px 8px;
      margin: 0 !important;
    }
    #shell .sidebar .brand .light-brand-logo {
      content: url('/ios-planet.png') !important;
      width: 34px !important;
      height: 34px !important;
      object-fit: contain;
    }
    #shell .sidebar .brand :is(.light-wordmark, .light-wordmark span) {
      display: inline !important;
      color: var(--ios-ink) !important;
      font: 700 19px/1.2 var(--ios-font) !important;
    }
    #shell .sidebar #navigation {
      display: flex !important;
      flex: 0 0 auto !important;
      flex-direction: column !important;
      align-items: stretch !important;
      gap: 4px !important;
      width: 100% !important;
    }
    #shell .sidebar #navigation button {
      display: flex !important;
      align-items: center !important;
      justify-content: flex-start !important;
      width: 100% !important;
      min-height: 44px !important;
      height: auto !important;
      gap: 9px !important;
      padding: 7px 10px !important;
      border: 1px solid transparent !important;
      border-radius: 999px !important;
      background: transparent !important;
      color: var(--ios-ink) !important;
    }
    #shell .sidebar #navigation button span {
      display: inline !important;
      font: 600 15px/1.25 var(--ios-font) !important;
      color: inherit !important;
    }
    #shell .sidebar #navigation button[aria-current=page] { background: #dff69d !important; }
    #shell .sidebar #navigation button:not([aria-current=page]):hover { background: #fff !important; }
    #shell .sidebar #navigation button img {
      content: normal !important;
      width: 24px !important;
      height: 24px !important;
      object-fit: contain;
      filter: none !important;
    }
    #shell .sidebar .light-sidebar-bottom {
      display: grid !important;
      gap: 6px;
      margin-top: auto !important;
    }
    #shell .sidebar .light-sidebar-bottom > button {
      display: flex !important;
      flex-direction: row !important;
      align-items: center !important;
      justify-content: flex-start !important;
      gap: 8px !important;
      width: 100% !important;
      min-height: 44px !important;
      padding: 7px 8px !important;
      color: var(--ios-ink) !important;
      border: 1px solid var(--ios-line) !important;
      border-radius: 13px !important;
      background: #ffffffaa !important;
      text-align: start;
    }
    #shell .sidebar .light-sidebar-bottom > button > span:not(.light-avatar) {
      display: grid !important;
      grid-template-columns: minmax(0, 1fr);
      text-align: start;
    }
    #shell .sidebar .light-sidebar-bottom > button strong {
      font: 700 13px/1.25 var(--ios-font) !important;
    }
    #shell .sidebar .light-sidebar-bottom > button small { color: var(--ios-muted) !important; }
    #shell .sidebar .light-sidebar-bottom > button .light-chevron { display: none !important; }
    #shell .ios-dock { display: none !important; }
    #shell .ios-web-actions {
      display: flex !important;
      align-items: center;
      gap: 7px;
      margin-inline-start: auto;
    }
    #shell .ios-web-actions button {
      display: grid !important;
      place-items: center;
      width: 44px !important;
      height: 44px !important;
      padding: 0 !important;
      border: 1px solid var(--ios-line) !important;
      border-radius: 50% !important;
      background: #fff !important;
    }
    #shell .ios-web-actions img { width: 21px; height: 21px; }
    #shell .ios-web-actions .ios-add { background: var(--ios-lime) !important; }
    #shell .page-heading .ios-settings { margin-left: 0; }
    #shell :is(.sidebar, .ios-web-actions) :focus-visible {
      outline: 2px solid #486c25 !important;
      outline-offset: 2px;
    }

    #shell .classic-masthead {
      top: 0;
      gap: 9px !important;
      padding: 10px 14px !important;
      margin: 0 0 14px !important;
    }
    #shell .classic-masthead #page-title {
      font: 700 25px/1.2 var(--ios-font) !important;
      box-shadow: none !important;
    }
    #shell .classic-masthead #light-week-control { max-width: none !important; }
    #shell .classic-masthead .light-week-day { width: 64px !important; justify-self: center; }
    #shell .classic-masthead .light-week-day:not([aria-pressed=true]):hover { background: #fff !important; }

    #shell #calendar-view .calendar-layout {
      grid-template-columns: minmax(0, 1fr) minmax(232px, 28%) !important;
      gap: 14px !important;
    }
    #shell #calendar-view .month-panel:not([hidden]) {
      position: static !important;
      grid-column: 1 / -1 !important;
      width: 360px !important;
      max-width: 100% !important;
      padding: 12px !important;
      margin: 0 !important;
    }
    #shell #calendar-view .month-panel .calendar-day { min-height: 39px !important; }
    #shell #calendar-view .calendar-layout:not(:has(#calendar-habits:not([hidden]))) .day-panel { grid-column: 1 / -1 !important; }
    #shell #calendar-view #journal-day-aside {
      display: block !important;
      grid-column: 2 !important;
    }
    #shell #calendar-view #journal-day-aside:has(#calendar-habits[hidden]) { display: none !important; }
    #shell #calendar-view #calendar-habits { width: 100% !important; }
    #shell #calendar-view #merged-day-overdue { margin: 0 !important; }
    #shell #calendar-view .day-panel { scroll-margin-top: 160px; }
    #shell .ios-day-cards .task-name { font: 600 16px/1.3 var(--ios-font) !important; }

    #shell[data-page=tasks] #journal-task-toolbar:not([hidden]) {
      display: grid !important;
      grid-template-columns: max-content minmax(200px, 1fr);
      align-items: center;
      gap: 10px !important;
      margin-block: 0 10px !important;
    }
    #shell[data-page=tasks] #light-task-filter {
      width: max-content !important;
      grid-template-columns: repeat(3, max-content) !important;
      margin: 0 !important;
    }
    #shell[data-page=tasks] #classic-task-tools {
      width: 100% !important;
      max-width: none !important;
    }
    #shell[data-page=tasks] #classic-task-search { max-width: none !important; }
    #shell[data-page=tasks] #items .task-group,
    #shell[data-page=notes] .notes-grid,
    #shell[data-page=habits] #habit-list {
      display: grid !important;
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      gap: 11px !important;
    }
    #shell #habit-list > :is(.empty, .ios-free-day) { grid-column: 1 / -1; }
    #shell[data-page=notes] #note-controls:not([hidden]) {
      display: flex !important;
      flex-wrap: wrap !important;
      align-items: end !important;
      gap: 8px !important;
      margin-block: 0 8px !important;
    }
    #shell[data-page=notes] #note-controls .notes-chips { width: 100%; }
    #shell[data-page=notes] #note-controls .notes-search-label { flex: 1 1 44%; width: auto !important; }
    #shell[data-page=notes] #note-controls > label:has(#note-filter) { flex: 0 1 155px; }

    #shell #fitness-view:not([hidden]) {
      display: grid !important;
      grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
      align-items: start;
      gap: 12px !important;
    }
    #shell #fitness-view :is(.health-daily,#health-daily-cards) { display: contents !important; }
    #shell #fitness-view .health-daily > .panel-title {
      display: flex !important;
      grid-column: 1 / -1 !important;
      order: -2 !important;
      justify-content: space-between !important;
      margin: 0 !important;
    }
    #shell #fitness-view .health-daily > .panel-title h2 {
      position: static !important;
      width: auto !important;
      height: auto !important;
      clip-path: none !important;
      margin: 0;
    }
    #shell #fitness-view :is(#health-daily-cards > .health-metric,#desktop-recovery) {
      grid-column: span 2 !important;
      align-self: stretch;
      min-width: 0 !important;
      min-height: 104px !important;
    }
    #shell #fitness-view .health-metric .metric-value { font-size: 24px !important; }
    #shell #fitness-view .ios-fitness-hours { grid-column: 1 / -1 !important; }
    #shell #fitness-view .health-daily > [data-health-panel=activity]:has(#steps-chart) {
      display: grid !important;
      gap: 12px;
      grid-column: span 4 !important;
      order: 5 !important;
      min-width: 0;
      padding: 0 !important;
      margin: 0 !important;
      border: 0 !important;
    }
    #shell #fitness-view .fitness-grid { display: block !important; }
    #shell #fitness-view :is(.fitness-hero,.fitness-advice,.workouts-panel) {
      background: var(--ios-glass) !important;
      border-color: var(--ios-line) !important;
      border-radius: 18px !important;
    }
    #shell #fitness-view .fitness-hero { width: 100% !important; }
    #shell #fitness-view .fitness-hero .steps-chart { min-height: 0 !important; }
    #shell #fitness-view .chart-point-control { cursor: pointer; }
    #shell #fitness-view .chart-point-control :is(.chart-point-hit) { fill: transparent; }
    #shell #fitness-view .chart-point-control:is(:hover,:focus-visible) .chart-point { fill: var(--ios-lime); stroke: #284d76; }
    #shell #fitness-view .ios-chart-detail { min-height: 21px; margin: 6px 0 0; }
    #shell #fitness-view .fitness-advice {
      grid-column: span 2 !important;
      order: 6 !important;
      min-width: 0;
      margin: 0 !important;
    }
    #shell #fitness-view .health-quick-links {
      grid-column: 1 / -1 !important;
      order: 7 !important;
      width: 100% !important;
    }
    #shell #fitness-view :is(#light-health-history,#health-daily-status,.fitness-toolbar,#fitness-error) {
      grid-column: 1 / -1 !important;
      order: 8 !important;
    }
    #shell #fitness-view :is([data-health-panel=overview],[data-health-panel=body]):empty { display: none !important; }

    #login { width: min(440px, calc(100% - 48px)) !important; margin-top: clamp(52px, 11vh, 118px) !important; }
    :is(#task-dialog,#note-dialog,#habit-dialog,#assistant-dialog,#settings-dialog,#filter-dialog,#fitness-dialog,#assistant-data-dialog,
      #light-measurement-dialog,#install-dialog,#telegram-dialog,#account-dialog,#invite-dialog,#trash-dialog,#push-dialog,#light-search-dialog,#archive-confirm,.ios-create-menu) {
      position: fixed !important;
      inset: 0 !important;
      width: min(var(--web-dialog-width, 560px), calc(100% - 48px)) !important;
      max-width: none !important;
      max-height: calc(100dvh - 48px) !important;
      margin: auto !important;
      transform: none !important;
    }
    :is(#task-dialog,#habit-dialog,#fitness-dialog,#push-dialog) { --web-dialog-width: 620px; }
    #note-dialog { --web-dialog-width: 700px; }
    #assistant-dialog { --web-dialog-width: 660px; }
    :is(#archive-confirm,.ios-create-menu) { --web-dialog-width: 420px; }
    #habit-form .ios-switch-list label {
      flex-direction: row-reverse !important;
      justify-content: space-between !important;
      text-align: start !important;
    }
    :is(#task-dialog,#note-dialog,#habit-dialog,#filter-dialog) form > .panel-title {
      top: 0 !important;
      margin-inline: 0 !important;
    }
    #settings-dialog .ios-settings-extra > button { width: 100%; }
    #assistant-dialog .assistant-header {
      flex-wrap: nowrap !important;
      min-width: 0;
      position: sticky;
      top: 0;
      z-index: 2;
      background: #f2f2f7 !important;
    }
  }
}
