/* Watch fonts — same FreeFonts used by GFX firmware for pixel-accurate preview */
@font-face {
    font-family: 'CrispSans';
    src: url('/crispface/firmware/tools/fonts/FreeSans.ttf') format('truetype');
    font-weight: normal;
    font-display: block;
}
@font-face {
    font-family: 'CrispSans';
    src: url('/crispface/firmware/tools/fonts/FreeSansBold.ttf') format('truetype');
    font-weight: bold;
    font-display: block;
}
@font-face {
    font-family: 'CrispMono';
    src: url('/crispface/firmware/tools/fonts/tamzen/ttf/Tamzen8x16r.ttf') format('truetype');
    font-weight: normal;
    font-display: block;
}
@font-face {
    font-family: 'CrispMono';
    src: url('/crispface/firmware/tools/fonts/tamzen/ttf/Tamzen8x16b.ttf') format('truetype');
    font-weight: bold;
    font-display: block;
}
@font-face {
    font-family: 'CrispSerif';
    src: url('/crispface/firmware/tools/fonts/FreeSerif.ttf') format('truetype');
    font-weight: normal;
    font-display: block;
}
@font-face {
    font-family: 'CrispSerif';
    src: url('/crispface/firmware/tools/fonts/FreeSerifBold.ttf') format('truetype');
    font-weight: bold;
    font-display: block;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Variables */
:root {
    --orange: #FF7F4F;
    --orange-light: #FFC299;
    --orange-dark: #FF5722;
    --blue: #4A9FCC;
    --blue-light: #87CEEB;
    --blue-dark: #2980B9;
    --off-white: #FAFAFA;
    --gray-light: #E0E0E0;
    --gray-medium: #757575;
    --gray-dark: #424242;
    --sidebar-bg: #2C2C2C;
    --sidebar-text: #E0E0E0;
    --sidebar-hover: #3C3C3C;
    --sidebar-active: #FF7F4F;
    --danger: #E53935;
    --success: #43A047;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--off-white);
    color: var(--gray-dark);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: var(--blue-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-brand {
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 700;
    color: var(--orange);
    border-bottom: 1px solid #444;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-brand select {
    background: transparent;
    color: var(--orange);
    border: 1px solid #555;
    border-radius: 3px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    padding: 4px 6px;
    width: 100%;
    cursor: pointer;
    appearance: auto;
}

.sidebar-brand select:focus {
    outline: none;
    border-color: var(--orange);
}

.sidebar-brand select option {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
}

.sidebar-brand-links {
    display: flex;
    gap: 12px;
    font-size: 12px;
    font-weight: 400;
}

.sidebar-brand-links a {
    color: var(--gray-medium);
    text-decoration: none;
}

.sidebar-brand-links a:hover {
    color: var(--sidebar-text);
    text-decoration: underline;
}

.sidebar-nav {
    list-style: none;
    padding: 10px 0;
    flex: 1;
}

.sidebar-nav li a {
    display: block;
    padding: 10px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
}

.sidebar-nav li a:hover {
    background: var(--sidebar-hover);
    text-decoration: none;
}

.sidebar-nav li a.active {
    color: var(--sidebar-active);
    border-left: 3px solid var(--sidebar-active);
    padding-left: 17px;
}

.sidebar-user {
    padding: 15px 20px;
    border-top: 1px solid #444;
    font-size: 13px;
    color: var(--gray-medium);
}

.sidebar-user a {
    color: var(--gray-medium);
}

.main-content {
    flex: 1;
    padding: 30px;
    min-width: 0;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--gray-dark);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.5;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--orange);
    color: #fff;
}

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

.btn-secondary {
    background: var(--gray-light);
    color: var(--gray-dark);
}

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

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #c62828;
    color: #fff;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 13px;
}

/* Flash messages */
.flash {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

.flash-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.flash-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* Cards / face list */
.face-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.face-card {
    background: #fff;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    padding: 20px;
    transition: box-shadow 0.15s;
}

.face-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.face-card h3 {
    font-size: 16px;
    margin-bottom: 6px;
}

.face-card .face-meta {
    font-size: 13px;
    color: var(--gray-medium);
    margin-bottom: 12px;
}

.face-card .face-actions {
    display: flex;
    gap: 8px;
}

/* Duplicate modal */
.dup-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.dup-modal-card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    width: 380px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.dup-modal-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-dark);
}

.dup-modal-card p {
    font-size: 13px;
    color: var(--gray-medium);
    margin-bottom: 16px;
}

