/* «מסודר» (11.11.2026, Achiya on tidy.onimli.pages.dev: «מאשר הכל»). The look and the motion stay as they are; only where
   things sit changes. One order for the top of every room: its title on one side and, in the far corner, its keys:
   «עוד», a second action, the one yellow key. «עוד» holds the room's quiet keys in one order: a second action on a phone,
   the room's settings, «לסדר», «איך עושים פה?» (tidy.js). From 1100px the rooms' bar stands at the side, the products'
   switch at its head, the bell and the settings with their names at its foot. «היום» has no keys of its own and stays as
   it was. Everything here is under html.tidy and comes last, so the sheets before it are untouched. */

html.tidy {
  --tidy-ring: color-mix(in srgb, var(--ink) 20%, transparent);
  --tidy-rule: color-mix(in srgb, var(--ink) 9%, transparent);
  --tidy-hover: rgba(255, 255, 255, .6);
  --tidy-lit: rgba(255, 255, 255, .92);
  --tidy-lit-shadow: inset 0 1px 0 #fff, 0 0 0 .5px rgba(27, 26, 23, .1), 0 3px 10px rgba(27, 26, 23, .12);
}
/* the night's own steps, as the rooms' bar has them (night.css) */
@media (prefers-color-scheme: dark) {
  html.tidy {
    --tidy-hover: rgba(246, 243, 236, .08);
    --tidy-lit: rgba(246, 243, 236, .14);
    --tidy-lit-shadow: inset 0 1px 0 rgba(246, 243, 236, .1), 0 0 0 .5px rgba(246, 243, 236, .12), 0 3px 10px rgba(0, 0, 0, .35);
  }
}

/* ---------- the top of every room: title on one side, keys in the far corner ---------- */
html.tidy .page-app .room__head:has(> .room__keys) {
  position: relative;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  margin-bottom: 18px;
}
html.tidy .page-app .room__head:has(> .room__keys) > * { grid-column: 1 / -1; margin-block: 0; }
html.tidy .page-app .room__head:has(> .room__keys) > h2 { grid-column: 1; grid-row: 1; padding-inline-end: 0; }
html.tidy .page-app .room__head > .room__keys {
  grid-column: 2; grid-row: 1;
  display: flex; align-items: center; gap: 8px;
}
html.tidy .page-app .room__head:has(.room__more.is-open) { z-index: 36; }
html.tidy .room__more { position: relative; }

/* «עוד» and a second action beside it: the same quiet key */
html.tidy .room__more-btn, html.tidy .room__keys > .text-btn {
  position: static;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; margin: 0; padding: 6px 16px;
  color: var(--ink-2); background: transparent;
  border: 0; border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--tidy-ring);
  font: 16px/1.25 var(--f-ui); white-space: nowrap;
  cursor: pointer; transition: background-color .2s, transform .16s;
}
html.tidy :is(.room__more-btn, .room__keys > .text-btn):hover { background: var(--tidy-hover); }
html.tidy .room__more-btn:active { transform: scale(.96); }
html.tidy .room__more-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
html.tidy .room__more.is-open .room__more-btn { background: var(--tidy-lit); }
html.tidy .room__more-btn > svg { flex: none; width: 22px; height: 22px; }
html.tidy .room__keys > .btn--primary { min-height: 44px; margin: 0; padding-inline: 18px 16px; gap: 6px; white-space: nowrap; }

/* the list behind «עוד»: the navigation's glass, a line a key */
html.tidy .room__more-list {
  position: absolute; z-index: 30; top: calc(100% + 10px); inset-inline-end: 0;
  display: none; flex-direction: column; align-items: stretch; gap: 2px;
  min-width: 248px; padding: 8px;
  background: var(--lg-tint); border: .5px solid var(--lg-edge); border-radius: 24px;
  -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur);
  box-shadow: var(--lg-shine), var(--lg-lift);
  transform-origin: top left;
}
html.tidy .room__more.is-open .room__more-list { display: flex; animation: room-more-pop .22s cubic-bezier(.2, .9, .3, 1.15) both; }
html.tidy .room__more-list > p { display: contents; }
html.tidy .room__more-list :is(a, button) {
  position: static;
  display: flex !important; align-items: center; justify-content: flex-start; gap: 10px;
  width: auto; min-height: 48px !important; height: auto; margin: 0 !important; padding: 8px 14px !important;
  color: var(--ink); background: transparent;
  border: 0; border-radius: 16px; box-shadow: none !important;
  font: 17px/1.25 var(--f-ui); text-align: start; text-decoration: none; white-space: nowrap;
  transition: background-color .15s;
}
/* a line the page hides stays hidden, and so does the guide inside a store app (app.css .in-store [data-web-only]) */
html.tidy .room__more-list :is(a, button)[hidden], html.tidy.in-store .room__more-list [data-web-only] { display: none !important; }
/* a line with no picture of its own starts where the others' words do */
html.tidy .room__more-list :is(a, button):not(:has(svg)) { padding-inline-start: 46px !important; }
html.tidy .room__more-list :is(a, button):is(:hover, :focus-visible) { background: color-mix(in srgb, var(--ink) 5%, transparent); }
html.tidy .room__more-list :is(a, button):focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
html.tidy .room__more-list :is(svg, .icon) { position: static; flex: 0 0 22px; width: 22px; height: 22px; margin: 0; }

