* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  background: #f5f5f5;
  color: #333;
}

.appearance-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.settings-sidebar {
  width: 220px;
  background: #ffffff;
  border-right: 1px solid #e0e0e0;
  overflow-y: auto;
  flex-shrink: 0;
}

.embedded .settings-sidebar {
  display: none;
}

.settings-nav {
  padding: 15px 0;
}

.settings-nav-item {
  display: block;
  padding: 10px 20px;
  color: #333;
  text-decoration: none;
  font-size: 13px;
  transition: background 0.2s;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.settings-nav-item:hover {
  background: #f5f5f5;
}

.settings-nav-section {
  margin-top: 5px;
}

.settings-nav-item.active-section {
  font-weight: 600;
  color: #2c5282;
  background: #e6f2ff;
  border-left-color: #4a90e2;
  cursor: default;
}

.settings-nav-subitem {
  display: block;
  padding: 8px 20px 8px 40px;
  color: #666;
  text-decoration: none;
  font-size: 12px;
  transition: all 0.2s;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.settings-nav-subitem:hover {
  background: #f5f5f5;
  color: #333;
}

.settings-nav-subitem.active {
  background: #e6f2ff;
  color: #2c5282;
  font-weight: 500;
  border-left-color: #4a90e2;
}

.appearance-main {
  flex: 1;
  background: #ffffff;
  overflow-y: auto;
  padding: 20px 30px;
}

.embedded .appearance-container {
  height: 100%;
}

.embedded .appearance-main {
  width: 100%;
}

.appearance-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.appearance-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.appearance-subtitle {
  margin: 5px 0 0;
  color: #555;
  font-size: 13px;
  line-height: 1.5;
}

.appearance-actions {
  display: flex;
  gap: 10px;
}

.appearance-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.appearance-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.appearance-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: #2d3748;
}

.appearance-card p {
  margin: 0 0 12px;
  color: #555;
  font-size: 13px;
  line-height: 1.5;
}

.appearance-meta {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px 12px;
  font-size: 12px;
  color: #555;
  margin-top: 10px;
}

.appearance-preview-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  align-items: center;
}

.favicon-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px dashed #cbd5e0;
  border-radius: 6px;
  background: #f8fafc;
}

.favicon-preview img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: white;
}

.favicon-preview .favicon-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #444;
}

.upload-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upload-field label {
  font-size: 12px;
  color: #555;
  font-weight: 600;
}

.upload-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-control input[type='file'] {
  font-size: 12px;
}

.helper-text {
  color: #666;
  font-size: 12px;
  line-height: 1.5;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #2c5282;
  color: #fff;
  border-color: #2c5282;
}

.btn-primary:hover {
  background: #24446c;
}

.btn-secondary {
  background: #fff;
  color: #2c5282;
  border-color: #cbd5e0;
}

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

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

.status-banner {
  padding: 10px 12px;
  background: #f0fff4;
  border: 1px solid #c6f6d5;
  color: #2f855a;
  border-radius: 6px;
  font-size: 12px;
  margin-top: 10px;
}

.favicon-previews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.preview-card {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
}

.preview-card h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #2d3748;
}

.preview-card .preview-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.preview-card .preview-box img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.preview-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 1px dashed #cbd5e0;
  color: #718096;
  font-size: 11px;
  background: #fff;
}

.apply-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.notice {
  margin: 0;
  font-size: 12px;
  color: #666;
}