.dup-modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.form-hint {
    font-size: 12px;
    color: var(--gray-medium);
    margin-top: 4px;
}

/* Page header actions */
.page-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Drag handle */
.drag-handle {
    color: var(--gray-medium);
    font-size: 18px;
    line-height: 1;
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
}

.drag-handle:active {
    cursor: grabbing;
}

.face-grid .drag-handle {
    display: none;
}

/* Drag states */
.face-card.dragging {
    opacity: 0.4;
}

/* Face list view */
.face-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.face-list .face-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
}

.face-list .face-card h3 {
    margin-bottom: 0;
    flex-shrink: 0;
}

.face-list .face-card .face-meta {
    flex: 1;
    margin-bottom: 0;
}

.face-list .face-card .face-actions {
    flex-shrink: 0;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--gray-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--gray-light);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    color: var(--gray-dark);
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(74, 159, 204, 0.2);
}

/* Login page */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--sidebar-bg);
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.login-box h1 {
    font-size: 22px;
    margin-bottom: 6px;
    color: var(--orange);
}

.login-box p {
    font-size: 14px;
    color: var(--gray-medium);
    margin-bottom: 24px;
}

.login-box .btn {
    width: 100%;
}

/* Editor layout */
body.editor-page .main-content {
    position: relative;
    padding: 0;
    overflow: hidden;
}