/* תורים: one line under the title, how many and where they are written; no count yet, only where */
html.tidy #room-calendar .room__head:has(> .room__keys) { grid-template-columns: auto auto minmax(0, 1fr) auto; }
html.tidy #room-calendar .room__head > h2 { grid-column: 1 / 4; }
html.tidy #room-calendar .room__head > .room__keys { grid-column: 4; }
html.tidy #room-calendar .room__head > #appts-sum { grid-column: 1; grid-row: 2; }
html.tidy #room-calendar .room__head > #appts-sum:empty { display: none; }
html.tidy #room-calendar .room__head > .appts-lede { grid-column: 2 / -1; grid-row: 2; align-self: center; }
html.tidy #room-calendar .room__head > .appts-lede::before { content: "· "; }
html.tidy #room-calendar .room__head > #appts-sum:empty ~ .appts-lede { grid-column: 1 / -1; }
html.tidy #room-calendar .room__head > #appts-sum:empty ~ .appts-lede::before { content: none; }

/* תורים: «יומן | דף התורים» and the calendar's views share a line where there is room (the first stays a part of its own:
   arrange-parts.js `top`, and it is the way back from «דף התורים», where the bar is hidden). The page is RTL only */
html.tidy:not([data-arranging]) #room-calendar > #cal-views { float: right; margin: 0 0 18px 14px; }
html.tidy:not([data-arranging]) #room-calendar > #cal-views ~ :not(.appts-bar) { clear: both; }
/* "where there is room": the bar never narrows below its views, so on a phone it drops under the switch instead of pushing
   «שבוע», «חודש» and «רשימה» off the screen (12.11.2026: the page scrolled sideways 98-168px at 360-430) */
html.tidy:not([data-arranging]) #room-calendar > #cal-views ~ .appts-bar { min-width: min-content; }
html.tidy #room-calendar .appts-bar { justify-content: flex-start; gap: 10px 14px; margin-bottom: 18px; }

/* לקוחות: the switch and «מגירות | לוח» a little further apart */
html.tidy #room-customers .dl-switchrow { gap: 12px; }

