:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.511 0.096 186.391);
  --primary-foreground: oklch(0.984 0.014 180.72);
  --secondary: oklch(0.967 0.001 286.375);
  --secondary-foreground: oklch(0.21 0.006 285.885);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --destructive-foreground: oklch(0.984 0.014 180.72);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.55 0 0);
  --radius: 0.625rem;
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-primary: oklch(0.6 0.118 184.704);
  --sidebar-primary-foreground: oklch(0.984 0.014 180.72);
  --sidebar-accent: oklch(0.97 0 0);
  --sidebar-accent-foreground: oklch(0.205 0 0);
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-ring: oklch(0.708 0 0);
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.205 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.437 0.078 188.216);
  --primary-foreground: oklch(0.984 0.014 180.72);
  --secondary: oklch(0.274 0.006 286.033);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --destructive-foreground: oklch(0.145 0 0);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
  --sidebar: oklch(0.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.704 0.14 182.503);
  --sidebar-primary-foreground: oklch(0.277 0.046 192.524);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.556 0 0);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

html.dark {
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.5;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  color: var(--card-foreground);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1rem 0;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}

.tab-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover {
  color: var(--foreground);
}

.tab-btn.active {
  color: var(--foreground);
  border-bottom-color: var(--primary);
}

.tab-panel {
  display: none;
}

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

.card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 1px 2px oklch(0 0 0 / 4%);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.form-field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--secondary-foreground);
}

.form-field input,
.form-field select {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--background);
  color: var(--foreground);
  font-size: 1rem;
  outline: none;
}

.form-field input:focus,
.form-field select:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 2px var(--ring);
}

.form-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  white-space: nowrap;
}

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

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

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

.btn-destructive {
  background: var(--destructive);
  color: var(--destructive-foreground);
}

.btn:focus-visible,
.tab-btn:focus-visible,
.copy-btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.btn-small {
  padding: 0.375rem 0.625rem;
  font-size: 0.875rem;
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--accent);
  color: var(--accent-foreground);
}

.drop-zone:focus-visible {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px var(--ring);
}

.file-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.file-list:empty {
  display: none;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}

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

.file-item .file-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item .file-status {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.file-item .file-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.progress-wrap {
  margin-top: 1rem;
}

.progress-bar {
  height: 0.75rem;
  background: var(--muted);
  border-radius: var(--radius);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.2s;
}

.progress-text {
  margin: 0.375rem 0 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  text-align: center;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-top: 1rem;
}

.alert-error {
  background: var(--destructive);
  color: var(--destructive-foreground);
}

.hidden {
  display: none !important;
}

.result {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.result h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
}

.result-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.result-row span {
  min-width: 7rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.result-row code,
.result-row a {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-code {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--foreground);
}

.owner-row a {
  color: var(--primary);
}

.dark .owner-row a {
  color: oklch(0.75 0.1 188);
}

.qr-wrap {
  margin-top: 1rem;
  text-align: center;
}

.qr-wrap canvas {
  max-width: 180px;
  height: auto;
}

.muted {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.mobile-warning {
  margin-top: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-foreground);
  font-size: 0.875rem;
}

.room-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.room-info p {
  margin: 0;
}

@media (max-width: 480px) {
  .form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .file-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .file-item .file-actions {
    width: 100%;
  }

  .file-item .file-actions .btn {
    flex: 1;
  }
}
