:root {
  --bg: #e6e7eb;
  --card: #ffffff;
  --ink: #1b1631;
  --muted: #4d4368;
  --line: #bcb1e8;
  --header: #4b2ea8;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background: #e6e7eb;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1760px;
  margin: 0 auto;
  padding: 12px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: #4b2ea8;
  color: #f4efff;
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid #a88ff5;
  box-shadow:
    0 10px 24px rgba(48, 28, 119, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.14rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #efe8ff;
  box-shadow: 0 0 0 4px rgba(194, 174, 255, 0.28);
}

.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.menu a {
  color: #f4efff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.menu a:hover,
.menu a.active {
  border-color: #a88ff5;
  background: rgba(194, 174, 255, 0.22);
}

.tool-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.tool-menu a {
  text-decoration: none;
  font-size: 0.88rem;
  color: #2f2551;
  border: 1px solid #cabef2;
  border-radius: 10px;
  padding: 6px 11px;
  background: #f8f5ff;
  font-weight: 600;
}

.tool-menu a:hover,
.tool-menu a.active {
  color: #fff;
  border-color: transparent;
  background: #4b2ea8;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 14px 30px rgba(19, 22, 28, 0.1);
}

h1 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: clamp(1.5rem, 1.4vw + 1rem, 2.2rem);
  letter-spacing: -0.02em;
}

h2 {
  margin: 14px 0 6px;
}

p, li {
  margin: 0 0 9px;
  line-height: 1.55;
  color: var(--muted);
}

ul {
  margin: 0;
  padding-left: 18px;
}

textarea, input, select {
  width: 100%;
  border: 1px solid #414043;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 0.92rem;
  color: var(--ink);
  background: #ffffff;
}

textarea {
  min-height: 170px;
  resize: vertical;
  font: 0.9rem/1.45 Consolas, "Courier New", monospace;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.small-note {
  color: var(--muted);
  font-size: 0.84rem;
}

button, .btn {
  border-radius: 10px;
  border: 1px solid #cabef2;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  padding: 8px 11px;
  font-size: 0.88rem;
  cursor: pointer;
}

button:active,
.btn:active,
button:focus,
.btn:focus,
button:focus-visible,
.btn:focus-visible {
  background: #4b2ea8;
  color: #fff;
  border-color: transparent;
}

.btn-primary {
  border-color: transparent;
  background: #4b2ea8;
  color: #fff;
  font-weight: 700;
}

.notice {
  margin-top: 10px;
  color: #4d525d;
  font-size: 0.9rem;
}

.notice.ok {
  border: 1px solid #bfc4cd;
  background: #f1f2f5;
  border-radius: 11px;
  padding: 9px 11px;
}

.notice.err {
  border: 1px solid #c5c9d3;
  background: #f1f2f5;
  color: #333740;
  border-radius: 11px;
  padding: 9px 11px;
}

.footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: #332b52;
  font-size: 0.84rem;
  border-top: 1px solid #cabef2;
  padding-top: 10px;
}

.footer a {
  color: #5533bf;
  text-decoration: none;
  margin-right: 10px;
}

.footer a:hover {
  text-decoration: underline;
}

@media (max-width: 760px) {
  .grid-two {
    grid-template-columns: 1fr;
  }
}
