@font-face {
  font-family: "Ergosy";
  src:
    url("/asset/font/ergosy-regular.woff2") format("woff2"),
    url("/asset/font/ergosy-regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Avenir Next";
  src: local("Avenir Next"), local("AvenirNext-Regular"), local("Avenir Next Regular");
  font-weight: 400;
  font-style: normal;
}

:root {
  --paper: #e6e7eb;
  --ink: #183028;
  --drawer-width: 240px;
  --drawer-move: 0ms cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow-x: hidden;
}

html {
  padding: 0;
  background: linear-gradient(120deg, #e1f0f9, #d1e4f0);
  transition: padding var(--drawer-move), background var(--drawer-move);
}

body {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding-right: 0;
  border-radius: 0;
  background: linear-gradient(120deg, #e1f0f9, #d1e4f0);
  color: var(--ink);
  font-family: "Ergosy", sans-serif;
  font-weight: 400;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  transition: border-radius var(--drawer-move);
}

html.is-drawer-open,
html.is-drawer-animating {
  background: linear-gradient(120deg, #9eb8cc, #8aa8c0);
}

html.is-drawer-open {
  padding: 4px var(--drawer-width) 4px 4px;
}

html.is-drawer-open body {
  border-radius: 16px;
}

#main_left_panel {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 46px;
  padding: 0 28px;
  background: transparent;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  transition: top var(--drawer-move);
}

html.is-drawer-open #main_top_nav {
  top: 4px;
}

.site-nav::before,
.site-nav::after {
  content: "";
  position: absolute;
  z-index: 0;
  width: 16px;
  height: 16px;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--drawer-move);
}

.site-nav::before {
  top: 0;
  left: 0;
  background: radial-gradient(circle at 100% 100%, transparent 16px, #9eb8cc 16.5px);
}

.site-nav::after {
  top: 0;
  right: 0;
  background: radial-gradient(circle at 0 100%, transparent 16px, #9eb8cc 16.5px);
}

html.is-drawer-open .site-nav::before,
html.is-drawer-open .site-nav::after {
  opacity: 1;
}

.site-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.site-logo {
  display: block;
  width: auto;
  height: 28px;
}

.site-name {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  color: #183028;
  font-family: "Ergosy", sans-serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0.12em;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.site-name-short {
  display: none;
}

.site-account {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 16px;
  color: #183028;
  text-decoration: none;
  white-space: nowrap;
}

.site-account-label {
  font-family: "Avenir Next", Avenir, sans-serif;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.04em;
  color: inherit;
  text-decoration: none;
}

.site-account-label:hover {
  color: #0070C0;
}

.site-account-tail {
  display: none;
}

html.is-authed .site-account-label {
  display: none;
}

html.is-authed .site-account-tail {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 20px;
  margin: 0;
  padding: 0;
  color: #183028;
}

.nav-pill {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 0;
  width: 48px;
  height: 26px;
  margin-top: -13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
  transition:
    transform 300ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity 240ms ease;
}

html.is-authed .site-account-tail.is-hovering .nav-pill {
  opacity: 1;
}

.site-account-pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  margin: 0;
  padding: 0 12px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-family: "Avenir Next", Avenir, sans-serif;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #183028;
}

.site-account-name {
  color: inherit;
}

.site-account-marks {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  width: 16px;
  margin-left: 2px;
}

.site-account-marks span {
  display: block;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
}

.site-account-marks span:nth-child(1),
.site-account-marks span:nth-child(2) {
  width: 16px;
}

.site-account-marks span:nth-child(3) {
  width: 9px;
}

.nav-icon,
.dev-line-toggle,
.site-account-search,
.site-account-alert {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 46px;
  margin: 0;
  padding: 0 8px;
  border: none;
  background: transparent;
  color: #5c5c5c;
  line-height: 0;
  appearance: none;
}

.site-account-avatar {
  position: relative;
  z-index: 1;
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 46px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #5c5c5c;
  line-height: 0;
  cursor: pointer;
  appearance: none;
}

html.is-drawer-open .site-account-pill {
  display: none;
}

html.is-drawer-open .site-account-avatar {
  display: inline-flex;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.dev-line-toggle,
.site-account-search,
.site-account-alert {
  cursor: pointer;
}

.nav-icon svg,
.dev-line-toggle svg,
.site-account-search svg,
.site-account-alert svg,
.site-account-avatar svg,
.site-account-gear,
.site-account-expense {
  display: block;
  width: 20px;
  height: 20px;
}

.dev-line-toggle[aria-pressed="true"] {
  color: #183028;
}

html:not(.is-admin) .dev-line-toggle {
  display: none;
}

.ws-tag {
  display: none;
  position: absolute;
  top: 0;
  right: 8px;
  transform: translateY(-50%);
  margin: 0;
  padding: 0 4px;
  background: #d8ebf4;
  color: #7aa7c4;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.02em;
}

html.has-dev-lines .ws-tag {
  display: block;
}

#main_left_panel > .ws-tag {
  right: auto;
  left: 50%;
  transform: translate(-50%, -50%);
}

#main_right_sidebrowser > .ws-tag {
  right: auto;
  left: 0;
  top: 50%;
  transform: translate(-50%, -50%);
}

html.has-dev-lines #main_left_panel,
html.has-dev-lines .site-nav,
html.has-dev-lines #main_browser,
html.has-dev-lines .page-footer,
html.has-dev-lines #main_right_sidebrowser,
html.has-dev-lines #profile_menu {
  outline: 1px dashed #7aa7c4;
  outline-offset: -1px;
}

html.has-dev-lines body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  background:
    linear-gradient(#7aa7c4, #7aa7c4) center / 1px 100% no-repeat,
    linear-gradient(#7aa7c4, #7aa7c4) center / 100% 1px no-repeat;
  transition: right var(--drawer-move);
}

html.is-drawer-open.has-dev-lines body::after {
  right: var(--drawer-width);
}

.hello {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  min-height: 0;
  text-align: center;
}

.hello p {
  margin: 0;
  font-size: 32px;
  line-height: 1.3;
  letter-spacing: 0.04em;
}

.page-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  margin: 0;
  padding: 0 16px;
  text-align: center;
  pointer-events: none;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

.page-footer::before,
.page-footer::after {
  content: "";
  position: absolute;
  z-index: 0;
  width: 16px;
  height: 16px;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--drawer-move);
}

.page-footer::before {
  bottom: 0;
  left: 0;
  background: radial-gradient(circle at 100% 0, transparent 16px, #9eb8cc 16.5px);
}

.page-footer::after {
  bottom: 0;
  right: 0;
  background: radial-gradient(circle at 0 0, transparent 16px, #9eb8cc 16.5px);
}

html.is-drawer-open .page-footer::before,
html.is-drawer-open .page-footer::after {
  opacity: 1;
}

.page-footer p {
  margin: 0;
  color: rgba(24, 48, 40, 0.42);
  font-family: "Ergosy", sans-serif;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.04em;
}

.site-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: var(--drawer-width);
  max-width: 600px;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 4px;
  background: linear-gradient(120deg, #9eb8cc, #8aa8c0);
  transform: translateX(100%);
  transition: transform var(--drawer-move), width var(--drawer-move);
  pointer-events: none;
}

html.is-drawer-open .site-drawer {
  transform: translateX(0);
  pointer-events: auto;
}

.profile-menu-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 32px;
}

.profile-menu-who {
  min-width: 0;
  flex: 1;
}

.profile-menu-name {
  margin: 0;
  color: #183028;
  font-family: "Avenir Next", Avenir, sans-serif;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.profile-menu-role {
  margin: 2px 0 0;
  color: rgba(24, 48, 40, 0.55);
  font-family: "Avenir Next", Avenir, sans-serif;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.site-drawer-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.site-drawer-close img {
  display: block;
  width: 100%;
  height: 100%;
}

.site-drawer .ui-card {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  height: auto;
  min-height: 0;
  border: none;
  border-radius: 16px;
  padding: 20px;
  background: linear-gradient(120deg, #ffffff, #f4f6f8);
  box-shadow:
    6px 8px 10px rgba(120, 145, 165, 0.38),
    2px 4px 6px rgba(90, 115, 135, 0.22);
}

.profile-menu {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  min-height: 0;
}

html.is-drawer-open,
html.is-drawer-open body,
html.is-drawer-animating,
html.is-drawer-animating body {
  overflow-x: visible;
}

.site-drawer-seam {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -20px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
}

.site-drawer-tools {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  transform: translateX(-2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.site-drawer-seam:hover .site-drawer-tools,
html.is-drawer-dragging .site-drawer-tools {
  opacity: 1;
  pointer-events: auto;
}

html.is-drawer-dragging .site-drawer,
html.is-drawer-dragging body {
  transition: none;
}

.site-drawer-tool {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0.5px solid #c8c8c8;
  border-radius: 8px;
  background: #ffffff;
  color: #183028;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(180, 210, 230, 0.7);
  transition: transform 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.site-drawer-tool:hover {
  color: #3a7ca8;
  transform: scale(0.86);
  box-shadow: inset 0 1px 4px rgba(180, 210, 230, 0.9);
}

.site-drawer-tool[data-drawer-size="drag"] {
  cursor: ew-resize;
  touch-action: none;
}

.site-drawer-tool[data-drawer-size="drag"]:hover {
  transform: none;
}

.site-drawer-tool svg {
  display: block;
  width: 12px;
  height: 12px;
}

.site-drawer-tool[hidden] {
  display: none !important;
}

.site-drawer-item,
.site-drawer-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 12px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #183028;
  cursor: pointer;
  font-family: "Avenir Next", Avenir, sans-serif;
  font-size: 14px;
  line-height: 1;
  text-align: left;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.site-drawer-item svg,
.site-drawer-logout svg {
  width: 16px;
  height: 16px;
  color: #5c5c5c;
  transition: color 160ms ease;
}

.site-drawer-item:hover,
.site-drawer-logout:hover {
  background: rgba(158, 184, 204, 0.22);
  color: #0070c0;
}

.site-drawer-item:hover svg,
.site-drawer-logout:hover svg {
  color: #0070c0;
}

.site-drawer-logout {
  margin-top: 0;
}

@media (max-width: 520px) {
  .site-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 16px;
  }

  html.is-authed .site-nav {
    padding-right: 0;
  }

  .site-brand {
    grid-column: 2;
    justify-self: center;
  }

  .site-account {
    grid-column: 3;
    justify-self: end;
    margin-left: 0;
  }

  .site-name-full {
    display: none;
  }

  .site-name-short {
    display: inline;
    font-size: 18px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
  }

  .site-logo {
    height: 18px;
  }
}
