:root {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --border: #dadce0;
  --text: #202124;
  --muted: #5f6368;
  --primary: #0f6cbd;
  --primary-hover: #115ea3;
  --green-bg: #e6f4ea;
  --green-fg: #137333;
  --amber-bg: #fef7e0;
  --amber-fg: #b06000;
  --red-bg: #fce8e6;
  --red-fg: #c5221f;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 12px;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg);
}

.app {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 16px;
}

.header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

h1 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #e8f0fe;
  color: var(--primary);
}

.header-actions {
  margin-top: 10px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

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

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

.small {
  font-size: 12px;
  margin: 4px 0 8px;
}

.btn {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
}

.btn:hover:not(:disabled) {
  background: #f1f3f4;
}

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

.btn-primary {
  width: 100%;
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface);
}

.btn-sm {
  padding: 4px 8px;
  font-size: 11px;
}

.sections-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-row {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  background: #ffffff;
}

.section-row.is-off {
  background: #fafafa;
}

.section-meta {
  min-width: 0;
  flex: 1;
}

.section-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 2px;
}

.section-desc {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 6px;
}

.section-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.pill-on {
  background: var(--green-bg);
  color: var(--green-fg);
}

.pill-off {
  background: var(--amber-bg);
  color: var(--amber-fg);
}

.pill-missing {
  background: var(--red-bg);
  color: var(--red-fg);
}

.section-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #bdc1c6;
  transition: 0.2s;
  border-radius: 22px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:disabled + .slider {
  opacity: 0.5;
  cursor: not-allowed;
}

input:checked + .slider:before {
  transform: translateX(18px);
}

.wrap-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wrap-form input {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
}

.storage-details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}

.storage-info pre {
  margin: 8px 0 0;
  padding: 8px;
  background: #f1f3f4;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 11px;
}

.guide-list {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--muted);
}

.guide-list li + li {
  margin-top: 4px;
}

.toast {
  position: sticky;
  bottom: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  background: #202124;
  color: #ffffff;
}

.toast.is-error {
  background: var(--red-fg);
}
