:root {
  --primary: #000;
  --secondary: #e1e1e1;
  --gray: #818181;
  --button: #191919;
  --button-hover: #242424;
  --button-press: #2a2a2a;
  --button-text: #e1e1e1;
  --button-stroke: rgba(255, 255, 255, 0.05);
  --sidebar-bg: #131313;
  --input-border: #383838;
  --popup-bg: #191919;
  --popup-stroke: rgba(255, 255, 255, 0.08);
  --border-radius: 11px;
  --padding: 12px;
  --sidebar-width: 80px;
  --font: "IBM Plex Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  display: flex;
  min-height: 100vh;
  font-family: var(--font);
  font-weight: 500;
  color: var(--secondary);
  background: #000;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

/* —— sidebar —— */

.sidebar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  width: calc(var(--sidebar-width) + 8px);
  min-height: 100vh;
  padding: 8px 4px;
  background: var(--sidebar-bg);
}

.side-logo {
  display: grid;
  place-items: center;
  height: 42px;
  margin: 2px 4px 8px;
  color: var(--secondary);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.02em;
  border-radius: 10px;
}

.side-logo:hover {
  background: var(--button-hover);
}

.side-tabs {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  padding-bottom: 6px;
}

.side-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-tab {
  display: grid;
  place-items: center;
  gap: 3px;
  width: 100%;
  padding: 10px 4px 8px;
  color: var(--gray);
  text-decoration: none;
  border-radius: 12px;
  font-size: 11px;
  position: relative;
}

.side-tab svg {
  width: 22px;
  height: 22px;
}

.side-tab.is-active {
  color: var(--secondary);
  background: #1c1c1c;
}

.side-tab:not(:disabled):not(.is-active):hover {
  color: var(--secondary);
  background: #181818;
}

.side-tab em {
  position: absolute;
  top: 4px;
  right: 4px;
  font-style: normal;
  font-size: 8px;
  color: #000;
  background: #e1e1e1;
  border-radius: 999px;
  padding: 1px 4px;
  line-height: 1.2;
}

.side-tab.is-soon.is-active {
  color: var(--secondary);
}

/* —— app shell —— */

.app {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #000;
}

.view {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 100%;
  padding: var(--padding);
}

.view.is-shown {
  display: flex;
}

.top-bar {
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 3;
}

.services {
  position: relative;
}

.services-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--button);
  box-shadow: 0 0 0 1px var(--button-stroke) inset;
  color: var(--button-text);
  font-size: 12px;
}

.services-btn:hover {
  background: var(--button-hover);
}

.services-plus {
  font-size: 14px;
  line-height: 1;
}

.services-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 360px);
  padding: 12px;
  border-radius: var(--border-radius);
  background: var(--popup-bg);
  border: 1px solid var(--popup-stroke);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.services-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  max-height: 220px;
  overflow: auto;
}

.services-list span {
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--button-elevated, #282828);
  font-size: 12px;
  color: var(--secondary);
}

.services-note {
  font-size: 11px;
  color: var(--gray);
  line-height: 1.4;
}

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  width: 100%;
  padding: 24px 0 40px;
}

.mascot {
  width: clamp(130px, 22vw, 180px);
  height: auto;
  user-select: none;
  pointer-events: none;
}

.mascot-dim {
  opacity: 0.55;
}

.omnibox {
  display: flex;
  flex-direction: column;
  width: min(100%, 640px);
  gap: 6px;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 10px;
  border-radius: var(--border-radius);
  outline: 1.5px solid var(--input-border);
  outline-offset: -1.5px;
  background: transparent;
}

.input-row.is-focused {
  outline: 2px solid var(--secondary);
  outline-offset: -1px;
}

.input-row.is-ready {
  outline-color: var(--secondary);
}

.input-icon {
  display: grid;
  place-items: center;
  color: var(--gray);
  flex-shrink: 0;
}

.input-icon svg {
  width: 18px;
  height: 18px;
}

.input-row.is-focused .input-icon,
.input-row.is-ready .input-icon {
  color: var(--secondary);
}

#link {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 0;
}

#link::placeholder {
  color: var(--gray);
  opacity: 1;
}

.icon-btn,
.dl-go {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex-shrink: 0;
  background: var(--button);
  color: var(--button-text);
  font-size: 18px;
  line-height: 1;
}

.icon-btn:hover,
.dl-go:hover {
  background: var(--button-hover);
}

.dl-go {
  background: var(--secondary);
  color: #000;
  font-size: 16px;
  font-weight: 600;
}

.dl-go:hover {
  background: #fff;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.switcher {
  display: inline-flex;
  gap: 3.5px;
  padding: 3.5px;
  border-radius: 999px;
  background: var(--button);
  box-shadow: 0 0 0 1px var(--button-stroke) inset;
}

.mode {
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--gray);
  font-size: 13px;
}

.mode:hover {
  color: var(--secondary);
}

.mode.is-on {
  color: #000;
  background: var(--secondary);
}

.paste {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--button);
  box-shadow: 0 0 0 1px var(--button-stroke) inset;
  color: var(--button-text);
  font-size: 13px;
}

.paste:hover {
  background: var(--button-hover);
}

.status {
  margin-top: 4px;
  font-size: 12px;
  color: var(--gray);
  text-align: center;
  min-height: 1.2em;
}

.status.is-error {
  color: #ed2236;
}

.status.is-ok {
  color: #37aa42;
}

.terms {
  text-align: center;
  color: var(--gray);
  font-size: 12px;
  padding-bottom: 6px;
}

.stage-soon {
  gap: 10px;
  text-align: center;
}

.soon-title {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.soon-text {
  font-size: 1.1rem;
  color: var(--secondary);
}

.soon-sub {
  max-width: 34ch;
  color: var(--gray);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 8px;
}

/* —— settings —— */

.settings {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 18px 8px 40px;
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.settings-title {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 0;
}

.settings-block {
  margin-bottom: 1.35rem;
  padding: 4px 0 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-block h2 {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray);
  text-transform: lowercase;
  letter-spacing: 0.04em;
  margin: 0.9rem 0 0.55rem;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.9rem;
  margin-bottom: 0.4rem;
  background: var(--button);
  border-radius: var(--border-radius);
  box-shadow: 0 0 0 1px var(--button-stroke) inset;
}

.settings-row span {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.settings-row strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
}

.settings-row small {
  font-size: 11px;
  color: var(--gray);
  line-height: 1.35;
}

.settings-row select {
  flex-shrink: 0;
  max-width: 9rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: #0d0d0d;
  color: var(--secondary);
  outline: none;
}

.settings-row input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--secondary);
  flex-shrink: 0;
}

.settings-foot {
  margin-top: 0.5rem;
  font-size: 11px;
  color: var(--gray);
  line-height: 1.4;
}

@media (max-width: 560px) {
  body {
    flex-direction: column-reverse;
  }

  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    min-height: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .side-logo {
    display: none;
  }

  .side-tabs {
    flex-direction: row;
    width: 100%;
    justify-content: space-between;
    padding-bottom: 0;
  }

  .side-group {
    flex-direction: row;
  }

  .side-tab span,
  .side-tab em {
    display: none;
  }

  .app {
    padding-bottom: 64px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .switcher {
    justify-content: space-between;
  }

  .paste {
    width: 100%;
  }

  .settings-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .settings-row select {
    max-width: none;
    width: 100%;
  }
}
