\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline html

.tc-tiddler-frame {
  border: none;
  border-bottom: 1px solid <<color page-background>>;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  flex-shrink: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: sticky;
}

.tc-alerts + p {
  margin: 0;
}

@media (min-width: 960px) {
  .tc-dropzone {
    height: 100vh;
    display: flex;
    flex-direction: column;
  }

  .tc-story-river {
    padding: 0;
    display: flex;
    overflow-y: hidden;
    height: 100%;
  }

  /**
   * Fix for Firefox and Safari where sticky elements (tiddlers) cause different scrollWidth of parent element (story river).
   */
  .tc-story-river::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: calc(var(--tiddler-width) * var(--tiddler-count));
    z-index: -1;
  }

  .krystal--static .tc-story-river {
    max-height: 100vh;
  }

  .tc-tiddler-frame {
    border: none;
    border-right: 1px solid <<color page-background>>;
    padding: var(--tiddler-padding);
    width: var(--tiddler-width);
  }

  .tc-tiddler-frame > * {
    transition: opacity 0.25s ease;
  }

  .krystal-link--active {
    background: <<color message-background>>;
  }

  .krystal-tiddler__frame--hide > *:not(.krystal-tiddler__title) {
    opacity: 0;
  }
    
  .krystal-tiddler__frame--overlay {
    box-shadow: 0 0 1em rgba(0, 0, 0, 0.125);
  }

  .krystal-tiddler__frame--maximized {
    left: 0 !important;
    right: 0 !important;
    bottom: 0;
    width: 100%;
    z-index: 5;
  }
  
  .tc-tiddler-frame:nth-of-type(1) { left: calc(0 * var(--tiddler-padding)) }
  .tc-tiddler-frame:nth-of-type(2) { left: calc(1 * var(--tiddler-padding)) }
  .tc-tiddler-frame:nth-of-type(3) { left: calc(2 * var(--tiddler-padding)) }
  .tc-tiddler-frame:nth-of-type(4) { left: calc(3 * var(--tiddler-padding)) }
  .tc-tiddler-frame:nth-of-type(5) { left: calc(4 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-of-type(6) { left: calc(5 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-of-type(7) { left: calc(6 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-of-type(8) { left: calc(7 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-of-type(9) { left: calc(8 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-of-type(10) { left: calc(9 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-of-type(11) { left: calc(10 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-of-type(12) { left: calc(11 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-of-type(13) { left: calc(12 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-of-type(14) { left: calc(13 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-of-type(15) { left: calc(14 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-of-type(16) { left: calc(15 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-of-type(17) { left: calc(16 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-of-type(18) { left: calc(17 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-of-type(19) { left: calc(18 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-of-type(20) { left: calc(19 * var(--tiddler-padding)); }

  .tc-tiddler-frame:nth-last-of-type(1) { right: calc(-1 * var(--tiddler-width) + 1 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-last-of-type(2) { right: calc(-1 * var(--tiddler-width) + 2 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-last-of-type(3) { right: calc(-1 * var(--tiddler-width) + 3 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-last-of-type(4) { right: calc(-1 * var(--tiddler-width) + 4 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-last-of-type(5) { right: calc(-1 * var(--tiddler-width) + 5 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-last-of-type(6) { right: calc(-1 * var(--tiddler-width) + 6 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-last-of-type(7) { right: calc(-1 * var(--tiddler-width) + 7 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-last-of-type(8) { right: calc(-1 * var(--tiddler-width) + 8 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-last-of-type(9) { right: calc(-1 * var(--tiddler-width) + 9 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-last-of-type(10) { right: calc(-1 * var(--tiddler-width) + 10 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-last-of-type(11) { right: calc(-1 * var(--tiddler-width) + 11 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-last-of-type(12) { right: calc(-1 * var(--tiddler-width) + 12 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-last-of-type(13) { right: calc(-1 * var(--tiddler-width) + 13 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-last-of-type(14) { right: calc(-1 * var(--tiddler-width) + 14 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-last-of-type(15) { right: calc(-1 * var(--tiddler-width) + 15 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-last-of-type(16) { right: calc(-1 * var(--tiddler-width) + 16 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-last-of-type(17) { right: calc(-1 * var(--tiddler-width) + 17 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-last-of-type(18) { right: calc(-1 * var(--tiddler-width) + 18 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-last-of-type(19) { right: calc(-1 * var(--tiddler-width) + 19 * var(--tiddler-padding)); }
  .tc-tiddler-frame:nth-last-of-type(20) { right: calc(-1 * var(--tiddler-width) + 20 * var(--tiddler-padding)); }

  .krystal--static .tc-tiddler-frame {
    left: initial;
    right: initial;
  }
}