.editor-layout {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.editor-sidebar-left {
    width: 250px;
    background: #fff;
    border-right: 1px solid var(--gray-light);
    padding: 20px;
    overflow-y: hidden;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.editor-canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #e8e8e8;
    position: relative;
}

.editor-toolbar {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #fff;
    border-bottom: 1px solid var(--gray-light);
    width: 100%;
}

.canvas-container-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

/* Watch frame around preview canvas (matches simulation body) */
body:not(.simulating) .canvas-container-wrapper .canvas-container {
    padding: 20px;
    background: #333;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.05);
    box-sizing: content-box;
}

.canvas-container-wrapper canvas {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.editor-sidebar-right {
    width: 420px;
    background: #fff;
    border-left: 1px solid var(--gray-light);
    padding: 20px;
    overflow-y: auto;
    flex-shrink: 0;
}

.editor-sidebar-right h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--gray-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.editor-sidebar-left h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--gray-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-add-face {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: var(--orange);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    line-height: 26px;
    text-align: center;
    padding: 0;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}

.btn-add-face:hover {
    background: var(--orange-dark);
}

.editor-select-watch {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.editor-select-watch p {
    font-size: 16px;
    color: var(--gray-medium);
    text-align: center;
}

/* Disabled face cards */
.face-card-list .face-card-disabled,
.face-list .face-card-disabled,
.face-grid .face-card-disabled {
    opacity: 0.4;
}

.face-card-disabled .face-card-name::after {
    content: ' (off)';
    color: var(--gray-medium);
}

/* Face card list in editor sidebar */
.face-card-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.face-card-list .face-card {
    padding: 0;
    cursor: pointer;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    transition: border-color 0.15s;
    background: #fff;
}

.face-card-list .face-card:hover {
    border-color: var(--blue);
    box-shadow: none;
}

.face-card-list .face-card.face-card-active {
    border-color: var(--orange);
    border-width: 2px;
}

.face-card-list .face-card.dragging {
    opacity: 0.3;
}

.face-card-list .face-card.face-card-enter {
    animation: faceCardSlideIn 0.4s cubic-bezier(0.2, 0, 0, 1);
}

@keyframes faceCardSlideIn {
    from { opacity: 0; max-height: 0; transform: scale(0.9); margin-top: -4px; margin-bottom: -4px; }
    to   { opacity: 1; max-height: 300px; transform: scale(1); margin-top: 0; margin-bottom: 0; }
}

.face-card-list .face-card[draggable="true"] {
    cursor: grab;
}

.face-card-list .face-card[draggable="true"]:active {
    cursor: grabbing;
}

.face-card-canvas {
    display: block;
    width: 80%;
    height: auto;
    margin: 8px auto 4px;
    border: 4px solid #333;
    border-radius: 8px;
}

.face-card-name {
    font-size: 11px;
    font-weight: 500;
    color: var(--gray-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

/* Face card bottom row (cog + name) */
.face-card-bottom {
    display: flex;
    align-items: center;
    padding: 2px 6px 6px;
    gap: 4px;
}

.face-card-cog {
    background: none;
    border: none;
    font-size: 14px;
    padding: 0;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    color: var(--gray-light);
    transition: color 0.15s;
    flex-shrink: 0;
}

.face-card-cog:hover {
    color: var(--gray-dark);
}

/* Face settings floating panel */
.face-settings-body {
    position: absolute;
    bottom: 8px;
    left: 0;
    width: 210px;
    background: #fff;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    padding: 12px;
    z-index: 10;
}

.btn-delete-face {
    margin-top: 10px;
    width: 100%;
}

.no-selection {
    font-size: 13px;
    color: var(--gray-medium);
    text-align: center;
    padding: 20px 0;
}

/* Property rows in editor */
.prop-row {
    margin-bottom: 12px;
}

.prop-row label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 3px;
    color: var(--gray-medium);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Inline checkbox row */
.prop-row-checkbox {
    margin-bottom: 8px;
}

.prop-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-size: 13px !important;
    font-weight: 400 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: var(--gray-dark) !important;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.prop-checkbox-label input[type="checkbox"] {
    width: auto !important;
    margin: 0;
}

.prop-row input,
.prop-row select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--gray-light);
    border-radius: 3px;
    font-size: 13px;
    font-family: inherit;
}

.prop-row input:focus,
.prop-row select:focus {
    outline: none;
    border-color: var(--blue);
}

.refresh-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.refresh-table td {
    padding: 3px 6px;
    border: 1px solid var(--gray-light);
}

.refresh-table td:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
}

.refresh-table td:last-child {
    text-align: right;
    white-space: nowrap;
    color: var(--gray-medium);
    width: 50px;
}

/* Stepper inputs */
.stepper {
    display: flex;
    align-items: stretch;
}

.stepper input[type="number"] {
    flex: 1;
    text-align: center;
    border-radius: 0;
    border-left: none;
    border-right: none;
    -moz-appearance: textfield;
    min-width: 0;
}

.stepper input[type="number"]::-webkit-inner-spin-button,
.stepper input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.stepper-btn {
    width: 26px;
    flex-shrink: 0;
    border: 1px solid var(--gray-light);
    background: #f5f5f5;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-dark);
    padding: 0;
    line-height: 1;
}

.stepper-btn:hover {
    background: var(--gray-light);
}

.stepper-btn:active {
    background: var(--orange);
    color: #fff;
    border-color: var(--orange);
}

.stepper-dec {
    border-radius: 3px 0 0 3px;
}

.stepper-inc {
    border-radius: 0 3px 3px 0;
}

.prop-row-inline {
    display: flex;
    gap: 8px;
}

.prop-row-inline .prop-row {
    flex: 1;
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-medium);
}

.empty-state p {
    font-size: 15px;
    margin-bottom: 16px;
}

/* Simulation mode */
body.simulating .sidebar,
body.simulating .editor-sidebar-left,
body.simulating .editor-sidebar-right,
body.simulating .editor-toolbar {
    display: none;
}

body.simulating .main-content {
    padding: 0;
}

body.simulating .editor-canvas-area {
    background: #1a1a1a;
}

body.simulating .canvas-container-wrapper {
    position: relative;
}

.sim-exit {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

.sim-exit:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Watch body wrapper */
.sim-watch {
    position: relative;
    display: inline-block;
}

.sim-watch-body {
    position: relative;
    width: 440px;
    height: 440px;
    background: #333;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* Physical buttons */
.sim-btn {
    position: absolute;
    width: 10px;
    height: 36px;
    background: #555;
    border: none;
    cursor: pointer;
    border-radius: 2px;
    padding: 0;
    transition: background 0.1s;
}

.sim-btn:hover {
    background: #777;
}

.sim-btn:active {
    background: var(--orange);
}

.sim-btn-label {
    position: absolute;
    font-size: 11px;
    color: #888;
    white-space: nowrap;
    pointer-events: none;
}

/* Left side buttons */
.sim-btn-back {
    left: -16px;
    top: 120px;
}

.sim-btn-back + .sim-btn-label {
    right: calc(100% + 22px);
    top: 124px;
}

.sim-btn-menu {
    left: -16px;
    bottom: 120px;
}

.sim-btn-menu + .sim-btn-label {
    right: calc(100% + 22px);
    bottom: 124px;
}

/* Right side buttons */
.sim-btn-up {
    right: -16px;
    top: 120px;
}

.sim-btn-up + .sim-btn-label {
    left: calc(100% + 22px);
    top: 124px;
}

.sim-btn-down {
    right: -16px;
    bottom: 120px;
}

.sim-btn-down + .sim-btn-label {
    left: calc(100% + 22px);
    bottom: 124px;
}

/* Face name in simulation */
.sim-face-name {
    position: absolute;
    bottom: -32px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 13px;
    color: #888;
}

/* Toolbar select */
.toolbar-select {
    padding: 4px 8px;
    border: 1px solid var(--gray-light);
    border-radius: 3px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    min-width: 120px;
}

.toolbar-select:focus {
    outline: none;
    border-color: var(--blue);
}

/* Snap alignment buttons */
.prop-snap-row { margin-bottom: 8px; }
.prop-snap-buttons {
    display: flex;
}
.prop-snap-btn {
    flex: 1;
    padding: 0;
    height: 28px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--gray-light);
    background: #f5f5f5;
    cursor: pointer;
    color: var(--gray-dark);
    line-height: 1;
}
.prop-snap-btn:first-child {
    border-radius: 3px 0 0 3px;
}
.prop-snap-btn:last-child {
    border-radius: 0 3px 3px 0;
}
.prop-snap-btn:not(:first-child) {
    border-left: none;
}
.prop-snap-btn:hover {
    background: var(--gray-light);
}
.prop-snap-btn:active,
.prop-snap-btn.active {
    background: var(--orange);
    color: #fff;
    border-color: var(--orange);
}

/* Complication name in properties panel */
.prop-comp-name {
    color: var(--orange);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: capitalize;
}

/* Property section label */
.prop-section-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-medium);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin: 12px 0 6px;
    padding-top: 8px;
    border-top: 1px solid var(--gray-light);
}

