* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f7fa;
  color: #1a1a2e;
  line-height: 1.6;
}

.container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: #666;
  margin-bottom: 2rem;
}

fieldset {
  border: 1px solid #dde1e6;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: #fff;
}

legend {
  font-weight: 600;
  font-size: 1.1rem;
  padding: 0 0.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

input[type="text"],
select,
textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
}

textarea {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.85rem;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #4a90d9;
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2);
}

.hint {
  font-size: 0.78rem;
  color: #888;
}

.hint.valid {
  color: #2e7d32;
}

.hint.invalid {
  color: #c62828;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: normal;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 500;
}

.btn-primary {
  background: #4a90d9;
  color: #fff;
  padding: 0.75rem 2rem;
  font-size: 1rem;
}

.btn-primary:hover {
  background: #357abd;
}

.btn-secondary {
  background: #e8ecf1;
  color: #333;
}

.btn-secondary:hover {
  background: #d0d5dd;
}

.btn-danger {
  background: #ef5350;
  color: #fff;
}

.btn-danger:hover {
  background: #c62828;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.account-row {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #fafbfc;
}

.account-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.account-header h3 {
  font-size: 1rem;
  color: #444;
}

.tag-row {
  align-items: center;
  margin-bottom: 0.5rem;
}

.tag-row .btn {
  align-self: center;
  margin-top: 0.25rem;
}

.errors {
  background: #fdecea;
  border: 1px solid #ef5350;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.errors p {
  color: #c62828;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  border-radius: 8px;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content h2 {
  color: #2e7d32;
  margin-bottom: 1rem;
}

.modal-content ul {
  list-style: none;
  padding: 0;
}

.modal-content li {
  padding: 0.35rem 0;
  border-bottom: 1px solid #eee;
}

.modal-content code {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.85rem;
  color: #333;
}

.mr-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  text-decoration: none;
  word-break: break-all;
}

.modal-content h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: #444;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.modal-actions {
  margin-top: 1.5rem;
  text-align: right;
}
