* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: #111;
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 96px;
}

.console {
  min-height: calc(100vh - 140px);
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 24px;
}

.sidebar {
  position: sticky;
  top: 24px;
  align-self: start;
  min-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border: 1px solid #eee;
  border-radius: 22px;
  background: #fafafa;
}

.sidebar h2 {
  margin: 0 0 8px;
}

.sidebar nav {
  display: grid;
  gap: 6px;
  margin-top: 24px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  color: #555;
  font-size: 14px;
  font-weight: 600;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  color: #111;
  background: #fff;
  box-shadow: inset 0 0 0 1px #eee;
}

.workspace {
  min-width: 0;
}

.hero {
  min-height: calc(100vh - 160px);
  display: grid;
  align-content: center;
  gap: 18px;
}

.eyebrow {
  margin: 0;
  color: #999;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(38px, 7vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.07em;
}

h2 {
  margin-bottom: 16px;
  font-size: 20px;
  letter-spacing: -0.03em;
}

code {
  padding: 2px 5px;
  border-radius: 6px;
  background: #f5f5f5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.muted {
  max-width: 720px;
  margin-bottom: 0;
  color: #777;
  line-height: 1.7;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #111;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.button.ghost {
  color: #111;
  border: 1px solid #e7e7e7;
  background: #fff;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
}

.result {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  color: #333;
  background: #f7f7f7;
  white-space: pre-wrap;
  line-height: 1.7;
}

.message-list {
  display: grid;
  gap: 10px;
}

.message {
  padding: 12px;
  border: 1px solid #eee;
  border-radius: 12px;
}

.message p {
  margin-bottom: 8px;
  color: #333;
  white-space: pre-wrap;
}

.message span {
  color: #aaa;
  font-size: 12px;
}

.message.assistant {
  background: #fafafa;
}

.topbar,
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.panel {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid #eee;
  border-radius: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.card {
  display: grid;
  gap: 8px;
  min-height: 130px;
  padding: 20px;
  border: 1px solid #eee;
  border-radius: 18px;
}

.card strong {
  font-size: 22px;
}

.card span {
  color: #999;
  font-size: 13px;
}

.inline-form,
.record-form {
  display: grid;
  gap: 12px;
}

.inline-form {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
  color: #555;
  font-size: 13px;
}

.check {
  display: flex;
  align-items: center;
  gap: 7px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: #111;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  outline: none;
  font: inherit;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #111;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 12px 8px;
  border-top: 1px solid #eee;
  text-align: left;
  vertical-align: top;
}

th {
  color: #777;
  font-weight: 600;
}

.link-button {
  min-height: auto;
  padding: 0;
  color: #b42318;
  border-radius: 0;
  background: transparent;
}

footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 18px;
  text-align: center;
}

footer a {
  color: #aaa;
  font-size: 12px;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 24px, 1080px);
    padding-top: 32px;
  }

  .topbar,
  .panel-head,
  .console {
    display: grid;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }

  footer {
    position: static;
    padding-bottom: 18px;
  }
}
