* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    max-width: 100%;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    /* Arc browser compatibility fixes */
    min-width: 0;
    position: relative;
}

.editor-container {
    height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    /* Arc browser compatibility */
    min-width: 0;
    flex-shrink: 1;
}

.content-view {
    width: 100%;
    padding: 40px;
    background: #fff;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    /* Arc browser compatibility */
    min-width: 0;
    flex-shrink: 1;
}

.content-view h1 {
    color: #0366d6;
    margin-bottom: 0;
    font-size: 2rem;
}

.content-view h2 {
    color: #586069;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.content-view p {
    margin-bottom: 1rem;
}

.content-summary {
    color: #586069;
    font-style: italic;
    display: block;
    padding-bottom: 12px;
    border-bottom: 1px solid #e1e4e8;
    margin-bottom: 20px;
}

.content-view em {
    color: #586069;
    font-style: italic;
}

.content-view pre,
.content-view code {
    overflow-x: auto;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.content-view * {
    max-width: 100%;
}


.child-view {
    width: 100%;
    padding: 40px;
    background: #f6f8fa;
    box-sizing: border-box;
    /* Arc browser compatibility */
    min-width: 0;
    flex-shrink: 1;
}

.child-view h3 {
    color: #24292e;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-child-btn {
    background: #0366d6;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.add-child-btn:hover {
    background: #0256cc;
}

.editing-child {
    border: 2px solid #0366d6;
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: auto;
}

.editing-child:hover {
    border-color: #0366d6;
    box-shadow: none;
}

.editing-child input {
    width: 100%;
    padding: 8px 12px;
    margin: 4px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
}

.editing-child input:focus {
    outline: none;
    border-color: #0366d6;
    box-shadow: 0 0 0 2px rgba(3, 102, 214, 0.2);
}

.editing-child input::placeholder {
    color: #6a737d;
}

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

.content-header h1 {
    flex: 1;
}

.content-header .inline-edit-btn,
.content-header .edit-button-group {
    margin-left: auto;
}

.inline-edit-btn {
    margin-left: 16px;
    font-size: 14px;
    vertical-align: middle;
}

.edit-button-group {
    display: inline-block;
    margin-left: 16px;
}

.edit-button-group .inline-edit-btn {
    margin-left: 0;
    margin-right: 8px;
}

.edit-button-group .inline-edit-btn:last-child {
    margin-right: 0;
}

.edit-btn {
    background: #f6f8fa;
    border: 1px solid #d1d9e0;
    color: #24292e;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
}

.edit-btn:hover {
    background: #e1e7ed;
    border-color: #c9d1d9;
}

.edit-btn.save {
    background: #2ea043;
    color: white;
    border-color: #2ea043;
}

.edit-btn.save:hover {
    background: #2c974b;
}

.edit-btn.cancel {
    background: #da3633;
    color: white;
    border-color: #da3633;
    margin-left: 8px;
}

.edit-btn.cancel:hover {
    background: #c93c37;
}

.content-textarea {
    width: 100%;
    min-height: 400px;
    padding: 16px;
    border: 1px solid #d1d9e0;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    background: #fff;
    box-sizing: border-box;
}

.content-textarea:focus {
    outline: none;
    border-color: #0366d6;
    box-shadow: 0 0 0 2px rgba(3, 102, 214, 0.2);
}

.wysiwyg-editor {
    width: 100%;
    min-height: 400px;
    padding: 16px;
    border: 1px solid #d1d9e0;
    border-radius: 6px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    background: #fff;
    outline: none;
    box-sizing: border-box;
}

.wysiwyg-editor:focus {
    border-color: #0366d6;
    box-shadow: 0 0 0 2px rgba(3, 102, 214, 0.2);
}

.format-popup {
    position: absolute;
    background: white;
    border: 1px solid #d1d9e0;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    gap: 4px;
    padding: 4px;
    z-index: 1000;
}

.format-btn {
    padding: 6px 10px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #24292e;
    font-weight: 500;
}

.format-btn:hover {
    background: #f6f8fa;
}

.child-item {
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e1e4e8;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
}

.child-item:hover {
    border-color: #0366d6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

.child-item-title {
    font-weight: 600;
    color: #0366d6;
    flex: 1;
}

.child-item-time {
    font-size: 0.75rem;
    color: #6a737d;
    margin-left: 8px;
    white-space: nowrap;
}

.child-item-summary {
    color: #586069;
    font-size: 0.9rem;
    font-style: italic;
    display: block;
    line-height: 1.4;
}

.breadcrumbs {
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #e1e4e8;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.breadcrumb-trail {
    flex: 1;
}

.recent-link {
    margin-left: auto;
}

.breadcrumb-link {
    color: #0366d6;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.breadcrumb-link:hover {
    background-color: #f1f8ff;
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: #586069;
    font-weight: normal;
}

.breadcrumb-current {
    color: #24292e;
    font-weight: 600;
    padding: 4px 8px;
}

.recent-link {
    background: #f6f8fa;
    border: 1px solid #d1d9e0;
    color: #24292e;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
    text-decoration: none;
}

.recent-link:hover {
    background: #e1e7ed;
    border-color: #c9d1d9;
    text-decoration: none;
}

.loading {
    text-align: center;
    color: #586069;
    font-style: italic;
    padding: 40px;
}

.mobile-overlay {
    display: none;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .content-view {
        padding: 20px;
        margin-bottom: 15px;
    }
    
    .child-view {
        padding: 15px;
    }
    
    .breadcrumbs {
        font-size: 0.8rem;
        margin-bottom: 15px;
    }
    
    .breadcrumb-separator {
        margin: 0 4px;
    }
}

.child-view-inline {
    background: #f6f8fa;
    padding: 20px 4px 40px 4px;
    border-radius: 6px;
    margin-top: 20px;
}

.child-view-inline .child-item {
    background: white;
    margin-bottom: 10px;
}

/* In-place editing styles */
.editing {
    outline: none;
    border-radius: 3px;
    padding: 4px;
}

.editing:focus {
    outline: none;
}

.main-content-editor {
    min-height: 200px;
}

.child-view-inline h3 {
    color: #24292e;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}