:root {
  color-scheme: light;
  --ink: #141312;
  --muted: #68645d;
  --paper: #fffdf8;
  --panel: rgba(255, 255, 255, 0.76);
  --line: rgba(28, 24, 20, 0.12);
  --accent: #2563eb;
  --accent-strong: #1849b8;
  --warm: #f4b860;
  --shadow: 0 24px 70px rgba(24, 29, 44, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(244, 184, 96, 0.28), transparent 26rem),
    radial-gradient(circle at 88% 12%, rgba(37, 99, 235, 0.16), transparent 24rem),
    linear-gradient(145deg, #fbf6ec 0%, #eef5f8 52%, #f8faf7 100%);
}

button,
textarea {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 12px 36px rgba(30, 35, 50, 0.08);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #ffffff;
  background: linear-gradient(145deg, var(--accent), #111827);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 8px 18px rgba(37, 99, 235, 0.24);
}

.status {
  max-width: 32vw;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

textarea:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.26);
  outline-offset: 3px;
}

.editor-wrap {
  min-height: 0;
  padding: clamp(12px, 2vw, 22px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

textarea {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 150px);
  resize: none;
  border: 0;
  border-radius: 22px;
  padding: clamp(20px, 4vw, 48px);
  color: var(--ink);
  background:
    linear-gradient(rgba(20, 19, 18, 0.055) 1px, transparent 1px) 0 47px / 100% 32px,
    rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.55;
}

textarea::placeholder {
  color: rgba(104, 100, 93, 0.62);
}

@media (max-width: 680px) {
  .shell {
    width: min(100vw - 18px, 1120px);
    padding: 9px 0;
    gap: 9px;
  }

  .topbar {
    align-items: center;
    border-radius: 20px;
  }

  .brand {
    font-size: 20px;
  }

  .status {
    max-width: 42vw;
  }

  .editor-wrap {
    border-radius: 22px;
  }

  textarea {
    min-height: calc(100vh - 158px);
    border-radius: 16px;
  }
}
