:root {
  --border: #d9dee3;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-dark: #1e40af;
  --bg: #f7f8fa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

body.embedded {
  background: #fff;
}

.launcher-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.launcher-header h1 {
  font-size: 20px;
  margin-bottom: 4px;
}

.button-row {
  display: flex;
  gap: 12px;
  margin: 24px 0 12px;
}

.btn {
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-view {
  background: #e5e7eb;
  color: var(--text);
}

.btn-view:hover {
  background: #d1d5db;
}

.btn-edit {
  background: var(--accent);
  color: #fff;
}

.btn-edit:hover {
  background: var(--accent-dark);
}

.edge-case {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 4px;
}

.edge-case a {
  color: var(--accent);
}

.window-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.window {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.window-label {
  background: #f1f3f5;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
}

.window iframe {
  width: 100%;
  border: none;
  display: block;
}

.window-frame-small {
  height: 160px;
}

.window-frame-medium {
  height: 320px;
}

.window-frame-large {
  height: 560px;
}

.fees-wrap {
  padding: 20px 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.fees-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.fees-header h2 {
  font-size: 16px;
  margin: 0;
}

.role-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.role-read {
  background: #e5e7eb;
  color: #374151;
}

.role-edit {
  background: #dbeafe;
  color: var(--accent-dark);
}

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

.fee-table th, .fee-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.fee-table input[type="number"] {
  width: 90px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.fee-table input[type="text"] {
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.error, .empty {
  color: var(--muted);
  font-size: 14px;
}

.success {
  color: #15803d;
  font-size: 13px;
  font-weight: 600;
}

.muted {
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
}

.rule-section {
  margin-bottom: 28px;
}

.rule-section h3 {
  font-size: 14px;
  margin: 0 0 8px;
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-link {
  border: none;
  background: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.btn-link:hover {
  color: var(--accent-dark);
}

.add-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.add-form select,
.add-form input[type="text"],
.add-form input[type="number"] {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
}

.add-form .btn {
  padding: 6px 14px;
}

.history-table {
  font-size: 13px;
}

.status-active {
  color: #15803d;
  font-weight: 600;
}

.status-disabled {
  color: var(--muted);
}
