:root {
  color: #1a1a1a;
  background: #f6f3ef;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 28px 32px 8px;
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.top-actions select {
  width: 280px;
  margin-top: 0;
}

.whoami {
  color: #666;
  font-size: 13px;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(380px, 100%);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(80, 40, 0, 0.05);
}

.login-card h1 { margin-bottom: 8px; }

.dialog-body {
  max-height: calc(100vh - 48px);
  padding: 22px;
  overflow: auto;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.dialog-head h2 { margin: 0; font-size: 20px; }

.account-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fafafa;
}

.account-row .tag { margin-left: 6px; }

.account-row .meta { margin-top: 4px; }

.app-checks {
  margin: 12px 0 0;
  padding: 4px 12px 12px;
  border: 1px solid #eee;
  border-radius: 10px;
}

.app-checks legend {
  padding: 0 4px;
  color: #666;
  font-size: 13px;
}

#account-form .check { margin-top: 12px; }

.eyebrow {
  margin: 0;
  color: #ff6a00;
  font-size: 13px;
  font-weight: 600;
}

h1 {
  margin: 4px 0 0;
  font-size: 28px;
}

main { padding: 16px 32px 48px; }

.list {
  display: grid;
  gap: 12px;
}

.card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 18px 20px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(80, 40, 0, 0.05);
}

.title {
  margin: 0;
  font-size: 18px;
}

.meta {
  margin: 6px 0 0;
  color: #666;
  font-size: 14px;
}

.copy {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.link-ops {
  margin-top: 12px;
  flex-wrap: wrap;
}

.link-error { margin: 8px 0 0; }

.side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.tag {
  padding: 3px 8px;
  border-radius: 999px;
  background: #e9f8ef;
  color: #128a45;
  font-size: 12px;
}

.tag.off { background: #f3f3f3; color: #888; }
.tag.expired { background: #fff1f0; color: #c2410c; }

.ops { display: flex; gap: 8px; }

button, input, select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

.primary { background: #ff6a00; color: #fff; }
.ghost { background: #f3f3f3; color: #333; }
.danger { background: #fff; color: #b42318; }

.empty { color: #888; }

dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  border: 0;
  border-radius: 18px;
  padding: 0;
}

dialog::backdrop { background: rgba(0, 0, 0, 0.35); }

form {
  max-height: calc(100vh - 48px);
  padding: 22px;
  overflow: auto;
}

.group {
  margin: 18px 0 0;
  color: #1a1a1a;
  font-size: 14px;
  font-weight: 700;
}

form h2 { margin: 0 0 16px; font-size: 20px; }

label {
  display: block;
  margin-top: 12px;
  color: #666;
  font-size: 13px;
}

input, select, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fafafa;
}

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

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

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  color: #1a1a1a;
}

.check input { width: auto; margin: 0; }

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.error { color: #b42318; font-size: 13px; }

.note {
  display: block;
  margin-top: 6px;
  color: #888;
  font-size: 12px;
  line-height: 1.5;
}

.source-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.source-row input {
  flex: 1;
  width: auto;
}

.source-row button {
  flex: none;
  margin-top: 6px;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .top, main { padding-left: 16px; padding-right: 16px; }
  .top { align-items: stretch; flex-direction: column; }
  .top-actions { flex-wrap: wrap; }
  .top-actions select { width: 100%; }
  .card { grid-template-columns: 1fr; }
  .side { align-items: flex-start; }
  .row { grid-template-columns: 1fr; }
}