/* Variable hint text */
.prop-hint {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

/* Town verification status */
.prop-town-status {
    display: block;
    font-size: 11px;
    margin-top: 2px;
    min-height: 14px;
}

/* Feeds list (calendar multi-feed UI) */
.prop-feed-list {
    margin-top: 4px;
}

.prop-feed-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: #f5f5f5;
    border: 1px solid var(--gray-light);
    border-radius: 3px;
    margin-bottom: 4px;
}

.prop-feed-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-left: 4px;
}

.prop-feed-bold-badge,
.prop-feed-alert-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.prop-feed-bold-badge {
    color: var(--orange);
}

.prop-feed-alert-badge {
    color: var(--blue-dark);
}

.prop-feed-item .btn-sm {
    padding: 2px 8px;
    font-size: 11px;
}

.prop-feed-add {
    width: 100%;
    margin-top: 4px;
}

/* Feeds modal overlay */
.prop-feed-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.prop-feed-modal-inner {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.prop-feed-modal-inner h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--gray-dark);
}

.prop-feed-modal-inner .form-group {
    margin-bottom: 12px;
}

.prop-feed-modal-inner .form-group label {
    font-size: 13px;
}

.prop-feed-modal-inner .form-group input[type="checkbox"] {
    width: auto;
    margin-right: 6px;
}

.prop-feed-modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* Shared feeds section */
.prop-feed-shared-section {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #ccc;
}

.prop-feed-shared-label {
    font-size: 11px;
    color: #999;
    margin-bottom: 4px;
}

.prop-feed-item-shared {
    opacity: 0.5;
}

.prop-feed-item-shared:hover {
    opacity: 0.8;
}

.prop-feed-enable-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    width: 100%;
    margin: 0;
}

.prop-feed-enable-cb {
    width: auto !important;
    margin: 0;
    flex-shrink: 0;
}

.prop-feed-usage {
    font-size: 10px;
    color: #999;
    margin-left: 4px;
    flex-shrink: 0;
}

/* Feed modal danger zone */
.prop-feed-modal-danger {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
}

.prop-feed-modal-danger button {
    font-size: 12px;
    padding: 4px 10px;
    color: #c00;
    background: none;
    border: 1px solid #c00;
    border-radius: 4px;
    cursor: pointer;
}

.prop-feed-modal-danger button:hover {
    background: #c00;
    color: #fff;
}

/* Advanced toggle */
.prop-advanced-toggle {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-medium);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin: 16px 0 0;
    padding: 8px 0 4px;
    border-top: 1px solid var(--gray-light);
    cursor: pointer;
    user-select: none;
}

.prop-advanced-toggle::before {
    content: '\25B6';
    display: inline-block;
    font-size: 8px;
    margin-right: 6px;
    transition: transform 0.15s;
}

