:root { color-scheme: light dark; --gap: 16px; --raised: #fff; --raised-edge: #0002; }
@media (prefers-color-scheme: dark) {
  :root { --raised: #2c2c2e; --raised-edge: #fff2; }
}
* { box-sizing: border-box; }
body { margin: 0; padding: 0; font: 16px/1.45 -apple-system, system-ui, sans-serif;
       display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.shell { flex: 1 1 auto; min-height: 0; display: flex; }
main { flex: 1 1 auto; min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden;
       padding: var(--gap); -webkit-overflow-scrolling: touch; }
.page { max-width: 480px; }
main.wide .page { max-width: none; }

.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: var(--gap); }
.topbar h1 { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.topbar h1:empty { display: none; }
.topbar-actions { flex: none; }
.topbar-actions:empty { display: none; }
main.auth .topbar { display: none; }

.side { flex: none; width: 240px; display: flex; flex-direction: column;
        padding: var(--gap); border-right: 1px solid #8883; overflow-y: auto; }
.side-item { display: block; padding: 8px 12px; border-radius: 10px; color: inherit;
             text-decoration: none; font-size: 14px; }
.side-item:hover { background: #8881; }
.side-item.primary { font-size: 15px; font-weight: 600; color: #0a84ff;
                     background: #0a84ff1f; }
.side-item.primary:hover { background: #0a84ff33; }
.side-title { margin: 20px 0 6px; padding: 0 12px; font-size: 12px; font-weight: 600;
              letter-spacing: .04em; text-transform: uppercase; opacity: .5; }
.side .languages { margin-top: auto; border-top: 1px solid #8883; justify-content: flex-end; }
.side-user { display: flex; align-items: center; gap: 8px; padding-top: var(--gap);
             border-top: 1px solid #8883; font-size: 14px; }
.side-user .muted { min-width: 0; overflow-wrap: anywhere; flex: 1 1 auto; }
.side-user form { max-width: none; }
.side-user button { display: inline-flex; align-items: center; justify-content: center;
                    width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px;
                    background: none; color: inherit; cursor: pointer; opacity: .7; }
.side-user button:hover { background: #8883; opacity: 1; }
.side-user svg { display: block; }

.burger { display: none; flex: none; align-items: center; justify-content: center;
          width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px;
          background: none; color: inherit; cursor: pointer; }
.burger:hover { background: #8883; }
.registration { max-width: none; margin-bottom: 24px; }
.card { display: flex; gap: var(--gap); align-items: center; margin-bottom: var(--gap); }
.card img, .placeholder { width: 72px; height: 72px; border-radius: 16px; flex: none; }
.placeholder { display: grid; place-items: center; background: #8883; font-size: 28px; font-weight: 600; }
h1 { font-size: 20px; margin: 0; }
.muted { opacity: .65; font-size: 14px; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: var(--gap) 0; font-size: 14px; }
dt { opacity: .65; }
dd { margin: 0; overflow-wrap: anywhere; text-align: right; }
.button { display: block; width: 100%; padding: 14px; border: 0; border-radius: 12px; background: #0a84ff;
          color: #fff; font: inherit; font-weight: 600; text-align: center; text-decoration: none; }
.button.secondary { background: #8883; color: inherit; margin-top: 8px; }
.button[aria-disabled="true"] { background: #8883; color: inherit; pointer-events: none; }

.button { cursor: pointer; -webkit-tap-highlight-color: transparent;
          transition: background-color .15s ease, transform .07s ease, opacity .15s ease; }
.button:hover { background: #3395ff; }
.button.secondary:hover { background: #8885; }
.button.danger:hover { background: #ff3b3038; }
.button:active { transform: translateY(1px) scale(.99); }
.button:focus-visible { outline: 2px solid #0a84ff; outline-offset: 3px; }
.button[aria-disabled="true"] { cursor: default; }
.is-busy { opacity: .55; pointer-events: none; }
button, select { cursor: pointer; }
.nav-out button:hover { opacity: .65; }
.notice { padding: 12px; border-radius: 12px; background: #ffcc0022; font-size: 14px; margin-bottom: var(--gap); }
.notice.bad { background: #ff3b3022; }
.notice.good { background: #34c75922; }
ul.rows { list-style: none; margin: 0; padding: 0; }
ul.rows li a { display: block; padding: 12px 0; border-bottom: 1px solid #8883;
               text-decoration: none; color: inherit; overflow-wrap: anywhere; }

.languages { flex: none; margin: 0; padding: var(--gap) 0; display: flex; flex-wrap: wrap;
             gap: 8px; font-size: 13px; }
.languages.standalone { padding: var(--gap); border-top: 1px solid #8883; }
.languages a, .languages span { padding: 4px 10px; border-radius: 999px; text-decoration: none; }
.languages a { color: inherit; opacity: .6; }
.languages span { background: #8883; font-weight: 600; }

form label { display: block; margin-bottom: 12px; font-size: 14px; }
form input { display: block; width: 100%; margin-top: 4px; padding: 10px;
             border: 1px solid #8886; border-radius: 10px; background: transparent;
             color: inherit; font: inherit; }
form select { display: block; width: 100%; margin-top: 4px; padding: 10px;
              border: 1px solid #8886; border-radius: 10px; background: transparent;
              color: inherit; font: inherit; }
form textarea { display: block; width: 100%; margin-top: 4px; padding: 10px;
                border: 1px solid #8886; border-radius: 10px; background: transparent;
                color: inherit; font: inherit; resize: vertical; }

.button.danger { background: #ff3b3022; color: inherit; }
.button.quiet { background: transparent; color: #0a84ff; border: 1px solid #0a84ff66; }
.button.quiet:hover { background: #0a84ff1a; border-color: #0a84ff; }
.good { color: #34c759; }
.bad { color: #ff3b30; }

.nav { flex: none; display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
       padding: var(--gap); margin: 0; border-bottom: 1px solid #8883; font-size: 14px; }
.nav a { color: inherit; }
.nav a.nav-action { background: #0a84ff; color: #fff; font-weight: 600;
                    padding: 6px 14px; border-radius: 999px; text-decoration: none;
                    transition: background-color .15s ease, transform .07s ease; }
.nav a.nav-action:hover { background: #3395ff; }
.nav a.nav-action.secondary { background: #8883; color: inherit; }
.nav a.nav-action.secondary:hover { background: #8885; }
.nav-user { display: flex; gap: 8px; align-items: center; margin-left: auto; min-width: 0; }
.nav-user .muted { min-width: 0; overflow-wrap: anywhere; }
.nav a.nav-action:active { transform: translateY(1px); }
.nav-out { display: flex; gap: 8px; align-items: center; }
.nav-user .icon, .nav-out button { display: inline-flex; align-items: center; justify-content: center;
                  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px;
                  background: none; color: inherit; font: inherit; cursor: pointer; opacity: .7;
                  transition: background-color .15s ease, opacity .15s ease, transform .07s ease; }
.nav-user .icon:hover, .nav-out button:hover { background: #8883; opacity: 1; }
.nav-user .icon:active, .nav-out button:active { transform: translateY(1px); }
.nav-user .icon:focus-visible, .nav-out button:focus-visible { outline: 2px solid #0a84ff; outline-offset: 2px; }
.nav-user svg { display: block; }

.inline { display: inline-block; margin-right: 8px; }
.inline .button { width: auto; padding: 6px 12px; font-size: 13px; }
.lifetime { margin: var(--gap) 0; }
.page-form { width: 100%; }
.menu { margin-bottom: var(--gap); }
.save-state { margin-left: 8px; }
.spoiler { border-top: 1px solid #8883; padding-top: var(--gap); margin-top: 32px; }
.spoiler summary { cursor: pointer; font-weight: 600; margin-bottom: var(--gap); }
.spoiler[open] summary { margin-bottom: var(--gap); }
.pair { display: grid; gap: var(--gap); align-items: start; margin-bottom: var(--gap); }
.pair > * { padding: 12px; border-radius: 12px; }
.pair form { max-width: none; }
.pair .notice { margin-bottom: 0; max-width: none; }
.pair-label { margin: 0 0 8px; font-size: 14px; line-height: 20px; }
.field-row { display: flex; gap: 8px; align-items: center; }
.field-row input { margin-top: 0; flex: 1; min-width: 0; }
.field-row .button { flex: none; display: inline-block; width: auto; min-width: 0;
                     margin-top: 0; padding: 10px 18px; white-space: nowrap; }
pre.code { background: #8881; border: 1px solid #8883; border-radius: 10px; padding: 14px 16px;
           overflow-x: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
           font-size: 13px; line-height: 1.5; margin: 0 0 var(--gap); }
dialog.sheet { border: 1px solid #8886; border-radius: 16px; padding: 24px; color: inherit;
               width: min(460px, calc(100vw - 32px)); background: Canvas;
               box-shadow: 0 24px 60px #0007;
               display: flex; flex-direction: column; gap: var(--gap); }
dialog.sheet::backdrop { background: #0009; }
dialog.sheet > * { margin: 0; }
dialog.sheet form { max-width: none; display: flex; flex-direction: column; gap: var(--gap); }
dialog.sheet form > * { margin: 0; }

.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { margin: 0; }
.wide-only { display: none; }
.narrow-only { display: inline; }
.sheet-close { display: inline-flex; align-items: center; justify-content: center;
               width: 32px; height: 32px; flex: none; border-radius: 8px;
               color: inherit; text-decoration: none; opacity: .6; font-size: 17px; }
.sheet-close:hover { opacity: 1; background: #8883; }
.back { margin: 0 0 10px; font-size: 14px; }
.back a { color: inherit; opacity: .65; text-decoration: none; }
.back a:hover { opacity: 1; }
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; background: #0a84ff;
            transform: scaleX(0); transform-origin: 0 50%; opacity: 0; pointer-events: none;
            z-index: 20; transition: transform .35s ease, opacity .25s ease; }
.progress.is-active { transform: scaleX(.85); opacity: 1; }
.actions-row { display: flex; gap: 8px; justify-content: center; }
.actions-row .button { flex: none; width: auto; min-width: 180px; margin-top: 0; }
.inline-row { display: flex; gap: 8px; }
.inline-row .inline { flex: 1 1 0; min-width: 0; margin: 0; display: block; }
.inline-row .inline .button { width: 100%; padding: 10px 12px; font-size: 14px;
                              min-width: 0; margin: 0; }
.check { display: flex; gap: 8px; align-items: center; }
.check input { width: auto; margin: 0; }
h2 { font-size: 16px; margin-top: 24px; }

main.card { display: flex; }
main.card .page { margin: auto; width: 100%; max-width: 480px; }
main.card .topbar { display: none; }
main.card .page > .button { display: block; width: 100%; min-width: 0; }
main.auth { display: flex; }
main.auth .page { margin: auto; width: 100%; max-width: 360px; }
main.auth .auth-box { display: flex; flex-direction: column; gap: var(--gap); }
main.auth .auth-box > * { margin: 0; }
main.auth .auth-box form .button { display: block; width: 100%; min-width: 0; }

@media (min-width: 720px) {
  .wide-only { display: inline; }
  .narrow-only { display: none; }
  main { padding: 32px; }
  .languages.standalone { padding: var(--gap) 32px; }

  h1 { font-size: 26px; }
  h2 { font-size: 18px; }

  .button { display: inline-block; width: auto; min-width: 200px; padding: 12px 24px; }
  main.narrow .page > .button { display: block; width: 100%; min-width: 0; }
  form .button { display: block; width: 100%; min-width: 0; }
  .inline .button { min-width: 0; margin-left: 0; }

  form { max-width: 420px; }
  .notice { max-width: 760px; }

  main.wide ul.rows li a { display: grid; grid-template-columns: 1fr auto; gap: 4px 24px;
                           align-items: baseline; padding: 14px 4px; }
  main.wide ul.rows li a .muted { text-align: right; }
  main.wide ul.rows li a:hover { background: #8881; }

  main.wide h1 { margin-bottom: 20px; }
  main.wide h2 { margin-bottom: 12px; }

  main.wide .apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
                         gap: 16px; margin-bottom: 32px; align-items: stretch; }
  main.wide .apps-grid li { display: flex; }
  main.wide ul.rows.apps-grid li a { flex: 1 1 auto; }
  main.wide ul.rows.apps-grid li a { display: block; border: 1px solid #8883; border-radius: 12px;
                                     padding: 22px 24px;
                                     transition: background-color .15s ease, border-color .15s ease; }
  main.wide ul.rows.apps-grid li a strong { font-size: 17px; }
  main.wide ul.rows.apps-grid li a .muted { text-align: left; margin-top: 10px; line-height: 1.5; }
  main.wide ul.rows.apps-grid li a:hover { background: #8881; border-color: #8886; }
  main.wide ul.rows.apps-grid li a:active { background: #8882; }

  main.wide .page-form { max-width: 460px; }
  .pair { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); }
  main.wide .page-form form { max-width: none; }

  main.wide ul.rows { margin-bottom: 32px; }
}

.scroll { overflow-x: auto; margin-bottom: 32px; }
.scroll.with-menus { overflow: visible; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th { text-align: left; font-weight: 600; opacity: .6; font-size: 13px;
                padding: 8px 12px 8px 0; border-bottom: 1px solid #8883; white-space: nowrap; }
table.grid td { padding: 12px 12px 12px 0; border-bottom: 1px solid #8883; vertical-align: middle; }
table.grid td:last-child, table.grid th:last-child { padding-right: 0; text-align: right; }
table.grid input[type="checkbox"] { width: auto; display: inline-block; margin: 0; }
table.grid td.actions { white-space: nowrap; }
.cards { list-style: none; margin: 0 0 var(--gap); padding: 0; display: grid; gap: 12px;
         grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); align-items: stretch; }
.card-row { position: relative; display: flex; align-items: center; gap: 10px;
            min-height: 76px;
            border: 1px solid #8883; border-radius: 12px; padding: 12px 14px; }
.card-row:hover { border-color: #8886; background: #8881; }
.card-body { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px 16px;
             align-items: baseline; justify-content: space-between;
             color: inherit; text-decoration: none; }
.card-main { display: flex; flex-direction: column; gap: 4px; min-width: 0;
             overflow-wrap: anywhere; }
.card-aside { display: flex; flex-direction: column; gap: 4px; min-width: 0; text-align: right;
              margin-left: auto; }
.card-aside > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
                     max-width: 100%; }
.card-row .row-menu { flex: none; }

.row-menu > summary { display: inline-flex; align-items: center; justify-content: center;
                     width: 34px; height: 34px; border-radius: 9px; background: #8883;
                     cursor: pointer; list-style: none; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu > summary:hover { background: #8885; }
.row-menu[open] > summary { background: #8885; }
.row-menu-items { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.row-menu[open] > .row-menu-items { position: absolute; right: 0; top: calc(100% + 6px);
    z-index: 6; width: max-content; max-width: calc(100vw - 2 * var(--gap));
    padding: 8px; background: var(--raised); border: 1px solid var(--raised-edge);
    border-radius: 10px; box-shadow: 0 12px 30px #0006; flex-wrap: nowrap; }
.row-menu { position: relative; }
@media (min-width: 720px) {
  .row-menu[open] > .row-menu-items { top: auto; bottom: calc(100% + 6px); }
}
table.grid td.actions .inline { margin: 0 0 0 6px; }
.icon-action { display: inline-flex; align-items: center; justify-content: center;
               width: 34px; height: 34px; padding: 0; border: 0; border-radius: 9px;
               background: #8883; color: inherit; font: inherit; cursor: pointer;
               transition: background-color .15s ease, transform .07s ease; }
.icon-action:hover { background: #8885; }
.icon-action:active { transform: translateY(1px); }
.icon-action:focus-visible { outline: 2px solid #0a84ff; outline-offset: 2px; }
.icon-action.danger { background: #ff3b3022; color: #ff3b30; }
.icon-action.danger:hover { background: #ff3b3038; }
.icon-action svg { display: block; }
table.grid form { max-width: none; margin: 0; }
table.grid select { display: inline-block; width: auto; height: 34px; margin: 0;
                    padding: 6px 8px; border: 1px solid #8886; border-radius: 8px;
                    background: transparent; color: inherit; font: inherit; font-size: 13px;
                    vertical-align: middle; }
table.grid td.actions > *, table.grid td.actions .inline { vertical-align: middle; }

.heading { display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
           justify-content: space-between; }
.heading > * { min-width: 0; }
.heading h1 { margin-bottom: 0; }
.install-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
                align-items: stretch; gap: 8px; }
.install-row .button { width: 100%; min-width: 0; margin: 0;
                       padding-left: 10px; padding-right: 10px; font-size: 14px;
                       overflow-wrap: anywhere; }

.share { margin-top: 12px; text-align: center; }
.share label { display: block; margin-bottom: 6px; }
.qr { width: 200px; max-width: 100%; margin: 0 auto; padding: 10px; border-radius: 12px; background: #fff; }
.qr svg { display: block; width: 100%; height: auto; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

@media (min-width: 720px) {
}

@media (max-width: 719px) {
  .card-body { flex-direction: column; align-items: stretch; gap: 6px; }
  .card-aside { margin-left: 0; text-align: left; flex-direction: row; flex-wrap: wrap;
                align-items: baseline; gap: 2px 10px; }
  .card-aside > span { white-space: normal; font-size: 14px; }

  form input, form select, form textarea,
  .field-row input, table.grid select,
  input.mono, textarea.mono { font-size: 16px; }

  .scroll { overflow-x: visible; }
  table.grid, table.grid tbody, table.grid tr, table.grid td { display: block; width: 100%; }
  table.grid thead { display: none; }
  table.grid tr { border: 1px solid #8883; border-radius: 12px; padding: 12px 14px;
                  margin-bottom: 12px; }
  table.grid td { border: 0; padding: 5px 0; display: flex; gap: 14px; align-items: baseline;
                  justify-content: space-between; text-align: right; overflow-wrap: anywhere; }
  table.grid td::before { content: attr(data-label); flex: none; opacity: .6; font-size: 13px;
                          text-align: left; }
  table.grid td:last-child, table.grid th:last-child { padding-right: 0; }
  table.grid td.actions { justify-content: flex-end; padding-top: 10px; }

  dialog.sheet { position: fixed; inset: 0; margin: 0; width: 100%; max-width: none;
                 height: 100dvh; max-height: none; border: 0; border-radius: 0;
                 padding: var(--gap); overflow-y: auto; box-shadow: none; }
  dialog.sheet::backdrop { background: Canvas; }
  .sheet-head { position: sticky; top: calc(var(--gap) * -1); background: Canvas; z-index: 2;
                padding: var(--gap) 0; margin: calc(var(--gap) * -1) 0 var(--gap); }
  .sheet-head h2 { flex: 1 1 auto; min-width: 0; }
  .sheet-close { order: -1; }

  .side { position: fixed; inset: 0; z-index: 30; width: auto; background: Canvas;
          border-right: 0; display: none; padding: var(--gap); }
  body.menu-open .side { display: flex; }
  body.menu-open main { display: none; }
  .burger { display: inline-flex; }
  .topbar { position: sticky; top: calc(var(--gap) * -1); z-index: 5; background: Canvas;
            padding: var(--gap) 0; margin: calc(var(--gap) * -1) 0 var(--gap); }
  .topbar-actions { position: fixed; left: var(--gap); right: var(--gap);
                    bottom: var(--gap); z-index: 10; }
  .topbar-actions .button { width: 100%; }
  main { padding-bottom: 76px; }
}
