* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 14px;
  color: #201f1e;
  background: #fff;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  border-bottom: 1px solid #e1dfdd;
  background: #fff;
}

.app-title {
  font-size: 15px;
  font-weight: 600;
  color: #0078d4;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #605e5c;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: background-color 0.15s, color 0.15s;
}

.icon-btn:hover {
  background-color: #f3f2f1;
  color: #201f1e;
}

/* Content area padding */
#view-main,
#view-settings,
.loading,
.error-panel {
  padding: 14px 16px;
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #605e5c;
  font-size: 13px;
}

.loading[hidden] {
  display: none;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e1dfdd;
  border-top-color: #0078d4;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Email card */
.email-card {
  background: #f3f2f1;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 12px;
}

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #605e5c;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 10px;
}

.email-card .field-label:first-child {
  margin-top: 0;
}

.field-value {
  font-size: 13px;
  color: #201f1e;
  margin-top: 2px;
  word-break: break-word;
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 10px 16px;
  background-color: #0078d4;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s;
}

.btn-primary:hover:not(:disabled) {
  background-color: #106ebe;
}

.btn-primary:active:not(:disabled) {
  background-color: #005a9e;
}

.btn-primary:disabled {
  background-color: #c8c6c4;
  cursor: not-allowed;
}

.btn-link {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 6px;
  background: none;
  border: none;
  color: #0078d4;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  border-radius: 4px;
  transition: background-color 0.15s;
}

.btn-link:hover {
  background-color: #f3f2f1;
}

/* Status messages */
.status {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.4;
}

.status.success {
  background-color: #dff6dd;
  color: #107c10;
  border-left: 3px solid #107c10;
}

.status.error {
  background-color: #fde7e9;
  color: #a4262c;
  border-left: 3px solid #a4262c;
}

/* Settings view */
.settings-intro {
  margin: 0 0 14px;
  font-size: 13px;
  color: #605e5c;
  line-height: 1.5;
}

.text-input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid #8a8886;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  color: #201f1e;
  background: #fff;
  transition: border-color 0.15s;
}

.text-input:focus {
  outline: none;
  border-color: #0078d4;
  box-shadow: 0 0 0 1px #0078d4;
}

.text-input::placeholder {
  color: #a19f9d;
}

.settings-actions {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
}

/* Error panel */
.error-panel {
  background-color: #fde7e9;
  color: #a4262c;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.4;
}