.prop-advanced-toggle.prop-advanced-open::before {
    transform: rotate(90deg);
}

.prop-advanced-toggle:hover {
    color: var(--gray-dark);
}

.prop-advanced {
    display: none;
    padding-top: 8px;
}

/* Complication edit page */
.comp-edit-form {
    max-width: 800px;
}

.comp-variables-section,
.comp-script-section {
    margin-top: 24px;
}

.comp-variables-header,
.comp-script-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.comp-variables-header h2,
.comp-script-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-dark);
}

/* Variable table */
.var-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 4px;
}

.var-table th {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-medium);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.var-col-type {
    width: 90px;
    flex: 0 0 90px;
}

.var-table td {
    vertical-align: middle;
}

.var-table input[type="text"],
.var-table select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--gray-light);
    border-radius: 3px;
    font-size: 13px;
    font-family: inherit;
}

.var-table input[type="text"]:focus,
.var-table select:focus {
    outline: none;
    border-color: var(--blue);
}

.var-table .col-name,
.var-table .col-default {
    width: 100px;
}

.var-table .col-type {
    width: 80px;
}

.var-table .col-options {
    width: 180px;
}

.var-table .col-remove {
    width: 30px;
}

.var-remove {
    width: 30px;
    padding: 4px !important;
    text-align: center;
}

/* Script editor */
#comp-script {
    width: 100%;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    line-height: 1.5;
    padding: 12px;
    border: 1px solid var(--gray-light);
    border-radius: 4px;
    background: #1e1e1e;
    color: #d4d4d4;
    resize: vertical;
    tab-size: 4;
}

#comp-script:focus {
    outline: none;
    border-color: var(--blue);
}

#script-editor {
    margin-top: 8px;
}

/* WiFi network rows */
.wifi-hint {
    font-size: 12px;
    color: var(--gray-medium);
    margin-bottom: 12px;
}

.wifi-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.wifi-row input[type="text"],
.wifi-row input[type="password"] {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--gray-light);
    border-radius: 3px;
    font-size: 13px;
    font-family: inherit;
}

.wifi-row input:focus {
    outline: none;
    border-color: var(--blue);
}

.wifi-pass-wrap {
    flex: 1;
    position: relative;
    display: flex;
}

.wifi-pass-wrap input {
    flex: 1;
    padding-right: 36px;
}

.wifi-pass-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: var(--gray-medium);
    padding: 2px 4px;
}

.wifi-pass-toggle:hover {
    color: var(--gray-dark);
}

/* Committed WiFi row (static display) */
.wifi-row-committed {
    background: #f5f5f5;
    border: 1px solid var(--gray-light);
    border-radius: 4px;
    padding: 8px 12px;
}

.wifi-static-ssid {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-dark);
}

.wifi-static-pass {
    flex: 1;
    font-size: 13px;
    color: var(--gray-medium);
    letter-spacing: 1px;
}

/* Watch face list rows */
.watch-face-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--gray-light);
    border-radius: 4px;
    margin-bottom: 6px;
}

.watch-face-row:hover {
    border-color: var(--blue);
}

.watch-face-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-dark);
}

.watch-face-actions {
    display: flex;
    gap: 6px;
}

/* Flash page */
.flash-section {
    background: var(--sidebar-bg);
    border-radius: 8px;
    padding: 32px 24px;
    margin-bottom: 24px;
}

.flash-section h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--off-white);
}

.flash-section label,
.flash-section p,
.flash-section td {
    color: var(--sidebar-text);
}

.browser-note {
    background: #333;
    border-left: 3px solid var(--blue);
    padding: 12px 16px;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: var(--blue-light);
    margin-bottom: 24px;
}

.flash-watch-picker {
    margin-bottom: 20px;
}

.flash-watch-picker label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-medium);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.flash-watch-picker select {
    width: 100%;
    padding: 10px 12px;
    background: #3a3a3a;
    border: 2px solid #3a3a3a;
    border-radius: 6px;
    color: var(--off-white);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    appearance: auto;
}

.flash-watch-picker select:focus {
    outline: none;
    border-color: var(--orange);
}

.flash-wifi-info {
    font-size: 12px;
    color: var(--gray-medium);
    margin-top: 6px;
}

.firmware-picker {
    display: flex;
    gap: 12px;
    margin: 0 0 20px;
}