/* ---------- a phone: «עוד» is a round key, and its list opens from the keys' corner ---------- */
@media (max-width: 899.98px) {
  html.tidy .room__more-btn {
    justify-content: center; width: 44px; padding: 0;
    color: var(--ink); background: var(--sheet); border-radius: 50%;
    box-shadow: 0 0 0 1px var(--hair), 0 4px 14px rgba(27, 26, 23, .05);
  }
  html.tidy .room__more.is-open .room__more-btn { background: var(--sheet); }
  html.tidy .room__more-btn > span { display: none; }
  /* the list opens from the corner of the screen, so it never runs off the other side */
  html.tidy .room__more { position: static; }
  html.tidy .page-app .room__head > .room__keys { position: relative; }
  html.tidy #room-calendar .room__head:has(> .room__keys) { grid-template-columns: auto minmax(0, 1fr) auto; }
  html.tidy #room-calendar .room__head > h2 { grid-column: 1 / 3; }
  html.tidy #room-calendar .room__head > .room__keys { grid-column: 3; }
}
/* the smallest phones: the two do not fit side by side, so where they are written keeps its own line */
@media (max-width: 374.98px) {
  html.tidy #room-calendar .room__head > #appts-sum { grid-column: 1 / -1; }
  html.tidy #room-calendar .room__head > .appts-lede { grid-column: 1 / -1; grid-row: 3; }
  html.tidy #room-calendar .room__head > .appts-lede::before { content: none; }
}
@keyframes room-more-pop { from { opacity: 0; transform: translateY(-6px) scale(.94); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { html.tidy .room__more.is-open .room__more-list { animation: none; } }

/* ---------- a computer: the rooms' bar stands at the side, the same glass ---------- */
@media (min-width: 1100px) {
  /* 15.11.2026 («לא מרגיש כמו מערכת»): the bar stands still beside the rooms, as the side of an app does (maane app.css
     #roomnav). Stuck in the page's flow it was pushed up at the end of every room, under the top with the products'
     switch cut, and its own height scrolled the chats' and the customers' desks as a page under their lists. Nothing
     stands under the top any more, so the rooms reckon no bar there; and with no bar (signing in) a room takes the desk */
  html.tidy { --roombar-h: 0px; }
  html.tidy .page-app .desk { padding-top: 12px; }
  html.tidy .page-app .app:not(:has(#roomnav[hidden])) :is(.desk, .appfoot__in) { padding-inline-start: 248px; }
  html.tidy .page-app .roomnav {
    position: fixed; z-index: 35;
    top: calc(var(--appbar-h) + 12px); bottom: 16px; inset-inline-start: max(16px, calc((100% - var(--desk)) / 2));
    display: flex; flex-direction: column;
    width: 216px; height: auto;
    margin: 0; padding: 10px;
    overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
    background: var(--lg-tint); border: .5px solid var(--lg-edge); border-radius: 30px;
    -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur);
    box-shadow: var(--lg-shine), var(--lg-lift);
  }
  html.tidy .page-app .roomnav::before { content: none; }
  html.tidy .page-app .roomtabs {
    flex-direction: column; align-items: stretch; gap: 4px;
    width: auto; margin: 0; padding: 0;
    background: none; border: 0; border-radius: 0; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  html.tidy .page-app .roomtabs a { min-height: 50px; padding: 8px 14px; gap: 10px; font-size: 17px; }
  html.tidy .page-app .roomtabs__ic { width: 32px; }
  html.tidy .page-app .roomtabs__n { margin-inline-start: auto; }

  /* the products' switch opens the bar, full width (tidy.js moves it here while the bar shows) */
  html.tidy .roomnav > .product-switch {
    display: flex; flex: none; margin: 0 0 10px; padding: 0 0 10px;
    background: none; border: 0; border-bottom: 1px solid var(--tidy-rule); border-radius: 0; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  html.tidy .roomnav > .product-switch #family-pill {
    flex: 1 1 auto; display: flex; align-items: center; justify-content: space-between;
    min-height: 46px; padding: 4px 16px;
    color: #1b1a17; background: #fff; border-radius: 999px;
    box-shadow: inset 0 0 0 1.5px #1b1a17, 0 2px 8px rgba(27, 26, 23, .14);
    font: 16px/1.1 var(--f-ui); text-decoration: none;
  }

  /* the bell and the settings close the bar, with their names; the one you are in is lit as a room is */
  html.tidy .roomnav > .sd-bar {
    display: flex; flex: none; flex-direction: column; gap: 4px;
    /* full width, so the two lines stand exactly under the rooms above them */
    margin: auto 0 0; padding-top: 10px;
    border-top: 1px solid var(--tidy-rule);
  }
  html.tidy .roomnav > .sd-bar .sd-icon {
    display: flex; align-items: center; justify-content: flex-start; gap: 10px;
    width: auto; height: 50px; padding: 8px 14px;
    color: var(--ink-2); background: none; border-radius: 999px; box-shadow: none;
    font: 17px/1.1 var(--f-ui); text-decoration: none;
    transition: background-color .2s;
  }
  html.tidy .roomnav > .sd-bar .sd-icon:hover { background: var(--tidy-hover); }
  html.tidy .roomnav > .sd-bar .sd-icon[aria-current="page"] { color: var(--ink); background: var(--tidy-lit); box-shadow: var(--tidy-lit-shadow); }
  html.tidy .roomnav > .sd-bar .sd-icon > svg { flex: 0 0 32px; order: 1; }
  html.tidy .roomnav > .sd-bar .sd-icon::after { order: 2; }
  html.tidy .roomnav > .sd-bar #sd-bell::after { content: "התראות"; }
  html.tidy .roomnav > .sd-bar #sd-gear::after { content: "הגדרות"; }
  html.tidy .roomnav > .sd-bar .sd-badge { position: static; order: 3; margin-inline-start: auto; }
}
@media (min-width: 1100px) and (prefers-color-scheme: dark) {
  /* the lit product keeps the day's paper and ink at night, as in the top bar (night.css) */
  html.tidy .roomnav > .product-switch #family-pill { background: #fbf6e8; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
}
