:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --primary: #03c75a;
  --primary-hover: #02b350;
  --primary-light: #e8f9ef;
  --accent: #3b82f6;
  --accent-light: #eff6ff;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.studio-header {
  height: 64px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-badge {
  background: #0f172a;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}

.logo-title {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.system-status {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 20px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--primary);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px var(--primary);
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-md);
}

.nav-tab {
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-tab:hover {
  color: var(--text-main);
}

.nav-tab.active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.user-pill {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 6px 12px;
  border-radius: 20px;
}

/* Main Layout */
.studio-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
}

.panel-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.action-group {
  display: flex;
  gap: 8px;
}

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

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

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

.btn-secondary {
  background: #fff;
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover:not(:disabled) {
  background: #f8fafc;
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover:not(:disabled) {
  background: #f1f5f9;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover:not(:disabled) {
  background: #2563eb;
}

.btn-sm {
  font-size: 12px;
  padding: 6px 12px;
}

/* MYBOX Gallery */
.mybox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 6px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin: 10px 0;
}

.mybox-photo-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
  background: #000;
}

.mybox-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mybox-photo-item.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
}

.mybox-check-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  border: 1.5px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
}

.mybox-photo-item.selected .mybox-check-badge {
  background: var(--primary);
}

.mybox-photo-time {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 9px;
  padding: 2px 4px;
  text-align: center;
}

.mybox-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.small-text {
  font-size: 12px;
}

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

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #1e293b;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #475569;
}

.badge-success {
  background: var(--primary-light);
  color: var(--primary);
}

/* Grid Layouts */
.review-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 24px;
}

.column-left, .column-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Dropzone */
.dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.dropzone-text {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
}

.dropzone-subtext {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Privacy Toolbar */
.privacy-toolbar {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.privacy-switches {
  display: flex;
  gap: 14px;
}

.switch-label {
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* Thumbnail Grid */
.photo-thumbnail-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  min-height: 80px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
}

.thumbnail-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
  background: #000;
}

.thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: #fff;
  font-size: 10px;
  padding: 4px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.thumbnail-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(3, 199, 90, 0.9);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
}

.empty-hint {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 30px 0;
}

/* Forms */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.form-group input, .form-group textarea, .form-select {
  font-family: inherit;
  font-size: 13px;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease;
}

.form-group input:focus, .form-group textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(3, 199, 90, 0.1);
}

.title-input {
  font-size: 15px !important;
  font-weight: 700;
  color: #0f172a;
}

.tags-input {
  color: var(--accent) !important;
  font-weight: 600;
}

/* Editor View */
.block-editor-view {
  min-height: 280px;
  max-height: 520px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: #fafafa;
  font-size: 14px;
  line-height: 1.8;
}

.block-editor-view h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 18px 0 8px 0;
  color: #1e293b;
  border-left: 3px solid var(--primary);
  padding-left: 8px;
}

.block-editor-view p {
  margin-bottom: 14px;
  color: #334155;
}

.block-editor-view .info-box {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 14px 0;
  font-size: 13px;
  white-space: pre-line;
}

.editor-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.info-text {
  font-size: 12px;
  color: #475569;
}

/* Trend Layout */
.trend-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
}

.trend-sidebar {
  display: flex;
  flex-direction: column;
}

.trend-subtabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: var(--radius-sm);
}

.trend-subtab {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  border: none;
  padding: 6px 0;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
}

.trend-subtab.active {
  background: #fff;
  color: #0f172a;
  box-shadow: var(--shadow-sm);
}

.trend-item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
}

.trend-card-item {
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.trend-card-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}

.trend-card-item.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary);
}

.trend-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.trend-item-source {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
}

.trend-item-traffic {
  font-size: 10px;
  color: var(--text-muted);
}

.trend-item-keyword {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.photo-spot-box {
  background: #f0fdf4;
  border: 1px dashed var(--primary);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 12px 0;
  color: #166534;
  font-size: 13px;
}

.mybox-sub-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Label row with action button */
.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.place-group {
  position: relative;
}

/* Place Search Popup */
.place-search-popup {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  z-index: 200;
  margin-top: 6px;
}

.place-search-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.place-search-bar input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.place-search-results {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.place-apply-custom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: #166534;
  margin-bottom: 6px;
}

.place-item {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid #f1f5f9;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.15s ease;
}

.place-item:hover {
  background: #eff6ff;
  border-color: var(--accent);
}

.place-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.place-cat {
  font-size: 11px;
  font-weight: normal;
  color: var(--accent);
  margin-left: 4px;
}

.place-addr {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.search-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 12px 0;
}

/* Header Account Bar */
.account-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-selector-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.account-icon {
  font-size: 15px;
}

.account-select {
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  outline: none;
  max-width: 240px;
}

/* Action Buttons */
.btn-success {
  background-color: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  font-weight: 700;
}

.btn-success:hover {
  background-color: var(--primary-hover);
}

.btn-outline-success {
  background-color: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
  font-weight: 700;
}

.btn-outline-success:hover {
  background-color: var(--primary-light);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none !important;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease-out;
}

.modal-backdrop.active {
  display: flex !important;
}

.modal-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-close:hover {
  color: #000;
}

.modal-body {
  padding: 20px 24px;
}

/* Account List inside Modal */
.modal-account-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.account-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.account-item-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.account-item-name {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.account-item-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.account-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Large Spinner */
.large-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* 실시간 4단계 발행 스텝퍼 */
.publish-stepper-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  margin-top: 12px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: all 0.25s ease;
}

.step-item.active {
  border-color: #03c75a;
  background: #f0fdf4;
  box-shadow: 0 2px 8px rgba(3, 199, 90, 0.12);
}

.step-item.completed {
  border-color: #cbd5e1;
  background: #fafbfc;
  opacity: 0.95;
}

.step-item.error {
  border-color: #f87171;
  background: #fef2f2;
}

.step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-item.active .step-circle {
  background: #03c75a;
  color: #ffffff;
  animation: pulse-step 1.5s infinite;
}

.step-item.completed .step-circle {
  background: #10b981;
  color: #ffffff;
}

.step-item.error .step-circle {
  background: #ef4444;
  color: #ffffff;
}

@keyframes pulse-step {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(3, 199, 90, 0.4); }
  70% { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(3, 199, 90, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(3, 199, 90, 0); }
}

.step-detail {
  flex: 1;
}

.step-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
}

.step-desc {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.step-badge-status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #64748b;
}

.step-item.active .step-badge-status {
  background: #dcfce7;
  color: #15803d;
}

.step-item.completed .step-badge-status {
  background: #e2e8f0;
  color: #0f172a;
}

.step-item.error .step-badge-status {
  background: #fee2e2;
  color: #b91c1c;
}