.firmware-option {
    flex: 1;
    display: block;
    padding: 14px 12px;
    background: #3a3a3a;
    border: 2px solid #3a3a3a;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
    text-align: center;
}

.firmware-option:hover {
    border-color: #555;
}

.firmware-option-selected {
    border-color: var(--orange);
}

.firmware-option input {
    display: none;
}

.firmware-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--off-white);
    margin-bottom: 4px;
}

.firmware-desc {
    display: block;
    font-size: 12px;
    color: var(--gray-medium);
}

.btn-flash {
    display: inline-block;
    background: var(--orange);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.btn-flash:hover:not(:disabled) {
    background: var(--orange-dark);
}

.btn-flash:disabled {
    background: #555 !important;
    cursor: not-allowed;
}

#flash-status {
    margin-top: 16px;
    font-size: 13px;
    min-height: 20px;
}

.status-success { color: var(--success); }
.status-error { color: var(--danger); }
.status-building { color: var(--orange-light); }

.btn-test {
    display: inline-block;
    background: transparent;
    color: var(--blue);
    border: 1px solid var(--blue);
    border-radius: 6px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, color 0.2s;
    margin-top: 16px;
}

.btn-test:hover {
    background: var(--blue);
    color: #fff;
}

/* Flash log */
.flash-log {
    margin-top: 24px;
    border-top: 1px solid #444;
    padding-top: 16px;
}

.flash-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.flash-log-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--off-white);
    margin: 0;
}

.flash-log-header a {
    font-size: 12px;
    color: var(--blue-light);
    cursor: pointer;
}

.flash-log-header a:hover {
    color: #fff;
}

.flash-log-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #3a3a3a;
    font-size: 13px;
}

.flash-log-entry:last-child {
    border-bottom: none;
}

.flash-log-time {
    color: var(--gray-medium);
    white-space: nowrap;
    min-width: 130px;
}

.flash-log-version {
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 12px;
    color: var(--orange-light);
    min-width: 70px;
}

.flash-log-watch {
    color: var(--sidebar-text);
    flex: 1;
}

.flash-log-result {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
    white-space: nowrap;
}

.flash-log-result-flashed {
    background: var(--success);
    color: #fff;
}

.flash-log-result-built {
    background: var(--gray-medium);
    color: #fff;
}

.flash-log-empty {
    color: var(--gray-medium);
    font-size: 13px;
}

/* Flash log popup */
.flash-log-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.flash-log-popup-inner {
    background: var(--sidebar-bg);
    border-radius: 8px;
    padding: 24px;
    max-width: 640px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    color: var(--sidebar-text);
}

.flash-log-popup-inner h2 {
    font-size: 18px;
    color: var(--off-white);
    margin-bottom: 16px;
}

.flash-log-popup-close {
    float: right;
    background: none;
    border: none;
    color: var(--gray-medium);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.flash-log-popup-close:hover {
    color: var(--off-white);
}

/* Flash page hint sections */
.hint-section {
    background: var(--sidebar-bg);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.hint-section h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--off-white);
    text-align: center;
}

.hint-section h3 {
    font-size: 14px;
    color: var(--orange);
    margin: 16px 0 8px;
}

.hint-section h3:first-of-type {
    margin-top: 0;
}

.watch-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 16px 0;
}

.watch-body {
    width: 100px;
    height: 100px;
    background: #3a3a3a;
    border: 2px solid #555;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--gray-medium);
}

.btn-col {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100px;
    padding: 4px 0;
}

.btn-col-left { align-items: flex-end; margin-right: 6px; }
.btn-col-right { align-items: flex-start; margin-left: 6px; }

.watch-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    white-space: nowrap;
}

.watch-btn-pip {
    width: 16px;
    height: 6px;
    border-radius: 2px;
    background: var(--orange);
    flex-shrink: 0;
}

.watch-btn-label { color: var(--sidebar-text); }
.btn-col-left .watch-btn { flex-direction: row; }
.btn-col-right .watch-btn { flex-direction: row-reverse; }

.hint-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.hint-table td {
    padding: 5px 0;
    vertical-align: top;
}

.hint-table td:first-child {
    color: var(--blue-light);
    width: 100px;
    font-weight: 600;
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 12px;
}

.hint-table td:last-child { color: var(--sidebar-text); }
.hint-table tr + tr td { border-top: 1px solid #333; }

.hint-note {
    font-size: 12px;
    color: var(--gray-medium);
    margin-top: 8px;
    line-height: 1.5;
}
