/* Cabinet appearance is scoped to screens so printed QR templates stay exact. */
@media screen {
  :root {
    --ink: #142b25;
    --muted: #728078;
    --line: #e0e6de;
    --lime: #d9f274;
  }
  body {
    background: #f6f7f3;
    color: var(--ink);
    font-family: Arial, system-ui, sans-serif;
  }
  header {
    background: #102921;
    padding: 22px 32px;
    min-height: 84px;
    border-bottom: 1px solid #ffffff18;
  }
  .brandmark {
    font-size: 27px;
    letter-spacing: -1px;
  }
  .brandmark span {
    font-size: 12px;
    letter-spacing: 0.4px;
    margin-left: 8px;
  }
  #sessionLabel {
    color: #c2cec6;
    font-size: 12px;
  }
  header .quiet {
    background: #ffffff0e;
    border: 1px solid #ffffff25;
    color: #edf6e9;
    padding: 9px 16px;
  }
  button,
  .button {
    border-radius: 12px;
    padding: 13px 20px;
    transition:
      background 0.15s,
      box-shadow 0.15s;
  }
  button:focus-visible,
  a:focus-visible {
    outline: 3px solid #7fae30;
    outline-offset: 3px;
  }
  input:focus,
  textarea:focus,
  select:focus {
    outline: 2px solid #9ebd6a;
    border-color: transparent;
  }
  input,
  textarea,
  select {
    border-color: var(--line);
    border-radius: 11px;
    padding: 13px 14px;
    line-height: 1.5;
  }
  textarea {
    background: #fafbf8;
  }
  label {
    font-size: 13px;
    color: #43554a;
  }
  small {
    line-height: 1.65;
  }
  .quiet {
    background: #edf0e8;
  }
  h1,
  h2,
  h3 {
    letter-spacing: -0.045em;
  }
  .login {
    max-width: 520px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 24px 70px #142b2509;
    margin: 70px auto;
    position: relative;
  }
  .login::before {
    content: "";
    display: block;
    height: 4px;
    width: 48px;
    background: var(--lime);
    margin-bottom: 28px;
    border-radius: 4px;
  }
  .login h1 {
    font-size: 44px;
    line-height: 1.1;
    margin: 16px 0;
  }
  .login p {
    font-size: 14px;
    line-height: 1.7;
  }
  .login button {
    width: 100%;
    margin-top: 12px;
    background: var(--ink);
  }
  body:has(#workspace:not([hidden]))::before {
    content: "";
    position: fixed;
    z-index: -1;
    inset: 0 auto 0 0;
    width: 218px;
    background: #102921;
  }
  body:has(#workspace:not([hidden])) main {
    max-width: 1700px;
    margin-left: 218px;
    padding: 34px 44px 72px;
  }
  body:has(#workspace:not([hidden])) footer {
    margin-left: 218px;
    color: #89958d;
    font-size: 11px;
  }
  .workspaceIntro {
    font-size: 10px;
    letter-spacing: 1.8px;
    font-weight: 700;
    color: #6c7c70;
    display: flex;
    align-items: center;
    gap: 9px;
  }
  .liveDot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #649247;
    border-radius: 50%;
  }
  .studioLabel {
    margin-left: auto;
    opacity: 0.55;
    font-size: 9px;
  }
  .toolbar {
    margin: 24px 0 32px;
    gap: 10px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--line);
  }
  .toolbar > div:first-child {
    max-width: none;
    min-width: 250px;
  }
  .toolbar .eyebrow {
    display: none;
  }
  #companyName {
    margin: 0 0 8px;
    font-size: 36px;
    line-height: 1.15;
  }
  #brandPicker {
    font-size: 27px;
    font-weight: 750;
    border: 0;
    background: transparent;
    padding: 0 28px 4px 0;
    margin: 0;
    max-width: 390px;
  }
  .toolbar .workspaceHint {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
  }
  .toolbar > button {
    font-size: 12px;
    padding: 12px 15px;
  }
  #publicLink {
    font-size: 12px;
    padding: 12px;
    text-decoration: none;
    white-space: nowrap;
  }
  .tabs {
    position: fixed;
    top: 134px;
    left: 16px;
    width: 186px;
    flex-direction: column;
    border: 0;
    margin: 0;
    gap: 8px;
  }
  .tabs::before {
    content: "РАБОЧЕЕ ПРОСТРАНСТВО";
    font-size: 8px;
    letter-spacing: 1.4px;
    color: #839b8c;
    padding: 10px 12px 20px;
  }
  .tabs button {
    text-align: left;
    font-size: 13px;
    color: #a9bcb0;
    padding: 16px;
    border-radius: 11px;
    border: 0;
    line-height: 1.4;
  }
  .tabs button.selected {
    background: var(--lime);
    color: #142a20;
    border: 0;
  }
  .tabs button:hover {
    background: #ffffff12;
    color: white;
  }
  .tabs button.selected:hover {
    background: #d1ed67;
    color: #142a20;
  }
  .sectionHeading {
    margin: 22px 0 24px;
    gap: 24px;
  }
  .sectionHeading h1 {
    font-size: clamp(34px, 3vw, 47px);
    line-height: 1.08;
    margin: 12px 0 20px;
  }
  .headingMuted {
    color: #8c9b8a;
  }
  .sectionHeading p {
    max-width: 540px;
    font-size: 13px;
    line-height: 1.65;
    margin: 0;
  }
  .sectionHeading .eyebrow {
    color: #67805b;
    font-size: 9px;
    letter-spacing: 1.8px;
  }
  #newArticle {
    background: var(--ink);
    box-shadow: 0 5px 15px #142b2510;
    white-space: nowrap;
  }
  .demo {
    border: 1px solid #eadcc2;
    border-left: 3px solid #ca9c54;
    background: #fcf7ed;
    border-radius: 9px;
    color: #907345;
    padding: 11px 15px;
    font-size: 11px;
    line-height: 1.6;
  }
  .newsTools {
    display: flex;
    align-items: end;
    gap: 14px;
    margin: 25px 0;
    padding: 0 0 22px;
    border-bottom: 1px solid var(--line);
  }
  .newsTools label {
    margin: 0;
  }
  .searchLabel {
    flex: 1;
    max-width: 460px;
  }
  .newsTools input,
  .newsTools select {
    background: white;
    font-size: 13px;
  }
  .newsCount {
    margin-left: auto;
    font-size: 11px;
    padding: 15px 0;
    color: #89958a;
    white-space: nowrap;
  }
  .articleList {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
  .newsRow {
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 0;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid #e3e8df;
    border-radius: 18px;
    background: white;
    box-shadow: 0 4px 12px #162c2203;
  }
  .newsRow:hover {
    border-color: #b9c9ab;
    box-shadow: 0 10px 24px #162c220a;
  }
  .newsRow img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/10;
    object-fit: cover;
    border-radius: 0;
  }
  .newsRow > div {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
  }
  .newsRow h3 {
    font-size: 18px;
    letter-spacing: -0.5px;
    line-height: 1.25;
    margin: 0 0 14px;
  }
  .newsRow p {
    font-size: 12px;
    line-height: 1.6;
    color: #7d887f;
  }
  .newsRow p:nth-of-type(2) {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 10px 0 18px;
  }
  .newsRow .statusBadge {
    align-self: start;
    background: #edf3e7;
    color: #5a7448;
    font-size: 9px;
    border-radius: 5px;
    padding: 4px 7px;
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
  }
  .newsRow .statusBadge.draft {
    background: #f1eee8;
    color: #8b7960;
  }
  .newsRow .statusBadge.scheduled {
    background: #edf0fb;
    color: #6271a2;
  }
  .newsRow button {
    align-self: start;
    margin-top: auto;
    font-size: 11px;
    padding: 9px 13px;
    background: #f0f3ed;
    color: #38563b;
    border: 1px solid #e1e8da;
    border-radius: 8px;
  }
  .editorLayout {
    grid-template-columns: minmax(260px, 0.8fr) minmax(380px, 1fr);
    gap: 24px;
  }
  .editorLayout:has(#articleForm:not([hidden])) .articleList {
    grid-template-columns: 1fr;
  }
  .editor {
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 10px 32px #10292105;
    scroll-margin-top: 24px;
  }
  .editor .sectionHeading {
    margin-top: 0;
  }
  .editor h2 {
    font-size: 24px;
  }
  .editor fieldset {
    background: #fafbf8;
    border-radius: 14px;
  }
  .editor legend {
    font-size: 12px;
    padding: 0 6px;
    color: #607450;
  }
  .editor .actions {
    padding-top: 18px;
    border-top: 1px solid var(--line);
  }
  .editor #saveArticle {
    background: var(--ink);
  }
  #brandForm,
  #accessPanel,
  #invitationPanel {
    background: white;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 28px;
    margin: 24px 0;
    max-width: 100%;
  }
  #brandPanel {
    max-width: 1050px;
  }
  #brandPanel > h1 {
    font-size: 36px;
  }
  #invitationPanel {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 6px 24px;
  }
  #invitationPanel h2,
  #invitationPanel p,
  #invitationPanel a {
    grid-column: 2;
    margin: 0 0 10px;
  }
  #invitationPanel h2 {
    font-size: 22px;
  }
  #invitationPanel p {
    font-size: 13px;
    line-height: 1.65;
  }
  #invitationQR {
    grid-column: 1;
    grid-row: 1/6;
    width: 130px;
    height: 130px;
  }
  #accessPanel {
    max-width: 100%;
  }
  #accessPanel h2 {
    margin-top: 24px;
    font-size: 24px;
  }
  #accessPanel p {
    font-size: 13px;
    line-height: 1.7;
    max-width: 680px;
  }
  #accessPanel hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 32px 0;
  }
  #billingAccessForm,
  #paymentForm {
    background: #f7f9f3;
    border: 1px solid #e7eddf;
    border-radius: 16px;
    padding: 10px 22px 22px;
    max-width: 680px;
  }
  #message:not(:empty) {
    background: #fff4e7;
    border: 1px solid #ead7bc;
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 13px;
  }
  @media (min-width: 1650px) {
    .articleList {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
  }
  @media (max-width: 1200px) {
    .articleList {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .editorLayout {
      grid-template-columns: 1fr;
    }
    .toolbar > div:first-child {
      flex-basis: 100%;
    }
  }
  @media (max-width: 800px) {
    body:has(#workspace:not([hidden]))::before {
      display: none;
    }
    body:has(#workspace:not([hidden])) main {
      margin: 0;
      padding: 24px 20px 60px;
    }
    body:has(#workspace:not([hidden])) footer {
      margin-left: 0;
    }
    header {
      padding: 18px 20px;
      min-height: 74px;
      gap: 12px;
    }
    #sessionLabel {
      font-size: 10px;
    }
    .brandmark {
      font-size: 23px;
    }
    .brandmark span {
      display: none;
    }
    .tabs {
      position: static;
      flex-direction: row;
      width: auto;
      background: #e9ede3;
      padding: 5px;
      border-radius: 12px;
      margin: 22px 0;
    }
    .tabs::before {
      display: none;
    }
    .tabs button {
      flex: 1;
      text-align: center;
      color: #6e7f6c;
      font-size: 12px;
      padding: 12px 8px;
    }
    .tabs button.selected {
      background: white;
      color: #153426;
      box-shadow: 0 2px 8px #142b250a;
    }
    .tabs button:hover {
      background: white;
      color: #153426;
    }
    .toolbar {
      margin: 20px 0 16px;
      padding-bottom: 22px;
    }
    .studioLabel {
      display: none;
    }
    #companyName {
      font-size: 32px;
    }
    #brandPicker {
      font-size: 25px;
      max-width: 100%;
    }
    .toolbar > button {
      padding: 11px 12px;
    }
    .toolbar > #phoneMode,
    .toolbar > #qrMode {
      flex: 1 1 calc(50% - 5px);
      white-space: nowrap;
    }
    .toolbar > #publicLink {
      flex-basis: 100%;
      padding: 4px 0;
    }
    .sectionHeading h1 {
      font-size: 30px;
    }
    .sectionHeading {
      align-items: start;
    }
    .newsTools {
      flex-wrap: wrap;
      gap: 12px;
    }
    .searchLabel {
      flex-basis: 100%;
      max-width: none;
    }
    .newsTools label:not(.searchLabel) {
      flex: 1;
    }
    .newsCount {
      padding: 14px 0;
    }
    input,
    textarea,
    select,
    .newsTools input,
    .newsTools select {
      font-size: 16px;
    }
    #brandForm,
    #accessPanel,
    #invitationPanel,
    .editor {
      padding: 20px;
    }
    #invitationPanel {
      grid-template-columns: 90px minmax(0, 1fr);
      gap: 6px 14px;
    }
    #invitationQR {
      width: 90px;
      height: 90px;
    }
    #invitationPanel h2 {
      font-size: 19px;
    }
    .login {
      padding: 28px;
      margin: 25px auto;
    }
    .login h1 {
      font-size: 34px;
    }
  }
  @media (max-width: 520px) {
    .articleList {
      grid-template-columns: 1fr;
      gap: 20px;
    }
    .newsRow h3 {
      font-size: 21px;
    }
    .newsRow p {
      font-size: 13px;
    }
    .newsRow button {
      font-size: 13px;
      padding: 12px 16px;
      min-height: 44px;
    }
    .newsRow > div {
      padding: 21px;
    }
    .toolbar .workspaceHint {
      font-size: 11px;
    }
    #publicLink {
      padding-left: 0;
    }
    #newArticle {
      width: 100%;
    }
    .sectionHeading {
      gap: 18px;
    }
    .editor .sectionHeading {
      flex-direction: row;
    }
    .editor .sectionHeading h2 {
      font-size: 20px;
    }
    .editor .actions {
      background: white;
      bottom: 0;
      padding-bottom: 12px;
    }
    #billingAccessForm,
    #paymentForm {
      padding: 8px 16px 20px;
    }
    #invitationPanel {
      display: block;
    }
    #invitationQR {
      display: block;
      width: 140px;
      height: 140px;
      margin: 18px 0;
    }
    .studio-dialog {
      padding: 20px;
    }
  }
}
