:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #667085;
  --line: #d9dee7;
  --primary: #116a7b;
  --primary-dark: #0d5260;
  --danger: #b42318;
  --warning: #a15c07;
  --ok: #067647;
  --shadow: 0 14px 34px rgba(22, 34, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--primary-dark);
}

button.secondary {
  color: var(--text);
  background: #e8edf2;
}

button.secondary:hover {
  background: #d8e0e8;
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: #8f1d14;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--text);
  background: #fff;
}

input[readonly],
textarea[readonly] {
  background: #f8fafc;
  color: #475467;
}

textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 30px;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.login-panel,
.editor,
.list-panel,
.new-key,
.public-key-reveal,
.public-key-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-panel {
  width: min(430px, 100%);
  margin: 12vh auto 0;
  padding: 28px;
}

.login-form,
#licenseForm {
  display: grid;
  gap: 14px;
}

.login-form {
  margin-top: 28px;
}

.message {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.message.error {
  color: var(--danger);
}

.message.ok {
  color: var(--ok);
}

.topbar,
.section-heading,
.new-key,
.license-head,
.license-actions,
.activation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  margin-bottom: 18px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.client-install-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.new-key {
  margin-bottom: 16px;
  padding: 14px;
  box-shadow: none;
}

.public-key-reveal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
}

.public-key-panel {
  margin-bottom: 16px;
  padding: 16px;
}

.public-key-panel textarea {
  min-height: 0;
  overflow: hidden;
  resize: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.new-key span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.new-key strong {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.editor,
.list-panel {
  padding: 18px;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading input {
  width: min(280px, 48vw);
}

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

.datetime-24 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px auto 76px;
  align-items: center;
  gap: 8px;
}

.datetime-24 span {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

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

.license-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.license-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.license-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 13px;
}

.license-key-row {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 12px;
}

.license-key-row span {
  font-weight: 800;
  text-transform: uppercase;
}

.license-key-row code {
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.license-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 10px;
  margin: 10px 0;
}

.license-detail-block {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.license-detail-block > span {
  font-weight: 800;
  text-transform: uppercase;
}

.license-detail-block > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.license-detail-block code {
  display: block;
  max-height: 130px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  color: var(--text);
  background: #f8fafc;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.license-detail-block em {
  color: var(--muted);
  font-style: normal;
}

.pill {
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef2f6;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.pill.ok {
  background: #dcfae6;
  color: var(--ok);
}

.pill.warn {
  background: #fef0c7;
  color: var(--warning);
}

.pill.bad {
  background: #fee4e2;
  color: var(--danger);
}

.license-id {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.license-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 12px;
}

.license-actions button,
.activation-row button {
  padding: 7px 10px;
  font-size: 12px;
}

.activations {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.activation-row {
  padding: 8px 0;
  border-bottom: 1px solid #edf1f5;
  color: var(--muted);
  font-size: 13px;
}

.activation-row:last-child {
  border-bottom: 0;
}

.activation-row code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
}

.empty-state {
  margin: 26px 0 0;
  color: var(--muted);
  text-align: center;
}

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

  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .client-install-actions,
  .section-heading input {
    width: 100%;
  }

  .topbar-actions button,
  .client-install-actions button {
    flex: 1;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100vw - 20px, 1180px);
    padding: 14px 0;
  }

  .login-panel,
  .editor,
  .list-panel,
  .public-key-reveal,
  .public-key-panel {
    padding: 14px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .datetime-24 {
    grid-template-columns: minmax(0, 1fr) 72px auto 72px;
  }

  .license-detail-grid {
    grid-template-columns: 1fr;
  }

  .new-key {
    align-items: stretch;
    flex-direction: column;
  }

  .client-install-actions {
    flex-direction: column;
  }
}
